• pewpew@feddit.it
    link
    fedilink
    arrow-up
    59
    arrow-down
    1
    ·
    16 days ago
    • “Can you make the player be able to summon a monster from the fifth dimension?” “Yes ok ez lol”
    • “Can you make the player able to exist in the world without having it fall though the ground?” “You are asking too much mate”
      • Justdaveisfine@midwest.social
        link
        fedilink
        arrow-up
        9
        ·
        16 days ago

        Oof, this reminds me of a personal experience.

        Me: Oh this grapple system is easy, we’ll just push the player’s vector towards the destination vector.

        Game: Oh but there’s a small object in the way that cannot be moved. This will make an immense amount of collision data per tick.

        Me: Can’t we just ignore-

        Game:

        • sp3ctr4l@lemmy.dbzer0.com
          link
          fedilink
          English
          arrow-up
          4
          ·
          16 days ago

          As another mod maker/game tinkerer…

          Genuinely, how did you fix this?

          If I understand this right, the problem would be… ignoring certain collision meshes/hulls while in grapple movement mode… but then if you stop your grapple while basically inside or intersecting with those meshes/hulls, now insane nonsense happens, right?

          Assuming this is an OoT hookshot style, just throw the player directly at the grapple end point thing, and not a more complex and realistic ‘throwing and climbing a rope like a mountain climber’ style grapple… the way I would try to address this would be:

          Give the grapple movement mode some kind of shut down mechanism/recovery.

          Like… oh the player is still trying to grapple toward point A… but they aren’t moving at anywhere near the speed they would be if they were unobstructed, cancel the grapple mechanic.

          Or: oh, the player is in grapple movement mode, but they collided with something, and they’re nowhere near the grapple end point, stop the grapple mechanic and stop moving them.

          For either (or both) of these, at the end now transition the player into some kind of specifically designed ‘grapple mode has failed due to an obstruction’ state, where the player now gets some amount of damage, a ‘collided into object’ animation, during which the player gets repositioned into a ‘collison safe/no collision violation’ nearest position, like a ‘get unstuck’ check in an mmo or something.

          Or another way would be: before the player actually begins being moved by the grapple… do the vector trace from the player, to the end point, and around that vector, quickly draw a large box, rectangular cuboid, perhaps with endcaps of some kind… that just projects what the straight line movement of the player’s collision hull would be… maybe make it a bit bigger than the player’s collision hull just to be safe…

          …just ‘draw’ that real quick, if it intersects with anything, no can do chief, grapple attempt fails, doesn’t engage.

          That would at least work for static world objects that don’t move, you’d still also need one or both of the above methods to handle colliding with things that can move, npcs, other dynamic objects.

          • Justdaveisfine@midwest.social
            link
            fedilink
            arrow-up
            3
            ·
            edit-2
            16 days ago

            I don’t know the “right” answer, but I set it so if you hit something, it plays out some checks similar to as you described:

            • If we collide with something but its only waist high, then we will have the player stop the grapple and attempt to vault over whatever it is.

            • If we collide with something and its more than waist high, then we wait for a very small delay and see if we made any progress towards our destination. If not, end the grapple because something is in the way.

            • Ignore all collision damage otherwise when grappling. Either we get stopped on the way and give up, or make it and then end the grapple.

            … And last but most horrible of all:

            • Do a completely different set of checks if the player is underwater when the collision happens.

            All my games are janky though so I don’t think this is some ideal setup.

            Edit: Cleaned up the collision damage part as I thought I handled it differently.

            • sp3ctr4l@lemmy.dbzer0.com
              link
              fedilink
              English
              arrow-up
              3
              ·
              edit-2
              16 days ago

              Yep, those first 3 are either exactly or almost exactly what I ended up with when I toyed around with making something similar, haha.

              Honestly, I think what you are describing as ‘janky workarounds’… are actually how you do this right, they are ‘efficiently implemented game mechanics’.

              Maybe the code could be cleaned up and de-spaghettified a bit, but I’ve seen many other systems like this in many games and mods.

              If it seems stupid, but it works… it isn’t stupid.

              The word for that is actually ‘clever’.

              … you’d be amazed how much enterprise level business software, for instance, relies on some weird ancient library or function that literally has a comment in the code that says “I do not know why this works, but it does, DO NOT CHANGE”.

              But also: oh god WATER.

              Fuck video game water rofl.

              I feel your pain.

          • Feathercrown@lemmy.world
            link
            fedilink
            English
            arrow-up
            0
            ·
            16 days ago

            You could plausibly implement some physics to deal with it. If the player is moving into a surface, move them along the part of their grapple movement component that’s perpendicular to that surface. This will allow them to slide along walls/floors/ceilings realistically. For the case where they need to move “through” a small object, you could treat their collision as a sphere and have it collide with the object; for small objects, this could let them pass by. Eg. for grappling sideways over a small rock on the ground, their point of collision would be mostly below them and a bit to the right, but they’re being pulled mostly straight to the right, so they would move perpendicular to the point of contact and move up-right over the rock, then continue their grapple path. Depending on your game’s physics system there are other solutions, but for a typical game engine, that should work well.

            • sp3ctr4l@lemmy.dbzer0.com
              link
              fedilink
              English
              arrow-up
              1
              arrow-down
              1
              ·
              edit-2
              16 days ago

              You could plausibly implement some physics to deal with it. If the player is moving into a surface, move them along the part of their grapple movement component that’s perpendicular to that surface.

              That just is running into the problem the original comment was trying to avoid in the first place:

              You are constantly jamming into the surface and doing a whole bunch of collision checks to basically scrape the player across the surface…

              …because you have to keep doing those checks in a loop untill you determine the obstacle is finally cleared, and then switch back to unrestricted or ‘normal’ grapple-movement.

              You have to keep doing 3d vector collision mesh check calculations for the whole time the player is being ‘scraped’… because you don’t know when to switch ‘perpendicular movement only’ mode off, otherwise… so this is inefficient.

              Assuming this is a 3D environment… there’s no way you can just totally null out one dimension of the movement vector unless the player is perfectly perpendicular hitting a perfectly perpendicular surface.

              If your level design is any degree of complex, with objects beyond basically perfect boxes that are all perfectly orientes to the world grid… and if the player is allowed to rotate… this doesn’t work, your calcs still always involve 3 dimensions.

              What you’re saying might work in a 2D game… or I guess 2.5D, maybe?.. but it wouldn’t work in a 3D game.

              Something possibly, sort of like what you’ve described, I think? but not really?.. another idea that might work would be:

              Upon detecting a collision, before the player has gotten to the grapple end point… the grapple movement basically complexifies with more nodes.

              So you use a pathfinding algorithm to draw, instead of just a line between two points… now you have a point of origin where the player is, the end point, and a third point that is off to the side of the obstruction.

              Now for that first segment, now the grapple pulls the player perpendicular to the obstruction surface, so it isn’t constantly colliding and doing friction… and then when the player clears the obstruction, hits that midpoint, the movent vector changes.

              This is basically what I described with doing the ‘draw a giant skinny box’ to check if a player can do an unobstructed grapple… but now more complicated as it involves 3D pathfinding…

              This could possibly work, but it would take a good deal more work to optimize this, to make your entire world work with 3d path finding… normally, nav meshes are just done on more or less flat ground, up to some degree of incline… but now you also have to do this on literally all surfaces.

              Again… this might work … but it would take a lot of game dev work to implement, as you’d have to fully 3d navmesh every level… and this potentially would not handle complex surfaces well.

              3D, aerial pathfinding in a very complex environment … to my knowledge, still isn’t really a thing many games have done very well, efficiently, with a general system. It usually just a bunch of manually placed aerial nav nodes, particular to the level itself… very intensive, manual work.

              This will allow them to slide along walls/floors/ceilings realistically.

              You have an odd definition of ‘realistically’.

              For the case where they need to move “through” a small object, you could treat their collision as a sphere…

              Whoah whoah whoah wow ok gotta stop you there.

              Spheres tend to be the absolute worst objects to use in a collision mesh or hull, because they are comprised of far, far more tris or rects than a box.

              This is a terrible idea.

              There is a reason hitboxes… are called ‘boxes’.

              …and have it collide with the object; for small objects, this could let them pass by.

              I think what you are trying to describe is a common concept in games where many objects that are basically… clutter, vegetation, extra fluff… they just do not interact with the player collision mesh/hull at all, for many parts of the engine/game.

              Like a uh, a small pile of trash or rock that doesn’t interact with the core player movement controller, but it might interact with an inverse kinematics system that slightly modifies the player’s animation so that their foot rests on top of the rubble or rock.

              But uh… doing a ‘estimate everything’s size by bounding it with a sphere and then negating movement collision if its small?’

              This is not something you’d want to call when the grapple attempt is started, it’d be a massive stutter or slowdown, you’d have to index every object in the level… and you’d end up with like, if you have a pile or array of many small things, all together… well individually they are all small, so you can phase through a pile of many small things that is in totality actually large.

              This is the kind of thing you just design your whole game and level and objects around from the ground up.

              Eg. for grappling sideways over a small rock on the ground, their point of collision would be mostly below them and a bit to the right, but they’re being pulled mostly straight to the right, so they would move perpendicular to the point of contact and move up-right over the rock, then continue their grapple path. Depending on your game’s physics system there are other solutions, but for a typical game engine, that should work well.

              Again this ‘solution’ of yours (which just entirely abandons the concept of just not colliding with small objects, which you literally just described) just causes the problem the original comment was trying to avoid: having to do a whole bunch of collision calcs every time any obstacle is encountered.

              … You speak as if you know what you are talking about, but you clearly do not.

              Have you ever actually mocked up a 3 physics scenario in a game engine, or modded an existing game in a manner that is very reliant on or interactive with its physics engine?

              • Feathercrown@lemmy.world
                link
                fedilink
                English
                arrow-up
                1
                arrow-down
                1
                ·
                edit-2
                15 days ago

                … You speak as if you know what you are talking about, but you clearly do not.

                You are constantly jamming into the surface and doing a whole bunch of collision checks to basically scrape the player across the surface… …because you have to keep doing those checks in a loop untill you determine the obstacle is finally cleared, and then switch back to unrestricted or ‘normal’ grapple-movement.

                Unnecessary “…”, and no, you don’t loop the check until the obstacle is passed any more than you would “loop” the player’s ordinary movement. As normal, each tick you attempt to move the player forward some distance. If there is an obstacle in the way, they’ll move less distance, which is fine-- this prevents them from rocketing up walls if they’re slightly below a target grapple point beyond the wall, as in the below scenario.

                You have to keep doing 3d vector collision mesh check calculations for the whole time the player is being ‘scraped’… because you don’t know when to switch ‘perpendicular movement only’ mode off, otherwise… so this is inefficient.

                What would be more efficient? Depending on how the game physics work, the player’s collision mesh is probably a capsule, simple box, or sphere. It’s really not that expensive to add this check; the player is presumably already doing collision checks using their mesh every tick for like, standing on the ground and touching walls.

                Assuming this is a 3D environment… there’s no way you can just totally null out one dimension of the movement vector unless the player is perfectly perpendicular hitting a perfectly perpendicular surface.

                If your level design is any degree of complex, with objects beyond basically perfect boxes that are all perfectly orientes to the world grid… and if the player is allowed to rotate… this doesn’t work, your calcs still always involve 3 dimensions.

                What you’re saying might work in a 2D game… or I guess 2.5D, maybe?.. but it wouldn’t work in a 3D game.

                When did I ever say that you would accomplish this effect by nulling out one component of their movement vector? That idea is a fabrication of your own delusions. It’s pretty easy to do a mesh collision check, get the normal of the tri the player collided with, and use that to remove all the player’s movement in that direction. This is probably already part of the engine’s physics calculations anyways!

                [the 3d pathfinding idea]

                This could work, especially if the grappling hook is one of those ones where gravity stops affecting you (could be good for gameplay, that’s valid). But to construct this path in a realistic manner, you would need to do similar calculations to what you’re saying are inefficient, except all at once instead of spread over multiple frames. If you simplify the pathfinding checks to make the movement simpler, you could in most cases do the same thing with the player collision checks. Depends on how you implement it though I suppose. Too specific to cover all cases in a general discussion.

                You have an odd definition of ‘realistically’.

                It is realistic that if I grapple into a surface I will move a shorter distance than if I was grappling freely, yes. This is true without friction etc. as well. Think of the extreme case: grappling directly downwards into the floor, in which case I would not move at all.

                Spheres tend to be the absolute worst objects to use in a collision mesh or hull, because they are comprised of far, far more tris or rects than a box.

                LMAO are you kidding me??

                First of all you could do a check using a proper sphere rather than a mesh with tris. This can actually be faster than using a box-- eg. checking if two spheres (or a sphere and a point) collide is literally just a distance check compared to their combined radii. I bet even sphere-tri collision is easier than tri-tri, although my game engine knowledge doesn’t extend far enough to say for sure in that case.

                There is a reason hitboxes… are called ‘boxes’.

                They’re called that because boxes are common, not because they’re the best.

                I think what you are trying to describe is a common concept in games where many objects that are basically… clutter, vegetation, extra fluff… they just do not interact with the player collision mesh/hull at all, for many parts of the engine/game. […]

                This entire line of critique is invalid because I wasn’t saying that at all. I’m saying that as a consequence of the collisions, they could pass around an obstacle; not that they could go through it. A rock under the player as they grapple sideways would push them upwards and slightly away due to the angle of the collision, and they could then continue moving sideways as before.

                Again this ‘solution’ of yours (which just entirely abandons the concept of just not colliding with small objects, which you literally just described) […]

                How on God’s green Earth could you possibly, after I literally just described the precise mechanism by which the player would interact with small objects, still believe that I meant they should simply pass through them??? Maybe if you read the whole post instead of replying to each sentence individually you would’ve made that connection. Yes, I see the irony; I did read your whole post first though.

                […] just causes the problem the original comment was trying to avoid: having to do a whole bunch of collision calcs every time any obstacle is encountered.

                If you apply the grapple as a force it’s literally the same collision calcs the player makes every single tick. If you can’t due to engine/game/etc. limitations, it’s still not that much extra collision calculation.

                … You speak as if you know what you are talking about, but you clearly do not.

                Have you ever actually mocked up a 3 physics scenario in a game engine, or modded an existing game in a manner that is very reliant on or interactive with its physics engine?

                Try me. I am extensively aware of the way physics is typically handled in games. I will admit I don’t often use game engines, because I usually try to make 2d games from scratch and implement my own simple physics. But yes, I’m aware of how 3d engines handle physics as well.

  • SkunkWorkz@lemmy.world
    link
    fedilink
    arrow-up
    50
    ·
    16 days ago

    Game director : we’re gonna add interact-able doors with proper door opening animations for the characters

    The game designers:

    The programmers and artists:

    The producers:

    • MonkeMischief@lemmy.today
      link
      fedilink
      arrow-up
      25
      ·
      edit-2
      16 days ago

      Now we need to decide in the case of collisions if:

      • Doors violently push anyone out of the way, possibly “crushing” them into walls or
      • Force themselves back closed, turning any random NPC / obstacle on the other side into an unbeatable lock or
      • Just trap an unfortunate NPC in a corner on the other side, or
      • If they use the physics system to swing open, in which case they’ll look smooth but possibly bonk the player/actor going through them a few times and could potentially (and comically) insta-kill them if physics is feeling grumpy.

      The frustratingly comedic unintended results of any choice makes for great organic marketing though.

      Gamedev is magical.

      Aside: Know what did this really well though? Resident Evil games after RE:4.

      The ability to “slowly quietly open”, and then at any time decide to violently action-hero kick it open to send a zombie on the other side flying, was genius.

      • Revan343@lemmy.ca
        link
        fedilink
        arrow-up
        4
        ·
        16 days ago

        Have you ever played ATV Offroad Fury on the PS2? When you reached the edge of the map, it would just fling you back towards the center.

        I propose that is how we deal with NPCs blocking doors. With negated fall damage, of course

        • chellomere@lemmy.world
          link
          fedilink
          arrow-up
          4
          ·
          15 days ago

          Wow, memory unlocked! Motocross Madness did this too, if you managed to drive up the giant wall surrounding the world. I checked, and it turns out both these games were developed by the same company, Rainbow Studios, so probably they used the same engine.

        • MonkeMischief@lemmy.today
          link
          fedilink
          arrow-up
          2
          ·
          edit-2
          14 days ago

          Haha that does sound slightly familiar! Like Mario Kart’s Lakatu on steroids. 😂

          Lol okay solved! Colliding with an opening door just yeets an NPC (safely) out of the way.

          Haha there needs to be a “monkey’s paw” community but around what new bugs pop up when someone proposes a fix for a mechanic.


          New bug report: Essential NPC unable to be interacted with because they walk toward the door to greet the player and get clipped through the opposite wall at high speed.

          Sometimes they fall through the map and the game crashes when they reach -9999 meters, other times they die intersecting the wall and it soft locks the main quest.


          Fun story rq: Deus Ex: Human Revolution had the most bizarre bug where, if you talked to a gang before getting the quest to go clear them out, on the second visit one of them would just spawn… like…on the moon, apparently? (A ridiculous distance upwards, not even visible except by objective marker) Made the quest unbeatable until they patched it hahaha.

  • milicent_bystandr@lemm.ee
    link
    fedilink
    arrow-up
    45
    ·
    edit-2
    15 days ago

    https://xkcd.com/1425

    Alt text: In the 60s, Marvin Minsky assigned a couple of undergrads to spend the summer programming a computer to use a camera to identify objects in a scene. He figured they’d have the problem solved by the end of the summer. Half a century later, we’re still working on it.


    Edit: seems I’m the third person to comment this! :')

  • frezik@midwest.social
    link
    fedilink
    arrow-up
    39
    ·
    edit-2
    16 days ago

    Always have to remind myself of this when managers ask me if something could be done. If it’s easy, I naturally get a little annoyed that they’re even asking. But knowing that is my job, not theirs, and it’s good that they ask. There’s lots of places where they assume and things go badly.

    • Sylvartas@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      37
      arrow-down
      1
      ·
      16 days ago

      As a gameplay programmer, I got anxiety from reading this (and I think the animators are already in a fetal position on the floor)

      • Knock_Knock_Lemmy_In@lemmy.world
        link
        fedilink
        arrow-up
        26
        ·
        16 days ago

        Can’t you just swap x for -x. Run some unit tests just in case. We’ll push to prod next Wednesday. Sound good? Got to dash, strategy meeting started 5 minutes ago. Seeyoubye.

        • BradleyUffner@lemmy.world
          link
          fedilink
          English
          arrow-up
          10
          arrow-down
          1
          ·
          16 days ago

          As a programmer, I’ve learned to cringe at any suggestion from someone that starts with “can’t you just”. Cause I guarantee you, I can’t “just” do that. It’s way more complicated than just.

        • Feathercrown@lemmy.world
          link
          fedilink
          English
          arrow-up
          9
          arrow-down
          1
          ·
          16 days ago

          The location that the player is visually interacting with would be different, but the world wouldn’t know that. Eg. in a cutscene, the player reaches out and touches a button on a control panel. If the player’s X is flipped, their left hand will be further left than their right hand, and will miss the button visually as they go to press it. Asymmetrical animations might also be fucked, ie. sidestep/jump right normally extends the left leg for leverage, but now their right leg would push off visually and they would still move right.

          • Knock_Knock_Lemmy_In@lemmy.world
            link
            fedilink
            arrow-up
            8
            ·
            16 days ago

            I don’t want you to come to me with problems. I want you to come with solutions. I’m going to schedule some action orientated soft skills training for you next month. There is a push to increase our education KPIs so budget is available.

      • MycelialMass@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        16 days ago

        Would it be possible to just mirror what the player is seeing so literally everything is backwards? Like a visual effect ‘in-post’? Obviously that would mess with any printed text but other than I cant think of big issue?

        • Sylvartas@lemmy.dbzer0.com
          link
          fedilink
          English
          arrow-up
          4
          ·
          16 days ago

          You could even do that on the player’s model specifically. But it’s still a maybe, you’re almost guaranteed to get some cursed bugs due to every preexisting code having been made with right handedness in mind.

          I’m sure animators are internally screaming at the reasons why this will make some originally right handed animations look off but that’s not my area of expertise.

          In reality it’s probably not the hardest thing to do gameplay-wise, especially if you’re doing it from the very beginning of the project, but I don’t think you can simply mirror animations (and some animations-related logic) and have it look natural, so you’d have to make dedicated animations and possibly logic for left hand strikes, right hand blocks etc. which would obviously be much more expensive. But yeah that’s probably what Minecraft does now for example, and since they have a very low level of detail on player characters and their animations it looks alright.

  • LillyPip@lemmy.ca
    link
    fedilink
    arrow-up
    23
    ·
    16 days ago

    There’s already a codebase for bursting from the ground in an explosion of lava. Everyone wants that.

    You’re the first person asking for a scarf, and our system doesn’t even know what a neck is.

  • resipsaloquitur@lemmy.world
    link
    fedilink
    arrow-up
    18
    ·
    16 days ago

    I worked at a company that made IoT stuff (which is an increasingly archaic term). The web team was pitching using a third party tool called ThingSpace to view and manage the things. The web dev said ThingSpace could do all these amazing things automatically. The manager said “can we change the color of the background?” The web dev said “…. no.”

  • tiredofsametab@fedia.io
    link
    fedilink
    arrow-up
    15
    ·
    16 days ago

    Player? Easy. Scarf? Easy. Wearing a scarf? That depends on a lot of factors such as which part of the body, how the models were made and rigged, etc.

    • Baggie@lemmy.zip
      link
      fedilink
      arrow-up
      2
      ·
      15 days ago

      And if it like blows in the wind that’s a whole jigglebone system and wind simulation that’s a lot of stuff going on

  • AdrianTheFrog@lemmy.world
    link
    fedilink
    English
    arrow-up
    10
    ·
    15 days ago

    The giant is easy. The ground is easy. The lava though… Do you want the particles to stick together? To visually connect? To collide with each other? To interact with dynamic objects?

    • psud@aussie.zone
      link
      fedilink
      English
      arrow-up
      3
      arrow-down
      1
      ·
      15 days ago

      My bg3 character is female. She was in slacks until act 3 where she could finally have a dress

      We looted everything. I feel like there are two dresses in the game: the robe Gale wears and a white dress you find in a Balders Gate house near the end of the game

  • Dagwood222@lemm.ee
    link
    fedilink
    arrow-up
    10
    arrow-down
    1
    ·
    16 days ago

    The logical answer is that too many Computer Science majors loved Silver Age comic books.

    The Martian Manhunter was stronger than superman, but couldn’t handle fire. Green Lantern was similarly godlike, but was unable to control anything colored yellow.

    • buttnugget@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      16 days ago

      Wow I had no idea that Shinobi was a series! When the original one came out in like 86 or so, I was obsessed with it. I still say “ninja magic!” to this day.