Developing the popular RTS Command & Conquer: Tiberian Sun involved solving a whole host of problems. But the biggest and most interesting problem was figuring out to allow hundreds of troops and vehicles to move around maps without slowing and destroying PCs at the time.
The latest video in Ars Technica’s wonderful War Stories series is all about how developers Westwood Stuidos solved pathfinding and unit management in Tiberian Sun.
In games, characters and units figure out where to go using pathfinding. This creates a series of possible routes the AI can take to reach their objective. With even one unit, this can mean dozens or more different paths.
In a game like C&C: Tiberian Sun this pathfinding becomes more complicated as players can spawn hundreds of units, all of them moving and stopping in different areas of a large map, which can contain other players doing the same thing. This many units trying to find their way at once could cause even powerful PCs back in the day to collapse under the computational weight.
One of my favourite quotes from the video is easily this: “Players don’t realise how hard you have to work to make a game not do something stupid.”
This is in reference to when pathfinding stops working or makes a mistake. These issues create the feeling that the AI unit you are ordering around is an idiot. So the team spent a lot of time making their AI not do dumb things.
As Westwood Studios co-founder Louis Castle explained: “If you spend time making something not do something stupid it will actually look pretty smart.”
The solution to their pathfinding problems was to create a series of rules and directions, that helped lessen how much processing power would be needed.
For example, if a unit is near friendly AI units that are moving, the game tells these units to ignore each other. When AI units encounter a friendly AI unit who is moving and is in their way, the game simply tells the unit to bump that stationary friend out of their way. Using these techniques allowed Westwood Studios to have hundreds of units in their game without destroying players’ computers.
The whole video is interesting as Louis Castle explains how they solved other problems, including issues with the CD-ROM and video compression.