HandmadeHero/README.md

104 lines
4.6 KiB
Markdown
Raw Normal View History

2023-09-08 07:07:34 -07:00
# HandmadeHero
2023-10-06 10:06:40 -07:00
Any code I do for this [series](https://handmadehero.org) will be here.
2023-09-08 13:09:49 -07:00
***(Only original hand-written code will be here, no code from the series itself)***
2023-09-08 10:00:05 -07:00
## Scripts
2023-10-06 10:06:40 -07:00
* `build.ps1` - Builds the project use `.\scripts\build msvc <args> <module>` or `.\scripts\build clang <args> <module>`
* `debug` adds debug symbols, etc
* `dev` for development builds. (automatically adds debug)
2023-09-20 11:43:55 -07:00
* `optimize` for optimized builds.
2023-10-06 10:06:40 -07:00
* `verbose` gives more info on arguments passed to tools, etc.
* `module` is the module to build, can be any of `platform` or `engine` for this point in the codebase. (Eventually game will also be a separate module)
2023-09-08 10:00:05 -07:00
* `clean.ps1` - Cleans the project
2023-10-06 10:06:40 -07:00
* `update_deps.ps1` - Updates the project dependencies to their latest from their respective repos.
2023-09-09 17:30:45 -07:00
*Make sure to run `update_deps.ps1` before building for the first time.*
## Notes
Building requires msvc or llvm's clang + lld, and powershell 7
2023-12-29 22:45:48 -08:00
The build is done in the following stages (if clean build):
2023-12-29 22:45:48 -08:00
1. Build engine module
1. Build and run pre-build metaprogram: engine_gen.cpp
2. Build engine module dll.
3. Build and run post-build metaprogram to generate engine symbol constants.
2. Build platform module
1. Build and run pre-build metaprogram.
2. Build platform module as executable
2023-10-06 10:06:40 -07:00
2023-12-29 22:45:48 -08:00
The final build order should have an additional game module: `handmade`, that will be dependent on the engine and platform modules.
2023-09-28 12:16:22 -07:00
## Milestone
2023-09-28 10:44:43 -07:00
2023-12-31 23:53:15 -08:00
Day 49 : Debugging Canonical Coordinatescl
2023-10-06 10:06:40 -07:00
Features Done so far:
* Tailor made build system via powershell scripts
* Supports building the repo with msvc or clang
2023-10-10 10:10:49 -07:00
* Will only build a module if it detects changes (md5 is cached)
2023-12-29 22:45:48 -08:00
* Check is rudimentary can cannot detect all changes (headers for the most part)
* Any changes to target should require a clean rebuild.
2023-10-06 10:06:40 -07:00
* Can stage codegen metaprograms to run before building the module
* Will automatically not run if app process is found (for engine module).
2023-12-29 22:45:48 -08:00
* Metaprogramming library used was self-made from scratch: gencpp
2023-10-06 10:06:40 -07:00
* Can emit exported mangled symbols for the engine module for hot-reload with the platform module without needing to use C linkage symbols or a complex hot-reload library (Live++, etc).
2023-12-29 22:45:48 -08:00
* Project builds in less than 5 seconds. (Most of it is taken up by the metaprogramming library)
2023-10-06 10:06:40 -07:00
* Platform Layer:
2023-10-21 22:46:01 -07:00
* Block Memory allocation via VirtualAlloc for engine module
* Memory mapped files for engine & game snapshots.
* Instantaneous hot reload of engine module
* Software rendering via Win32 GDI
2023-10-06 10:06:40 -07:00
* Direct Sound audio
* Keyboard & Mouse Input via GetAsyncKeyState & Win32 window messagng
* XInput controller support
* Dualsense controller support via joyshock library
2023-10-21 22:46:01 -07:00
* Fullscreen toggle
* Can't change refresh rate
* Auto-hide cursor in client region (painted surface), not using editor tools
2023-10-06 10:06:40 -07:00
* Engine Layer:
* Take & load snapshots of either the engine's or game's memory state.
* Allows for engine or game state to be restored even if a crash occurs to exact memory state it was before.
* Basic input abstraction into hard-coded actions (``EngineActions` & `PlayerActions`)
* Record & replay input.
2023-10-17 20:52:41 -07:00
* WIP : 2.5D Tile Map
* Virtualized into chunks
2023-10-21 19:21:53 -07:00
* Some basic collision detection & math (pre-math coverage by Casey)
2023-10-20 23:17:44 -07:00
* Bitmap file loading
* Compression mode 3
2023-10-21 19:21:53 -07:00
* Basic rendering
* Linear alpha blending
* Anchored to center position
2023-10-28 14:10:30 -07:00
* Experimental type sytem for physics vectors.
2023-12-29 22:45:48 -08:00
* Basic local co-op support
* Each player can be assigned a controller
* So far only support for two players
* Camera assignable to follow arbitary entity
2023-09-28 10:44:43 -07:00
2023-09-18 17:16:40 -07:00
## Gallery
2023-12-29 22:45:48 -08:00
![img](docs/imgs/handmade_win32_2023-12-30_01-52-23.gif)
2023-10-28 14:10:30 -07:00
![img](docs/imgs/10x_2023-10-28_16-58-16.gif)
2023-10-21 22:46:01 -07:00
![img](docs/imgs/10x_2023-10-22_01-44-21.gif)
2023-10-21 19:21:53 -07:00
![img](docs/imgs/handmade_win32_2023-10-21_22-18-47.gif)
2023-10-20 23:17:44 -07:00
![img](docs/imgs/handmade_win32_2023-10-21_02-16-43.png)
2023-10-20 20:15:35 -07:00
![img](docs/imgs/handmade_win32_2023-10-20_23-14-37.png)
![img](docs/imgs/Code_2023-10-20_21-57-06.png)
![img](docs/imgs/handmade_win32_2023-10-19_22-57-13.gif)
2023-10-19 11:16:50 -07:00
![img](docs/imgs/handmade_win32_2023-10-19_14-07-20.png)
2023-10-17 20:52:41 -07:00
![img](docs/imgs/handmade_win32_2023-10-16_23-08-11.png)
2023-10-11 14:52:13 -07:00
![img](docs/imgs/handmade_win32_2023-10-11_23-39-57.gif)
2023-10-10 21:56:16 -07:00
![img](docs/imgs/handmade_win32_2023-10-11_00-47-19.gif)
![img](docs/imgs/handmade_win32_2023-10-10_13-13-14.gif)
2023-10-06 10:07:57 -07:00
![img](docs/imgs/handmade_win32_2023-10-06_12-43-47.gif)
2023-10-01 17:23:32 -07:00
![img](docs/imgs/handmade_win32_2023-10-01_20-22-20.gif)
2023-10-06 10:06:40 -07:00
![img](docs/imgs/Code_2023-10-01_19-20-56.gif)
2023-09-28 12:16:22 -07:00
![img](docs/imgs/Code_2023-09-28_15-14-53.gif)
2023-09-24 19:37:05 -07:00
![img](https://files.catbox.moe/9zau4s.png)
2023-09-18 17:16:40 -07:00
![img](https://files.catbox.moe/b7ifa8.png)