Brilliant. It shows how your code is never encapsulated enough. You think physics should apply to all agents in your game and you think climbing a ladder is trivial and then someone thinks they can easily stop all NPCs from starting new Interactions. Boom.
In that particular case, what would be your favorite fix. I tend to say that the second step of climbing a ladder should probably not count as a new interaction.
I don't know if "encapsulation" is the right word, but the "undamageable" state should definitely have included fall damage. No point in having more than one way to reduce health points, damage is damage.
I think you're giving a bit too much credit to game logic codebases.
They generally move at a pretty fast pace and change often(due to the iterative nature of what's "fun"). I don't think I saw a single unit test until I was well out of the game industry.
My go-to exception for this has always been Factorio. They have not only unit tests, but integration tests, regression tests, fuzzers, performance regression tests, ....
Their blog regularly goes into details about how it all works. It's very much worth reading.
It seems to me if the physics engine and whatnot is deterministic I don't see why it wouldn't be possible to record input sequences and keep those and their effects as regression tests.
Those tests can be written, but if you do it naively coverage is measurable and very small.
And the physics engine is not necessarily deterministic (or if it is, you can't always control all it's parameters)
It's been a few years but if I recall correctly we did have a "smoke test" running on a jenkins box under someone's desk that booted a few levels with most of the game entities(they were called danger_room_1/2/3/etc) and verified that the game didn't crash. Aside from that though there wasn't much else which lead to some spectacular build breaks.
At first I figured the physical solution, not being able to climb higher than the ladder in any case, would seem to be a reasonable one. And you probably want to do that. But that might somehow end up with characters stuck on a ladder if the dismount event never fires for some reason, so making the ladder a single event and\or exempting the dismount from the "blockable furniture actions" list, should also be done.
They should probably also consider adding fall damage as part of the considerations in invulnerable mode.
Interactions should be atomic. Unexpected outcomes in a state machine should be rejected (and probably errors logged if in dev mode).
Edit (additionally):
If they can't be made atomic, make the transitions timed, with expiration, never allow deadlocks to occur and always branch to a fail-safe state. Players will tolerate things like the uncontrollable NPC getting pinched off screen and respawning, even with a comical animation if it's that kind of game; they hate a blind referee ruining things for no perceivable reason.
I don't think I agree with this if you mean climbing ladders should be atomic... what if I save/load the game while someone is in the middle of climbing one? What if the level changes somehow unloading them? What if a level designer wants someone to start on a ladder?
In the case of Outer Worlds, I don't recall having seen any ladders where it would be unsafe to pick started or finished and snap to those states over the save.
In the case of another game where someone's actually making progress up a very large structure, I can't think of any game offhand where saving in such a state has actually been allowed. However allowing a save there by necessity triggers the edited version of my statement which includes a timed state transition and safe aborts for failures in state change. Such a save would also include the current state of progression as well as the remaining limit for the timer.
The companions in The Outer Worlds do all kinds of insane things anyway. They are always getting caught on the wrong side of doors, or outside of elevators. Or you leave them behind and they just teleport in next to you.
Probably the most ludicrous is that when sneaking, only the player is taken into consideration by enemies. I've seen patrolling enemies kick my companions out of the way without actually noticing them.
All of those are mostly because any other policy would result in companion-less runs of the game. AI just isn't there yet to read and react to the situation in a way that should take such outcomes in to consideration, and arguably that effort might never be something custom tailored to a game, it'd have to be off the shelf with maybe just some tuning and/or helper hints.
Reading the player's intent would probably still be a very difficult problem, so even with the perfect knowledge of how to interact in the world they'd probably not act and react to changes in the player's intent anywhere near as well.
Fortunately they tend to not just immediately go Leeroy Jenkins as soon as an enemy somewhere in the far distance goes active.
Skyrim was/is awful about that. I'd be sneaking along through a tomb, and then Lydia screams "I am sworn to carry your burdens!" and charges in, waking up a dozen draughir.
Billions of dollars of programming time can be spent on self driving cars, not so for your NPCs.
When large amounts of programming time is spent on game ai it does end up "self driving" at an adequate level, see Google's sc2
bot, Google's older arcade game bot's, and openai's dota bot. It's just not worth it investing that amount of time into most games.
> I tend to say that the second step of climbing a ladder should probably not count as a new interaction.
That might make sense when you view it through this specific lens, but that design decision allowed them to save character positions on ladders and make 'getting on' and 'getting off' be separate 'things' - just off the top of my head.
The '2 interactions' method actually makes the most sense in the context of their game engine - it's the same way getting 'on' or 'off' a chair works.
Their fix of just allowing interactions is probably the most correct option. That is essentially toggling a setting, as opposed to re-engineering how ladder mechanics work.
Good chance the dual "furniture" is because "sitting in furniture" triggers a separate animation cycle. Then through root-motion animation the NPCs are climbing. Getting on switches NPCs to the climb animation set. Getting off the later swaps NPCs back to regular animation set.
Altogether an elegant solution for managing what is otherwise a special case.
I'm not sure I understand why NPCs are prevented from interacting with the environment while you're talking... given that gameplay isn't stopped. Seems like an arbitrary decision that might lead to other surprising behavior too... e.g. talking to someone else to interrupt an NPC performing a scripted action.
Probably because interacting with the environment could cause environmental changes that might affect you.
For example, if you're standing in a doorway talking to someone and an NPC wants to close the door, it could close in between you and the NPC you're talking to.
I seem to remember a fallout clip where the character is trying to have a conversation with the NPC but then a monster is also attacking the NPC or something and the NPC is just oblivious. Kind of breaks the immersion when you are having a normal conversation and the NPC is taking mortal wounds at the same time.
It would be hard to make believable interactions when unexpected environmental side effects can happen at any time
My philosophy is that an important simple invariant shouldn't be maintained through the emergent behavior of a complex system.
If companions should be unkillable, then don't count on eliminating all sources of potential damage. Really make them unkillable. A ladder shouldn't ever take someone higher than the ladder goes so if some guy attempts to climb higher than the ladder goes, then freeze them in place or make them climb in place. Since these shouldn't trigger, crash the game if in dev mode, and if in prod mode check whether player allows telemetrics and if so phone home.
Those are the failsafe fixes.
Finally fix the root cause here by special casing that getting off a ladder during interaction is allowed.
Well, don't let NPCs fall to their death if they are potential companions.
These problems arise when a game engine starts as a generic physics simulation and various restrictions/rules mandated by gameplay design are added as an afterthought.
This may sound a bit silly, but depending on the story needs, these can potentially be completely separate entities. That way you wouldn't need to create a weird crossover entity that switches between friendly and enemy AI components etc.
In that particular case, what would be your favorite fix. I tend to say that the second step of climbing a ladder should probably not count as a new interaction.