Skip to content

mikea/ztd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZTD

Zig Tower Defense

Status: Technological demo

About

This game was written by me during fall 2022 holidays to learn Zig and Data Oriented Design approach. It contains a highly optimized 2D sprite engine with custom OpenGL-based renderer.

To let the DOD shine, this project's goal was to push performance boundaries of the number of units present in the simulation. Currently on Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz the engine achieves up to 10*10^6 units/sec of single-threaded performance.

Runtime Requirements

  • Linux with following packages: libglfw3-dev
  • Windows 64

Usage

Start: ./ztd or ./ztd <level>. Available levels: level1, level2, level3, stress1

Keys:

  • PgUp/PgDn, Mouse Wheel - zoom
  • B - build mode
  • ESC - exit build mode, clear selection
  • q - quit

Development

Requirements:

  • linux, libglfw3-dev package
  • Zig 0.11 (I use zigup to fetch master version)

Commands:

  • zig build
  • zig build run
  • zig build run -Drelease-fast=true -- [<level>]

Docker multiplatform build

./dev.sh dist will build linux and win64 release .zip archives.

Code Organization

Underlying data structures:

Game engine:

Game:

License

  • code in src/ is licensed under GPL3.
  • code in lib/ is licensed under respective original licenses.
  • mini world sprites are licensed under CC0
  • rubik font is licensed under Open Font License

Screenshot