Scale difficulty by run position; wipe towers at phase end

Follow-up pass on the 2.0 refactor, closing the gap between "waves are drawn
at random" and "difficulty still lives in the enemy assets".

- Enemy health is no longer authored per enemy type. New EnemyScalingConfig
  scales a per-zone HP *budget* by encounter number; per-enemy health is that
  budget divided by the wave's enemy count. Scaling the total rather than the
  per-enemy value keeps enemy count a texture knob (few tanks vs many swarmers)
  instead of a second, uncontrolled difficulty axis. EnemyDefinition.MaxHp
  becomes HpMultiplier, a deviation around 1.0. Speed stays archetype-only and
  unscaled -- escalating it compounds with health and invalidates tower balance
  mid-run.
- GoldConfig entries no longer reference a WaveDefinition. Payout is a property
  of run position, not of which wave got drawn: WaveGoldEntry ->
  EncounterGoldEntry, Waves -> Encounters, keyed by global encounter number.
  Its inspector labels elements "Encounter N" and projects cumulative earnings.
- The wave's voted buffs now show as icon badges in the top bar, read from the
  same RunState slot the spawn path uses so the display can't drift from what
  the enemies actually carry. Hover names the buff; unillustrated cards fall
  back to a lettered badge rather than vanishing.
- Clearing a phase's boss destroys every built tower, unrefunded. Queued build
  jobs still refund -- those towers were never delivered. Runs with the field
  empty, so the walkability churn doesn't hit the re-path scheduler.
- Fixed an RPC codegen break: [ClientRpc] requires a ClientRpc suffix, unlike
  the newer [Rpc(SendTo...)] style this file doesn't use.
- Setup checklist reordered into dependency order; it previously asked for a
  RunDefinition two sections before creating one.

Also carries the editor-side asset reorganisation into Definitions/RunDefinitions
and the sprite move into Enemy/Player draft icon folders.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Matt F 2026-07-31 00:32:33 -07:00
parent 4892d7253d
commit 16706a1ecf
154 changed files with 2608 additions and 287 deletions

View file

