Skip to content

Instantly share code, notes, and snippets.

@heinezen
Last active June 26, 2019 15:06
Show Gist options
  • Save heinezen/a95e832efbb008234260640ccbf6c41b to your computer and use it in GitHub Desktop.
Save heinezen/a95e832efbb008234260640ccbf6c41b to your computer and use it in GitHub Desktop.

Reference

(Fill meeeeeeeeeeeee)

ability.Ability

Ability(Entity):

Generalization object for all abilities. Abilities define what game entities can do and what they are, respectively. They can be considered passive and active traits.

Standard behavior without specializations:

  • Abilities in the abilities set of GameEntity are considered enabled as soon as the game entity is created, unless a StateChager object disables them.
  • No ability explicitely requires sounds or to be animated. For this purpose, ability specializations are used.
  • A game entity's abilities are available to all players, not just the owner. This can be limited to players with specific diplomatic stances towards the owner by inheriting DiplomaticAbility.

Specializations:

  • AnimatedAbility: Assigns an animation that is played while the ability is active.
  • AnimationOverrideAbility: Overrides the animations of specified animated abilities temporarily.
  • CommandSoundAbility: Assigns a sound that is played once when the player orders the game entity to use the ability.
  • DiplomaticAbility: Makes the ability only accessible for players when the owner of the game entity has the specified diplomatic stances towards them.
  • ExecutionSoundAbility: Assigns a sound that is played while the ability is active.

ability.specialization.AnimatedAbility

AnimatedAbility(Ability):
    animations : set(Animation)

Abilities of this type will play an animation while they are active. Whether the animation loops is defined in the .sprite file linked in the Animation object.

animations The animation(s) played while the ability is active. If more than one animation is defined, the engine picks one of them at random.

ability.specialization.AnimationOverrideAbility

AnimationOverrideAbility(Ability):
    overrides : set(AnimationOverride)

Specifies a set of animation overrides that are applied when the ability is used.

Usage example: Consider a unit with two attacks. One of them is animated by having the unit wield a sword, while the other one is an animation in which the unit uses a bow. What we want is that the animation of the Move and Idle abilities correspond to the attack that was used last, e.g. after a sword attack, the movement animation show the unit moving around with a sword in its hand, and after a bow attack, the movement animation show the unit moving around with a bow. To accomplish this, we would let both attack abilities inherit from AnimationOverrideAbility and specify AnimationOverride objects for them that target Move and Idle.

overrides Stores the animations and abilities that will be overriden temporarily as AnimationOverride objects.

ability.specialization.CommandSoundAbility

CommandSoundAbility(Ability):
    sounds : set(Sound)

Abilities of this type will play a sound once when the player orders the game entity to use them.

sounds The sound(s) played when the order to use the ability is given. If more than one sound is defined, the engine picks one of them at random.

ability.specialization.DiplomaticAbility

DiplomaticAbility(Ability):
    stances : set(DiplomaticStance)

Restricts the players who can access the ability. Access is given to a player when the owner of the game entity has one of the specified stances towards this player. Note that when inheriting from this specilization, the access must also be explicitely allowed for the owner of the game entity by adding the Self stance to the set.

Usage example: Consider a trade post like the marketplace from AoE games. Players can send trade carts between trade posts to generate resources. Trade post behavior is activated by assigning the TradePost ability to a game entity. Without inheriting from DiplomaticAbility, all player can trade with this trade post, including its owner. However, if we want to limit the trade post to only be accessible for allies, we can let the ability inherit from DiplomaticAbility and add the Allied stance to the stances set.

stances The stances the owner needs to have towards another player to make the ability accessible for the latter.

ability.specialization.ExecutionSoundAbility

ExecutionSoundAbility(Ability):
    sounds : set(Sound)

Abilities of this type will play a sound while they are active.

sounds The sound(s) played while the ability is active. If more than one sound is defined, the engine picks one of them at random.

ability.type.ApplyContinuousEffect

ApplyContinuousEffect(Ability):
    effects                   : set(ContinuousEffect)
    application_delay         : float
    allowed_types             : set(GameEntityType)
    blacklisted_game_entities : set(GameEntity)

Applies a batch of continuous effects on another game entity.

effects The applied continuous effect definitions.

application_delay Time between the initiation of the ability and the application of the effects.

allowed_types Whitelist of game entity types that can be targeted with the ability.

blacklisted_game_entities Blacklist for specific game entities that would be covered by allowed_types, but should be excplicitely excluded.

ability.type.ApplyDiscreteEffect

ApplyDiscreteEffect(Ability):
    effects                   : set(ContinuousEffect)
    reload_time               : float
    application_delay         : float
    allowed_types             : set(GameEntityType)
    blacklisted_game_entities : set(GameEntity)

Applies a batch of discrete effects on another game entity.

effects The applied discrete effect definitions.

reload_time Minimum time between two applications of the batch of effects.

application_delay Time between the initiation of the ability and first application of the effects.

allowed_types Whitelist of game entity types that can be targeted with the ability.

blacklisted_game_entities Blacklist for specific game entities that would be covered by allowed_types, but should be excplicitely excluded.

ability.type.Cloak

