11 ms·
Why video game doors are so hard to get right [video]
- deleted 5y ago[deleted]
- dharmab 5y agoA related article: A survey of gamedevs answering "What is a thing in video games that seems simple but is actually extremely hard for game developers to make?" https://www.ign.com/articles/turns-out-hardest-part-making-game-everything https://www.ign.com/articles/turns-out-hardest-part-making-g...
- faanghacker 5y agoSo basically, everything is difficult, including doors. That makes the OP article sound like clickbait, making doors out to be the most difficult thing about game design. Also, I wonder how much of it is due to the disconnect between design and software implementation. From a software perspective, it doesn't seem that difficult to define doors as a separate class or type of game object behavior, and hard code that behavior into sequences. It seems like the difficulty is mostly on the design/animation side. Controversial opinion: Maybe the problem is that designers and animators are just not as good at solving these logic problems as the software engineers.
- burnished 5y agoSounds like you'd benefit from giving it a try. I'm going to go out on a limb here; you're at that stage of your life where everything you haven't tried sounds simple and you don't understand why other people struggle so much. I'm guessing this because on hearing that something is difficult your first suggestion is to.. simply design a class, and then suggest that the problem resides in the kinds of people approaching the problem. Its a sort of arrogance that I think will be familiar to many people. But it sort of assumes that other people are too stupid or incompetent to try <insert obvious easy solution>. You might do better by trying to figure out what went wrong with the 'obvious' solution, or what you are missing in your own understanding that makes the problem appear so much simpler. If you figure out novel solutions, great! That's real genius. I think mostly you'll find out how tough most problems are.
- dharmab 5y agoThank you for writing up a clear headed response. I had started to write a response to the comment, but decided I didn't know a way to phrase it in a way that would be constructive and decided not to submit.
- faanghacker 5y agoI didn't say it was simple, I'm sure it's a complex problem. But maybe not disproportionately difficult to model if you can handle the complexity. That's why I gave the benefit of the doubt to the software engineers. IME Most people can't handle complexity in their own fields of work, whether it comes to tax accountants making mistakes on my tax return that I caught later; or real estate agents telling me my queen-sized bed won't fit in the apartment, when I already knew from analyzing the floorplan that it would, and I was correct when we measured the room; or international flight attendants overcharging me because they can't do currency conversions properly. I've worked in the software industry including FAANG and dealt with a wide range of people, some of whom I've had to explain basic problem solving concepts or do things for them that they should have done themselves. Believe me, I'm at the stage of my life where I've tried a lot of things, succeeded at some, and failed at others. I've lived in different cities in different countries. More importantly, having been exposed to a wide range of people, I am less inclined to overestimate most people's ability to do things. Is that arrogant? Maybe. But I started out assuming that everyone has some latent untapped talent/creativity/curiosity/potential and over the years I'm less inclined to give people so much benefit of the doubt.
- scrollaway 5y agoAh, you’re one of those people. Sounds to me like the person you’re replying to had you perfectly figured out. If you’re lucky one day you’ll get to look back on this comment in regret. If not, you’ll keep living in ignorance.
- faanghacker 5y agoGood thing I had the foresight not to "follow my passions" and work in big tech instead of game dev or academia, which is why I'm retired and don't need to worry about either regret or ignorance.
- 5faulker 5y agoDoors are one of those things that seem simple but actually is not, due to it being an interaction point between players and the game.
- Animats 5y agoMove, shoot, and drive are easy, or at least well worked out, and everything else is hard. Doors are just a common case of "everything else" Sitting down realistically is hard. Standing up realistically is hard. Picking up stuff realistically is hard. Interacting with any object via contact is hard. Interacting with moving avatars is really hard. The hard problems come up when you actually have to do motion planning, in the robotic sense. Few games do that. In most games, you're just moving the avatar while running canned animations. UE5 has a new dynamic animation system which is supposed to help with this. In the UE5 demo video, you see the character walk through an open doorway, and she reaches out and touches the doorframe. That's some kind of IK-driven animation triggered by proximity. Not clear if the mechanism behind that is general enough to handle door opening. Anyone know? In virtual worlds, where you don't have pre-planned gameplay, it's a big problem. Second Life has hundreds of thousands of doors, and at least three vendors of door control software. Usually, doors have to be clicked on to open them, although stores often have automatic sliding doors.
- egypturnash 5y agoWatch the video, it goes into detail about why doors are hard, especially as you start moving from "press space when near the door to make it slide into the wall" to "the door is a physics-simulated object that interacts with all the other physics-simulated objects in the game, and which players and NPCs will open in a realistic fashion that involves blending pre-fab animation with the location of the handle/knob relative to the character instead of vaguely waving a canned animation in the direction of the door as it magically opens". Never mind a door simulated at the level of "I am opening it just wide enough for me to get outside with some food and water for the semi-feral cats who live under my house, with minimum opportunity for them to run inside before they're distracted with that food, also I have to kick it to get it open now because this is New Orleans and the house just settled a little more after Ida and now the frame's a little less square". Which is an interaction I have with a door every morning without ever thinking about the door. There's also a quote from a lead developer at an AAA team saying that doors are the hardest thing to get right. Everything in a video game is a thin veneer of illusion, and doors are surprisingly complex in how they have to interact with every level of that illusion.
- faanghacker 5y agoI suppose if you're going for that level of realism, then you have more complexity like the person reaching for the doorknob and opening it. That's certainly more complex. Maybe the problem is trying to simulate it as a generic physics engine object, as opposed to a specific object type that has its own hard-coded rules of motion. Again, there's complexity involved, and I can see how it makes the job more difficult when you have to integrate with the rest of the game engine. Still, I would think that by now game devs should know that doors are difficult, and thus take them into account from the beginning when designing a game engine (maybe that's what they do) rather than trying to integrate them into the engine that's already been designed.
- short_sells_poo 5y agoThere are some things that generalize in game development, mamy don't. How you implement a door can very much depend on the sort of game you are building. And it can absolutely get complicated simply by the fact that you'll likely need to hand roll your solutions. I haven't worked in game dev in decades, but I remember that just network synchronization could be tricky because the degree to which a door is open could lead to very different outcomes in a game. Eg take a shooter game: Does the door block/deflect bullets? Yes? Well now you need to make sure to synchronize clients really cleverly because each player will see a different state of the door depending on their latency. Whether they can shoot through the opening is relative to each clients' reference frame. Oh, just make the server decide you say? Well, now all your inputs have a perceptible delay because your client has to wait for confirmation from the server, or you'll often see jarring prediction error correction when the thing you predicted is wrong. A huge amount of research and work has gone into this and yet there's still no silver bullet. That you think this is all solved just says that you know very little of the problem area - which is ok - but then you should not be making broad and confident statements about it. A touch of humility doesn't hurt.
- faanghacker 5y agoI watched the video again. Still don't see what the big deal is. For example... NPCs blocking doors? Don't put NPCs there, and tell AI to avoid door zones rather than trying to make them know how to move out of the way when doors open. Car on the other side of the door? Don't let the door open all the way. In the elevator example in the IGN article: Implement an elevator door like in modern elevators, or if it's more primitive, don't let players or NPCs walk under the elevator, or worst case, kill the character -- can't call the AI dumb if they avoid being under the elevator that can kill them. This isn't an unsolved problem. Halo did this with telefragging someone who is blocking a teleporter, and StarCraft did this by destroying the siege tank under a landed building.
- gus_massa 5y ago> StarCraft did this by destroying the siege tank under a landed building If this in StarCraft I? In StarCraft II even a burrowed zergling can prevent the landing of a Command Center. (That makes no sense from a realistic point of view.)
- faanghacker 5y agoYes, StarCraft I. The issue wasn't physical realism. The problem was that a player could move a tank under a building during mid-landing, siege it up, and the boundaries of the building protected the siege tank from melee attacks. Killing the tank was the "creative" solution, instead of a "brute force" solution to change the game dynamics to prevent the tank from sieging up under the building in the first place. In SC2 the tanks will be forced to move out from under the building when it lands, but SC2 also has a much improved unit movement system over SC1 that allows this to be done more easily.
- sgarman 5y agoI've never seen this in any of the BW games I watched. I wonder if they fixed it. You just can't land a building where a unit is. There was a crazy bug where you could load units into a flying CC and use it as a mobile fortress but that too is patched.
- Legogris 5y ago> For instance, I worked on a game where if you reloaded immediately after defeating a particular boss, you would get locked into the boss room, because the door leading out of it was not keeping its open state correctly. Reminds me of Zelda: OoT. At the final boss fight, Ganon knocks the sword out of your hand, the only point in the game where you're without a sword equipped as an adult. In early versions of the game, if you saved and reloaded at that point, you would end up with the sword unequipped, resulting in some glitchy behavior. For example you could now use any equipped item on horseback. The hookshot could be abused to allow you to move Link pretty much freely in 3D space. Even in later versions, you can get to this behavior by never picking up the first sword and lifting the left side of the cartridge ever so slightly when Mido blocks the way to the first dungeon until you have a sword, allowing you to pass through him. The no-sword OoT challenge is just challenging enough to be fun.
- mucle6 5y agoIIRC the glitch speedruns relied on the fact that you didn't have to get the master sword since you could pick it up if you were able to "warp" to that cutscene. https://youtu.be/OKSWkpC_SC4?t=946 https://youtu.be/OKSWkpC_SC4?t=946 Link starts at where the master sword gets knocked off but the premise of the speedrun is interesting on its own.
- don-code 5y agoAh, the Crooked Cartridge trick! I haven't heard this mentioned since the 2000s. Zelda: OoT was (and still is) one of my favorite games of all time, and I was devastated to have bricked my cartridge this way - along with my nearly-fully-finished game (IIRC it was just the Golden Skulltula sidequest remaining). To be fair, it was _saving_ after having performed the glitch that persisted glitched data to the save RAM, but I only figured that out seven years later.
- sparker72678 5y agoThis is a great video. Next I’d love to see, “Why online checkout forms are so hard to get right.” Software is hard.
- ehnto 5y agoPart of the reason is that the state can be extremely complex. It looks like some simple forms, but if you were to write out all the state combinations for tax, location, shipping, product combinations, configurations, logged in/out, guest/account, pricing rules, payments, inventory, warehousing, internationalization, so on and so fourth, you get a pretty complex state machine.
- falcor84 5y agoI'm not quite following you there, other than possibly the authentication piece, all of the other variables seem to me to be recalculable from scratch every time - where else would you need state transitions? (i.e. where is there Path Dependency?)
- matsemann 5y agoValidation. A field is incorrect, but only because it hasn't been touched yet so don't show an error. Or it's incorrect because the value isn't allowed based on another change you made in the form.
- ehnto 5y agoI was mostly using a state machine as a way to frame the complexity of the domain, most checkouts don't use state macines but the possible state permutations exist even if only calculated once.
- fsckboy 5y agoyes, the state machine can be complex, but there's no excuse for throwing away the state that represents everything the user has gone to the trouble to enter in, that is not complex and should be preserved.
- wcarss 5y agoRelated, here[1] is an excellent ~hour long talk by Kerry Davis of Valve about how much thought they had to put into doors for VR while working on Half Life: Alyx. 1 - https://www.youtube.com/watch?v=9kzu2Y33yKM https://www.youtube.com/watch?v=9kzu2Y33yKM (edit: it looks like digipen also posted that talk themselves, and theirs doesn't have the ~10-15 minute gap the VNN one has, but theirs seems to not have the slides. Take your pick! https://www.youtube.com/watch?v=8OWjxGL8PDM0 https://www.youtube.com/watch?v=8OWjxGL8PDM0)
- TOMDM 5y agoThe doors in Alyx feel so good. Poking a gun through, or quickly tossing a grenade and then closing the door again felt so natural.
- usrusr 5y agoProud second place on the list of best doors in video games, after the XCom door that is only ever correctly opened by carefully arranging six soldiers in descending order of disposability before touching that right mouse button.
- MarkMc 5y agoFascinating that players in VR would not attempt to turn the handle of a latched door, and instead would simply assume the door was locked. And the solution was incredible: simply play the hand-rotation animation when the player grabs the handle - and the player will think they had rotated their hand!
- deleted 5y ago[deleted]
- simion314 5y agoI am wondering why floors also are hard, the falling though the world is a bug I see too often, especially on the indie games I tried.
- tinus_hn 5y agoIt’s not hard, Quake did it right many years ago. It just requires you to limit yourself in ways that aren’t acceptable these days.
- bruce343434 5y agoAs someone outside of this field, could you elaborate on how quake "did it right" and how it requires you to limit yourself?
- deleted 5y ago[deleted]
- tinus_hn 5y agoQuake, for optimization reasons, did a lot of preprocessing on the geometry that makes up the world. This made it possible to render it on slow hardware. The process for one required the designer to make sure there were no cracks anywhere to fall through, because if you had one the preprocessing would fail. The preprocessor divides the entire inside of the level into convex areas and builds a graph that expresses where they touch. So for movement, if you just make sure that you can only go from one area into another that according to the graph touches it, there simply is no way to move out of bounds because the out of bounds area is not in the graph at all. This does mean though that you have a world that is mostly static, that consists only of indoor spaces and has a limited amount of complexity because otherwise the preprocessing results in an unmanageable amount of data. There is just no way you can preprocess the whole world like that in a modern open world game.
- djmips 5y agoI think it's because floors are often modelled infinitely thin, a plane with no thickness. It's all to easy to get on the wrong side of that plane for any number of reasons.
- grumbel 5y agoI always liked the doors in Splinter Cell Chaos Theory (https://youtu.be/ajlONBnhLkE?t=81 https://youtu.be/ajlONBnhLkE?t=81), as they give you numerous ways to open them, including a sneaky way where you get full control to slowly open it in an analog fashion.
- Stevvo 5y agoChaos Theory has got to be one of my favorite games of all time; the movement is sublime, to this day unmatched by other entries in the series.
- djmips 5y agoAnd ladders. ;-)
- Kinrany 5y agoAn essay about game development professions that uses doors as the main example: https://lizengland.com/blog/2014/04/the-door-problem/ https://lizengland.com/blog/2014/04/the-door-problem/ Edit: mentioned in the end of the video, of course :)
- faanghacker 5y agoI noticed that most if not all of these questions are applicable to doors in even simple 2D games. Whereas the physics engine and real-world realism aspects are what the video talks about. If the problem is that doors are inherently difficult to design, the counterpoint is that these questions have already been answered in multiple ways over the past 30+ years of video game history. It's easier today than ever to answer these questions by drawing on previous games.
- sluggosaurus 5y agoWhile I'm duly impressed by the achievement of hyper-realistic door physicals, the effort:payoff ratio seems completely wack. I think these game developers are overthinking it. Minecraft does doors right in comparably simple way, and I think few if any players have a problem with it; it's a more popular game than any game with fancy doors. The most realistic doors in the world won't make a bad game any better, while simplistic doors won't make a good game any worse.
- adnzzzzZ 5y agoThere's value in getting things right no matter how long they take and no matter if people will notice it or not. I personally don't hold this view too strongly but I can understand other gamedevs who do.
- sluggosaurus 5y agoI understand how artists would think that way. Obviously they have passions and care about details few except other artists would notice. But on a commercial project, shouldn't managers reign in on this sort of thing and redirect the efforts of artists in a more productive direction?
- beenBoutIT 5y agoManagers need to be able to spot OCD spirals and keep things on track. Having perfectly realistic doors isn't that important - the end user only notices them when they break. TLOU2 is remembered most for being less great than TLOU and not for its superior door mechanics.
- lazugod 5y ago> Minecraft does doors right in comparably simple way, and I think few if any players have a problem with it Ha. This is an amusing claim given that redstone, the whole complicated circuitry used in advanced Minecraft machines, was arguably added for the purpose of powering doors. Years of work have gone into all of the community-made piston doors of various sizes and features. And all interactive components like buttons and pressure plates have to have their signal duration balanced against how long it takes to walk through a door. Even ignoring redstone, though, doors are complicated to design in the exact same ways. Which way do they swing open? Depends how you’re facing when you place them… unless the game detects double doors, and reverses the second one to match. And each door has to have a corresponding vertical trap door, which can either be flush with a floor or with a ceiling. Which way do trap doors open? Well, whichever way works best with the ladder below them. Oh, which means trap doors must also act like ladders. In fact, you can climb a wall of nothing but trap doors in the game. What about water? Trap doors can be waterlogged, and that’s a common way to hide irrigation. But normal doors intentionally aren’t. Why? Because doors are the most common early-game tool for scuba diving - a placed door becomes a free pocket of air. Does it seem realistic? No, and maybe they could fix it, but then that would affect anyone who uses doors as entrances to underwater houses, as well as make scuba diving more difficult. Players argue about the use of doors for diving; they argue about whether they should be able to shoot arrows through the windows in doors; they argue about whether every new tree should bring a new type of wood, and thus a new type of door. Doors are hard, no matter how simple the game.
- bladedtoys 5y agoFor the curious, one extremely useful tool used for things like this is “inverse kinematics”[0] In this case you need the wrist, elbow, shoulder, hip, etc joints to bend such that the hand exactly reaches the door knob and stays on the knob as the door swings open possibly stepping the legs forward or backwards. Coding inverse kinematics from scratch is definitely non-trivial, luckily that is rarely necessary. https://en.wikipedia.org/wiki/Inverse_kinematics#Inverse_kinematics_and_3D_animation https://en.wikipedia.org/wiki/Inverse_kinematics#Inverse_kin...
- wincy 5y agoIsn’t Star Citizen expending a great amount of effort in coding reverse kinematics for their entire game?
- daenz 5y agoThey don't cover the network relevancy in this video, but that's another issue. In a network game, if player 1 opens a door, you want player 2 to see the door opening IFF they are within the "network relevancy" radius of the door. If they aren't within that radius, the door state shouldn't be replicated. However, if later they do come within the radius, that network state of an opened door should propagate to player 2, minus the "opening" animation. In UE4, this is handled with 2 different network synchronization mechanisms: 1) multicast events (for animations) and 2) replicated state (for authoritative state). When player 1 opens the door, the server fires a multicast event to all clients within the network relevancy radius that says "play door animation." Multicast events only play once, and only to clients who were listening at the time of it firing. At the end of the door animation, the server sets the authoritative state to "opened." This authoritative state propagates to all clients, current and future clients. This allows player 2, who was outside the radius when the door was opened, to see the door as opened as they get closer, without seeing the animation playing.
- notafraudster 5y agoIs there a concern about a race condition in this sort of model? Granted a time quanta is probably quite low. Like, I go from just outside the listening boundary to just inside after my client has ignored the animation cue and before my client gets the state cue. Absent clever visual occlusion checks it seems like this could be a concern. How is this kind of thing resolved? It's true that skipping an animation and having a door pop open is better than having the door stay closed and a desync, but it seems like there's gotta be more corner cases here?
- daenz 5y agoMy understanding is that the network relevancy radius is usually pretty large, so you're unlikely to notice a lot of edge cases. Also, by using events for relatively unimportant things (animation playing, effects, sounds, etc) and replicated state for the important stuff, then everything mostly works out correctly, since the server makes a strong effort to ensure eventual consistency of replicated state. Where network replication matters a lot more though is on things like movement and shooting in competitive games. There is a great short series of blog posts by Gabriel Gambetta that covers different problems and solutions, but everything is a tradeoff https://www.gabrielgambetta.com/client-server-game-architecture.html https://www.gabrielgambetta.com/client-server-game-architect...
- dleslie 5y agoThe comments about the challenges, specifically walking into door frames and general access accuracy challenges, speaks less to the door than to the mode of movement. The same concerns can be applied to picking up small objects and navigating narrow and treacherous paths; both concepts which are a consistent challenge for game developers as well. These concerns are less pronounced on PC because fine adjustments are simplified by the input method. With gamepads, precise movements are possible but more challenging than with a mouse, and any player momentum amplifies the challenge.
- olivierestsage 5y agoI always thought the first Quake had it right: doors slide open automatically upon the approach of the player character, and are always fully open by the time you reach them, so the player is never blocked (as long as they have the key). But obviously that would not work for a game set in a realistic setting.
- Gravityloss 5y agoYou don't usually realize this when playing but the scale in Quake is weird. Everything is big and bulky. There's just no budget for a lot of triangles. That makes navigating it a lot easier. It's closer to a driving game in some sense. Stylistically it works when in a fantasy setting, or in some science fiction "tech base". But it wouldn't, if you had ordinary everyday objects like doors, beds or kitchens around. If you've made Quake maps, you also notice that to make it playable, you should avoid things like protruding door frames, or the player easily and annoyingly gets stuck on the wrong side of it. The mapper must place clip brushes so the player smoothly flows over these obstacles. The player never notices these "nudges".
- robbrown451 5y agoIt's funny how, right at the beginning (20 seconds in), he is saying he is impressed with the doors in Last of Us Part II, while showing a door that closes in one direction, then opens in the other. This would be especially impossible given the closer mechanism at the top of the door, but then you notice that both parts of the mechanism are attached to the door itself (rather than one being attached to the door frame) and just swings with it, so it is worthless as a closer mechanism. I can't blame the devs for taking shortcuts like that, but still a bit weird to call that one out as an impressive example.
- Trasmatta 5y ago> but still a bit weird to call that one out as an impressive example Everything else about the doors in TLOU2 is impressive, though. I don't think there's any game that exists that has doors that are as well engineered as TLOU2 that also properly swing in only one direction.
- robbrown451 5y agoTrue, and I doubt I would even notice a problem if playing the game. It's just when you are specifically looking at the doors, stuff like that jumps out at you. If I made the video, I probably would have edited it a bit differently so it doesn't call attention to flaws at a time when he's making the opposite point.
- LanceH 5y agoThe reason doors open both ways is so a player doesn't have to back up when opening a door inward. While it's something we do in person easily enough, it requires fine movements of a character or it requires taking over the character. Both feel awful for the player. So, the sacrifice of having the door open unrealistically both directions. Can you imagine running away from the zombies, you reach for the door, move to back up and realize you didn't quite grab the handle? Or the other version where you do grab the handle and realize you need to let go of it to start shooting, but are stuck in an animation. Personally, I'm cool with worlds with no doors and outsized doorways. Ideally the scenery between my character and the camera fades out, so the camera only has to move to follow, not to get a better angle. I do admire the effort that goes into it making the doors look good.
- mensetmanusman 5y agoI still occasionally laugh at recalling how doors worked in Quake 2; if you made your own doors in the map editor it was possible to design some that would open up like normal doors but they would turn you to gibs if you were unfortunate to stand in their turning path. Great way to play tricks on friends.
- mastazi 5y agoThe more I delve into game development the more I'm convinced that we in fact do not live in a simulation. Why would someone spend day after day carefully modelling things that no one seems to notice anyway? For example the way in which dead leaves accumulate in a specific corner of my balcony. If those beings that created the simulation are so advanced that they created this amazing word, why were they at the same time so stupid that they didn't do any optimisation and instead decided to model and refine things that almost no one notices anyway? If those intelligent beings decided to spend less time on that aspect, and leaves accumulated on my balcony in a less complicated pattern, I wouldn't notice anything weird anyway, because I would be accustomed to that other less complicated pattern. So there would be no reason to make an effort on that.
- sdenton4 5y agoGo read Permutation City... There's two threads of simulation, one which is hacky video games style, and the other is built up entirely from simple physics.
- wtetzner 5y agoMaybe they just wrote a simulator for physics, and what you’re noticing is just emergent behavior.
- ruined 5y agoi mean, if you're looking at it, it's obviously important enough to simulate. and what, specifically, do you think you would notice if it was in some way simplified? how can you be certain about the leaves on your balcony? you have no objective frame of reference to compare "full detail" simulation.
- scambier 5y agoRelevant Twitter threads: https://twitter.com/ZenOfDesign/status/1369336758211608583 https://twitter.com/ZenOfDesign/status/1369336758211608583 https://twitter.com/kurtmargenau/status/1369342602177220609 https://twitter.com/kurtmargenau/status/1369342602177220609
- account42 5y agoAs far as door controls go, I really like Frictional Game's approach to controlling doors via an analog mouse motion as seen in the Penumbra and Amnesia series. Not only does this feel a bit more natural than having an animation play after clicking, you are also fully in control of how far the door is open at any time.