What is V12
V12 Engine is a TypeScript game engine for real-time strategy games in the browser, drawn by a WebGPU renderer of its own: units you select and order, buildings, resources, heroes, fog of war, a map editor, and multiplayer on a server. You write the rules and the look; V12 does the rest.
Alpha
V12 is in alpha and under active development. APIs, file formats and saves can change between releases, @public names included, and every change is listed in the packages' changelogs. Pin an exact version for anything you ship.
import { launch } from '@v12-engine/client'
import { createGame } from '@v12-engine/engine'
import '@v12-engine/client/styles.css'
const game = createGame(rules).view(view) // the rules (a Rules) and how they look (a GameView)
launch({ target: '#game', game, map })That draws the ground, units, fog, HUD and minimap, and turns the player's clicks and keys into orders. Start with the Quick start.
What's in the box
| Part | What you get |
|---|---|
| Simulation | 30 ticks a second, seeded: the same seed plays the same game. Orders, combat, fog, Recast pathfinding with crowds. |
| Rules | Units, abilities, buffs, items, upgrades as data; hooks, events, timers, sequences and components for the rest. |
| Client | WebGPU, a HUD, minimap, control groups, rebindable keys, settings, pause menu, saves, graphics quality. |
| Map editor | Ground, water, cliffs, units, regions, paths. Played on the spot, saved as files of your project. Add your own panels and tools. |
| Server | One simulation, each player told only what their side may see. Lobby, reconnection, computer players. |
| Shipping | Errors caught and logged, saves that survive a patch, the simulation off the drawing thread, large armies, desktop and offline. |
The packages
| Package | What it is |
|---|---|
@v12-engine/engine | The simulation. No DOM: runs in Node too. |
@v12-engine/client | The game on a page: its renderer (@v12-engine/render, WebGPU) draws it, Solid draws the interface. |
@v12-engine/editor | The map editor. |
@v12-engine/create | npm create @v12-engine: a project to start from. |
See How it fits together and Entry points.
Whole games to learn from
- Campaign: three missions and a hero. The
campaignstarter, built step by step in the tutorial. - Examples: what the engine can do, a small scene each, to read and copy. The
examplesstarter (npm create @v12-engine my-examples -- --starter examples). - Melee: workers, gold, buildings and a computer player. The
meleestarter, andapps/example/src/games/meleein the repository.
Get it
The packages are on npm. npm create @v12-engine my-game makes a project with the ones it needs, or install them yourself (npm install @v12-engine/engine @v12-engine/client). What each one is for: Packages.