Cloak(Ability):
    interrupted_by     : set(Ability)
    interrupt_cooldown : float

Makes the unit invisible to game entity's of other players.

interrupted_by Abilities of the game entity that interrupt the cloak when used.

interrupt_cooldown Time needed to reactivate the cloak after an ability from interrupted_by has been used.

ability.type.CollectStorage

CollectStorage(Ability):
    container        : Container
    storage_elements : set(GameEntity)

Allows a game entity to insert specified game entities into one of its containers.

container The container the target game entity will be inserted into. A Storage ability with this container must be enabled.

storage_elements The set of game entities that can be inserted into the container. The container must define a corresponding StorageElement for the GameEntity objects.

ability.type.Constructable

Constructable(Ability):
    starting_progress     : int
    construction_progress : set(ConstructionProgress)

Makes the game entity constructable via Effect types.

starting_progress The construction progress when the game entity is created.

construction_progress A set of ConstructionProgress objects that can activate state changes and animation overrides when the construction progresses.

ability.type.Create

Create(Ability):
    creatables : set(CreatableGameEntity)

Allows a game entity to spawn new instances of game entities.

creatables Stores the reference to the creatable game entities as well as the preconditions that have to be fulfilled in order to spawn a new instance.

ability.type.Damageable

Damageable(Ability):
    attribute       : Attribute
    damage_progress : set(DamageProgress)

Allows the alteration of the base state of the game entity when its attribute values increase or decrease.

attribute The attribute which is monitored.

damage_progress A set of DamageProgress objects that can activate state changes and animation overrides when the current attribute increases or decreases.

ability.type.Deletable

Deletable(Ability):

Makes the game entity deletable via manual command. This will trigger the currently active Die ability without the need to fulfill the conditions for death. If the game entity does not have an active Die ability, the engine will try to trigger Despawn instead. If this ability is also not present, the game entity is instantly removed from the game.

ability.type.DepositResources

DepositResources(Ability):
    search_range              : float
    allowed_types             : set(GameEntityType)
    blacklisted_game_entities : set(GameEntity)

Allows a game entity to dropoff resources at other game entities that have the DropSite ability. Game entities with the Gather ability will automatically use this ability when their gathering capacity is reached.

search_range The range in which the unit will search for a resource drop site when the ability is not used manually.

allowed_types Whitelist of game entity types that can be used as drop sites. They must have a DropSite ability accepting the corresponding resource.

blacklisted_game_entities Blacklist for specific game entities that would be covered by allowed_types, but should be excplicitely excluded.

ability.type.Despawn

Despawn(Ability):
    despawn_condition : set(DespawnCondition)
    despawn_time      : float
    state_change      : StateChanger

Second stage of a "clean exit" that removes the game entity from the current game. The ability is can be used when a Die ability was executed by the same game entity or if the game entity has no Die ability. Despawn is triggered if at least one of the conditions in despawn_conditions is fulfilled. There can only be one Despawn ability active at the same time. If more than one Despawn abilities are enabled, the least recently enabled one of them is used.

despawn_conditions Conditions that trigger the ability. Only one of them needs to be fulfilled. If the set contains no conditions, the game entity is despawned immediately.

despawn_time Time until the game entity is removed from the game. The removal is permanent.

state_change Alters the base abilities and modifiers of a game entity after the ability is executed. The state change stays active until the game entity is removed from the game.

ability.type.Die

Die(Ability):
    death_conditions : set(DeathCondition)
    death_time       : float
    state_change     : StateChanger

First stage of a "clean exit" that removes the game entity from the current game. The ability is triggered if at least one of the conditions in death_conditions is fulfilled. All current tasks of the game entity will be disabled. There can only be one Die ability active at the same time. If more than one Die abilities are enabled, the least recently enabled one of them is used.

After Die has finished, the Despawn ability is activated. Despawn must be triggered by another condition. Until then, the game entity will be assigned the 'dead' status by the engine. If no Despawn is present for the game entity, it will immediately be removed from the game.

Die can be combined with ApplyDiscreteEffect for an ability by inheriting from both API objects. The resulting ability can be used in either ways. If the player uses this ability as an ApplyDiscreteEffect ability, the game entity will die on use. Similarly, if one of the death conditions is triggered, effects will be applied. This can be used to model self destruct behavior.

death_conditions Conditions that trigger the ability. Only one of them needs to be fulfilled. If the set contains no conditions, the game entity dies immediately.

death_time Time until Despawn can be used.

state_change Alters the base abilities and modifiers of a game entity after the ability is executed. The state change stays active until the game entity is removed from the game.

ability.type.DropSite

DropSite(Ability):
    accepts : set(Resource)

Allows a game entity to act as a resource dropoff site for game entities with the DepositResources ability.

accepts Resources that can be dropped off at the game entity.

ability.type.EnterContainer

EnterContainer(Ability):
    allowed_containers        : set(Container)
    allowed_types             : set(GameEntityType)
    blacklisted_game_entities : set(GameEntity)

Allows a game entity to enter specified containers of another game entity's Storage ability.

allowed_containers The containers that can be entered.

allowed_types Whitelist of game entity types that can be targeted with the ability.

blacklisted_game_entities Blacklist for specific game entities that would be covered by allowed_types, but should be excplicitely excluded.

