3 ms·
Ask HN: I'm looking for a specific blog post about game programming, any help?
It's one of my all time favorite posts, but somehow I can't find it. My memory is hazy but if I had to paraphrase I'm pretty sure it started off something like this:
Every time I see a game with a changelog like this, I cringe:
Peasants who become queens no longer continue to beg for bread
Horses no longer stay frozen after entering and exiting the pause menu
NPCs no longer attempt to open doors that have been removed
Fixed bug where NPCs were unable to see in dark rooms even after lighting a candle.
What's happening here is that the game has a huge state, and different parts of the state are being modified all over the place. This means that when extending the state in part A, you need to understand the entire codebase to know every state update that now needs to be changed. What you need to do is centralize all the code that modifies the state into one giant function, and this function should takes an enum describing the thing that triggered the change and modify the state accordingly.
... I think it went something like that, anyway. Any help?