1. Home
  2. Unity RTS Engine
  3. Game Manager

Game Manager

The Game Manager is the component that handles the faction initialization in the map and some other general settings for the game. This is the main script that connects each component with each other.

When creating a new map using the RTS Engine menu, this component is attached to an object called ‘GameManage’.

Selecting this object will display the inspector of the “GameManager.cs” script. It is composed of two parts: Factions and General Game Settings.


Factions:

  1. “Add Faction” button: This button allows you to add a new faction slot to the map. The amount of faction slots represents the maximal amount of factions that this map is capable of having. When playing this map with less than the maximal amount of factions allowed, the unused faction slots will simply be discarded. The button also displays the amount of faction slots (Faction Count).
  2. Faction navigation buttons: The two buttons (“>>” and “<<”) allows you to navigate between factions. Right below these buttons, you will see the currently selected faction settings.
  3. Defining faction slots:
    1. Faction Name: The name of the faction that will be displayed in the UI.
    2. Faction Type: Assign a Faction Type Info from the project tab in this field. This is only for testing purposes only (when you want to test-play the map directly without going through the menus). If you’re entering the map from the single player or the multiplayer menu then the chosen faction type in those menus will overwrite the defined ones in this field.
    3. Faction Color: The color that this faction uses (will be displayed in the buildings and units).
    4. Player Controlled (Single Player only): Only one faction can be player controlled. This means when the player starts this map, he will be playing with this faction.
    5. Initial Maximal Population: This is the maximal amount of population that the faction starts with. (Which can be extended in game). Gets overwritten with the value set in the multiplayer and single player menus if you’re entering the map from there.
    6. Capital Building: Drag and drop the Capital building of the faction in this field (Creating the capital is covered in this part, you can either jump to that part or simply keep following the tutorial because it will get to it anyway).
    7. NPC Manager: The NPC Manager prefab that will be used to control the behavior of the faction in case it’s not player controlled. Only valid to test-play the map as NPC Managers chosen in the menus will override this when starting a game from the menus.
  4.  “Remove Faction” button: This button will remove the currently selected faction.

General Game Settings:

  1. Random Player Faction: When turned on, this will shuffle the factions at the beginning of the game will pick a random capital position (from all the defined ones) for the player.
  2. Main Menu Scene: This is the name of the main menu scene that the player gets transferred to when he leaves a single player game.
  3. Peace Time (in seconds): A countdown that starts at the beginning of the game. During this time, no faction can attack another.
  4. General Audio Source: Some audio clips are played from a local audio source such as resource collection sound effects which are played from the resource area itself. Other audio clips like an error sound for example, are played using another audio source which this one.

How can we help?