ability.type.ExchangeResources

ExchangeResources(Ability):
    source_resources : set(ResourceAmount)
    target_resources : set(ResourceAmount)
    source_fee       : float
    target_fee       : float
    exchange_mode    : ExchangeMode

Exhanges a fixed amount of resources for another fixed amount of resources. Players can exchange resources with themselves or other players.

source_resources Resource amount sent by the player initiating the ability to the targeted player (this is omitted if the player trades with themselves). This removes an amount of

remove_amount = source_resources * source_fee

from the player's resource pool. The resource amount must be available at the time of initiation.

target_resources Resource amount removed from the targeted player's resource pool (this is omitted if the player trades with themselves). The resource amount must be available at the time of initiation. The initiating player receives an amount of

receive_amount = target_resources * target_fee

that is added to their resource pool.

source_fee A multiplier for the amount of resources the initiating player has to spent.

target_resources A multiplier for the amount of resources the initiating player receives.

exchange_mode Configures advanced exchange behavior as an ExchangeMode object.

ability.type.ExitContainer

ExitContainer(Ability):
    allowed_containers : set(Container)

Allows a game entity to exit specified containers of another game entity's Storage ability when they are in the container.

allowed_containers The containers that can be exited.

ability.type.Fly

Fly(Ability):
    height : float

Allows a game entity fly at a fixed height.

height The height at which the game entity flies. This value is always relative to the ground below.

ability.type.FormFormation

Formation(Ability):
    formations : set(GameEntityFormation)

Allows a game entity to be part of certain formations.

formations Formation types that the game entity can be part of as well as the corresponding subformation that is used.

ability.type.Foundation

Foundation(Ability):
    foundation_terrain : Terrain
    flatten_ground     : bool

Changes the terrain under a game entity when it is created. Only works if a TileRequirement ability is enabled.

foundation_terrain Replacement terrain that is placed on the tiles the game entity occupies.

flatten_ground Determines whether the ground under the game entity is flattened when it is placed on it. The height level at the center of the game entity is used as orientation.

ability.type.GameEntityStance

GameEntityStance(Ability):
    stances: set(GameEntityStance)

Defines activity stances for a game entity. These stances define which abilities will be used without player interaction when the game entity is idle.

stances Stance definitions for the game entity as aux.game_entity_stance.GameEntityStance objects.

ability.type.Gate

Gate(Ability):
    range                     : float
    allowed_types             : set(GameEntityType)
    blacklisted_game_entities : set(GameEntity)

Deactivates the hitbox of the game entity for movement of other game entities (like Passable) when specified game entities are in range. The hitbox is still relevant for the game entity's own movement.

range Minimum distance to one of the specified game entities at which the game entity becomes passable.

allowed_types Whitelist of game entity types that makes this game entity passable when they are in range.

blacklisted_game_entities Blacklist for specific game entities that would be covered by allowed_types, but should be excplicitely excluded.

ability.type.Gather

Gather(Ability):
    auto_resume         : bool
    resume_search_range : float
    targets             : set(ResourceSpot)
    carry_capacity      : int
    gather_rate         : ResourceRate
    carry_progress      : set(CarryProgress)

Allows a game entity to gather from resource spots defined the Harvestable abilities of other game entities.

auto_resume Determines whether the game entity will automatically resume gathering after the resource spot is depleted. When enabled, the game entity will check if it can refill the depleted resource spot with one of its Restock abilities. Otherwise, the game entity will search for a new resource spot it can access with this ability.

resume_search_range The range in which the game entity searches for a new resource spot if auto_resume is enabled.

targets Resource spots that can be accessed with this ability.

carry_capacity Maximum carry capacity for resources gathered with this ability. If the stored amount of resources reaches this value or the resource spot is depleted, the game entity will use the DropResources ability.

gather_rate The rate at which the game entity collects resources from the resource spot,

carry_progress A set of CarryProgress objects that can activate state changes and animation overrides when the carried amount of resources increases.

ability.type.Harvestable

Harvestable(Ability):
    resources : ResourceSpot

Assigns a game entity a resource spot that can be harvested by other game entities with the Gather ability.

resource_spot The resource spot as a ResourceSpot object. It defines the contained resource and capacity.

ability.type.Herd

Herd(Ability):
    range                     : float
    allowed_types             : set(GameEntityType)
    blacklisted_game_entities : set(GameEntity)

Allows a game entity to change the ownership of other game entities with the Herdable ability.

range Minimum distance to a herdable game entity to make it change ownership.

allowed_types Whitelist of game entity types that can be herded.

blacklisted_game_entities Blacklist for specific game entities that would be covered by allowed_types, but should be excplicitely excluded.

ability.type.Herdable

Herdable(Ability):
    adjacent_discover_range : float

Makes the game entity switch ownership when it is in range of another game entity with a Herd ability. The new owner is the player who owns the game entity with the Herd ability. If the herdable game entity is in range of two or more herding game entities, the ownership changes to the owner of the game entity which is closest.

adjacent_discover_range When the game entity is herded, other herdables in this range are also herded. The rules in Herd of the herding game entity apply.

ability.type.Hitbox

Hitbox(Ability):
    radius_x : float
    radius_y : float
    radius_z : float

