O'Reilly logo

Going to War: Creating Computer War Games by Jason Darby

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Computer Unit Orders

In the previous example, you created a new starting point from where the unit was located, and the destination was a set location on the map. When making a larger game, you need to consider having a bigger map and many more units. Using this single A to B approach probably will not create a sufficiently complex computer AI, and the competing human player will quickly figure out the strategy of the computer, which will mean very little challenge for the player, especially in reply value.

To give a unit a set of orders, you need to store a list of possible destinations in memory that can be called at any point in the game. The order of these destinations won’t matter because you may decide to specify a particular destination ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required