Many gamers and developers alike have thought about developing a game based around time travel; not just the story, but actual gameplay! However, it turns out that's much harder to do than you'd think, and there are very few such games. ACHRON is one of them. It's a real-time strategy game featuring free-form time travel! As developer Chris Hazard puts it, ACHRON is the world's first meta-time strategy game where players and units can jump to and play at different times simultaneously and independently.
The game itself, due to the time travel, has many challenges for the AI. For example, ACHRON must simulate many different units across space like other RTS games, but also through time! This causes an explosion of computation that needs to be done for the game to work, and obviously this has a dramatic impact on the performance of the code and the memory footprint of every piece of data stored. On Sunday 19th (September 2010) I'll be interviewing Chris live online. If you're interested in game AI in practice, anyone can get access to the session by signing-up on this page.
Using Time Travel for AI?
If your game includes time travel, why don't you leverage it for your engine as well and make the most of it? I asked Chris this exact question via Twitter...
Alex Champandard: “@achron Why don't you offload your pathfinding calculations to the past, or just get back the correct results from the future? :-)”
Chris Hazard: “@AiGameDev We can't offload pathfinding to different points in time because of temporal inconsistencies, amplified by butterfly effect.”
Jokes aside, making time travel something that fun to play is a very big challenge.
Keeping Time Travel Fun...
One of the biggest design challenges of ACHRON is making the game as simple as possible. Time-travel isn't the easiest thing to understand, as it can have many implications on the way events play out. Luckily, in the context of a game, the developer can leverage the AI to try to make things easier to understand.
Chris Hazard explains the situation in the context of a real-time strategy game:
“Due to the time-traveling nature of Achron, the player's attention is focused at a specific point in time. Whether playing against an AI or just having units behave intelligently when a player isn't *then*, the player should not experience the exact same moves by the AI every game, which requires a certain degree of randomness in the AI.
However, the timeline must remain locally consistent. Consider a two-player game consisting of a human player and a computer player. The Human player's base A is battling against Computer player's base B, and both players are changing their orders to units in the past, present, and future at these locations. The Human player's base C and Computer player's base D are also in a war against each other, but neither side is changing the timeline in those locations. The two pairs of units are not interacting spatially; changes to the timeline that affect A and B should not affect C or D.
How do you create behavior that changes every game, but is temporally consistent except when that particular unit's timeline is altered? With hundreds of units and thousands of events to be recorded, memory must be kept to an absolute minimum; one extra bit stored per unit can easily turn into 100 kilobytes of cache invalidation across the timeline. What is a viable solution uses as little memory as possible?”
A Little Hint...
In other words, how do you make sure units being created in time minimize their interactions with other units that already existed then, such that few changes occur in the future in different parts of the map? Chris mentions a hint about a possible solution:
“How do you design a reasonable random number generator for use in local unit AI that is temporally consistent except when that particular unit's timeline is altered?”
Of course, keep in mind the performance and memory constraints of the game! If you have any ideas, be sure to post them below in the comments.