Defines the hitbox of a game entity that is used for collision with other game entities.

radius_x The size of the hitbox in the x axis direction.

radius_y The size of the hitbox in the y axis direction.

radius_z The size of the hitbox in the z axis direction.

ability.type.Idle

Idle(Ability):

Used for assigning animations and sounds to game entities in an idle state. In contrast to the other abilities, game entities always have an implicit idle state, even if they have no Idle ability defined.

ability.type.LineOfSight

LineOfSight(Ability):
    range : float

Reveals an area around the game entity.

range Determines the radius of the circular area around the game entity that is revealed.

ability.type.Live

Live(Ability):
    attributes : set(AttributeSetting)

Assigns attributes to a game entity. The properties of the attributes are defined in AttributeSetting objects.

attributes Configures the attribute values of the game entity via AttributeSetting objects.

ability.type.Move

Move(Ability):
    speed : float
    modes : set(MoveMode)

Allows a game entity to move around the map.

speed Speed of movement.

modes Movement modes that can be used by the game entity.

ability.type.Named

Named(Ability):
    name             : TranslatedString
    description      : TranslatedMarkupFile
    long_description : TranslatedMarkupFile

Assigns a game entity name and descriptions.

name The name of the game entity as a translatable string.

description A description of the game entity as a translatable markup file.

long_description A longer description of the game entity as a translatable markup file.

ability.type.Passable

Passable(Ability):

Deactivates the hitbox of the game entity for movement of other game entities. However, the hitbox is still relevant for the game entity's own movement.

ability.type.Projectile

Projectile(Ability):
    arc               : int
    accuracy          : set(Accuracy)
    target_mode       : TargetMode
    ignored_types     : set(GameEntityType)
    unignore_entities : set(GameEntity)

Gives a game entity projectile behavior. A projectile is always spawned with another GameEntity object as a target. The engine calculates a parabolic path to the target, using the arc, accuracy and target_mode members. While moving along this path, the game entity can use other abilities.

arc The starting arc of the projectile as value between 0 and 360.

accuracy The accuracy of the projectile as an Accuracy object.

target_mode Determines the end point of the projectile path with a TargetMode object. The end point can be at the expected position of the target, when the projectile hits, or at the position of the target, when the projectile spawns.

ignore_types The projectile will not use abilities on game entities with these types and ignore their hitbox, while moving along the path. However, the projectile will always use abilities on its target, even if it has one of they types in this set.

unignore_entities Whitelist of game entities who have a type that is listed in ignore_types, but should not ne ignored.

ability.type.ProvideContingent

ProvideContingent(Ability):
    amount : set(ResourceAmount)

Provides a temporary resource amount to a ResourceContingent. The amount is provided until the ability is disabled.

amount Temporary resource amount that is provided by the game entity.

ability.type.RallyPoint

RallyPoint(Ability):
    indicator : Ambient

Allows a game entity to set a rally point on the map. Game entities spawned by the Create ability or ejected from a container will move to the rally point location. The rally point can be placed on another game entity. In that case, the game entities moving there will try to use an appropriate ability on it.

indicator Indicator showing the location of the rally point on the map as an Ambient game entity object. It's Visibility ability is only active if the game entity using the rally point is selected.

ability.type.RangedContinuousEffect

RangedContinuousEffect(ApplyContinuousEffect):
    min_range : int
    max_range : int

Applies a batch of discrete effects on another game entity. This specialization of ApplyContinuousEffect allows ranged application.

min_range Minumum distance to target.

max_range Maximum distance to the target.

ability.type.RangedDiscreteEffect

RangedDiscreteEffect(ApplyDiscreteEffect):
    min_range : int
    max_range : int

Applies a batch of discrete effects on another game entity. This specialization of ApplyDiscreteEffect allows ranged application.

min_range Minumum distance to target.

max_range Maximum distance to the target.

ability.type.RegenerateAttribute

RegenerateAttribute(Ability):
    rate : AttributeRate

Regenerate attribute points at a defined rate. The game entity must have the attribute in its Live ability.

rate Regeration rate as an AttributeRate object.

ability.type.RegenerateResourceSpot

RegenerateResourceSpot(Ability):
    rate : ResourceRate
    resource_spot : ResourceSpot

Regenerate the available resources of a game entity's resource spot at a defined rate.

rate Regeration rate as an ResourceRate object.

resource_spot Resource spot that is refilled. The game entity must have a Harvestable ability that contains this resource spot.

ability.type.RemoveStorage

RemoveStorage(Ability):
    container        : Container
    storage_elements : set(GameEntity)

Allows a game entity to remove specified game entities from one of its containers.

container The container the target game entity will be removed from. A Storage ability with this container must be enabled.

storage_elements The set of game entities that can be removed from the container. The container must define a corresponding StorageElement for the GameEntity objects.

ability.type.Research

Research(Ability):
    researchables : set(ResearchableTech)

Allows a game entity to research a Tech object. Initiating a research will lock the technology for other game entities that can research it. The lock is lifted when the research process of the Tech is cancelled.

researchables Stores the reference to the researchable techs as well as the preconditions that have to be fulfilled in order to research them.

ability.type.Resistance

