Skip to content

GameSettings

Gabriël edited this page Nov 1, 2021 · 3 revisions

The GameSettings class contains all settings needed to start a game. It mostly holds just data and is therefore very simple.

As you will notice, the settings below are almost all respresented by integers. What these integers mean can be found here.

Properties

  • map: int - Alias for GameSettings.map_id
  • civs: list[int] - Alias for GameSettings.civilisations

Fields

  • names: list[str] - A list of strings containing all names for the AI's that need to participate.
  • civilisations: list[int] - A list of integers containing the ID's of the civs that AIs will play.
  • map_id: int - The map ID.
  • map_size: int - The size of the map.
  • difficulty: int - The difficulty of the game.
  • game_type: int - What the game type is: Random Map, King of the Hill etc.
  • resources: int - The starting resources setting for every players
  • reveal_map: int - How the map is revealed.
  • starting_age: int - Which age the players start in
  • victory_type: int - How players can achieve victory.
  • victory_value: int - WIP
  • game_time_limit: int - How long the game can run (in in-game seconds) before it will close automatically.

Functions

GameSettings(names, civilisations, map_id, map_size, difficulty, game_type, resources, reveal_map, starting_age,victory_type, game_time_limit) - Instantiate a new instance of this class.

Required Parameters

  • names: list[str] - The list of strings that are the names of the AIs that will compete in any game that uses these settings

Optional Parameters

  • civilisations: list[str, int] = None - A list of strings or integers that represent the civs the AIs are going to play. The civ at index 0 will be assigned to the ai with name at index 0, the civ at index 1 will be assigned to the ai with name at index 1 etc. If set to None or if the length of the list does not match the length of the names list, all missing entries will be set to the default huns
  • map_id: str, int = 'arabia' - A string or int representing the map the game is going to be played on
  • map_size: str, int = 'medium' - The map size
  • difficulty: str, int = 'hard' - The difficulty of the game and thus what the AIs will be set to
  • game_type: str, int = 'random_map' - The game type
  • resources: str, int = 'low' - The amount of starting resources for each player
  • reveal_map: str, int = 'normal' - How much of the map is revealed at the start. Should be one of normal, explored, all_visible.
  • starting_age: str, int = 'dark' - The starting age of each player.
  • victory_type: str, int = 'conquest' - How players should achieve victory
  • victory_value: int = 0 - WIP Does not work at the moment.
  • game_time_limit: int = 0 - How long the game should run before automatically be closed by the Launcher. Set to 0 for no time limit.

Returns

An instance of the GameSettings class.


GameSettings.clone() - Returns a shallow-copy of this GameSettings instance.

Returns

A shallow copy of the original instance.

Clone this wiki locally