Go to the first, previous, next, last section, table of contents.

Game Initialization

Game initialization always starts by resetting all the game-defining data structures to an empty state. This means no types, no world, etc. Then Xconq reads and interprets all of the game modules that have been requested. These modules may overwrite each other arbitrarily. Then any command line or startup options are processed (this may involve an interactive dialog), and the random number generator is initialized. and players are matched with sides (any sides needed for players will be created and named at this time). Xconq then executes a number of synthesis methods to do various kinds of setup.

(Some interfaces might allow for confirmation of the setup before launching into the game proper, but this cannot be assumed.)

Since the details of good game synthesis can be complicated, synthesis methods are simply wired-in pieces of code. Each method is self-contained; it assumes the game state to be valid, it will determine its own applicability and produce a valid result. It will also acquire any data that it needs, so does not require any special setup; however, a method may fail to run if it cannot find that data. For instance, the usual fractal terrain generator needs percentiles for each terrain type, and will not function without them. It may be that all the requested synthesis methods fail; this is OK if Xconq's data is present and consistent, but otherwise Xconq will shut itself down, since it has no remaining alternatives (think of this as a serious programming error and fix the game design).


Go to the first, previous, next, last section, table of contents.