Resistance(Ability):
    resistances : set(Resistance)

Assigns a game entity resistances to effects applied by other game entities.

resistances A set of resistances as Resistance objects.

ability.type.Restock

Restock(Ability):
    auto_restock : bool
    target       : RestockableResourceSpot
    restock_time : float
    manual_cost  : Cost
    auto_cost    : Cost
    amount       : int

Refills a resource spot with a defined amount of resources.

auto_restock Determines whether the game entity will automatically restock a resource spot that it helped deplete.

target The resource spot that can be restocked with this ability.

restock_time Time until the restocking finishes.

manual_cost Cost of restocking when the ability is used manually by a player.

auto_cost Cost of restocking when the ability is automatically used by the game entity.

amount The amount of resources that is refilled.

ability.type.Selectable

Selectable(Ability):

Makes the game entity selectable by players.

ability.type.SendBackToTask

SendBackToTask(Ability):
    allowed_types : set(GameEntityType)
    blacklisted_game_entities : set(GameEntity)

Empties the containers of the Storage abilities of a game entity and lets the ejected game entities resume their previous tasks.

allowed_types Whitelist of game entity types that can will be affected.

blacklisted_game_entities Blacklist for specific game entities that would be covered by allowed_types, but should be excplicitely excluded.

ability.type.ShootProjectile

ShootProjectile(Ability):
    projectiles               : orderedset(Projectile)
    min_projectiles           : int
    max_projectiles           : int
    min_range                 : int
    max_range                 : int
    reload_time               : float
    spawn_delay               : float
    projectile_delay          : float
    require_turning           : bool
    manual_aiming_allowed     : bool
    spawning_area_offset_x    : float
    spawning_area_offset_y    : float
    spawning_area_offset_z    : float
    spawning_area_width       : float
    spawning_area_height      : float
    spawning_area_randomness  : float
    allowed_types             : set(GameEntityType)
    blacklisted_game_entities : set(GameEntity)

Spawns projectiles that have a GameEntity object as a target. Projectiles are essentially fire-and-forget objects and only loosely depend on the game entity they originate from. The game entity using ShootProjectile will forward its max_range value and the target's ID to the spawned projectile object, so that it can calculate the projectile path.

projectiles Projectile game entities that can be spawned by the ability. The projectiles are fired in the order they have in the set. The amount of spawned projectiles is min_projectiles by default and can be increased by Modifier objects up to an upper limit of max_projectiles. The last Projectile is reused when the number of projectiles supposed to be fired is greater than the size of the set.

min_projectiles Minimum amount of projectiles spawned.

max_projectiles Maximum amount of projectiles spawned.

min_range Minimum distance the game entity has to have to the target.

max_range Maximum distance at which the game entity can initiate the ability. Projectiles will be fired at targets further than this distance if the target was in range of the shooting game entity when the ability was initiated.

reload_time Time until the ability can be used again. The timer starts after the last projectile has been fired.

spawn_delay Time between the initiation of the ability and first projectile being fired.

projectile_delay Time until the next projectile is spawned when multiple projectiles are fired.

require_turning Determines whether the game entity must turn towards the target.

manual_aiming_allowed Determines whether the ability can be aimed at a coordinate instead of a GameEntity object.

spawning_area_offset_x Part of the spawn location coordinates. The spawn location is an offset from the anchor point of the game entity.

spawning_area_offset_y Part of the spawn location coordinates. The spawn location is an offset from the anchor point of the game entity.

spawning_area_offset_z Part of the spawn location coordinates. The spawn location is an offset from the anchor point of the game entity.

spawning_area_width Determines the spawn area in which the projectile can be spawned randomly.

spawning_area_height Determines the spawn area in which the projectile can be spawned randomly.

spawning_area_randomness Value between 0 and 1 that determines far the spawn location can be from the spawn area center. The engine chooses random (x,y) coordinates in the spawn area and multiplies them by this value in order to determine the spawn location.

allowed_types Whitelist of game entity types that can be targeted with the ability.

blacklisted_game_entities Blacklist for specific game entities that would be covered by allowed_types, but should be excplicitely excluded.

ability.type.Stop

Stop(Ability):

Stops all current tasks and returns the game entity to an idle state.

ability.type.Storage

Storage(Ability):
    container       : Container
    empty_threshold : AttributeAmount

Enables a game entity to store other game entities. The stored game entities can influence the state of the storing game entity.

container Defines which and how many game entities can be stored.

empty_threshold Empties the storage if the current value of the referenced attribute falls below the defined value.

ability.type.TileRequirement

TileRequirement(Ability):
    tiles_x : int
    tiles_y : int

Makes a game entity require a rectangular set of tiles on the terrain grid.

tiles_x Number of tile required on the x axis of the grid.

tiles_y Number of tile required on the y axis of the grid.

ability.type.TerrainRequirement

TerrainRequirement(Ability):
    terrain_requirement : set(Terrain)

Makes a game entity require a specific terrain to move and be placed on.

terrain_requirement Set of terrains the game entity requires.

ability.type.Trade

Trade(Ability):
    trade_routes : set(TradeRoute)

Allows a game entity to trade with other game entities that have the TradePost ability.

