Project Impossible - Localized Physics and Infinite Maps
71 replies, posted
[QUOTE=pilot;49009831]Has anyone made a Spacebuild server yet with this?
Infinite maps sounds pretty dandy for space.[/QUOTE]
If there's a proper infinite SB map I'd be happy to toss it onto my server.
[QUOTE=DavidRalphsky;49005654]Oh gawd I haven't checked the thread in a while. Thanks for linking me back, Bull.
Yeah sorry about that. What I did was set these:
[URL="https://github.com/RafaelDeJongh/cap/blob/6ecdbdf43cd07d402ffc6dbb02927e0c8add3a35/lua/entities/shield_core_buble/modules/collision.lua#L40"]Github link 1[/URL]
[URL="https://github.com/RafaelDeJongh/cap/blob/6ecdbdf43cd07d402ffc6dbb02927e0c8add3a35/lua/entities/event_horizon/modules/collision.lua#L107"]Github link 2[/URL]
to be return nil rather than simply return.
I'm afraid this isn't the correct solution, though you were in the correct file. This'll probably work mostly, but not under certain conditions (i.e. if ent1 and ent2 are valid)
Ah, yes, the infamous Jeep/Jalopy bug. Still not sure why they like to teleport to the wrong side of the cell and fly backwards, and then get stuck in limbo. It doesn't seem to have any reason to do so, but it might be because of the GHD constraint retriever code.
Strange. Looks to be some kind of rendering bug. I assume that was occurring outside of cell 0 0 0?[/QUOTE]definitely change isvalid checks is the wrong decision and even may cause physics crash in some conditions.
as for "return nil" vs just "return" - do you know that actually "return" is equivalent to "return nil"? "Return" actually means "return nothing or nil" exactly same like "return nil", of course if this wasn't changed somehow in latest gmod updates...
As for "rendering bug" its not actually rendering bug. I believe there is something wrong with local coordinates when using this addon or so. I can also say that function findinsphere work incorrect and break some of cap codes including "connecting" animated ramp to gatespawner gate, so it wont animating anymore when installed this addon on gatespawner gates.
[QUOTE=AlexALX;49015306]as for "return nil" vs just "return" - do you know that actually "return" is equivalent to "return nil"? "Return" actually means "return nothing or nil" exactly same like "return nil", of course if this wasn't changed somehow in latest gmod updates...[/QUOTE]
Apparently it is different. Return doesn't work, while return nil does. So apparently I need to start tackling these issues while drunk because I seem to find these crazy solutions
[QUOTE=AlexALX;49015306]definitely change isvalid checks is the wrong decision and even may cause physics crash in some conditions.[/QUOTE]
Yeah.
[QUOTE=AlexALX;49015306]As for "rendering bug" its not actually rendering bug. I believe there is something wrong with local coordinates when using this addon or so. I can also say that function findinsphere work incorrect and break some of cap codes including "connecting" animated ramp to gatespawner gate, so it wont animating anymore when installed this addon on gatespawner gates.[/QUOTE]
Could be a possibility. I've not been as insanely-devoted to this as I was in the first couple weeks, and mostly pop in to do bugfixing and clarifications.
I've got a server running this [url=steam://connect/221.121.155.63:27015]if anyone is interested[/url].
return nil is indeed the exact same thing as return. It's just how lua itself works, has nothing to do with gmod. Make sure it's not returning [b]true[/b] anywhere-- that would break maprepeat. If it does return true, make it return nothing there instead. ShouldCollide should only ever return false or nil if mods want to be compatible with maprepeat.
The weird thing is, CAP only seems to return true if one of the entities is invalid or if an entity is colliding with itself (which, I have no clue why it would need to do that...)
EDIT:
Do this:
lua_run print(hook.Call("ShouldCollide",GM,player.GetByID(1),ents.FindByName("pyramid")))
lua_run PrintTable(hook.GetTable().ShouldCollide)
if the first one returns 'true' then something is breaking it by returning true. then you can go through the table of shouldcollide hooks in order and check each one for why it would be returning true.
(I don't have gmod open to test those right now so you might have to modify my syntax, but I think that's right.)
[QUOTE]Make sure it's not returning true anywhere-- that would break maprepeat. If it does return true, make it return nothing there instead. ShouldCollide should only ever return false or nil if mods want to be compatible with maprepeat.[/QUOTE]hmm, good idea, someone should try this, cap uses shouldcollide hook in event horizon and shield core. as far i know its returning true because i wanted prevent physics crash, but probably its not need to return true. If this helps i'll include those fixes to cap when will work on new update, but idk when i'll do this.
[QUOTE=SuperLlama;49021134]return nil is indeed the exact same thing as return.[/QUOTE]
That's what I thought but for some reason setting it to return nil works, at least for me.
Possibly the lizard government is to blame for this. More tests required.
Well I'm on break. Went ahead and fixed player gravity so it doesn't break maprepeater.
[editline]December 22[/editline]
Because of some issues discovered with ?'s in keyvalues, I've gone ahead and taken out that bit of the code.
From now on, any brushes that would've had ?'s should now just use %100 in its stead.
Not going to push to git until I get the sayso from SuperLlama, since knowing this addon removing the ? code is going to cause gravity hull to turn your face inside out.
100% very cool person award. - Thanks for bringing this back.
Yep. Something went wrong.
[IMG]http://i.imgur.com/4cVUoxw.jpg[/IMG]
Sometimes this happens, sometimes it works fine, sometimes only cell 0 0 0 appears.
[editline]December 23[/editline]
Alright there's some weirdness going on. I'm reloading the map over and over with different maxplayers, and it keeps breaking in different ways.
[IMG]http://i.imgur.com/Z2aTRuZ.jpg[/IMG]
[IMG]http://i.imgur.com/x5HAhAQ.jpg[/IMG]
[IMG]http://i.imgur.com/KjPx7J2.jpg[/IMG]
such is life in the.... repeater.
Have you guys ever fired ACF rounds using this?
They just keep going on forever, never colliding with map brushes.
Oh man, I remember when this was first coming out. Awesome to see somebody picking it up again.
-snip
Try calling Activate or maybe Spawn on the jeep.
Activate and spawn don't work. This is so weird.
Anyway, I quickly added a bit of code in the func_maprepeat entity so that it properly sets your weapons' cell. The whole world-model-is-invisible-in-other-cells should be fixed. Github has been updated and I'll update the workshop later once I get some other stuff fixed.
[Editline]March 12[/editline]
Fixed another weapon issue! Now your weapons will no longer be visible in the hull (As in, you won't be seeing floating weapons in the sky anymore. Weapons will still be rendered for your model on the hull.)
[IMG]http://i.imgur.com/47u9Se3.jpg[/IMG]
[QUOTE=DavidRalphsky;49920834]Activate and spawn don't work. This is so weird.
Anyway, I quickly added a bit of code in the func_maprepeat entity so that it properly sets your weapons' cell. The whole world-model-is-invisible-in-other-cells should be fixed. Github has been updated and I'll update the workshop later once I get some other stuff fixed.
[Editline]March 12[/editline]
Fixed another weapon issue! Now your weapons will no longer be visible in the hull (As in, you won't be seeing floating weapons in the sky anymore. Weapons will still be rendered for your model on the hull.)
[IMG]http://i.imgur.com/47u9Se3.jpg[/IMG][/QUOTE]
Thank you! I have a few other bugs you may like to know about regarding hulls.
If you fire a rocket out of one, you can end up really screwing with its targeting (HL2 RPG). I suggest that if you see a rocket being fired through a hull, it should be removed (if only for the fact that playing with that shit's targeting will be a nightmare if not impossible)
Also I mentioned earlier that ACF is incompatible with this because it doesn't collide with the ground in your map, causing it to traverse millions of cells before its velocity goes crazy and crashes the server.
[QUOTE=HDG_MrDeeJayy;49921387]
If you fire a rocket out of one, you can end up really screwing with its targeting (HL2 RPG). I suggest that if you see a rocket being fired through a hull, it should be removed (if only for the fact that playing with that shit's targeting will be a nightmare if not impossible)[/quote]
Hmm. Currently there's an exception for those rockets where, once it leaves the hull, targeting is disabled and it just goes out in a straight line. Is that not happening?
[QUOTE=HDG_MrDeeJayy;49921387]
Also I mentioned earlier that ACF is incompatible with this because it doesn't collide with the ground in your map, causing it to traverse millions of cells before its velocity goes crazy and crashes the server.[/QUOTE]
You mean the bullets from the ACF? There's no real way for me to fix that on this side...wait, it crashes the server? Do the bullets speed up over distance or something? Why would it traverse millions of cells?
And wait, it doesn't collide with the ground? That's strange. I gotta go redownload ACF to test.
[QUOTE=DavidRalphsky;49921460]Hmm. Currently there's an exception for those rockets where, once it leaves the hull, targeting is disabled and it just goes out in a straight line. Is that not happening?[/quote]
I haven't had an opportunity to test it with a version any newer than 1 month ago at the latest... I'd have to doublecheck, but last time i checked this functionality didn't exist (Rather, the rocket would just sit there in one place.
[QUOTE=DavidRalphsky;49921460]
You mean the bullets from the ACF? There's no real way for me to fix that on this side...wait, it crashes the server? Do the bullets speed up over distance or something? Why would it traverse millions of cells?
And wait, it doesn't collide with the ground? That's strange. I gotta go redownload ACF to test.[/QUOTE]
I mean any weapon from ACF. Cannon, bullet, you name it, it goes right through. Passes through any map brush until it reaches the zone for traversing cells. Gravity starts to play a role on it, and it goes downwards, traversing cells slowly (but velocity increasing) until the velocity seems to go out of hand. You can spot its trail as it does this no matter what cell you are in.
A single round normally wont crash the server. But consider this: With nothing for those rounds to collide with, theres nothing to stop them. That's one entity that will forever be there. And if its an automatic gun? That could literally be 80 entities travelling at insane speeds traversing tons of cells in seconds... the strain is enough to put clients into the low fps and servers in the shit.
I think this is something that ACF may need to fix, however this problem will still exist for anything else that doesn't treat a map brush as a solid surface (or even does penetration). Perhaps if an entity is discovered to be traversing cells too frequently (and I'm talking more than 1 cell per second), it should be considered "lost" or "out of control" and dealt with accordingly.
[QUOTE=HDG_MrDeeJayy;49922617]
A single round normally wont crash the server. But consider this: With nothing for those rounds to collide with, theres nothing to stop them. That's one entity that will forever be there. And if its an automatic gun? That could literally be 80 entities travelling at insane speeds traversing tons of cells in seconds... the strain is enough to put clients into the low fps and servers in the shit.
I think this is something that ACF may need to fix, however this problem will still exist for anything else that doesn't treat a map brush as a solid surface (or even does penetration). Perhaps if an entity is discovered to be traversing cells too frequently (and I'm talking more than 1 cell per second), it should be considered "lost" or "out of control" and dealt with accordingly.[/QUOTE]
I tested it out and the guns collided with the ground properly and everything, but yeah, after shooting the bullet and waiting a while, my game started lagging hardcore. I'll have to see what I can do about entities travelling too fast or something, I dunno. I'm still fighting with vehicles.
I figured out why thirdperson isn't working--It's because it uses TraceHull instead of TraceLine. But because I'm a massive pleb, I cannot get an override working. I got it adding the func_brushes not in the cell to the filter correctly, but then it just collided with the vehicle you're in for some reason. So I scrapped it all and restarted, and then it ended up adding to the filter correctly but then colliding with the brushes anyway. I dunno, I just got back to this addon after months of CS: GO.
[editline]March 13[/editline]
-snip
Well I took a break from coding and enjoyed the map with a friend of mine. Was so much fun flying around c:
[url]http://i.imgur.com/92jfItu.gifv[/url]
[url]http://i.imgur.com/RqfMzlt.gifv[/url]
Not a lot of people replying to the thread :C
[QUOTE=DavidRalphsky;49928212]Well I took a break from coding and enjoyed the map with a friend of mine. Was so much fun flying around c:[/QUOTE]
[url]http://i.imgur.com/92jfItu.gifv[/url]
[url]http://i.imgur.com/RqfMzlt.gifv[/url]
**EDIT**
I should actually give the new version a try before asking questions. My bad.
-snip
I AM A GOD!!!!
Figured out TraceHull and a fixed it. I forgot it can accept functions now, so instead of the old
[lua]
local tro = util.RealTraceLine(tr) -- Make a new traceline using the old data
tro.HitPos = MapRepeat.CellToPos(tro.HitPos,cell) -- Find the relative position in the cell and override HitPos
tro.StartPos = tr.start -- Set StartPos to the trace's start
return tro -- Return new traceline
[/lua]
^ From traceline, I had to do
[lua]
local tho = util.RealTraceHull( {
start = th.start,
endpos = th.endpos,
filter = function(e)
if(type(th.filter) == 'function') then
pass = th.filter(e)
else
pass = table.HasValue(th.filter,e)
end
return MapRepeat.InCell(e,cell) && pass
end,
mins = th.mins,
maxs = th.maxs,
} )
[/lua]
WHEWWW! Anyway, updating the GitHub with that now. Seems to work fine in testing. Your camera collides with the ground and such, but not the brushes/props/etc that are not in your cell.
SPECIAL THANKS TO SUPERLLAMA FOR HELPING ME WITH THE TABLES BEING FUNCTIONS AND SUCH!
<3 U BBY
[editline]16th March 2016[/editline]
This is officially the vehicle update!
[B]VEHICLE CELL TRANSITIONS ARE NOW FIXED. NO MORE TELEPORTING TO THE WRONG SIDE OF THE CELL![/B]
Not going to push to the github yet until I've tested it more, and this does still have some issues. For example, if you try driving into the next cell, you'll end up crashing into an invisible wall, but then you can drive through. Will work that out pretty soon.
[editline]16th March 2016[/editline]
Alright, while this is awesome, it's kind of tainted. You crash into the wall every time, stopping you dead and causing you to do a flip usually.
And the ghost of the jeep that people in other cells are supposed to see doesn't get placed correctly, and instead sits at 0 0 0. More testing required!
[editline]16th March 2016[/editline]
This is what I mean:
[video=youtube;ggsyDT9RROk]https://www.youtube.com/watch?v=ggsyDT9RROk[/video]
Finally got around to making that "single entity" mode people have sought after. This should help reduce lag and increase functionality when used on contraptions. As requested I've made it into a toggle.
[video]http://youtube.com/watch?v=S-n9r68LwZI[/video]
I went ahead and [URL="https://github.com/DavidRalphsky/localizedphysics/commit/d9fd25d89f2b7a3d45cfdda44a95ca0a66b7cc3b"]fixed Admin Cleanup for MapRepeater[/URL]. Already pushed to GitHub.
[editline]March 18[/editline]
Also, updated the workshop addon with all of my progress from the past week or so. It's quite the list of bugfixes.
Update: I [URL="https://github.com/DavidRalphsky/localizedphysics/commit/30290d0586e2c4e63c1b1a6446131073ce86a6ba"]fixed TraceEntity[/URL] and pushed it to the GitHub. This fixes ULX teleport and whatever else uses TraceEntity.
[editline]20th March 2016[/editline]
Also [URL="https://github.com/DavidRalphsky/localizedphysics/commit/7566863ce145ad09936de685f951ce4f4f16ecac"]added an undo for Gravity Hull[/URL]. Now you can apply a hull and then hit undo to remove it!
[B][U]PROP BOUNCING BUG FIXED![/U][/B]
With this REALLY FOOKN EASY fix ([URL="https://github.com/DavidRalphsky/localizedphysics/commit/598854977bc7ff38d922dfbaa77c816fecca9bc3"]Already pushed to the GitHub[/URL]), the physics crashing causing props to bounce and fall through the world should be fixed! If you're still getting it (you really shouldn't), [URL="http://steamcommunity.com/id/DavidRalphsky/"]contact me[/URL] or post here!
(excuse the snip I edited the wrong post)
I love this addon, but interestingly, it causes my client to do a full resync roughly every second, as seen here:
[img]https://dl.dropboxusercontent.com/u/3166522/upload/2016/03/hl2_2016-03-31_04-18-58_407699e.png[/img]
(In the upper part of the graph, the breaks in the red show a loss of updates from the server, with the high byte count following showing a resync.)
I've verified that this is caused by gravity hull's SLShipTick think hook. I believe it's because SLShipTick takes a very long time to complete. I'm using the current workshop version. I wasn't able to find an in-game print out of the version number anywhere.
I'd love to see this fixed and, if there's anything that I can do to assist in debugging or fixing it, please let me know.
[editline]31st March 2016[/editline]
I've created an issue on GitHub for that: [url]https://github.com/BillyTheBull/localizedphysics/issues/24[/url]
Sorry, you need to Log In to post a reply to this thread.