A custom 3D game engine built from scratch with C++ and DirectX 11.
Homec Engine is a modular game engine featuring terrain rendering, skeletal animation, procedural sky, a weather system, and an in-game developer console. It is designed as a learning-oriented project with a clean separation between rendering, engine logic, physics, and math modules.
HomecPhysicsEngine/
├── GameClient/ # Executable — window creation, input routing, entry point
├── Homec.Engine/ # Engine DLL — scene, entities, components, console, map loading
├── Homec.Renderer/ # Renderer DLL — DirectX 11, shaders, models, terrain, UI
│ └── assets/ # Maps, models, textures
├── Homec.Physics/ # Static lib — AABB collision, rigidbody, raycasting
├── Homec.Math/ # Static lib — math utilities
└── publish.ps1 # Release packaging script
GameClient → Homec.Engine → Homec.Renderer
→ Homec.Physics → Homec.Math
- DirectX 11 rendering pipeline with inline HLSL shaders (vs_5_0 / ps_5_0)
- Multi-texture terrain (diffuse, roughness, colormap, splatmap, displacement)
- Procedural sky dome with sun disc, glow, and FBM noise clouds
- Per-submesh FBX texture binding (embedded and external)
- Direct2D / DirectWrite UI overlay (HUD, console, text)
- Assimp-based FBX model loading with full skeletal hierarchy
- CPU skinning with dynamic vertex buffers
- Idle / Run animation state switching via
CharacterAnimatorComponent - Runtime character model swapping (
/charSwapcommand)
- Entity-Component architecture (Transform, Render, Camera, Light, Collider, Rigidbody, Animation, Audio, Portal)
- JSON-driven map system (
map.json— terrain, entities, lights, portals, weather, BGM) - Click-to-move player movement with terrain collision and boundary clamping
- Third-person orbit camera with scroll zoom
- In-game developer console (Enter to open, Esc to close)
- AABB collision detection and resolution
- Rigidbody gravity simulation
- Terrain height sampling for ground collision
- Background music per map (looping, volume control)
- Per-entity audio components
Open the console with Enter, type a command, and press Enter again to execute.
| Command | Description |
|---|---|
/weather sunny |
Clear sky, bright sun |
/weather cloudy |
Overcast, dense clouds |
/weather night |
Dark sky, moonlight |
/weather sunset |
Orange horizon, warm tones |
/weather rainy |
Grey sky, heavy clouds |
/weather foggy |
Misty atmosphere |
/charSwap <name> |
Swap player model (e.g. hunter, warrior) |
/help |
List available commands |
Character models are loaded dynamically from the assets/Models/ directory. To add a new character:
- Create a folder:
Homec.Renderer/assets/Models/<name>/ - Place two FBX files inside:
Standing Idle.fbx— idle animationFast Run.fbx— run animation
- In-game:
/charSwap <name>
No code changes required. The engine discovers models by folder name at runtime.
- Visual Studio 2022+ with C++ Desktop workload
- Windows SDK 10.0+
- vcpkg with the following packages:
assimp:x64-windowsnlohmann-json:x64-windows
Open HomecPhysicsEngine.sln in Visual Studio, select Debug | x64, and build (Ctrl+Shift+B).
Run the publish script from the project root:
powershell -ExecutionPolicy Bypass -File .\publish.ps1This will:
- Build all projects in Release | x64
- Copy
GameClient.exe, engine/renderer DLLs, and vcpkg DLLs topublish/ - Copy the full
assets/directory (maps, models, textures)
Output: publish/GameClient.exe — ready to run standalone.
Maps are defined in Homec.Renderer/assets/Maps/<MapName>/map.json. A map file contains:
{
"name": "HomeTown",
"terrain": { "heightmap": "...", "texture": "...", "heightScale": 50.0 },
"spawnPoint": [0, 60, -10],
"lighting": { "ambient": [0.2, 0.2, 0.25], "directional": { ... } },
"weather": { "skyZenithColor": [...], "cloudDensity": 0.45 },
"entities": [ { "name": "Player", "model": "hunter/Fast Run.fbx", ... } ],
"lights": [ ... ],
"portals": [ ... ],
"bgm": { "file": "town_theme.wav", "loop": true }
}This project is for educational and personal use.