trade_routes Trade routes that can be established with trade posts. The TradeRoute object defines rules and traded resources for the trade.

ability.type.TradePost

TradePost(Ability):
    trade_routes : set(TradeRoute)

Makes a game entity a trade post that other game entities can trade with using their Trade ability.

trade_routes Trade routes that can be established with this trade post. The TradeRoute object defines rules and traded resources for the trade.

ability.type.TransferStorage

TransferStorage(Ability):
    storage_element  : GameEntity
    source_container : Container
    target_container : Container

Transfers one game entity from a container to another.

storage_element Game entity that is transfered.

source_container Container the game entity is stored in when the ability is used.

target_container Container that the game entity is inserted into. The target container can belong to the same game entity.

ability.type.Transform

Transform(Ability):
    states        : set(StateChanger)
    initial_state : StateChanger

Defines a set of predefined state changes that a game entity can activate by using the TransformTo ability. Only one StateChanger object per Transform ability can be active at the same time.

states State changes that can be activated. TransformTo can switch to more states than those which are defined in this set. However, it is recommend to list all state changes reachable by transformation in here to allow easy access to them in scripts.

initial_state Activates automatically when the ability is enabled.

ability.type.TransformTo

TransformTo(Ability):
    target_state       : StateChanger
    transform_time     : float
    transform_progress : set(TransformProgress)

Activates a state change for a game entity. A Transform ability must be assigned to the game entity. The previous state change will be deactivated when the transformation has finished.

target_state Target state change that activates when the time defined in transform_time has passed.

transform_time The time for the transformation to complete.

transform_progress A set of TransformProgress objects that can activate state changes and animation overrides while the transformation progresses.

ability.type.Turn

Fly(Ability):
    turn_speed : float

Allows a game entity to turn on the spot.

turn_speed Speed at which the game entity turns.

ability.type.UseContingent

UseContingent(Ability):
    amount : set(ResourceAmount)

Reserves a temporary resource amount of a ResourceContingent. Game entities produced via the Create ability only spawn the the contingent has enough space to support them. The amount is reserved until the ability is disabled.

amount Temporary resource amount that is reserved by the game entity.

ability.type.Visibility

Visibility(Ability):
    visible_in_fog : bool

Configures a game entity's visiblity in the fog of war.

visible_in_fog Determines whether the game entity is visible in the fog of war.

aux.accuracy.Accuracy

Accuracy(Entity):
    accuracy : float
    accuracy_dispersion : float
    dispersion_dropoff : DropOffType
    target_types : set(GameEntityType)
    blacklisted_entities : set(GameEntity)

Stores information for the accuracy calculation of a game entity with Projectile ability.

accuracy The chance for the projectile to land at the "perfect" position to hit its target as a value between 0 and 1.

accuracy_dispersion The maximum accuracy dispersion when the projectile fails the accuracy check.

dispersion_dropoff Multiplies the maximum dispersion with a dropoff factor. The dropoff depends on the distance of the projectile spawning game entity in relation to the max_range of its ShootProjectile ability.

target_types Lists the game entities types for which the accuracy value can be used.

blacklisted_entities Used to blacklist game entities that have one of the types listed in target_types, but should not be covered by this Accuracy object.

aux.attribute.Attribute

Attribute(Entity):
    name         : TranslatedString
    abbreviation : TranslatedString

Defines an attribute that can be assigned a value range by AttributeSetting. Attributes are used for interaction between game entities (e.g. health) and as payment for effects.

name The name of the attribute as a translated string.

abbreviation Short version of the names as a translated string.

aux.attribute.AttributeAmount

AttributeAmount(Entity):
    type   : Attribute
    amount : int

A fixed amount of a certain attribute.

type The attribute.

amount Amount of attribute points.

aux.attribute.AttributeSetting

AttributeSetting(Entity):
    attribute      : Attribute
    min_value      : int
    max_value      : int
    starting_value : int

Assigns an interval for an attribute of a game entity. The game entity can have a current attribute value while it exists. Attribute values can be changed by abilities or effects.

attribute Attribute the interval is defined for.

min_value Minimum value the current attribute value can have. Can be negative.

max_value Maximum value the current attribute value can have.

starting_value The current attribute value when the game entity is created.

aux.attribute.AttributeRate

AttributeRate(Entity):
    type   : Attribute
    rate   : float

A per second rate of a certain attribute.

type The attribute.

rate Rate of attribute points.

aux.attribute.ProtectingAttribute

ProtectingAttribute(Attribute):
    protects : Attribute

Protects an attribute by preventing its value to be decreased by another game entity. Attribute increases by other game entities, costs and regeneration are not affected.

protects The attribute that is protected.

aux.create.CreatableGameEntity

CreatableGameEntity(Entity):
    game_entity    : GameEntity
    cost           : Cost
    creation_time  : float
    creation_sound : Sound
    requirements   : set(AvailabilityRequirement)
    placement_mode : PlacementMode

Defines preconditions, placement and spawn configurations for a new instance of a game entity created by a Create ability.

game_entity Reference to the GameEntity object that is spawned.

cost Resource amount spent to intiate creation. Cancelling the creation results in a refund of the spent resources.

creation_time Time until the game entity is spawned from the creating game entity.

