Phase 1 Complete: Dungeon Engine & Visuals. Switched to Manual Exploration Plan.
This commit is contained in:
@@ -17,48 +17,30 @@ The engine will consist of three main components:
|
||||
|
||||
## Proposed Changes
|
||||
|
||||
### [NEW] `src/engine/dungeon/`
|
||||
We will structure the engine purely in JS logic first.
|
||||
### [COMPLETED] `src/engine/dungeon/`
|
||||
We structured the engine effectively.
|
||||
|
||||
#### [NEW] `TileDefinitions.js`
|
||||
- **Data Structure**:
|
||||
```javascript
|
||||
{
|
||||
id: 'corridor_straight',
|
||||
type: 'corridor', // 'room', 'objective'
|
||||
width: 2,
|
||||
length: 5,
|
||||
exits: [ {x:0, y:0, dir:'N'}, ... ] // Local coords
|
||||
}
|
||||
```
|
||||
#### [DONE] `TileDefinitions.js`
|
||||
- **Data Structure**: Updated to use Object Map & Single Anchor Points for alignment correction.
|
||||
|
||||
#### [NEW] `DungeonDeck.js`
|
||||
#### [DONE] `DungeonDeck.js`
|
||||
- Handles the stack of cards.
|
||||
- Methods: `draw()`, `shuffle()`, `insert(card, position)`.
|
||||
- **Campaign Injection**: Ability to inject specific "Events" or "Rooms" at certain deck depths (e.g., "After 10 cards, shuffle the Exit card into the top 3").
|
||||
- Methods: `draw()`, `shuffle()`, `insert()`.
|
||||
|
||||
#### [NEW] `Generator.js`
|
||||
- **Grid System**: A virtual 2D array or Map `Map<"x,y", TileID>` to track occupancy.
|
||||
#### [DONE] `DungeonGenerator.js`
|
||||
- **Grid System**: `GridSystem.js` handles collision & spatial logic.
|
||||
- **Algorithm**:
|
||||
1. Place Entry Room at (0,0).
|
||||
2. Add Entry Exits to `OpenExitsList`.
|
||||
3. **Step**:
|
||||
- Pick an Exit from `OpenExitsList`.
|
||||
- Draw Card from `DungeonDeck`.
|
||||
- Attempt to place Tile at Exit.
|
||||
- **IF Collision**: Discard and try alternative (or end path).
|
||||
- **IF Success**: Register Tile, Remove used Exit, Add new Exits.
|
||||
2. Step-by-Step generation implemented (currently automatic 1s delay).
|
||||
3. **Refinement**: Automatic generation shows alignment issues due to random nature. **Plan Change**: Moving to Manual Player Exploration next.
|
||||
|
||||
### Campaign Integration
|
||||
- **Mission Config Payload**:
|
||||
```javascript
|
||||
{
|
||||
missionId: "campaign_1_mission_1",
|
||||
deckComposition: [ ... ],
|
||||
specialRules: {
|
||||
forceExitAfter: 10, // Logic: Treat specific room as 'Objective' for generation purposes
|
||||
exitType: "ladder_room"
|
||||
}
|
||||
missionId: "mission_1",
|
||||
objectiveId: "room_dungeon", // Simplified for now
|
||||
specialRules: {}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user