architecture-patterns.yaml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. # Architecture Patterns - Common patterns identified from game design requirements
  2. # Used during Step 4 (decisions) to match GDD keywords to architectural needs
  3. #
  4. # ⚠️ CRITICAL: All version/feature info MUST be verified via WebSearch during workflow
  5. # This file only provides: triggers, relationships, and pattern identification logic
  6. requirement_patterns:
  7. realtime_multiplayer:
  8. triggers:
  9. - "real-time multiplayer"
  10. - "online multiplayer"
  11. - "networked gameplay"
  12. - "PvP"
  13. - "co-op"
  14. - "competitive"
  15. - "synchronous multiplayer"
  16. decisions_needed:
  17. - networking_model
  18. - netcode_solution
  19. - server_authority
  20. - state_synchronization
  21. - lag_compensation
  22. - matchmaking
  23. suggested_stack:
  24. - "Dedicated servers or relay for authoritative gameplay"
  25. - "Client-side prediction with server reconciliation"
  26. - "UDP-based transport (ENet, LiteNetLib, or engine-native)"
  27. - "Matchmaking service (engine-native, PlayFab, or custom)"
  28. turn_based_multiplayer:
  29. triggers:
  30. - "turn-based"
  31. - "asynchronous multiplayer"
  32. - "hotseat"
  33. - "play-by-mail"
  34. - "card game"
  35. - "board game"
  36. decisions_needed:
  37. - session_persistence
  38. - turn_validation
  39. - game_state_storage
  40. - player_notification
  41. - reconnection_handling
  42. suggested_stack:
  43. - "REST or WebSocket API for turn submission"
  44. - "Server-side turn validation and state management"
  45. - "Database-backed game state (SQLite, PostgreSQL, or cloud)"
  46. - "Push notifications for turn alerts"
  47. physics_simulation:
  48. triggers:
  49. - "physics"
  50. - "rigid body"
  51. - "collision"
  52. - "ragdoll"
  53. - "destruction"
  54. - "vehicle simulation"
  55. - "fluid simulation"
  56. decisions_needed:
  57. - physics_engine
  58. - simulation_fidelity
  59. - determinism_requirements
  60. - collision_layer_strategy
  61. - physics_tick_rate
  62. suggested_stack:
  63. - "Engine-native physics (PhysX, Jolt, Godot Physics)"
  64. - "Fixed timestep simulation decoupled from rendering"
  65. - "Collision layer matrix for performance"
  66. - "Physics materials system for surface interactions"
  67. procedural_generation:
  68. triggers:
  69. - "procedural"
  70. - "randomly generated"
  71. - "roguelike"
  72. - "roguelite"
  73. - "infinite terrain"
  74. - "wave function collapse"
  75. - "dungeon generation"
  76. - "world generation"
  77. decisions_needed:
  78. - generation_algorithm
  79. - seed_management
  80. - chunk_streaming
  81. - content_validation
  82. - generation_pipeline
  83. suggested_stack:
  84. - "Seeded PRNG for reproducibility"
  85. - "Chunk-based or room-based generation depending on scope"
  86. - "Constraint-based validation passes"
  87. - "Async generation with loading strategies"
  88. rpg_systems:
  89. triggers:
  90. - "RPG"
  91. - "character stats"
  92. - "inventory"
  93. - "skill tree"
  94. - "leveling"
  95. - "experience points"
  96. - "equipment"
  97. - "loot"
  98. - "crafting"
  99. decisions_needed:
  100. - stat_system_design
  101. - inventory_architecture
  102. - progression_model
  103. - save_data_schema
  104. - effect_and_buff_system
  105. suggested_stack:
  106. - "Data-driven stat and item definitions (JSON, YAML, or ScriptableObjects)"
  107. - "Component or ECS-based character system"
  108. - "Serializable save system with versioning"
  109. - "Observer pattern for stat change propagation"
  110. platformer_mechanics:
  111. triggers:
  112. - "platformer"
  113. - "2D physics"
  114. - "jumping"
  115. - "side-scrolling"
  116. - "metroidvania"
  117. - "precision movement"
  118. decisions_needed:
  119. - character_controller_type
  120. - camera_system
  121. - level_design_tools
  122. - animation_system
  123. - input_buffering
  124. suggested_stack:
  125. - "Custom character controller (not physics-driven rigidbody)"
  126. - "Coyote time and input buffering for feel"
  127. - "Tilemap or modular level construction"
  128. - "State machine for character states"
  129. strategy_rts:
  130. triggers:
  131. - "strategy"
  132. - "RTS"
  133. - "4X"
  134. - "base building"
  135. - "unit management"
  136. - "resource management"
  137. - "fog of war"
  138. - "tower defense"
  139. decisions_needed:
  140. - pathfinding_solution
  141. - unit_selection_system
  142. - ai_architecture
  143. - fog_of_war_approach
  144. - resource_economy_model
  145. suggested_stack:
  146. - "A* or flow field pathfinding depending on unit count"
  147. - "Spatial partitioning for unit queries (quadtree, spatial hash)"
  148. - "Command pattern for unit orders"
  149. - "ECS or data-oriented design for large unit counts"
  150. puzzle_mechanics:
  151. triggers:
  152. - "puzzle"
  153. - "logic game"
  154. - "match-3"
  155. - "word game"
  156. - "brain teaser"
  157. - "sokoban"
  158. decisions_needed:
  159. - puzzle_state_representation
  160. - undo_redo_system
  161. - hint_system
  162. - difficulty_progression
  163. - solution_validation
  164. suggested_stack:
  165. - "Immutable state snapshots for undo/redo"
  166. - "Rule engine for move validation"
  167. - "Data-driven puzzle definitions"
  168. - "Analytics-informed difficulty tuning"
  169. open_world:
  170. triggers:
  171. - "open world"
  172. - "sandbox"
  173. - "seamless world"
  174. - "large map"
  175. - "exploration"
  176. - "survival"
  177. - "crafting"
  178. decisions_needed:
  179. - world_streaming
  180. - lod_strategy
  181. - persistence_model
  182. - ai_budget_management
  183. - day_night_cycle
  184. suggested_stack:
  185. - "Chunk-based world streaming with async loading"
  186. - "Multi-level LOD for terrain, objects, and AI"
  187. - "Zone-based save system with dirty tracking"
  188. - "Spatial partitioning for active entity management"
  189. narrative_driven:
  190. triggers:
  191. - "story"
  192. - "dialogue"
  193. - "branching narrative"
  194. - "visual novel"
  195. - "quest system"
  196. - "cutscenes"
  197. - "choices matter"
  198. decisions_needed:
  199. - dialogue_system
  200. - narrative_scripting_tool
  201. - quest_tracking
  202. - branching_logic
  203. - localization_pipeline
  204. suggested_stack:
  205. - "Dialogue graph tool (Yarn Spinner, Ink, or custom)"
  206. - "Event-driven quest state machine"
  207. - "Flag/variable system for world state tracking"
  208. - "Localization table with string keys"
  209. mobile_casual:
  210. triggers:
  211. - "mobile"
  212. - "casual"
  213. - "free-to-play"
  214. - "F2P"
  215. - "hyper-casual"
  216. - "idle game"
  217. - "touch controls"
  218. decisions_needed:
  219. - monetization_model
  220. - session_design
  221. - save_and_sync
  222. - performance_budget
  223. - input_abstraction
  224. suggested_stack:
  225. - "Lightweight engine or framework (Unity Mobile, Godot, or custom)"
  226. - "Cloud save with offline-first design"
  227. - "Ad mediation SDK and IAP integration"
  228. - "Aggressive memory and draw call budgeting"
  229. vr_xr:
  230. triggers:
  231. - "VR"
  232. - "virtual reality"
  233. - "AR"
  234. - "augmented reality"
  235. - "XR"
  236. - "mixed reality"
  237. - "motion controls"
  238. - "room-scale"
  239. decisions_needed:
  240. - xr_runtime
  241. - interaction_system
  242. - locomotion_method
  243. - comfort_settings
  244. - performance_target
  245. suggested_stack:
  246. - "OpenXR for cross-platform headset support"
  247. - "Engine XR toolkit (XR Interaction Toolkit, XR Tools)"
  248. - "Fixed foveated rendering and LOD for performance"
  249. - "Comfort options (vignette, snap turn, teleport)"
  250. fighting_action:
  251. triggers:
  252. - "fighting game"
  253. - "action combat"
  254. - "combo system"
  255. - "hitbox"
  256. - "frame data"
  257. - "hack and slash"
  258. - "beat-em-up"
  259. decisions_needed:
  260. - combat_system_architecture
  261. - hitbox_hurtbox_system
  262. - animation_canceling
  263. - frame_data_model
  264. - input_handling
  265. suggested_stack:
  266. - "Frame-based combat state machine"
  267. - "Data-driven hitbox/hurtbox definitions"
  268. - "Input buffer with command parsing"
  269. - "Deterministic simulation for rollback netcode"
  270. racing_vehicle:
  271. triggers:
  272. - "racing"
  273. - "driving"
  274. - "vehicle physics"
  275. - "kart"
  276. - "flight sim"
  277. - "space sim"
  278. decisions_needed:
  279. - vehicle_physics_model
  280. - track_design_tools
  281. - camera_system
  282. - ai_racing_line
  283. - replay_system
  284. suggested_stack:
  285. - "Custom vehicle physics or engine-provided vehicle controller"
  286. - "Spline-based track and AI path definition"
  287. - "Ghost replay via input or transform recording"
  288. - "Multiple camera modes (chase, cockpit, replay)"
  289. # Quality attribute patterns
  290. quality_attributes:
  291. high_framerate:
  292. triggers:
  293. - "60 FPS"
  294. - "120 FPS"
  295. - "low latency"
  296. - "performance critical"
  297. - "competitive"
  298. - "VR"
  299. architectural_needs:
  300. - frame_budget_allocation
  301. - profiling_pipeline
  302. - object_pooling
  303. - batching_strategy
  304. - gc_pressure_management
  305. cross_platform:
  306. triggers:
  307. - "cross-platform"
  308. - "PC and console"
  309. - "mobile and desktop"
  310. - "multi-platform"
  311. - "Nintendo Switch"
  312. - "Steam Deck"
  313. architectural_needs:
  314. - input_abstraction_layer
  315. - resolution_scaling
  316. - platform_capability_detection
  317. - build_pipeline_per_platform
  318. - platform_specific_apis
  319. scalable_multiplayer:
  320. triggers:
  321. - "MMO"
  322. - "hundreds of players"
  323. - "massively multiplayer"
  324. - "persistent world"
  325. - "server scaling"
  326. architectural_needs:
  327. - server_fleet_management
  328. - interest_management
  329. - database_sharding
  330. - zone_instancing
  331. - load_balancing
  332. mod_support:
  333. triggers:
  334. - "modding"
  335. - "user-generated content"
  336. - "UGC"
  337. - "mod support"
  338. - "workshop"
  339. - "custom content"
  340. architectural_needs:
  341. - data_driven_architecture
  342. - asset_loading_abstraction
  343. - scripting_api
  344. - sandboxed_execution
  345. - content_validation
  346. accessibility:
  347. triggers:
  348. - "accessibility"
  349. - "colorblind"
  350. - "subtitles"
  351. - "remappable controls"
  352. - "difficulty options"
  353. - "assist mode"
  354. architectural_needs:
  355. - input_remapping_system
  356. - text_scaling_and_narration
  357. - color_palette_alternatives
  358. - difficulty_modifier_system
  359. - settings_persistence
  360. # Game service integration patterns
  361. integration_requirements:
  362. player_services:
  363. common_choices:
  364. - "Steam API - PC standard (achievements, leaderboards, matchmaking)"
  365. - "PlayFab - cross-platform backend services"
  366. - "Epic Online Services - free cross-platform (auth, lobbies, voice)"
  367. - "GameSparks or AccelByte - full-featured game backend"
  368. - "Engine-native (Unity Gaming Services, Unreal Online Subsystem)"
  369. considerations:
  370. - platform_requirements
  371. - cross_platform_needs
  372. - cost_at_scale
  373. - feature_completeness
  374. monetization:
  375. common_choices:
  376. - "Steam IAP - PC purchases and DLC"
  377. - "Platform stores - console-mandated (PSN, Xbox, Nintendo)"
  378. - "Unity IAP or Godot IAP plugins - mobile"
  379. - "Custom storefront - web-based games"
  380. considerations:
  381. - platform_revenue_share
  382. - regional_pricing
  383. - refund_policies
  384. - receipt_validation
  385. analytics_telemetry:
  386. common_choices:
  387. - "Unity Analytics or Unreal Insights - engine-native"
  388. - "GameAnalytics - free tier, game-focused"
  389. - "Amplitude or Mixpanel - product analytics"
  390. - "Custom telemetry with time-series database"
  391. considerations:
  392. - privacy_compliance
  393. - data_granularity
  394. - real_time_vs_batch
  395. - cost_per_event
  396. voice_chat:
  397. common_choices:
  398. - "Vivox - industry standard (Unity/Unreal integration)"
  399. - "Discord SDK - community-focused"
  400. - "Photon Voice - Photon ecosystem"
  401. - "Epic Online Services voice"
  402. considerations:
  403. - platform_compatibility
  404. - spatial_audio_support
  405. - moderation_tools
  406. - bandwidth_overhead
  407. cloud_saves:
  408. common_choices:
  409. - "Steam Cloud - PC standard"
  410. - "Platform cloud (PSN, Xbox, iCloud)"
  411. - "PlayFab or custom backend - cross-platform"
  412. - "Engine services (Unity Cloud Save)"
  413. considerations:
  414. - conflict_resolution
  415. - save_size_limits
  416. - offline_support
  417. - migration_between_versions
  418. anti_cheat:
  419. common_choices:
  420. - "Easy Anti-Cheat - widely adopted, free for some engines"
  421. - "BattlEye - AAA standard"
  422. - "Custom server authority - indie/small scale"
  423. - "VAC - Steam-integrated"
  424. considerations:
  425. - server_authority_level
  426. - client_trust_model
  427. - performance_impact
  428. - platform_support
  429. # Decision heuristics
  430. decision_rules:
  431. engine_selection:
  432. if_requirements_include:
  433. - 3d_high_fidelity: "Unreal Engine"
  434. - 2d_focused: "Godot or Unity"
  435. - cross_platform_mobile: "Unity or Godot"
  436. - open_source_priority: "Godot"
  437. - aaa_pipeline: "Unreal Engine"
  438. - rapid_prototype: "Godot"
  439. - web_browser_target: "Godot (HTML5), Phaser, or PlayCanvas"
  440. - vr_xr: "Unity (XR Toolkit) or Unreal (OpenXR)"
  441. - roblox_platform_target: "Roblox Studio — platform handles deployment, networking, and avatar system"
  442. networking_model:
  443. if_requirements_include:
  444. - competitive_pvp: "Dedicated servers with rollback or server reconciliation"
  445. - cooperative_pve: "Host-migration capable peer-to-peer or listen servers"
  446. - turn_based: "Client-server REST/WebSocket with authoritative state"
  447. - mmo_scale: "Dedicated server fleet with spatial partitioning"
  448. - local_multiplayer: "Shared-screen input splitting (no networking)"
  449. physics_solution:
  450. if_requirements_include:
  451. - standard_3d: "Engine-native physics (PhysX, Jolt, Godot 3D)"
  452. - deterministic_required: "Custom fixed-point or deterministic physics library"
  453. - 2d_platformer: "Custom character controller with raycasts"
  454. - vehicle_sim: "Specialized vehicle physics (engine-provided or custom)"
  455. - destruction: "Engine destructibles or Chaos (Unreal) / custom solution"
  456. audio_solution:
  457. if_requirements_include:
  458. - simple_sfx: "Engine-native audio system"
  459. - adaptive_music: "FMOD or Wwise middleware"
  460. - spatial_3d_audio: "Engine spatial audio or middleware (Wwise Spatial)"
  461. - large_sound_library: "FMOD or Wwise for memory management and streaming"
  462. - procedural_audio: "Custom DSP or middleware with scripting"
  463. ai_approach:
  464. if_requirements_include:
  465. - simple_enemies: "Finite state machines"
  466. - complex_behaviors: "Behavior trees"
  467. - emergent_ai: "Utility AI or GOAP (Goal-Oriented Action Planning)"
  468. - large_scale_rts: "Hierarchical AI with strategic and tactical layers"
  469. - companion_npcs: "Behavior trees with context awareness"
  470. - open_world_npcs: "Scheduler-based AI with daily routines"
  471. save_system:
  472. if_requirements_include:
  473. - simple_progress: "Key-value storage (PlayerPrefs, config files)"
  474. - complex_world_state: "Serialized scene graph with versioned schema"
  475. - cloud_sync: "Platform cloud saves with local fallback"
  476. - roguelike_runs: "Run state snapshot with permadeath logic"
  477. - sandbox_world: "Chunk-based world serialization"