8478b385bc03d90278b1fd5a30aaddbc17cb2809
- Replace std HashMap (SipHash) with ahash::AHashMap for fast non-crypto hashing - Pack tile data from tuples to structs: FloorTileData (~35 bytes) and FixtureTileData (~18 bytes) - FloorTileData: pack 3 bools into single flags byte, use u8 for id/weight - FixtureTileData: pack 2 bools into single flags byte - Update all accessors: is_standable_tile, visibility, terrain generation, forestry - Preparation for async pathfinding (Arc wrapping to come in follow-up) Memory reduction: ~54% for floor tiles (76→35 bytes), ~62% for fixtures (48→18 bytes) Hash performance: AHashMap uses fxhash, faster than SipHash for game data
Dorf
This project is my way of learning Rust by recreating key aspects of Dwarf Fortress in Bevy. The aim is to build a feature-rich, procedurally generated simulation game, combining colony management, world-building, etc.
Project Goals
- Learn Rust by implementing complex game systems.
- Explore procedural generation techniques.
- Develop an engaging simulation game inspired by Dwarf Fortress.
Current Status
Work in progress.
Features
Core Systems
Procedural World Generation
-
Terrain generation
- Generate heightmaps and elevation
- Add water bodies and erosion effects
- Apply biome-specific textures
-
Biome distribution
- Define biome attributes (temperature, rainfall, etc.)
- Map biomes to regions based on attributes
- Add transitional zones between biomes
-
Rivers, caves, and mountain ranges
- Implement river pathfinding algorithms
- Procedurally carve cave networks
- Generate mountain chains with fractal noise
Resource Management
-
Gathering raw materials
- Implement tree-cutting and stone-mining mechanics
- Add dynamic replenishment or exhaustion of resources
-
Stockpile mechanics
- Create system for defining and assigning stockpiles
- Optimize pathfinding for resource transport
-
Crafting items and tools
- Develop crafting recipes and progression
- Add tools with different qualities and effects
Colony Simulation
-
Individual dwarves with unique traits
- Generate personality traits and preferences
- Assign skill proficiencies and growth over time
-
Needs and mood systems
- Model basic needs (hunger, thirst, rest)
- Implement mood modifiers and stress responses
-
Job assignment and task automation
- Create task queue and priority system
- Enable task reassignment dynamically
Gameplay Mechanics
Building and Construction
-
Rooms, workshops, and fortifications
- Design grid-based construction system
- Implement structural stability checks
-
Mining and digging mechanics
Combat and Defense
-
Squad management
- Develop squad formation and control UI
- Assign weapons and defensive equipment
-
Enemy invasions
- Generate enemy waves with scaling difficulty
- Simulate AI pathfinding and strategies
-
Traps and defenses
- Add trap-building interface
- Implement trigger mechanisms and consequences
Economy and Trade (Possible)
-
Trading with caravans
- Generate trading caravans based on world events
- Add barter or currency-based exchange
-
Currency and wealth system
- Track wealth and its effects on game dynamics
- Introduce theft and economic threats
Procedural Storytelling
Historical World-Building
-
Generate civilizations, leaders, and conflicts
- Assign dynamic histories to regions and NPCs
- Model geopolitical relationships
-
Persistent world history
- Save and load historical data across game sessions
- Link events and characters to history dynamically
Events and Narratives
- Random and scripted events
- Add contextual random events (e.g., resource scarcity, rival factions)
User Interface
-
Visual grid-based interface
- Add visual overlays for resources, paths, and zones
-
Keyboard and mouse input
Roadmap
- Build procedural world generation prototype.
- Implement basic colony simulation.
- Add crafting and resource management mechanics.
- Introduce combat and defense systems.
- Polish user interface.
- Expand procedural storytelling and events.
Languages
Rust
100%