Chaos Theory and the Fog of War


The Legend of Quintavius’ gameplay mechanics are very experimental. The idea is basically a battle simulator, with several characters on either side running around and smacking each other with their weapons. But coding it from scratch has been a journey all on its own.

Almost every character has the same AI and does the following; first they find a target, then they navigate to that target, and lastly they engage in combat with the target. But this seemingly simple behavior ended up getting really complicated, and opened the door for some unusual bugs.

Characters pick a target that’s closest to them, but then must maneuver around obstacles and their own allies to get to their target. Since this is a top-down game and characters can only move in 4 directions, they switch between prioritizing up/down and left/right movement. And if a character runs into another enemy, they target them instead. Friendly soldiers will also try to stop fighting and find Quintavius if they have low health, and ranged soldiers will try to keep their distance from their target and attack from afar. Some characters even have different abilities that make everything even more complicated.

There’s so much going on that even the tiniest, most unnoticeable difference in an otherwise deterministic jumble of code can completely change the course of a battle. It actually seems to have a lot to do with chaos theory and the butterfly effect. I’m not an expert on that topic; my knowledge mainly comes from Wikipedia and Youtube videos. But its presence in my game really fascinates me, and I think it’s a sign of good game design.

But it goes further than that, because when I say a character “tries,” I mean it. Sometimes a character can get stuck around obstacles or allies trying to reach their target, or try to push another character instead of just going around, almost like they’re confused. Soldiers try to find Quintavius if they’re in danger, but they can still get caught or even trapped by several monsters, unable to escape. And ranged soldiers almost seem to get lost, trying to stay away from monsters until they wander too far and have trouble getting back to the party. These imperfections have inadvertently made these characters even more alive, almost more human.

It’s very similar to the fog of war, the uncertainty of your allies’ and enemies’ capabilities, and intentions. And the uncertainty of your own capabilities, too. Can you both fight and avoid monsters, and keep your entire team alive at the same time? Because they’re counting on you. Think about it; everyone else might also be uncertain of your intentions, too.

Some of the bugs in this game have made it more realistic. Why should I put the effort into removing them when they make the game so much more interesting? Why not decide to make them features instead and keep working on them? I’ve been thinking about this a lot, and it’s why I have such a hard time defining what a bug is. But it’s also why I’m fine with releasing the game with all these bugs. Paired with the story, I think it makes a really unique experience. You truly have no idea what will happen.

Leave a comment

Log in with itch.io to leave a comment.