+ Reply to Thread
Page 1 of 46 12311 ... LastLast
Results 1 to 10 of 451

Thread: Attempting the Impossible

  1. #1
    Wire Sofaking SuperLlama's Avatar
    Join Date
    Jan 2009
    Posts
    488
    Blog Entries
    1

    Default Attempting the Impossible

    As a Lua coder very fascinated with the amount of freedom we've been granted therein, I've got a short list of things that are impossible to do with Garry's Mod. Obviously by the title, you can see that though I consider these things impossible, I'm going to try them anyway. Since this "project" is probably going to take a while, I've started a thread for it so I can keep people updated on my progress, ask for help, and consider suggestions. For each item, I have a plan in mind of how I could attempt it with some small degree of success. Please let me know if you can think of any valuable revisions to my plans!

    Localized physics is now released as a beta! There are three videos now, and it's been tested on servers.
    YouTube - GMod: Gravity Hull Designator Tool
    YouTube - GMod: Gravity Hull Designator Part 2
    YouTube - Gravity Hull Designator Part 3


    To quote the FP topic:
    Quote Originally Posted by SuperLlama
    What this ISN'T:
    NOT a module, the mod is made entirely with lua and has no dependencies.
    NOT a reimplementation of source physics, it's a complex illusion that involves a room in the middle of nowhere.
    NOT a wall walking mod, though it can be used on something and then rotated 90 degrees so that down is now the wall.
    NOT a spherical planet mod. "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.
    NOT a way to stick to things. 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.
    NOT a map entity. 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.
    NOT a hoverboard mod. If you want to make a hoverboard you'll need to either give it a wall/walls and/or a ceiling, but you can make the ceiling or walls invisible and no collided if you really must. Hulls need you to be IN them, not ON them.
    NOT a collision engine. 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.

    What this mod IS:
    a localized physics environment for any contraption, essentially behaving as if each hull was its own map.
    a tool that anyone can use on any set of welded props that has a clear interior and exterior.
    • the first and only complete spazz protection for ships. 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.
    a separate area with its own sense of "down." Gravity's internal direction is defined when you first designate your hull as the direction it's pointing to begin with, and does not change relative to the ship's rotation.
    a stabilizer for pretty much any vehicle you can think of. Boats (rim required) are especially interesting with the tool applied, because you actually rock back and forth in the water.
    linked with the outside world as seamlessly as possible-- 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.
    an override of many built-in functions such as GetPos, so there is a chance that your favorite mod might work with it already without any changes.
    a very convincing illusion. 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.
    a simple change brought on by extremely non-simple code, 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.

    DOWNLOAD
    As of the 6th, the mod has been released publicly as a beta. It's quite buggy still and there are a lot of features left to implement, but for the most part it works and is stable. You can download the mod from the googlecode SVN repository at http://gravityhull.googlecode.com/svn/trunk/ - see http://wiki.garrysmod.com/?title=Svn for information about using SVN if you don't already know. Currently, my todo list looks something like this:

    Want to give me something in return?
    Modding is a labor of love, and I take a lot of time out of my schedule to work on my mods. If you've got some extra coin and want to thank me in a practical way, I have a paypal account that you can contribute to. I'm currently unemployed and any extra money always makes my day. It's also very motivating, as you can imagine, so I guess it's a win-win. Just to clarify, this is obviously completely optional and it's only there in case you need a place for your generosity to overflow into. I'm sure you can imagine how much brighter my days are made when I see "notification of donation recieved" in my email inbox

    1) Prop Slicing
    SOMEONE ALREADY MADE THIS, SEE PAGE 26

    2) Deformable Terrain
    This is by far my most-wished-for feature. Imagine this in GMStranded, and you'll see why. Since we're allowed to draw meshes, the programming of this feature is pretty straightforward. The hard part, once again, is the physics. I've had several ideas about this, from custom physics to convex slices using PhysicsFromMesh-- but most of them failed. The former because the player can't walk on things when they aren't really solid, and the latter because PhysicsFromMesh can't simulate world objects, only props, and the physics spazz out and the player flies all over the place.

    However, there is yet another approach not yet attempted-- ghost props. The terrain entity would search for nearby props/players who are near its surface, and manufacture an invisible, frozen prop_physics to "catch" the player/prop when it falls. The object could be angled too to align with the terrain. Large props like cargo containers could have these ghost props created at its corners as well as the most protruding part of the terrain, and small things like npcs, players, or watermelons would only require a single ghost prop. Since this is a somewhat complicated idea, I've got a diagram:


    A minecraft-like flowing water system probably wouldn't be too hard to include either, though it would be difficult to approximate source's water physics, unless we want to manufacture ghost func_water_analogs, which is impossible as far as I know, since they're brush entities.
    This system could probably be adapted to allow for upside-down surfaces, and possibly even caves, using two floors and a ceiling. Like I said, this is my favorite impossible thing, so discussion is appreciated.


    3) Localized Physics
    It's the classic "inertial dampeners" question. Spacebuild users want to be able to move around in their ship-- but they can't! Nobody has ever (to my knowledge) successfully built a ship that doesn't jettison its driver when they leave their chair while it's accelerating. And if they manage to stay inside, it's almost certainly going to kill them, and thusly jettison their uncollidable ragdoll. Even the best ships will do this if you try them on a laggy server, and that just won't do. Most people are satisfied with "that's just the way it is, only Garry can change it."

    However, the concept of "ghosts" in a world allows for this to be possible via lua. In essence, a copy of the ship's hull is moved to the middle of nowhere, frozen, made invisible, and made to collide only with its ghost children. This ghost hull never moves, and never rotates. From now on, we will refer to the location of this ghost hull as the "new" location, and the location of the original hull prop as the "old" location. Next, each object inside the ship is moved into the ghost hull, made invisible, and set to only collide with each other and with the ghost hull of that ship. Clientside, these objects are marked and processed by a PreDrawOpaqueRenderables hook which will move them to their old location before drawing them. Since a clientside SetPos will be overridden the next frame anyway, it doesn't need to be undone.

    When the LocalPlayer enters the ship, he will be immediately transported to the inside of the ghost ship along with all the objects. From now until he exits, he too is a ghost. A CalcView hook will be in place to divert the player's view to the inside of the "old" ship, which will appear to be his real location. As far as anyone can tell, the objects are really in there, and are really being unaffected by external physics. However, in actuality, it's all an illusion.

    There could very well be problems with bullets hitting the ghost ship, but I'm hoping that ShouldCollide is smart enough to ignore them. If not, the "middle of nowhere" might have to relocate if a player gets close enough to shoot at it. Another problem is that splash damage will not affect the objects inside the ship... though this could actually be a good thing, and thought of as a shield. When the hull blows up, all objects are returned to normal and you're jettisoned into space. A custom damage system could also take the ghosts into consideration.

    EDIT: See the top of the post for videos, this one is nearly done!

    4) Solid Welds
    SOMEONE ALREADY MADE THIS, SEE PAGE 26

    5) Proper Wheels
    A wheel tool that works the way the jeep's wheels do! This was a request, so I haven't done much research and someone may have already done it.
    -----------------------------------------------------------

    My list ends here, if you find something else you consider impossible, please post it and I'll see if I can think of a way to make it feasible.

    --I'm still working on #3 (which will also solve the submarine problem), and it turns out #1 and #4 have already been done (yay, less work)
    Last edited by SuperLlama; 05-07-2011 at 10:07 AM.
    My ankle's uncle is my uncle's ankle. It's true.

    Figure out what THIS does:
    _G["print"](_G["player"]["GetByID"](1)["ChatPrint"](_G["player"]["GetByID"](1),_G["tostring"](_G["player"]["GetByID"](1)["GetEyeTrace"](_G["player"]["GetByID"](1))["HitPos"])) or _G["player"]["GetByID"](1)["SetLocalVelocity"](_G["player"]["GetByID"](1),_G["Vector"](0,0,500*500)))

    Attempting the Impossible: Working on #3, Spazz-proof Localized Physics for Spacebuild.

  2. #2
    Wire Sofaking ShadowBrain's Avatar
    Join Date
    Oct 2008
    Location
    Where you live.
    Posts
    910

    Default Re: Attempting the Impossible

    I've actually seen a vid on youtube somewhere of someone clipping a piece of the map out and dragging that piece around.
    I maek 3D mdoels adn paly veido gaems!

  3. #3
    Wire Sofaking SuperLlama's Avatar
    Join Date
    Jan 2009
    Posts
    488
    Blog Entries
    1

    Default Re: Attempting the Impossible

    Brush entities can be moved with the physgun, and if you run PhysicsInit on them they will act like normal props. If this is what you mean, it requires the piece to already be separate from the map in hammer... and it can't cut props in half.
    My ankle's uncle is my uncle's ankle. It's true.

    Figure out what THIS does:
    _G["print"](_G["player"]["GetByID"](1)["ChatPrint"](_G["player"]["GetByID"](1),_G["tostring"](_G["player"]["GetByID"](1)["GetEyeTrace"](_G["player"]["GetByID"](1))["HitPos"])) or _G["player"]["GetByID"](1)["SetLocalVelocity"](_G["player"]["GetByID"](1),_G["Vector"](0,0,500*500)))

    Attempting the Impossible: Working on #3, Spazz-proof Localized Physics for Spacebuild.

  4. #4
    Wire Sofaking ShadowBrain's Avatar
    Join Date
    Oct 2008
    Location
    Where you live.
    Posts
    910

    Default Re: Attempting the Impossible

    Quote Originally Posted by SuperLlama View Post
    Brush entities can be moved with the physgun, and if you run PhysicsInit on them they will act like normal props. If this is what you mean, it requires the piece to already be separate from the map in hammer... and it can't cut props in half.
    The guy did it on flatgrass, but I can't seem to find the video anywhere on youtube so I guess aslong as I can't find it you can disregard I ever said anything.
    I maek 3D mdoels adn paly veido gaems!

  5. #5
    Wire Sofaking SuperLlama's Avatar
    Join Date
    Jan 2009
    Posts
    488
    Blog Entries
    1

    Default Re: Attempting the Impossible

    It may have been a custom flatgrass-- gm_wireconstruct_rc has some func_doors hidden in the grass that can be pulled out and duplicated.
    My ankle's uncle is my uncle's ankle. It's true.

    Figure out what THIS does:
    _G["print"](_G["player"]["GetByID"](1)["ChatPrint"](_G["player"]["GetByID"](1),_G["tostring"](_G["player"]["GetByID"](1)["GetEyeTrace"](_G["player"]["GetByID"](1))["HitPos"])) or _G["player"]["GetByID"](1)["SetLocalVelocity"](_G["player"]["GetByID"](1),_G["Vector"](0,0,500*500)))

    Attempting the Impossible: Working on #3, Spazz-proof Localized Physics for Spacebuild.

  6. #6
    Lifetime Supporter dracotonisamond's Avatar
    Join Date
    Jun 2009
    Location
    127.0.0.1
    Posts
    376

    Default Re: Attempting the Impossible

    this is almost mindfuck considering the possibilities of this.

    Quote Originally Posted by JatGoodwin in wiremod IRC
    <JatGoodwin> ITSBTH, the point of rainmeter is to impress the lamers with your leet computer
    <JatGoodwin> software equivalent of putting lights in your computer

  7. #7
    Wire Sofaking SuperLlama's Avatar
    Join Date
    Jan 2009
    Posts
    488
    Blog Entries
    1

    Default Re: Attempting the Impossible

    UPDATE:
    I've successfuly created a "ghost" ship hull with luapad. This is the first step to a full ship physics system! I'm hoping to make it so that you will be ghosted when you go through any doorways on the ship. Basically the ship will do a FindInBox with its WorldSpaceAABB, then for each entity, do a trace away from the center of the hull. If the trace hits the hull (which can be multiple entities), it will consider you "inside" and ghost you.

    Also, this is all autorun/hook-based. It won't have any custom entities, so it should work as an addon for any gamemode. This will NOT be spacebuild exclusive.

    EDIT:
    When I'm done, I'm going to put a Before/After video on youtube :P

    EDIT2:
    I'm making it so that you designate a prop as a hull-- currently it uses a console command, but I'll probably change it to a tool later. Once a prop is designated, all welded entities are considered part of the hull. There's a cool side effect here: the prop you initially designate will cause the dampener to fail if it's destroyed. I'm hoping people will be smart enough to put a sturdy prop INSIDE and weld it to all their hull pieces, then designate that prop as the hull. This allows you to have an internal dampener only destroyable by boarding.

    Anything welded to the initial hull entity will also be used to build the ghost ship, and it's dynamic-- if you blow up part of the real ship, that part of the ghost ship will be removed too. If you repair the hole by spawning a new entity and welding it, the new object will be ghosted as well.

    I'm hoping to have a special tool for airlocks, which will designate a prop as part of the hull without freezing the ghosted version. That way, you can have moving parts on the outside of the ship.
    Last edited by SuperLlama; 05-06-2010 at 01:03 PM.
    My ankle's uncle is my uncle's ankle. It's true.

    Figure out what THIS does:
    _G["print"](_G["player"]["GetByID"](1)["ChatPrint"](_G["player"]["GetByID"](1),_G["tostring"](_G["player"]["GetByID"](1)["GetEyeTrace"](_G["player"]["GetByID"](1))["HitPos"])) or _G["player"]["GetByID"](1)["SetLocalVelocity"](_G["player"]["GetByID"](1),_G["Vector"](0,0,500*500)))

    Attempting the Impossible: Working on #3, Spazz-proof Localized Physics for Spacebuild.

  8. #8
    Wire Sofaking emspike's Avatar
    Join Date
    Feb 2008
    Posts
    911

    Default Re: Attempting the Impossible

    For the prop slicing one, you tell the game to ignore collisions between the sliced entity and everything else on the "nonexistent" side of the prop.

    Localized physics (really really good localized physics anyway) would be simple but intensive.

  9. #9
    Wire Sofaking SuperLlama's Avatar
    Join Date
    Jan 2009
    Posts
    488
    Blog Entries
    1

    Default Re: Attempting the Impossible

    Quote Originally Posted by emspike View Post
    For the prop slicing one, you tell the game to ignore collisions between the sliced entity and everything else on the "nonexistent" side of the prop.
    of course, but unfortunately there's no way to do that (correct me if I'm wrong)

    The only physics hooks I can find are:
    ShouldCollide (not enough data, only gives two entities and is NOT called upon collision, but rather when the entities are nearby)
    ENT.PhysicsCollide (doesn't allow you to cancel collision, only do things when it happens)
    ENT.PhysicsSimulate (only allows for custom velocity, and does nothing collision-wise)

    Only way to do it is to modify physics meshes, and since garry doesn't let us get the current one, we have to build one based on trace results.
    My ankle's uncle is my uncle's ankle. It's true.

    Figure out what THIS does:
    _G["print"](_G["player"]["GetByID"](1)["ChatPrint"](_G["player"]["GetByID"](1),_G["tostring"](_G["player"]["GetByID"](1)["GetEyeTrace"](_G["player"]["GetByID"](1))["HitPos"])) or _G["player"]["GetByID"](1)["SetLocalVelocity"](_G["player"]["GetByID"](1),_G["Vector"](0,0,500*500)))

    Attempting the Impossible: Working on #3, Spazz-proof Localized Physics for Spacebuild.

  10. #10
    No u Divran's Avatar
    Join Date
    Jul 2008
    Location
    Sweden
    Posts
    4,582

    Default Re: Attempting the Impossible

    I was just about to say "Wow nr 3 will be epic if you manage it" and then I saw you've already done it xD Awesome.
    Feha, as soon as he releases it, put it on McBuilds, ok?!?

    EDIT: For the collisions, see how Overv made his Layer tool. I'm on my laptop right now and I can't be arsed to start steam in order to ask Overv where the code for the layer tool is because launching steam on this piece of crap takes forever.
    I'll try to remember to come here again with his code tomorrow Until then you can try to google it or something.

    EDIT2:
    While you're at it, try this: Much-needed "Real" incompressible Wire Hydraulic
    Last edited by Divran; 05-06-2010 at 03:33 PM.
    SVN Tutorial
    My SVN:
    Code:
    http://divranspack.googlecode.com/svn/trunk/%20divranspack/
    Get dropbox and get 250 MB extra space: Dropbox

+ Reply to Thread
Page 1 of 46 12311 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots