Terasology / Health

Health Module for providing Health and related events
https://terasology.github.io/Health/
0 stars 14 forks source link

Document how to add more damage types #103

Open jdrueckert opened 1 year ago

jdrueckert commented 1 year ago

Context

The Health module doc mentions the DamageResistComponent that allows configuring damage types an entity will not be damaged by. Most basic damage types are provided by the Terasology engine code base. There is a minor note on damage types in the Asset System Tutorial. Like all other prefabs, damage types can be modified on module level using Deltas & Overrides. New damage types can further be provided as module assets.

Task

Extend the module docs with information on how to add more damage types.

Open Questions

Should this information be in module-level docs or rather in the engine wiki and only linked to in the Health module docs?

skaldarnar commented 1 year ago

This goes beyond the task of updating the module docs here, but I believe this is the best place to drop my notes:


org.terasology.engine.logic.health

Binary "health" system to allow for entities to be destroyed.

Damage types are defined as prefabs. The minimal definition is a prefab with the empty object {}.

Components commonly found in damage type prefabs include:

In the engine, the following damage types are defined:

A subset of these damage types is part of the EngineDamageTypes enumeration:

From these 6 damage types, only 2 damage types are used or referenced in the engine itself.

git grep -e PHYSICAL --or -e engine:physicalDamage \
  -- ':!engine/src/main/java/org/terasology/engine/logic/health/EngineDamageTypes.java'

I propose to: