QUICK_START_GUIDE.txt 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. ╔═══════════════════════════════════════════════════════════════════════════════╗
  2. ║ 🎮 RESPAWN SYSTEM - QUICK START GUIDE 🎮 ║
  3. ║ Get Running in 5 Minutes! ║
  4. ╚═══════════════════════════════════════════════════════════════════════════════╝
  5. 📍 STEP 1: CREATE 3 GAMEOBJECTS IN YOUR SCENE
  6. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  7. In Unity Hierarchy, RIGHT-CLICK → Create Empty:
  8. ┌─────────────────────────────────────────────────────────────────────────────┐
  9. │ GameObject #1: "GameManager" │
  10. ├─────────────────────────────────────────────────────────────────────────────┤
  11. │ 1. Create Empty GameObject │
  12. │ 2. Rename to "GameManager" │
  13. │ 3. Add Component → GameManager.cs │
  14. │ 4. In Inspector, assign these references: │
  15. │ • Cohesion Manager: [Drag from scene] │
  16. │ • Checkpoint System: [Drag CheckpointSystem GameObject] │
  17. │ • Death Screen UI: [Drag DeathScreenUI GameObject] │
  18. │ • Player Movement: [Drag Player → GridMovement component] │
  19. │ │
  20. │ 5. Leave settings at defaults (or customize): │
  21. │ • Death Delay: 2 │
  22. │ • Respawn Fade Time: 1 │
  23. │ • Reset Monsters On Respawn: ☐ (unchecked) │
  24. └─────────────────────────────────────────────────────────────────────────────┘
  25. ┌─────────────────────────────────────────────────────────────────────────────┐
  26. │ GameObject #2: "CheckpointSystem" │
  27. ├─────────────────────────────────────────────────────────────────────────────┤
  28. │ 1. Create Empty GameObject │
  29. │ 2. Rename to "CheckpointSystem" │
  30. │ 3. Add Component → CheckpointSystem.cs │
  31. │ 4. In Inspector, assign: │
  32. │ • Cohesion Manager: [Drag from scene] │
  33. │ • Player Transform: [Drag Player GameObject] │
  34. │ • Player Movement: [Drag Player → GridMovement component] │
  35. │ │
  36. │ 5. Settings (defaults are fine): │
  37. │ • Auto Save On Checkpoint: ☑ (checked) │
  38. │ • Checkpoint Radius: 3 │
  39. └─────────────────────────────────────────────────────────────────────────────┘
  40. ┌─────────────────────────────────────────────────────────────────────────────┐
  41. │ GameObject #3: "DeathScreenUI" │
  42. ├─────────────────────────────────────────────────────────────────────────────┤
  43. │ 1. Create Empty GameObject │
  44. │ 2. Rename to "DeathScreenUI" │
  45. │ 3. Add Component → DeathScreenUI.cs │
  46. │ 4. NO REFERENCES NEEDED! (Auto-creates UI) │
  47. │ │
  48. │ 5. Optional: Customize death messages in Inspector array │
  49. └─────────────────────────────────────────────────────────────────────────────┘
  50. 📍 STEP 2: ENSURE PLAYER HAS CORRECT TAG
  51. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  52. ┌─────────────────────────────────────────────────────────────────────────────┐
  53. │ ⚠️ CRITICAL: Player GameObject MUST have "Player" tag │
  54. ├─────────────────────────────────────────────────────────────────────────────┤
  55. │ 1. Select your Player GameObject in Hierarchy │
  56. │ 2. In Inspector, find "Tag" dropdown at the top │
  57. │ 3. Select "Player" from dropdown │
  58. │ │
  59. │ If "Player" tag doesn't exist: │
  60. │ 1. Click "Add Tag..." │
  61. │ 2. Click "+" button │
  62. │ 3. Type "Player" │
  63. │ 4. Go back to Player GameObject and assign the tag │
  64. └─────────────────────────────────────────────────────────────────────────────┘
  65. 📍 STEP 3: ADD TEST TOOL (OPTIONAL BUT RECOMMENDED)
  66. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  67. ┌─────────────────────────────────────────────────────────────────────────────┐
  68. │ Testing Tool: RespawnSystemTester.cs │
  69. ├─────────────────────────────────────────────────────────────────────────────┤
  70. │ 1. Select ANY GameObject in your scene (or create "TestTools") │
  71. │ 2. Add Component → RespawnSystemTester.cs │
  72. │ 3. References auto-find themselves! │
  73. │ │
  74. │ Now you can test with keyboard: │
  75. │ • Press K = Kill all party members │
  76. │ • Press H = Damage party by 20 HP │
  77. │ • Press P = Save checkpoint │
  78. │ • Press R = Force respawn │
  79. │ • Press F1 = Toggle debug UI │
  80. └─────────────────────────────────────────────────────────────────────────────┘
  81. 📍 STEP 4: TEST IT!
  82. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  83. ┌─────────────────────────────────────────────────────────────────────────────┐
  84. │ Testing Sequence │
  85. ├─────────────────────────────────────────────────────────────────────────────┤
  86. │ 1. Press PLAY in Unity │
  87. │ 2. Wait 2-3 seconds (initial checkpoint saves automatically) │
  88. │ 3. Check Console for: "[GameInitializer] Initial checkpoint saved" │
  89. │ 4. Press K key to kill party (or let monsters kill you) │
  90. │ 5. Watch the sequence: │
  91. │ → Screen fades to black │
  92. │ → Death screen appears │
  93. │ → "RESPAWN" button shows │
  94. │ 6. Click RESPAWN button │
  95. │ 7. Party respawns at starting position, fully healed! │
  96. │ │
  97. │ ✅ If this works, your system is fully operational! │
  98. └─────────────────────────────────────────────────────────────────────────────┘
  99. 📍 OPTIONAL: ADD CHECKPOINT ZONES
  100. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  101. ┌─────────────────────────────────────────────────────────────────────────────┐
  102. │ Create Checkpoint Trigger Zones │
  103. ├─────────────────────────────────────────────────────────────────────────────┤
  104. │ 1. Create Empty GameObject at checkpoint location │
  105. │ 2. Name it "Checkpoint_Entrance" (or descriptive name) │
  106. │ 3. Add Component → Box Collider │
  107. │ • Mark "Is Trigger" checkbox │
  108. │ • Set Size: X=5, Y=3, Z=5 (or as needed) │
  109. │ 4. Add Component → CheckpointTrigger.cs │
  110. │ 5. Configure in Inspector: │
  111. │ • Show Visual Feedback: ☑ │
  112. │ • One Time Use: ☑ │
  113. │ • Checkpoint Message: "Safe Zone Reached" │
  114. │ │
  115. │ Yellow wireframe cube shows checkpoint location in Scene view! │
  116. │ │
  117. │ Create multiple checkpoints throughout your dungeon! │
  118. └─────────────────────────────────────────────────────────────────────────────┘
  119. 📋 FINAL CHECKLIST
  120. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  121. Before Playing:
  122. ☐ GameManager GameObject exists with script attached
  123. ☐ CheckpointSystem GameObject exists with script attached
  124. ☐ DeathScreenUI GameObject exists with script attached
  125. ☐ All references assigned in GameManager Inspector
  126. ☐ All references assigned in CheckpointSystem Inspector
  127. ☐ Player GameObject has "Player" tag
  128. ☐ RespawnSystemTester added (optional)
  129. ☐ Console shows no errors
  130. Testing Works When:
  131. ☐ Pressing K kills all party members
  132. ☐ Death screen appears after 2 seconds
  133. ☐ Screen fades to black smoothly
  134. ☐ Respawn button is clickable
  135. ☐ Party respawns at checkpoint with full HP
  136. ☐ All character UI cards recreated
  137. ☐ Player can move again after respawn
  138. 🎯 YOUR SCENE HIERARCHY SHOULD LOOK LIKE:
  139. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  140. Scene
  141. ├── 🎮 GameManager ← GameManager.cs
  142. ├── 💾 CheckpointSystem ← CheckpointSystem.cs
  143. ├── 💀 DeathScreenUI ← DeathScreenUI.cs
  144. ├── 🧪 TestTools ← RespawnSystemTester.cs (optional)
  145. ├── 🏃 Player
  146. │ ├── GridMovement
  147. │ └── [Other components]
  148. ├── 👥 TeamCohesionManager
  149. ├── 🎨 Canvas
  150. │ └── PartyUIManager
  151. ├── 🏰 Dungeon
  152. │ ├── 📍 Checkpoint_Entrance ← CheckpointTrigger.cs (optional)
  153. │ ├── 📍 Checkpoint_MidLevel ← CheckpointTrigger.cs (optional)
  154. │ └── 📍 Checkpoint_Boss ← CheckpointTrigger.cs (optional)
  155. └── 👹 Monsters
  156. 🐛 TROUBLESHOOTING
  157. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  158. ❌ Problem: Death screen doesn't appear
  159. ✅ Solution:
  160. • Check GameManager exists in scene
  161. • Verify all references assigned in Inspector
  162. • Look for "[GameManager]" errors in Console
  163. ❌ Problem: Party doesn't respawn
  164. ✅ Solution:
  165. • Wait 2+ seconds after game starts (for initial checkpoint)
  166. • Check Console for "Initial checkpoint saved" message
  167. • Verify CheckpointSystem is in scene
  168. ❌ Problem: Checkpoints don't trigger
  169. ✅ Solution:
  170. • Ensure Player has "Player" tag
  171. • Check BoxCollider "Is Trigger" is checked
  172. • Make collider larger (5x3x5 recommended)
  173. ❌ Problem: References missing in Inspector
  174. ✅ Solution:
  175. • Make sure all GameObjects exist in scene
  176. • Drag from Hierarchy into Inspector slots
  177. • Don't use prefabs, use scene instances
  178. ❌ Problem: Console shows errors
  179. ✅ Solution:
  180. • Read error message (prefixed with system name)
  181. • Check all scripts compiled successfully
  182. • Verify GameObject names match exactly:
  183. "GameManager", "CheckpointSystem", "DeathScreenUI"
  184. 🎓 HOW IT WORKS (SIMPLE EXPLANATION)
  185. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  186. 1. CHARACTER DIES → HP = 0
  187. 2. UI CARD REMOVED
  188. 3. SYSTEM CHECKS: "All dead?"
  189. 4. YES → FADE TO BLACK
  190. 5. SHOW DEATH SCREEN
  191. 6. PLAYER CLICKS RESPAWN
  192. 7. LOAD LAST CHECKPOINT
  193. 8. RESTORE PARTY (Full HP/Stamina)
  194. 9. RECREATE UI
  195. 10. FADE IN → PLAY!
  196. 💡 TIPS
  197. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  198. • Initial checkpoint saves 2 seconds after game start
  199. • Respawn always restores full HP/stamina/mana
  200. • No items lost on death (simple mode)
  201. • You can add multiple checkpoint zones
  202. • Test with RespawnSystemTester before real gameplay
  203. • All Console logs prefixed with system name for filtering
  204. 📚 DOCUMENTATION
  205. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  206. For detailed information, see:
  207. 📄 RESPAWN_SYSTEM_SETUP.md - Complete setup guide
  208. 📄 RESPAWN_SYSTEM_SUMMARY.txt - Feature overview
  209. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  210. That's it! Your respawn system is ready! 🎉
  211. Time to implement: ~5 minutes
  212. Complexity: Simple
  213. Impact: Huge player experience improvement!
  214. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━