Basic Information & Data

Basic Information & Data

GameParameters

What are the parameters (numerical configuration) for the game? e.g. number of cards a player has to draw in their turn, number of bad things that happen to the player etc.). These manage the balance and sometimes behaviour of the game and adjusting numerical values in this class (and sometimes other variable types) should still allow the game to be playable (although in a different version).

Create a class that contains a variable for each parameter, extending the core.GameParameters.java class (e.g. "pandemic.PandemicParameters.java").

  • Note: Game parameters classes may extend the core.interfaces.ITunableParameters.java interface - implementing all of the required methods, according to the code documentation, would allow game parameters to be randomized or tuned.

Colt Express is an example of a game implementation using the GameParameters and a special ColtExpressTypes class in order to define the game data/parameters instead (games.coltexpress.ColtExpressParameters.java).

GameData (optional)

Does your game need data? What data does the game rely on? e.g. card effects, tile patterns, board nodes connections.

  • Set up one json file for each component type (component classes can read these automatically - check the examples in the data/pandemic folder); or implement your own file format and data reading class.
  • Add a class that will store all of the data read from these files (e.g. "pandemic.PandemicData.java"), extending the core.AbstractGameData.java abstract class.

Constants

Create a class (e.g. "pandemic.PandemicConstants.java") that contains hashes of string keys for the game, definitions of categorical variables or any other game-specific constant definitions. Use these throughout the game for better efficiency.

GamePhase (optional)

What are the phases of your game (that have different rules and/or actions available for the players)? e.g. main, player reactions, drawing cards etc.

In your game state class, add an inner-class enum containing all of your game-specific phases (you can always make use of the public ones already available in core.gamephase.DefaultGamePhase.java).

If your game doesn’t start in the “Main” phase, initialise the gamePhase variable in your ForwardModel._setup() accordingly.