WebGL2 · three.js r160 · zero assets · no build step

A code-only open-world game engine for the browser.

No assets. No build step. No dependencies. Every texture, mesh and sound is generated at runtime, so a complete open-world shooter ships in about 915 KB and runs offline. It powers two shipped games — Dead Zone and Neon Police.

live License Release Stars Last commit Issues built-in v1.15.0 0 dependencies offline-ready three.js r160 ~34 ES modules MIT
// features

An engine with nothing to download

A small, dependency-light WebGL engine for open-world browser shooters. A new game is mostly a config object plus a gameplay hook.

Zero asset files

No image, model or audio files anywhere. The city, every texture, every mesh and every sound is synthesised in code — which is why a whole game fits in about 915 KB minified, across two requests.

Streaming procedural world

A 5 × 5 window of 96-unit chunks around the player, derived from a seeded hash so the same seed always builds the same world. Each chunk merges its geometry per material — roughly one draw call per material, not hundreds.

Config, not boilerplate

Construct new GameBase(canvas, config) and implement hooks like onGameplay and extraPois. A game never talks to three.js directly — it configures the shell and inherits the rest.

Zero-byte audio

Every SFX and all music is synthesised with the WebAudio API — per-weapon gunshots, impacts, footsteps, groans, thunder and wind beds. A generative engine crossfades four moods on tempo and layer mix, live.

Frame-budgeted, no workers

Chunk building is synchronous but budgeted to a 6 ms slice, nearest-first, so travel never hitches. Collision is AABB prisms and vehicles use an arcade model — no physics engine, no worker threads.

Systems included

Weapons, enemy AI director, loot, levelling and prestige, a store, a safe house, HUD and maps, throwables, vehicles, a companion, a 16-mission campaign and four game modes — all switched on by config keys.

// how it works

Serve it, wire a page, build a game

The engine source is plain ES modules, so it needs a server — python3 -m http.server 8080. The import map is required: the engine imports three as a bare specifier.

  1. Serve the files

    No build step and no dependencies. Any modern browser with WebGL2 will run it. The engine imports three as a bare specifier, so the import map is required.

  2. Wire up a page

    A canvas, an overlay and a module script. Load hud.css for the shared HUD, touch, shop and map styling.

  3. Build a game

    Construct GameBase with a config object, then call init() and loop(). That alone is a complete, playable open-world shooter.

  4. Turn systems on

    Vehicles, companion, campaign and modes are off unless you ask. Each is a single config key — mode: 'bossrush' replaces the normal spawn loop.

index.html
<!-- 1. the import map is required -->
<script type="importmap">
{ "imports": { "three": "./engine/three.module.js" } }
</script>

<canvas id="game"></canvas>
<script type="module" src="./mygame.js"></script>
mygame.js
import { GameBase } from './engine/gamebase.js';

const game = new GameBase(document.getElementById('game'), {
  seed: 1234,
  dayLength: 300,
  worldWeights: [['city', 5], ['park', 2], ['jungle', 2]],
  pool: ['walker', 'runner'],   // what the director sends
  autoSpawn: true,
  persist: true,              // save to localStorage
  startingWeapons: ['knife', 'pistol'],
  objectiveMain: 'SURVIVE',

  onGameplay(dt, g) { /* your logic each frame */ },
});

game.init();
game.loop();
turn systems on — each is one config key
const game = new GameBase(canvas, {
  // …the above, plus:
  vehicles: true,          // drivable cars (F to get in)
  ally: true,              // a companion who follows and shoots
  allyName: 'Rook',
  campaign: true,          // the 16-mission scripted chain
  mode: 'bossrush',        // 'arena' | 'bossrush' | 'defence' | 'extraction'
});
// architecture & demo

How it is put together

A game configures GameBase and implements hooks; everything else is inherited. Play the two games built on it, or read the architecture notes in the repo.

// get started

Clone it and ship a game

The result is a static bundle with all paths relative, so it works from a sub-path — drag it onto a static host, or push to a repo and enable GitHub Pages.

terminal
# 1. get the engine
git clone https://github.com/drsamonline/neon-engine.git
cd neon-engine

# 2. serve it (ES modules need a server)
python3 -m http.server 8080

# 3. open the example game — the smallest complete game on the engine
#    http://localhost:8080/example/

# optional: bundle everything for release (~915 KB in 2 requests)
python3 minify.py

Go deeper

The repo ships full documentation alongside the source.

// faq

Questions

Do I need a build step or any dependencies?
No. The engine has no build step and no dependencies — it is vanilla ES modules plus a vendored copy of three.js r160. minify.py can bundle everything for release, but it is optional.
Where are the textures, models and sounds?
There are none. Every texture, mesh and sound is generated at runtime, so there is no asset pipeline and nothing to download beyond the code. That is why a complete open-world shooter fits in about 915 KB.
What does it need to run?
Any modern browser with WebGL2. The engine source is plain ES modules, so it needs to be served over HTTP — for example python3 -m http.server 8080. Games bundled with minify.py emit an IIFE and can launch from disk via file://.
How do I add a weapon, enemy or biome?
Add an entry to WEAPONS in weapons.js, to ENEMY_TYPES in ai.js, or a new generator method plus a weight on World. Extensions are data-first — the shop, HUD and firing code follow automatically.
Is there a physics engine or worker threads?
Deliberately not. Collision is AABB prisms, knockback is impulses and vehicles use an arcade model. Chunk building is synchronous but frame-budgeted to a 6 ms slice, nearest-first, so travel never hitches.
Can I use it in my own project?
Yes. You may use, modify, remix and redistribute the engine — including in derivative works — as long as you credit Dr. Sohil Momin as the original creator. three.js and BufferGeometryUtils remain under their own MIT licences.
What games are built with it?
Two shipped games: Dead Zone (endless zombie survival) and Neon Police (open-city crime response). Both are free to play in the browser at drsamonline.github.io/neon-games/.