Entity

In ICE, there is no distinction between game objects of different types; i.e. there’s no “ship” or “projectile” object type. Instead, every object consists of various components which can be combined to create different kinds of objects. Game objects in ICE are called entities. An entity might be a ship, a static obstacle, a projectile, an explosion fragment or something else; the combination of components determines behavior and attributes of the entity.

Entities are defined in YAML files. An entity definition is a mapping of component names and their contents. All entity data is in components; even data such as the position (physics) or graphics (visual). Each component type is optional. Under the hood, some components might cause different components to be added; E.g. a weapon component adds a spawner component if it’s not already in the entity definition.

Example (a ship entity):

visual: visual/turtle.yaml
engine:
  maxSpeed: 350
  acceleration: 5000
volume:
  aabbox:
    min: [-4, 0]
    max: [4, 12]
weapon:
  0: weapons/lightPlasma.yaml
collidable:
health: 15
warhead:
  damage: 10
  killsEntity: true
dumbScript: dumbscripts/zigzag.yaml
score:
  exp: 30
spawner:
  - entity: explosions/deathBase.yaml
    condition: death
    components:
      visual: visual/turtle.yaml
      physics:
        position: [0, 0]
  - entity: explosions/spiralSmall.yaml
    condition: death
    components:
      physics:
        position: [0, 0]
        rotation: 0.0

This entity has a number of components:

This is only a small subset of components in ICE. Other components might be useful for entities representing different concepts (e.g. projectiles) or to create ships with different abilities. Various combinations of components can lead to interesting, sometimes unexpected results; experimenting might pay off. In-depth documentation of each component type can be found in the modding reference.