@ -2307,7 +2307,10 @@ MonoBehaviour:
m_EditorClassIdentifier: Assembly-CSharp::TD.Gameplay.EnemyAbilities.EnemyAbilityPool
abilities:
- {fileID: 11400000, guid: 0305468bc8f912d429a8b20bf23f947c, type: 2}
noAbilityWeight: 100
- {fileID: 11400000, guid: 030f10c9a264e544ea3e0f4fdb4171bd, type: 2}
- {fileID: 11400000, guid: cb2ec6bb70f57d0429b99b7cd4c7db73, type: 2}
- {fileID: 11400000, guid: a18691a20d75f17479a83b3e171759e7, type: 2}
- {fileID: 11400000, guid: c64c7121b0456bb4a873acec9e0abf91, type: 2}
--- !u!4 &181002641
Transform:
m_ObjectHideFlags: 0
@ -13016,6 +13019,57 @@ BoxCollider:
serializedVersion: 3
m_Size: {x: 24, y: 1, z: 30}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &875833597
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 875833599}
- component: {fileID: 875833598}
m_Layer: 0
m_Name: EnemyUpgradePool
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &875833598
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 875833597}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c4d98a01d9b9a7b438a6f91b0b7f498f, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::TD.Gameplay.EnemyUpgrades.EnemyUpgradePool
options:
- {fileID: 11400000, guid: eef28ca7b8844504e9d75ff903a3bb61, type: 2}
- {fileID: 11400000, guid: 46e2a6a59c0a3034f9fa44681d9ba422, type: 2}
- {fileID: 11400000, guid: 80fb851b702ff304183cb6e89c4aa245, type: 2}
- {fileID: 11400000, guid: a67aa3644d2ad4847a47040f53fea26f, type: 2}
- {fileID: 11400000, guid: 37d761966a349ba4cb4141f913224d5c, type: 2}
- {fileID: 11400000, guid: f6bfb033a15b6d0419587b80a8286bd1, type: 2}
--- !u!4 &875833599
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 875833597}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 38.30481, y: 0.5, z: 155.93135}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &902199259
GameObject:
m_ObjectHideFlags: 0
@ -13942,6 +13996,78 @@ BoxCollider:
serializedVersion: 3
m_Size: {x: 17, y: 1, z: 13}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &961493951
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 961493954}
- component: {fileID: 961493952}
- component: {fileID: 961493953}
m_Layer: 0
m_Name: RunState
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &961493952
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 961493951}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Netcode.Runtime::Unity.Netcode.NetworkObject
GlobalObjectIdHash: 3660389945
InScenePlacedSourceGlobalObjectIdHash: 0
DeferredDespawnTick: 0
Ownership: 1
AlwaysReplicateAsRoot: 0
SynchronizeTransform: 1
ActiveSceneSynchronization: 0
SceneMigrationSynchronization: 0
SpawnWithObservers: 1
DontDestroyWithOwner: 0
AutoObjectParentSync: 1
SyncOwnerTransformWhenParented: 1
AllowOwnerToParent: 0
--- !u!114 &961493953
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 961493951}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a293cf6dca91dd2478c9f4e799cf9e0d, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::TD.Gameplay.Waves.RunState
ShowTopMostFoldoutHeaderGroup: 1
runDefinition: {fileID: 11400000, guid: 1bb81a966192c344d94cce2628c1832b, type: 2}
--- !u!4 &961493954
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 961493951}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 38.30481, y: 0.5, z: 155.93135}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &993870443
GameObject:
m_ObjectHideFlags: 0
@ -14522,6 +14648,7 @@ MonoBehaviour:
placementManager: {fileID: 1507514108}
cameraController: {fileID: 1239994223}
rejectionMessageDuration: 2.5
menuButtonIcon: {fileID: 0}
chatMaxHeight: 280
chatMaxMessages: 2147483647
chatSystemColor: {r: 1, g: 0.7, b: 0.2, a: 1}
@ -18307,19 +18434,11 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::TD.Gameplay.WaveManager
ShowTopMostFoldoutHeaderGroup: 1
waveDefinitions:
- {fileID: 11400000, guid: 65f66289ea1233b4897f46cd997d9c7a, type: 2}
- {fileID: 11400000, guid: 190e39db44aa0794aa808fd60976f7c4, type: 2}
- {fileID: 11400000, guid: 39921b44a1a0a56478200028940c5202, type: 2}
- {fileID: 11400000, guid: 50f498bc5bfc46e44b064cc96403e2cb, type: 2}
- {fileID: 11400000, guid: 9ee6dee12f0660844b4d46880f01c02f, type: 2}
- {fileID: 11400000, guid: 41231de63e8f25d448f19f3816e0c22f, type: 2}
- {fileID: 11400000, guid: 6290df178cbd3144aa92a0f09833a7be, type: 2}
- {fileID: 11400000, guid: 86736fd52c18fa84e8ced40f30b514fa, type: 2}
- {fileID: 11400000, guid: 8fdf53cfc405a5f41a00f376198b8d84, type: 2}
- {fileID: 11400000, guid: 4db677d2940202340841471f90a5b73a, type: 2}
startingLives: 40
draftTimeSeconds: 30
voteTimeSeconds: 25
goldConfig: {fileID: 11400000, guid: d5e01c919f14a1e4888ad494a159241b, type: 2}
enemyScalingConfig: {fileID: 11400000, guid: ae9fde0b564e20440ac2e20861fa1ca6, type: 2}
--- !u!43 &1393870843
Mesh:
m_ObjectHideFlags: 0
@ -20189,6 +20308,7 @@ MonoBehaviour:
- {fileID: 0}
- {fileID: 11400000, guid: d5b2e8fa3c7e9b5f4a1d0c2e7f6b3a91, type: 2}
- {fileID: 11400000, guid: 0f693e29ca953e1439e10cb8f12e4b30, type: 2}
- {fileID: 11400000, guid: 86d4c3ab00d4c654eb4c255280ee5701, type: 2}
- {fileID: 11400000, guid: 04219895bbea4fb9a94fd62fef35bf2a, type: 2}
- {fileID: 11400000, guid: e3f1a9c2b5d84e76a0c3f1e8d27b4905, type: 2}
startingDeck:
@ -22897,6 +23017,7 @@ MonoBehaviour:
m_EditorClassIdentifier: Assembly-CSharp::TD.Dev.DevWaveControls
hotkey: 94
grantTowerHotkey: 101
skipToBossHotkey: 100
--- !u!4 &1731269687
Transform:
m_ObjectHideFlags: 0
@ -27956,6 +28077,78 @@ Mesh:
- serializedVersion: 1
m_IndexStart: 0
m_IndexCount: 0
--- !u!1 &2021000666
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2021000669}
- component: {fileID: 2021000667}
- component: {fileID: 2021000668}
m_Layer: 0
m_Name: WaveVote
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &2021000667
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2021000666}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Netcode.Runtime::Unity.Netcode.NetworkObject
GlobalObjectIdHash: 3520766009
InScenePlacedSourceGlobalObjectIdHash: 0
DeferredDespawnTick: 0
Ownership: 1
AlwaysReplicateAsRoot: 0
SynchronizeTransform: 1
ActiveSceneSynchronization: 0
SceneMigrationSynchronization: 0
SpawnWithObservers: 1
DontDestroyWithOwner: 0
AutoObjectParentSync: 1
SyncOwnerTransformWhenParented: 1
AllowOwnerToParent: 0
--- !u!114 &2021000668
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2021000666}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a18321dc2d138034fbdb5f705f19f893, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::TD.Gameplay.EnemyUpgrades.WaveVote
ShowTopMostFoldoutHeaderGroup: 1
optionsPerVote: 3
--- !u!4 &2021000669
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2021000666}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 38.30481, y: 0.5, z: 155.93135}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!43 &2024389666
Mesh:
m_ObjectHideFlags: 0
@ -28831,6 +29024,7 @@ MonoBehaviour:
options:
- {fileID: 11400000, guid: 6b1d3f8a2c5e4097b8a1d0c3e6f9b240, type: 2}
- {fileID: 11400000, guid: f4a2b8d1c6e93f05a7b2d4c8e1f6a930, type: 2}
- {fileID: 11400000, guid: 0b9f4905752751f44b9959b84b620266, type: 2}
- {fileID: 11400000, guid: 65ff25c1c8a89f7df8e88f71968c1c98, type: 2}
- {fileID: 11400000, guid: 5f390de69ba43b2a6a0d89cf09580320, type: 2}
- {fileID: 11400000, guid: 29b35841f7e5db454903798cb5d83434, type: 2}
@ -29237,3 +29431,6 @@ SceneRoots:
- {fileID: 759470735}
- {fileID: 954434161}
- {fileID: 181002641}
- {fileID: 961493954}
- {fileID: 2021000669}
- {fileID: 875833599}