Skip to content

Termination Conditions

Raluca D. Gaina edited this page Feb 12, 2018 · 1 revision

This page shows the current supported termination conditions by the VGDL engine. The VGDL engine terminates the running game when any of the conditions is satisfied. The game is terminated with either a Win or Lose state. All terminations may specify whether (in 2+ player games), the win state at the end of the game should be determined by the score (using the count_score=True parameter).

Termination conditions are written in TerminationSet in the game description file. The list of conditions is checked sequentially (if multiple conditions are true, the first one will trigger) and it must be in the following format:

TerminationSet
    Condition parameters win=True
    Condition parameters win=False

Condition is chosen from the following list. Condition parameters should be written afterwards then finally define if the condition is Win state or Lose state. This can be done by assigning the win parameter either to True for winning or False for losing. If the win property is not written, the engine assigns False to it.

In multi player games, the win state of each player must be specified, separated by a comma, in the following format, for example, for 2 players (meaning first player loses, second wins):

TerminationSet
    Condition parameters win=False,True

List of Termination Conditions:

SpriteCounter:

Description:
Level is terminated if the number of a certain sprite is less than or equal to a certain value.

Properties:

  • stype: The sprite name for the condition. It takes string values that correspond to a defined sprite (No default value).
  • limit: The compared number. It takes integer values (Default value is 0).

SpriteCounterMore:

Description:
Level is terminated if the number of a certain sprite is more than or equal to a certain value.

Properties:

  • stype: The sprite name for the condition. It takes string values that correspond to a defined sprite (No default value).
  • limit: The compared number. It takes integer values (Default value is 0).

MultiSpriteCounter:

Description:
Level is terminated if the summation of three different sprites is equal to a certain value.

MultiSpriteCounterSubTypes:

Description:
Level is terminated if the number of sprites of a certain type is equal to a certain value AND the number of different subtypes of the main type is equal to another value.

Properties:

  • stype1: The first sprite name for the condition. It takes string values that correspond to a defined sprite (Default value is null).
  • stype2: The second sprite name for the condition. It takes string values that correspond to a defined sprite (Default value is null).
  • stype3: The third sprite name for the condition. It takes string values that correspond to a defined sprite (Default value is null).
  • limit: The compared number. It takes integer values (Default value is 0).

StopCounter:

Description:
Level is NOT terminated if the summation of three different sprites is equal to a certain value (prevents any other terminations from triggering).

Properties:

  • stype1: The first sprite name for the condition. It takes string values that correspond to a defined sprite (Default value is null).
  • stype2: The second sprite name for the condition. It takes string values that correspond to a defined sprite (Default value is null).
  • stype3: The third sprite name for the condition. It takes string values that correspond to a defined sprite (Default value is null).
  • limit: The compared number. It takes integer values (Default value is 0).

TimeOut:

Description
Level is terminated if the game time is larger than or equal to a certain value.

Properties:

  • limit: the amount of time which the level terminates afterwards. It takes integer values (Default value is 0).

Examples:

SpriteCounter stype=avatar limit=0 win=False

This termination condition states: the player will lose the level, if the number of avatar sprite is less than or equal to 0 (No avatar sprite in the level).

MultiSpriteCounter stype1=brokenegg stype2=egg limit=1 win=False

This termination condition states: the player will lose the level, if the number of brokenegg and egg is equal to 1 (either one of them on the level).

Timeout limit=1500 win=True

This termination condition states: the player will win the level, if he can survive for 1500 time ticks after the start of the game.

Timeout limit=1500 count_score=True

This termination condition states: the player with most points will win the level, if they can survive for 1500 time ticks after the start of the game.

Table of Contents:

Clone this wiki locally