Basic idea/big picture
The game setup and startup is a mess. It should be streamlined and cleanly designed both UI and code wise.
Details
From the main menu you should be able to get into a "start game" screen. There you can configure:
The factions
There are three types of faction: army, rebel and civilian
civilian is special, as there is only 0 or one faction of this type. So the player should be able to enable/disable civs via a checkbox. They are always neutral to all others.
rebels are also special. They do not have a main base and spawn in every unoccupied sector. They are enemy with every other faction. This may also be enabled/disabled via checkbox
For the army factions the player can select the number of factions (1 player faction and 1-n AI factions). They should spawn in the corners of the map (maybe we cap it to max 4 armies for now?)
Technical background
I imagine to have a Game object. It is put together after the player clicks "start game" and contains... well everything in the running game:
The engine
All factions
each faction has it's HQ, entities, relations to other factions etc.
GameOptions (maybe only needed beforehand at creation time?)
Regarding options: There are 2 kind of options (right now we only have global GameOptions): Options regarding the local client/player and game options regarding the rules of the current game.
How I imagine the setup of a Game: The "create game" UI might use a mutable PreparedGame (or something) model. It always contains a valid set of properties to create a game: a map seed or loaded map, the factions, maybe GameOptions. Upon clicking "start game" an immutable Game is created that immediately starts. The UI then switches to the GameView showing the Knowledge of the HQ of the player faction (which might come in another issue).
Core of this issue
In this issue I want to at least have some straight way to create and start a game instance. One object that contains everything we need that is being given to the UI in a sense like "here GameView, display this game".
Related issues/Prerequisites
When completed, this issue might render #153 obsolete.
Basic idea/big picture The game setup and startup is a mess. It should be streamlined and cleanly designed both UI and code wise.
Details From the main menu you should be able to get into a "start game" screen. There you can configure:
Technical background I imagine to have a
Game
object. It is put together after the player clicks "start game" and contains... well everything in the running game:Regarding options: There are 2 kind of options (right now we only have global
GameOptions
): Options regarding the local client/player and game options regarding the rules of the current game.How I imagine the setup of a
Game
: The "create game" UI might use a mutablePreparedGame
(or something) model. It always contains a valid set of properties to create a game: a map seed or loaded map, the factions, maybeGameOptions
. Upon clicking "start game" an immutableGame
is created that immediately starts. The UI then switches to the GameView showing the Knowledge of the HQ of the player faction (which might come in another issue).Core of this issue In this issue I want to at least have some straight way to create and start a game instance. One object that contains everything we need that is being given to the UI in a sense like "here GameView, display this game".
Related issues/Prerequisites When completed, this issue might render #153 obsolete.