Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Homec Engine

A custom 3D game engine built from scratch with C++ and DirectX 11.

Windows DirectX 11 C++17

Overview

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.

Architecture

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

Module Dependencies

GameClient → Homec.Engine → Homec.Renderer
                          → Homec.Physics → Homec.Math

Features

Rendering

  • 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)

Animation

  • 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 (/charSwap command)

Engine

  • 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)

Physics

  • AABB collision detection and resolution
  • Rigidbody gravity simulation
  • Terrain height sampling for ground collision

Audio

  • Background music per map (looping, volume control)
  • Per-entity audio components

Console Commands

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

Adding Characters

Character models are loaded dynamically from the assets/Models/ directory. To add a new character:

  1. Create a folder: Homec.Renderer/assets/Models/<name>/
  2. Place two FBX files inside:
    • Standing Idle.fbx — idle animation
    • Fast Run.fbx — run animation
  3. In-game: /charSwap <name>

No code changes required. The engine discovers models by folder name at runtime.

Build

Requirements

  • Visual Studio 2022+ with C++ Desktop workload
  • Windows SDK 10.0+
  • vcpkg with the following packages:
    • assimp:x64-windows
    • nlohmann-json:x64-windows

Debug Build

Open HomecPhysicsEngine.sln in Visual Studio, select Debug | x64, and build (Ctrl+Shift+B).

Release Build & Packaging

Run the publish script from the project root:

powershell -ExecutionPolicy Bypass -File .\publish.ps1

This will:

  1. Build all projects in Release | x64
  2. Copy GameClient.exe, engine/renderer DLLs, and vcpkg DLLs to publish/
  3. Copy the full assets/ directory (maps, models, textures)

Output: publish/GameClient.exe — ready to run standalone.

Map System

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 }
}

License

This project is for educational and personal use.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages