Skip to content

lizard-demon/fps-advanced

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FPS Advanced

A simple first-person shooter engine written in ~1200 lines of Zig, featuring brush-based geometry and BVH accelerated swept point-based collision detection with source-like movement including surfing.

Features

  • First-person movement with mouse look and WASD controls
  • Brush-based geometry using convex polyhedra for collision and rendering
  • BVH spatial acceleration for efficient collision queries
  • Quake-style physics with proper acceleration, friction, and air control
  • Cross-platform graphics via Sokol (OpenGL, Metal, WebGL, WGSL)
  • Audio system with background music and sound effects

Controls

  • WASD - Move
  • Mouse - Look around
  • Space - Jump
  • Escape - Toggle mouse lock

Building

Prerequisites

Native Build

zig build run

Web Build

zig build -Dtarget=wasm32-emscripten

Architecture

  • Physics - Collision detection with brush expansion and BVH traversal
  • Rendering - Mesh generation from brush plane intersections
  • Audio - 16-voice mixer with PCM file support
  • Math - SIMD-optimized Vec3/Mat4 operations

The world consists of 8 brushes defining platforms, slopes, and structures. Each brush is a convex polyhedron represented by plane equations, enabling both collision detection and mesh generation from the same data.

Dependencies

  • sokol - Cross-platform graphics
  • cimgui - Immediate mode UI
  • shdc - Shader compiler

About

A more advanced version of my fps source template, featuring a high performance linear BVH with brush collision and swept-point collision on expanded geometry - PCM audio support and tooling - and source-like movement including surfing.

Resources

Stars

23 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors