royitaqi / HollowKnight.GodhomeWinLossTracker

A mod for the game Hollow Knight. Goal is to improve boss fight training experience in Godhome by tracking per-boss win/loss counts for Hall of Gods and pantheons.
3 stars 1 forks source link

REF: how to curate boss attacks into damage sources (`BossGoNameToDamageSourceFsms` and `DamageSourceNameMap`) #86

Closed royitaqi closed 1 year ago

royitaqi commented 1 year ago

TL;DR

  1. Get the name of the current damage source.
  2. Decide if the damage source is a descendant of the boss GO or a separate GO.
    • [ ] Descendant
    • [ ] Separate
  3. Find the FSM state which either creates/clones the damage source GO or activates the damage source GO.

Get the name

Steps:

  1. Enter the fight. Take damage from boss attack.
  2. In mod log, look for the RawHit event. Note down the current damage source of that hit.

Notes:

Decide if descendant or separate

Steps:

  1. Enter the fight. When that attack happens, search in Unity Explorer's Object Explorer.

Find the FSM state

Steps:

  1. In AssetsViewer, search . "Global Search" -> "Asset Data" -> choose "Hollow Knight_Data" folder -> type string -> "By String".
  2. On the left side of the result window, identify which scene to use by looking up the scene ID in FSMView.
  3. On the right side of the result window, go through all assets and click on "Go to reference" to see their FSM name.
  4. Make sure this FSM is picked and setup for the boss. Look for "EnemyStateObserver: Setting up FSM for enemy HK" in log.
  5. If the current FSM is not the above noted, specify in BossGoNameToFsm to override.
  6. Enter the fight. Turn logging level to "Fine" by tapping "[" twice. Take damage from the same boss attack.
  7. In mod log, look for the RawHit event and the BossStateChange events around it. It should reveal what state is involved.