creation_sound Sounds that are played on creating an instance of the game entity.

requirements A set of requirements that unlock the creatable game entity for the creating game entity. Only one requirement needs to be fulfilled to trigger the unlock. If the set is empty, the game entity is considered available from the start for the creating game entity.

placement_mode Decides where and how the game entity instance is spawned as a PlacementMode object.

aux.death_condition.DeathCondition

DeathCondition(Entity):

Generalization object for all death conditions that are usable by the Die ability.

aux.death_condition.type.AttributeInterval

AttributeInterval(DeathCondition):
    attribute : Attribute
    min_value : optional(AttributeAmount)
    max_value : optional(AttributeAmount)

Triggers when the current attribute value of a game entity is outside of a defined interval. At least one of the members min_value and max_value has to be set.

attribute Attribute of the game entity.

min_value Lower bound of the interval. If the current attribute value is lower than or equal to (<=) this bound, the condition will trigger.

max_value Upper bound of the interval. If the current attribute value is greater than or equal to (>=) this bound, the condition will trigger.

aux.death_condition.type.ProjectileHit

ProjectileHit(DeathCondition):

Triggers when a game entity hitbox collides with that of another game entity.

aux.death_condition.type.ProjectileHitTerrain

ProjectileHitTerrain(DeathCondition):

Triggers when a game entity's hitbox collides with the terrain of the map.

aux.death_condition.type.ProjectilePassThrough

ProjectilePassThrough(DeathCondition):
    pass_through_range : int

Triggers when the distance to the spawn location of the game entity becomes greater than a defined value.

pass_through_range Distance to the spawn location. Only (x,y) coordinates are considered.

aux.despawn_condition.DespawnCondition

DespawnCondition(Entity):

Generalization object for all despawn conditions that are usable by the Despawn ability.

aux.despawn_condition.type.ResourceSpotsDepleted

ResourceSpotsDepleted(DespawnCondition):
    only_enabled : bool

Triggers when all resource spots in Harvestable abilities have been depleted.

only_enabled The condition only considers resource spots of enabled Harvestable abilities.

aux.despawn_condition.type.Timer

Timer(DespawnCondition):
    time : float

Triggers after a specified amount of time has passed after the Despawn ability has been activated. If the Despawn ability is diabled before the timer has finished, it will be reset.

time Time that has to pass after the activation of the corresponding Despawn ability.

aux.exchange_mode.ExchangeMode

ExchangeMode(Entity):

Generalization object for exchange modes of the ExchangeResource ability.

aux.exchange_mode.type.Fixed

Fixed(ExchangeMode):

Applies no additional rules to the ability.

aux.exchange_mode.volatile.Volatile

Volatile(ExchangeMode):
    source_min_amount : int
    source_max_amount : int
    target_min_amount : int
    target_max_amount : int
    scope             : optional(ExchangeScope)

Generalization object for volatile exchange modes. Adjusts the transfered resource amounts after every transaction.

source_min_amount Lower bound for the source resource amount.

source_max_amount Upper bound for the source resource amount.

target_max_amount Upper bound for the source resource amount.

target_max_amount Upper bound for the target resource amount.

scope An optional scope for which the adjustments are made. When a scope is defined, the transfered resource amounts are changed for all abilities that reference the same scope object in their exchange mode.

aux.exchange_mode.volatile.VolatileFlat

VolatileFlat(Volatile):
    change_source_amount : int
    change_target_amount : int

Changes the transfered resource amounts by a fixed amount after every transaction.

change_source_amount Changes the current source resource amount by this value.

change_target_amount Changes the current target resource amount by this value.

aux.exchange_scope.ExchangeScope

ExchangeScope(Entity):

Generalization object for volatile exchange modes.

aux.game_entity_stance.GameEntityStance

GameEntityStance(Entity):
    ability_preference : orderedset(Ability)
    type_preference    : orderedset(GameEntityType)

Generalization object for activity stances for the GameEntityStance ability.

ability_preference The abilities which the game entity will execute or search targets for. Their order in the set defines the priority of usage.

type_preference Determines which game entity types are prioritized as targets. Their order in the set defines the priority of usage. Game entities with types that are not in the set will be ignored.

aux.game_entity_stance.Agressive

Agressive(GameEntityStance):

The game entity will use ranged abilities or move to the nearest target in its line of sight to use other abilities. If the target gets out of the line of sight, the game entity searches for a new target. When no new target can be found, the game entity stops moving and returns to an idle state.

aux.game_entity_stance.Defensive

Defensive(GameEntityStance):

The game entity will use ranged abilities or move to the nearest target in its line of sight to use other abilities. If the target gets out of range or the line of sight, the game entity searches for a new target. When no new target can be found, the game entity returns to its original position and returns to an idle state.

aux.game_entity_stance.StandGround

StandGround(GameEntityStance):

The game entity will stay at its current position.

aux.game_entity_stance.Passive

Passive(GameEntityStance):

The game entity will stay at its current position and only reacts to manual commands given by players. Abilities in ability_preference will be ignored.

aux.formation.GameEntityFormation

GameEntityFormation(Entity):
    formation    : Formation
    subformation : Subformation

Defines a placement in a formation for the Formation ability.

