Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to add more damage types #103

Open
jdrueckert opened this issue Apr 30, 2023 · 1 comment
Open

Document how to add more damage types #103

jdrueckert opened this issue Apr 30, 2023 · 1 comment
Labels
Category: Doc Requests, Issues and Changes targeting javadoc and module documentation Good First Issue Good for learners that are new to Terasology Type: Improvement Request for or addition/enhancement of a feature

Comments

@jdrueckert
Copy link
Member

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?

@jdrueckert jdrueckert added Type: Improvement Request for or addition/enhancement of a feature Good First Issue Good for learners that are new to Terasology Category: Doc Requests, Issues and Changes targeting javadoc and module documentation labels Apr 30, 2023
@skaldarnar
Copy link
Contributor

skaldarnar commented Jul 1, 2023

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:

  • BlockDamageModifierComponent
  • DamageSoundComponent

In the engine, the following damage types are defined:

  • direct in directDamage.prefab
  • physical in physicalDamage.prefab
  • explosive in explosiveDamage.prefab
  • drowning in drowningDamage.prefab
  • healing in healingDamage.prefab
  • support removed in supportRemovedDamage.prefab

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

  • DIRECT
  • PHYSICAL
  • EXPLOSIVE
  • DROWNING
  • HEALING

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'
  • physical damage
    • used when destroying block-like entities due to attack by a character (CharacterSystem.java)
    • hitting with an item deals phyiscal damage (itemBase.prefab)
    • (referenced in explosiveDamage.prefab)
  • support removed damage
    • used when destroying a block due to missing structural support (for instance, torches) (BlockStructuralSupportSystem.java)
    • used when destroying a block due to missing structural support (SideBlockSupportRequired.java)
      • why do we have this in two places?

I propose to:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Doc Requests, Issues and Changes targeting javadoc and module documentation Good First Issue Good for learners that are new to Terasology Type: Improvement Request for or addition/enhancement of a feature
Projects
None yet
Development

No branches or pull requests

2 participants