• Project Impossible - Localized Physics and Infinite Maps
    71 replies, posted
[U][B]A little backstory[/B][/U] For those who have been playing GMod since around 2011, you may remember an old addon called the Gravity Hull Designator. It was one of the most revolutionary addons to ever come out! It was created by SuperLlama, who later also created another addon called Map Repeater, sharing a lot of the same code with Grav Hull. In essence, it was a way to make infinite maps. Unfortunately, motivation started to drain from the project, and GMod 13, which broke everything, was the final nail in the coffin. SuperLlama moved on to other projects, including [URL="https://forums.oculus.com/viewtopic.php?t=4759"]Morrowind VR[/URL] (which is fookn awesome if you'll excuse the tone-shift.). Jump to a couple months ago, and the GHD popped up on the workshop a couple times, but most of them were still terribly broken. One kinda-stable one was from user Nightshade (or Derek or Admin or Erik The Born), who was approached by another user, Bull (Par on Facepunch), who had a fix for a few of the issues on the tool. Unfortunately, Map Repeater was left untouched, because the code in it is pretty sophisticated and jeez that's a lot of variables that loop back on themselves. It was disabled and planned to be cut out of GHD completely. Then I found the workshop item while browsing, downloaded it, and did a lot of bugfinding. I posted a couple discussion posts, and eventually added Bull and Nightshade. After a quick chat, I decided to dive into the Map Repeater code and see if I survive. Two days later, I discovered a single hook that was mistyped. I corrected it and bam, Map Repeater was fixed. And there was much celebration (I got drunk on accident while playing CS: GO). Anyway, after that I added SuperLlama, who has been acting as an advisor for the project, and we've been working on fixin' this addon for you guys. [U][B]Onto stuff that actually matters![/B][/U] [U]Videos[/U] [video=youtube;xn4bDLPY69Q]https://www.youtube.com/watch?v=xn4bDLPY69Q[/video] [video=youtube;5h3FVep2MCE]https://www.youtube.com/watch?v=5h3FVep2MCE[/video] [video=youtube;TMHcZdr79Sk]https://www.youtube.com/watch?v=TMHcZdr79Sk[/video] [video=youtube;x99gEVd9UnU]https://www.youtube.com/watch?v=x99gEVd9UnU[/video] [B]What defines the hull?[/B] The interior of the hull is defined as the set of locations where there is a floor under you, and if the point's elevation from the floor exceeds the vertical protrusion factor, it also requires at least one non-floor (a wall or ceiling). [B]What this ISN'T:[/B] • [B]NOT a module,[/B] the mod is made entirely with lua and has no dependencies. • [B]NOT a reimplementation of source physics[/B], it's a complex illusion that involves a room in the middle of nowhere. • [B]NOT a wall walking mod[/B], though it can be used on something and then rotated 90 degrees so that down is now the wall. • [B]NOT a spherical planet mod[/B]. "Down" inside the ship is defined as the orientation gravity was pulling when the tool was first used. Spawn a dumpster, shoot it, flip it upside-down, and you're on the ceiling. • [B]NOT a way to stick to things[/B]. Again, down is only one direction internally and you cannot walk around the inside of a ring unless you make it out of multiple hulls, each with their own down. This might be made easier in the future. • [B]NOT a map entity[/B]. I might make a map entity later on that allows the effect to be present, but for now it's just something you build with. • [B]NOT a collision engine[/B]. This mod uses nothing more than source's built-in havok implementation, but it sure fools it a lot. Many shortcomings of havok are avoided by making it think something different is happening. [B]What this mod IS:[/B] • [B]a localized physics environment for any contraption[/B], essentially behaving as if each hull was its own map. • [B]a tool that anyone can use[/B] on any set of welded props that has a clear interior and exterior. • [B]the first and only complete spazz protection for ships[/B]. Since the ghost doesn't move, entities inside cannot be thrown through the wall. NOTE: In the future there will be a slider to control how much entities are thrown around by motion, but it will be applied in a backwards manner (negative velocity to the props, not positive velocity to the ghost) to avoid wallclipping, so even a 0% dampener will still stop spazz deaths even though it will throw things around just as much as before. •[B] a separate area with its own sense of "down."[/B] Gravity's internal direction is defined when you first designate your hull, and does not change relative to the ship's rotation. • [B]a stabilizer for pretty much any vehicle you can think of.[/B] Boats are especially interesting with the tool applied, because you actually rock back and forth in the water. • [B]linked with the outside world[/B] as seamlessly as possible (WIP)-- the physgun behaves properly for the most part, and you can toolgun entities on the outside while you're inside a hull, as well as press buttons/get in chairs. • [B]an override of many built-in functions[/B] such as GetPos, so there is a chance that your favorite mod might work with it already without any changes. • [B]a very convincing illusion[/B]. You're not actually in your ship, but it sure looks like you are. For this reason a lot of things (manhack lights for example) might render in the wrong place. But hey, a video game is just an illusion too, so who cares. • [B]a simple change[/B] brought on by [B]extremely non-simple code,[/B] that can revolutionize almost everything else that's already possible with the simple addition of walking in a moving object and gravity being affected by rotation. [B][U]FAQ[/U][/B] Q: My contraption isn't working, it says it was designated but it isn't! A: Does it have walls or a ceiling? If not, you need to increase the Vertical Protrusion Factor. Q: Does this work with spheres? A: Not in the way you're asking. Q: Does this work with <<SUBJECT ADDON HERE>> A: Maybe; depends on what the addon does. There may or may not be conflicts and there's a decent chance it won't work inside the hull, but lots of mods do. It's a matter of overriding the right things and I plan to fix as many of these as I can. Q: I just want to fly a spaceship, I don't want people running around climbing walls like spiderman. A: They can't. The only way you can walk on a wall is by making a "ship" and rotating it so that its floor is on the wall (or designating the wall with hit surface defines floor checked)-- it's not just a "climb wherever you want" deal. [B]DOWNLOAD[/B] The current version is on our [URL="https://github.com/DavidRalphsky/localizedphysics/"]Github[/URL], and it is also on the [url="http://steamcommunity.com/sharedfiles/filedetails/?id=531849338"]workshop[/url]. [B]Support us![/B] Mod work is extremely tiring and hard to get motivated for. Stuff you make for fun gets dropped below stuff you made for money in terms of priorities. Donations? That's one hell of an incentive to get back to work on it. [URL="https://www.paypal.com/us/cgi-bin/webscr?cmd=_flow&SESSION=OcUYStib-j55V4q1e3ogCrP5eGdDhfuuis1USdFGPVWspGbVmO66rABV4Fa&dispatch=5885d80a13c0db1f8e263663d3faee8d64ad11bbf 4d2a5a1a0d303a50933f9b2"]Donate to SuperLlama here! He made this all possible![/URL] [B][U]TODO[/U][/B] • Optimize the constraint-enabled in/out scanner to reduce lag. • Add the ability for the effect to be (adv)duplicated, including objects welded to the inside of the ship. • Fix the hull within a hull within a hull from sending you to limbo • Work on making major mods work flawlessly with the mod, especially wire and spacebuild. • Implement a dampening percentage slider so that values below 100% will allow some inertia through. • Implement a dampening threshold slider so that only velocity changes above the value will obey the above. • Recode the physgun beam in lua so that it renders. • Add a stencil system so you can have the classic "cloaked ship with a doorway" effect. • Fix parenting with Map Repeater. • Fix adv dupe weirdness with Map Repeater. • [del]Fix thirdperson camera colliding with n
Thank you for bringing this back. This may get me back into gmod again :)
[img]http://i.imgur.com/CkVZN4I.jpg[/img] great start for the new thread, I'm glad you updated the TODO and revision list from my original one :) [highlight](User was banned for this post ("image macro" - Craptasket))[/highlight] EDIT: apparently seals are illegal if used improperly, I apologize mr. moderator.
By the way, I take 0, utterly 0 credit for any part of this addon. All of it was that sexy guy SuperLlama, I just fixed it for 'im (along with Par) while he's busy with other projects. luv ya llama
It's been a real honor developing this tool along my idol Super Llama and my co-workers. We finally released map repeat code today in a more stable version. We recorded it while testing it just b4 release! I will post a video of it as soon as Im done editing it!
I decided to start with a clean slate and downloaded the version of GHD from three years ago pre-GMod 13 and start fixing it from there. I just want to make sure no-one deleted anything and broke something down the line
What's with the new thread though? Didn't your friend already make one [url=https://facepunch.com/showthread.php?t=1477648]here[/url]?
[QUOTE=YourStalker;48862223]What's with the new thread though? Didn't your friend already make one [url=https://facepunch.com/showthread.php?t=1477648]here[/url]?[/QUOTE] Read through to the end: "Why was this reposted? Bull and I felt like fixed map repeater was a feature to merit a new, fixed release. And because Bull was having trouble with changing the title :^)"
SuperLlama's offline and I'm bored. Challenge accepted. Currently working on adding content behind the "space" keyvalue in info_maprepeat. Everything's working fine but apparently lua thinks that 2 is greater than or equal to 10, so I'm confused. [editline]October 9[/editline] Alright, I figured out the problem and added a quick texture for the space, [IMG]http://images.akamai.steamusercontent.com/ugc/643244950449521597/C3CFE5763F5C464A5D4757F43F044E4EF0AF8315/[/IMG] Once you reach the z cell (or higher) specified in the info_maprepeat, that texture will be put in the skybox and all props will have no gravity. Otherwise you get the default skybox and props have gravity. [IMG]http://images.akamai.steamusercontent.com/ugc/643244950449577577/82BEEECD079BD2B4E922ACA8F54BA4D514B9942E/[/IMG] I'll get rid of the fog in space cells in a bit. [editline]October 9[/editline] Fog disabled! Was way easier than I thought. Unfortunately, now space cells (especially the asteroid level) don't have the nice transition, so you'll see objects kind of phase into existence if they're more than the source render range away. I guess that has to be. [IMG]http://images.akamai.steamusercontent.com/ugc/643244950449597016/915E93338B4EB04DEDBDDDFF241E633105FFEC0C/[/IMG] [editline]October 9[/editline] Don't be afraid to post, guys. Feedback always helps...in fact, the absence of feedback is worse than overly negative feedback.
Whoa great job on the space! can't wait to try that out. If the space skybox is an effect you're drawing in a hook, you might be able to fade its alpha during the transition cell based on your Z position, making it a little bit smoother when you're leaving the atmosphere. Might also be able to change the fog color in space so it's black, that could possibly stop the phasing in without making it look like there's air.
[QUOTE=SuperLlama;48870832]If the space skybox is an effect you're drawing in a hook, you might be able to fade its alpha during the transition cell based on your Z position, making it a little bit smoother when you're leaving the atmosphere.[/QUOTE] EXACTLY what I was thinking, but every time I tried it, it didn't work. Alpha simply would not change. Anything other than 255 wouldn't draw the effect. I'll explain more in a steam message. [Editline]October 10[/editline] Dammit. SetGravity doesn't work on props, only players and NPC's. I was hoping to have gravity decrease more and more the higher you go. It'll only work on players though. For props I'd have to manually add velocity. Damn. [editline]October 10[/editline] Players are set up to have no grav in space cells as well (which can be overridden by a grav hull), and I also disabled combine balls from having their gravity set (even though it was fun to do artillery with them). Currently trying to figure out some issues with ShipSpit causing crazy physics, having the spit prop be deleted.
for some reason on gm_flatinfinite, other cells are not rendering for the client, yet they can enter them
[QUOTE=AJ10017;48881866]for some reason on gm_flatinfinite, other cells are not rendering for the client, yet they can enter them[/QUOTE] Which version are you using? Is it just the cells around cell 0 0 0? Do further out cells render? Any script errors?
I'm using the latest github version, and only cell 0,0,0 is rendering No other cells render
[QUOTE=AJ10017;48885483]I'm using the latest github version, and only cell 0,0,0 is rendering No other cells render[/QUOTE] Yeah Github's currently messed up I think, should be fixed soon, but until then try [url=http://steamcommunity.com/sharedfiles/filedetails/?id=531849338]the workshop version.[/url]
[QUOTE=DavidRalphsky;48887381]Yeah Github's currently messed up I think, should be fixed soon, but until then try [url=http://steamcommunity.com/sharedfiles/filedetails/?id=531849338]the workshop version.[/url][/QUOTE] i tried the workshop version but it lagged my server horribly and spammed the server console with "0 10"
[QUOTE=AJ10017;48887425]i tried the workshop version but it lagged my server horribly and spammed the server console with "0 10"[/QUOTE] Just updated the workshop to remove that debug print, sorry, but not sure why it would lag. Is it just in general? Or when you grav hull something?
it would lag whenever props would move, ill look into it
The following error occurs when going through a Stargate using CAP while this addon is installed: [code][CAP: Code] addons/localizedphysics/lua/gravityhull/sh_entityoverrides.lua:188: attempt to compare number with string 1. FindInSphere - addons/localizedphysics/lua/gravityhull/sh_entityoverrides.lua:188 2. unknown - lua/entities/kawoosh_hurt.lua:53 [/code] On gm_flatgrass, with no gravity hulls involved, and all addons updated as of ten minutes ago, the "kawoosh" (actual name) discombobulates props as intended (I survived standing directly in it as a player, which shouldn't be happening, but it's possible that something unrelated is involved there), and all other functions relating to the mod work fine. I haven't tried sticking a gravity hulled box into the kawoosh yet because I want to confirm whether or not it's even your bug first, and I haven't tried gm_flatinfinite because not only do I have the rendering glitch, but I have a bizarre secondary bug where it seems like there's a gigantic invisible pyramid covering the spawn cell and I have to noclip out of it. Exact cause is completely unknown to me, but at the time I figured it was probably just "I installed it badly". [editline]12th October 2015[/editline] Well, to be more accurate, the specific error occurs after the gate dial, just as the wormhole gets established (in the TV show's logic), when the kawoosh is spawned and active (game logic). Soon as it goes away and it's actually safe to walk through the gate, the error ceases.
[QUOTE=lavacano;48889035] [code][CAP: Code] addons/localizedphysics/lua/gravityhull/sh_entityoverrides.lua:188: attempt to compare number with string 1. FindInSphere - addons/localizedphysics/lua/gravityhull/sh_entityoverrides.lua:188 2. unknown - lua/entities/kawoosh_hurt.lua:53 [/code][/QUOTE] That's very strange. It seems like it's this line [code]e:GetPos():Distance(vec) <= rad[/code] that is causing the problem, but it shouldn't be. rad is the radius, which looks to be correctly inputted in CAP, [code]for _,v in pairs(ents.FindInSphere(self.Entity:GetPos(),self.Radius)) do[/code] I'll look into this further. [QUOTE=lavacano;48889035]I haven't tried gm_flatinfinite because not only do I have the rendering glitch[/QUOTE] Which rendering glitch? [QUOTE=lavacano;48889035]but I have a bizarre secondary bug where it seems like there's a gigantic invisible pyramid covering the spawn cell and I have to noclip out of it.[/QUOTE] Oh boy. Another ShouldCollide hook confliction. I'll check up the code on both addons. Thank you for the bug report! [editline]October 12[/editline] Fixed the first issue. Turned out that, for some reason, CAP gives a string as a radius, strangely. Was easy enough to fix, though the kabloosh thing doesn't destroy props or damage players as it should. Will continue! Still working on the ShouldCollide confliction. If anyone can find where CAP puts its ShouldCollide hook, I'd be grateful! [editline]October 12[/editline] Well I figured out the ShouldCollide issue. CAP has a few entities that use ShouldCollide, and unfortunately they have [code] else return [/code] I was able to fix this for me by doing [code] else return nil [/code] So there's a temp fix you guys can use while I try to get in contact with the CAP devs. (I don't even know if this is a fix I'm slightly drunk and just got out of deathrun so don't think I'm smert)
[QUOTE=DavidRalphsky;48889793]Which rendering glitch?[/QUOTE] Sorry for late response, I come down to the GMod section so infrequently I always forget about when I do show up :v: The rendering glitch I meant was the one mentioned earlier, where only the origin cell (0,0,0) would render (other cells could exist but you'd just see the skybox)
[QUOTE=lavacano;48912852](other cells could exist but you'd just see the skybox)[/QUOTE] Hold it, do cells 2,0,0 and 0,2,0 and etc render? (once you go into the nonexistant cell 1,0,0 or 0,1,0 etc)
Infinite maps are still broken for me. All the cells get bunched together clientside but it works serverside. [editline]19th October 2015[/editline] srcds
[QUOTE=Ott;48941499]Infinite maps are still broken for me. All the cells get bunched together clientside but it works serverside. [/QUOTE] Are you using Github? If so, use the workshop version. I'm actively updating that one.
Actively update the GitHub version, please. You don't even need to make pull requests, I'll just use your fork. GitHub should be your main development platform, it's free cloud storage and backups.
[QUOTE=Ott;48947923]Actively update the GitHub version, please. You don't even need to make pull requests, I'll just use your fork. GitHub should be your main development platform, it's free cloud storage and backups.[/QUOTE] Yeah I'll update my fork, one moment. [editline]October 20[/editline] [URL="https://github.com/DavidRalphsky/localizedphysics"]Done.[/URL]
[QUOTE=DavidRalphsky;48889793]Well I figured out the ShouldCollide issue. CAP has a few entities that use ShouldCollide, and unfortunately they have [code] else return [/code] I was able to fix this for me by doing [code] else return nil [/code] So there's a temp fix you guys can use while I try to get in contact with the CAP devs. (I don't even know if this is a fix I'm slightly drunk and just got out of deathrun so don't think I'm smert)[/QUOTE] Please provide a patch we can apply to CAP. These instructions are incredibly unclear, and since you were drunk and the way I followed them didn't work, I'm thinking they're also incomplete (you have shit memory when you're intoxicated, it happens). In case you don't already know how (Using PowerShell and command-line git from within the CAP directory): [code]git diff > shouldcollidefix.patch[/code]
[QUOTE=lavacano;48889035]but I have a bizarre secondary bug where it seems like there's a gigantic invisible pyramid covering the spawn cell and I have to noclip out of it.[/QUOTE] [b][i][u]EUREKA MOTHERFUCKERS[/u][/i][/b] In CAP, lua/entities/shield_core_buble/modules/collision.lua: change line 3 from: [code] if (!ent1:IsValid() || !ent2:IsValid()) then return true end[/code] to: [code] if (!ent1:IsValid() && !ent2:IsValid()) then return true end[/code] Shields work, flatinfinite works. No detrimental effects found thus far that were caused by this change. [editline]false merge[/editline] However, while testing, I found a different bug, which can be reproduced without CAP being loaded so it's definitely not CAP still conflicting. 1. Spawn a HL2 jeep on flatinfinite. 2. Get in, drive down the road (I was using the jeep's boost function, may or may not be relevant) 3. Eventually, you will collide with an invisible wall. Crossing the cell borders malfunctions, and you end up approx. 20 cells away from where you started, in the direction you were originally going. [editline]28th October 2015[/editline] [t]http://images.akamai.steamusercontent.com/ugc/583574158722107676/04DFCC3B852E2377F56A1CCA85DAB8D3C2441F03/[/t][t]http://images.akamai.steamusercontent.com/ugc/583574158722108274/BAB31514B1FCAC12BCB8D2F5ADA9829CD1D4CDA7/[/t] OK so apparently we're not entirely bug free yet. But I seem to have solved the big one! The gates still work well enough (dialing out to my gate at [3,2,0] is 100% success, and I [i]can[/i] dial back to spawn but it doesn't put me exactly at the gate), and you can actually be on flatinfinite without colliding with things you shouldn't be colliding with, so now we're just dealing with visual problems mostly.
Oh gawd I haven't checked the thread in a while. Thanks for linking me back, Bull. [QUOTE=lavacano;48970695]These instructions are incredibly unclear[/QUOTE] 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. [QUOTE=lavacano;49003419]In CAP, lua/entities/shield_core_buble/modules/collision.lua: change line 3 from: [code] if (!ent1:IsValid() || !ent2:IsValid()) then return true end[/code] to: [code] if (!ent1:IsValid() && !ent2:IsValid()) then return true end[/code][/QUOTE] 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) [QUOTE=lavacano;49003419]1. Spawn a HL2 jeep on flatinfinite. 2. Get in, drive down the road (I was using the jeep's boost function, may or may not be relevant) 3. Eventually, you will collide with an invisible wall. Crossing the cell borders malfunctions, and you end up approx. 20 cells away from where you started, in the direction you were originally going.[/QUOTE] 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. [QUOTE=lavacano;49003419] [t]http://images.akamai.steamusercontent.com/ugc/583574158722107676/04DFCC3B852E2377F56A1CCA85DAB8D3C2441F03/[/t] [t]http://images.akamai.steamusercontent.com/ugc/583574158722108274/BAB31514B1FCAC12BCB8D2F5ADA9829CD1D4CDA7/[/t][/QUOTE] Strange. Looks to be some kind of rendering bug. I assume that was occurring outside of cell 0 0 0?
Has anyone made a Spacebuild server yet with this? Infinite maps sounds pretty dandy for space.
Sorry, you need to Log In to post a reply to this thread.