Unity RTS Engine

  1. Home
  2. Unity RTS Engine
  3. Missions/Scenarios
  4. Create a Scenario

Create a Scenario

A Scenario is an asset file type which allows you to define a series of missions that can the player have to complete in a game. Since it’s an asset file, a scenario can be easily used in multiple maps.

To create a new scenario, right-click with the mouse in the project tab and click on: Create -> RTS Engine -> Scenario. An asset file will be then created, select it and define the scenario info from the inspector.


Overview of the scenario asset file inspector:


Scenario General Settings:

  1. Code: Each scenario must be assigned a unique code that identifies it.
  2. Name: The name of the scenario which will appear in the game’s scenario UI menu.
  3. Description: Short description of the scenario which is shown in the campaign menu.

Mission Navigation/Creation:

To add a new mission for the scenario, you can simply click the button “Add” which also displays the current mission count. To navigate between missions, you can use both the “<<” (go to previous mission) or the “>>” (go to next mission) buttons. The mission ID that you are currently configuring will be displayed right under the navigation buttons. Right after the mission settings, a “Remove” button will delete the displayed mission when clicked.


General Mission Settings:

The first tab presents fields which apply to all mission types.

  1. Code: Assign a unique code for each mission
  2. Type: Pick one of the following types:
    1. Collect Resource: Player will have to collect a certain amount of a resource type in order to complete this mission.
    2. Eliminate: Player will have to eliminate certain faction entities (units and/or buildings) in order to complete this mission.
    3. Produce: Player will have to produce certain faction entities (units and/or buildings) in order to complete this mission.
    4. Custom: You’ll be able to control the mission’s completion/forfeit conditions through your own components. All custom events and unity events will be triggered to allow to identify the start, completion or failure of the mission.
  3. Name: The name of the mission which will appear in the scenario’s UI menu when the mission is active.
  4. Description: The description of the mission which will appear in the scenario’s UI menu when the mission is active.
  5. Icon: The icon of the mission which will appear in the scenario’s UI menu when the mission is active.
  6. Survival Time: When enabled, you can input survival time (in seconds) which represents the time that the player requires to survive (not lose the game) when the mission is active in order to complete it. If the player reaches the mission’s objective or the survival time is over and the player’s faction hasn’t been defeated, the mission will be completed, so whichever comes first. In order to have a survival only mission (with no additional objectives), set the mission type to custom.
  7. Time Limit: When enabled, you can input the time limit (in seconds) which represents the time in which the player has to complete the mission’s objective before it is forfeited.
  8. Defend Faction Entities: Input the codes/categories of the faction entities (units and/or buildings) that, when dead (only if they belong to the player faction), the player fails the mission.
  9. Complete Audio: Audio clip played when the player completes this mission.

Custom Mission Settings:

The second tab represents settings which differ from one mission type to another.

  1. Resource Collection Mission:
    1. Target Resource: The Resource Type Info asset file that defines the resource type to collect.
    2. Target Amount: Player needs to collect this amount from the above resource type to complete the mission.
  2. Elimination/Production Mission:
    1. Target Code: A list of faction entity (units and/or buildings) codes and/or categories which the player needs to either produce or eliminate.
    2. Target Amount: The amount of the above faction entity types that need to be either produced or eliminated.

Mission Event Settings:

In addition to the custom events provided for missions in the RTS Engine. You can trigger events for each mission independently by using the following unity event triggers:

  1. Start Event: Invoked when the mission is started
  2. Complete Event: Invoked when the mission is completed
  3. Fail Event: Invoked when the mission is failed.

 

How can we help?