Project Document
1. Project Overview
Core Concept: A hybrid shop-management, town-defense, and action-RPG roguelite. You play as an out-of-town traveler who inherits an abandoned blacksmith shop. Through a strict 7-day cycle, you must balance economic management, crafting, political alliances, and combat survival.
Engine: Unity (2022 LTS or newer recommended)
Perspective: 3D Isometric or 2D Top-Down (adaptable)
Core Loop: Craft & Trade (Mon-Fri) ➔ Survive the Raid (Fri Night) ➔ Dungeon Crawl (Sat-Sun) ➔ Die ➔ Inherit & Repeat.
2. Core Gameplay Loop (The 7-Day Cycle)
Monday – Friday: The Forge (Management / Crafting)
- Mechanic: Resource management and crafting mini-games/systems.
- Economy: Buy raw materials from passing random event traders or the local village market.
- The Mayor's Dilemma (Risk vs. Reward): * The Mayor requests weapon shipments for the town guard.
* Trade-off: Fulfilling contracts pays less than selling to private adventurers, but lowers the difficulty/enemy count of the Friday Night Raid.
- Town Upgrades & Mercenaries: Use earned gold to build village barricades, upgrade the forge, or hire AI mercenaries to defend the shop.
Friday Night: The Raid (Tower Defense / Action)
- Mechanic: A wave-based monster assault on the village and your shop.
- Execution: The player fights alongside hired mercenaries and the town guard (whose strength is determined by your Mon-Fri Mayor contracts).
- Outcome: If the shop's defenses fall or the player dies, the run ends.
Saturday & Sunday: The Expedition (Action RPG)
- Mechanic: Dungeon crawling.
- Execution: The player equips the best gear they held back from selling and ventures into local ruins/dungeons.
- Objective: Gather rare materials, discover new blueprints, and loot gear that cannot be bought in town.
Death & The Graveyard (Roguelite Meta-Progression)
- Mechanic: Permadeath with inherited assets.
- Upon Death: * Current gold and mundane gear are lost.
* Retained: Unlocked blueprints, stored rare materials, and permanent town upgrades are passed to the next "Out-of-Town Traveler".
- Visual Flair: The previous character's grave is dynamically added to the graveyard behind the blacksmith shop. Inspecting graves could show stats (e.g., "Traveler #4 - Survived 3 Weeks").
3. Unity Technical Architecture
To ensure scalability and modularity, the project should adhere to an Event-Driven Architecture using Unity's ScriptableObjects for data management.
A. Core Systems & Managers
GameManager(Singleton): Handles high-level state (MainMenu,InGame,GameOver).TimeManager: Controls the 7-day cycle.
* Uses a State Machine pattern (CraftingState, RaidState, ExpeditionState).
* Fires C# Events: OnDayChanged, OnNightFell, OnWeekEnded. Other scripts (spawners, UI, merchants) listen to these events to update their logic.
EconomyManager: Tracks gold, town reputation, and mayor contract fulfillment.
B. Data Management (ScriptableObjects)
ItemData: Base ScriptableObject for all in-game items (Materials, Weapons, Armor).BlueprintData: Dictates requiredItemDataingredients and the resulting output.EnemyData: Defines stats for Friday night raid monsters and weekend dungeon mobs.
C. The Crafting System
- Inventory: A modular grid or slot-based system.
- Crafting Station: Checks the player's inventory against
BlueprintDatarequirements. - Contract System: Generates procedural requests (e.g., "Mayor needs 5 Iron Swords").
D. Combat & Entities
HealthComponent: Attached to the player, mercenaries, enemies, and destructible town defenses.- AI (NavMesh): * Enemies: Programmed to target the forge, town defenses, or the player using Unity's NavMeshAgent.
* Mercenaries: State-based AI (Patrol, Engage, Fallback) stationed around the blacksmith.
E. Meta-Progression & Save System
SaveManager: Serializes game data to JSON.- Inheritance Logic: When
PlayerDeathEventis triggered:
1. Tally retained materials and blueprints.
2. Increment DeathCount.
3. Save data to disk.
4. Reload the main scene.
- Graveyard Spawner: On
Start(), readsDeathCountfrom the save file and instantiatesGravePrefabobjects in the backyard grid based on that integer.
4. Initial Scene Breakdown
- Scene_MainForge: The primary hub. Contains the anvil, merchant stalls, Mayor NPC, and the dynamic backyard graveyard.
- Scene_RaidDefense: Could be the same as MainForge but with night lighting, activated spawner nodes, and NavMesh obstacles enabled.
- Scene_Dungeon1..X: Procedurally generated or hand-crafted rooms for weekend gameplay. Connected via portal/loading zone from the Forge.
5. Next Steps for Prototyping
- Blockout: Create a greybox of the blacksmith shop and graveyard.
- Time System: Implement the C# script that cycles through Mon-Sun and prints the current day to the UI.
- Inventory & Basic Crafting: Create a ScriptableObject for "Iron Ore" and "Iron Sword", and build a UI button to convert one to the other.
- The Mayor vs. Market: Implement two drop-off zones (one for the Mayor, one for the Market) to test the gold vs. raid difficulty economic balance.
Optimisation Notes
Engine configs
- Asset compression & generation
- Object pools for transient objectz
- Caching components to reduce get component functions
- GPU instancing for seamless textures
- Time slicing for pathfinding and other heavy algorithms
World & Kingdom
Carla & Roberto
https://www.photographw.com/products/kitchen-cooking-automatic-mixer-2?utm_source=ig&utm_medium=Instagram_Reels&utm_campaign=120203236251720411&utm_term=120203236251540411&utm_content=120203236251560411&fbclid=PAAaboLEdqWD17-vXowo-fKF_-CeKANagTtS1v0cRN5LK8--cHdA6gn6gyRhM_aem_AfH5ayni9sBOOTcoCawqXIKDbaxWT_LtILj7lm8MXU1BjCEOB78pmwBCApNqZb_QG5u4Ts_CGKTZdSMWvoyTU68K