formation The formation the game entity is placed in.

subformation Subformation inside the subformation that the game entity is inserted into.

aux.move_mode.MoveMode

MoveMode(Entity):

Generalization object for move modes for the Move ability.

aux.move_mode.AttackMove

AttackMove(MoveMode):

Move to a position on the map. Stances from GameEntityStance ability are considered during movement.

aux.move_mode.Follow

Follow(MoveMode):
    range : float

Follow another game entity at a defined range. The movement speed is adjusted to the followed game entity, but cannot go higher than the speed value from Move. Stances from GameEntityStance ability are ignored during movement. Following is stopped when the followed game entity gets out of the line of sight of the following game entity.

range The range at which the other game entity is followed.

aux.move_mode.Normal

AttackMove(MoveMode):

Move to a position on the map. Stances from GameEntityStance ability are ignored during movement.

aux.move_mode.Patrol

Patrol(MoveMode):

Lets player set two or more waypoints that the game enity will follow. Stances from GameEntityStance ability are considered during movement.

aux.placement_mode.PlacementMode

PlacementMode(Entity):

Generalization object for all placement modes that are configurable for a CreatableGameEntity object.

aux.placement_mode.type.Eject

Eject(PlacementMode):

The game entity is ejected from the creating game entity. Ejecting considers the game entity's Hitbox, TileRequirement and TerrainRequirement abilities for the ejection location.

aux.placement_mode.type.Place

Place(PlacementMode):
    allow_rotation : bool

The game entity can be placed on the map after its creation. Placement considers the game entity's Hitbox, TileRequirement and TerrainRequirement abilities for the placement location.

allow_rotation The player can cycle through the PerspectiveVariant variants of the game entity before placement.

aux.research.ResearchableTech

ResearchableTech(Entity):
    tech           : Tech
    cost           : Cost
    research_time  : float
    research_sound : Sound
    requirements   : set(AvailabilityRequirement)

Defines preconditions for researching a technology with the Research ability.

tech Reference to the Tech object that is researched.

cost Resource amount spent to intiate the research. Cancelling the research results in a refund of the spent resources.

research_time Time until the Tech object's patches are applied.

research_sound Sounds that are played when the research finishes.

requirements A set of requirements that unlock the technology for the researching game entity. Only one requirement needs to be fulfilled to trigger the unlock. If the set is empty, the technology is considered available from the start for the researching game entity.

aux.target_mode.TargetMode

TargetMode(Entity):

Generalization object for target modes used by projectiles.

aux.target_mode.type.CurrentPosition

CurrentPosition(TargetMode):

Makes the projectile path end at the current postion of the target when the projectile spawned.

aux.target_mode.type.ExpectedPosition

ExpectedPosition(TargetMode):

Makes the projectile path end at the postion where the target is expected to be when the projectile is supposed to hit it.

aux.trade_route.TradeRoute

TradeRoute(Entity):
    trade_resource    : Resource
    start_trade_post  : GameEntity
    end_trade_post    : GameEntity

Generalization object that defines a trade route between two game entities.

trade_resource Resource that is traded on this trade route. The traded amount depends on the trade route type.

start_trade_post The game entity where the traded resource is collected. The game entity must have a TradePost ability that contains this TradeRoute object.

end_trade_post The game entity the traded resource is delivered to. The game entity must have a TradePost ability that contains this TradeRoute object.

aux.trade_route.type.AoE1TradeRoute

AoE1TradeRoute(Entity):
    exchange_resources : set(Resource)
    trade_amount       : int

Uses Age of Empires 1 rules for trading.

exchange_resources The trading game entity exchanges trade_amount of a selected resource in this set by trade_amount of the resource defined by trade_resource.

trade_amount Amount of resources traded each time.

aux.trade_route.type.AoE2TradeRoute

AoE2TradeRoute(Entity):

Uses Age of Empires 2 rules for trading. The trading game entity chooses the nearest possible end_trade_post from the start_trade_post. Calculation of the traded resource amount is based on this formula:

trade_amount = 0.46 * tiles_distance * ((tiles_distance / map_size) + 0.3)

aux.storage.Container

Container(Entity):
    storage_elements : set(StorageElement)
    slots            : int
    carry_progress   : set(CarryProgress)

Used by the Storage ability to store definitions of how the stored game entities influence the storing game entity.

storage_elements Contains the definitions for handling stored game entities as StorageElement objects.

slots Defines how many slots for game entities the container has. Multiple game entities may be stacked in one slot depending on the elements_per_slot member in StorageElement.

carry_progress A set of CarryProgress objects that can activate state changes and animation overrides when the container is filled.

aux.storage.StorageElement

StorageElement(Entity):
    storage_element   : GameEntity
    elements_per_slot : int
    conflicts         : set(StorageElement)
    state_change      : StateChanger

Defines how a stored game entity influences its storing game entity.

storage_element The stored game entity to which this definition applies.

elements_per_slot Defines how many game entities of the type referenced in storage_element can be stacked in one slot.

conflicts A set of storage elements which cannot be in the container at the same time as this storage element.

state_change Alters the base abilities and modifiers of the storing game entity when at least one game entity of the type referenced in storage_element is present in the container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment