EN
games/dmmotor / README.md · commit 9d248a4
# dmmotor**dmmotor** is a first-person shooter engine written in PHP for [JumPHP](https://jumphp.net): a port of theengine **id Software released under the GNU GPL v2** (linuxdoom-1.10, <https://github.com/id-Software/DOOM>),playing **[Freedoom](https://freedoom.github.io)** Phase 1 and Phase 2 (chosen at start), the free content (levels, graphics, sounds) under the BSDlicence. It is not affiliated with or endorsed by id Software, ZeniMax or Bethesda.Play it: <https://jumphp.net/dmmotor>## What is in it- `src/Dm/` — the engine, translated from the C source into PHP (one file per original part, its name in the header):  - `Wad`, `Gfx`, `Patch`, `Texture` — the WAD, palettes, light maps, walls, flats, sprites (w_wad.c, r_data.c);  - `MapData` and the map structures — the level (p_setup.c);  - `Render/View` — the BSP renderer: walls, floors and ceilings, sky, sprites, see-through walls, the weapon    (r_main.c, r_bsp.c, r_segs.c, r_plane.c, r_things.c, r_draw.c), into a 320 x 200 palette screen;  - `Play/World` and its traits — movement, collisions, line of sight, attacks (p_mobj.c, p_map.c, p_maputl.c,    p_sight.c), monsters (p_enemy.c), weapons (p_pspr.c), pickups and damage (p_inter.c), the player (p_user.c),    doors, lifts, floors, ceilings, lights, switches, teleporters (p_spec.c, p_doors.c, ...);  - `Info.php` — the frame and thing tables, **generated** from info.c by `tools/gen-info.php`;  - `StatusBar`, `MenuScreen`, `Sounds`, `Strings`, `Automap` — status bar, menus, sound effects, texts, map;  - `Music` — the songs of the WAD (MIDI) played live by a two-operator FM synthesizer in the manner of the OPL2,    with the instruments of the WAD's GENMIDI lump, streamed through JumPHP's `PcmStream`.- `src/Service/` — `DmGame` (the shared state, the IWAD chosen), `SaveGames` (6 slots per game, the whole level),  `WadCatalog` (the WADs to choose from: `assets/wads/`, the local `wads/` folder, and the server's).- **WADs of the server**: on the playground, the folder `dmmotor/wads` of the server's externals (shared by its  administrator) is listed through the engine extension `jumphp/externals` (`../../extensions/externals`): each WAD is  looked into by packets (header, directory, title picture), then downloaded block by block when chosen, and cached.  Only free base games (with the FREEDOOM lump) and mods are played, never a commercial game.- `src/Scene/` — the JumPHP scenes: title and menus, play, intermission, finale, pause.- `assets/wads/` — `freedoom1.wad` and `freedoom2.wad` (Freedoom 0.13.0) in parts of 15 MB (`tools/split-wad.php`),  with Freedoom's `COPYING.txt` and `CREDITS*.txt`. `assets/launch/` — the pictures of the game choice  (`tools/make-launch.php`).Differences with the original: floats instead of 16.16 fixed point (PHP in the browser has 32-bit integers),walls projected by clipping in view space instead of angle tables; the music is a live FM synthesizer, notDMX's own; the mouse turns with its moves in the window (no pointer lock in JumPHP); no demo playback (they needthe exact fixed point arithmetic); single player only.## ControlsArrows / WASD / ZQSD: move and turn — A/Q, D: strafe — Ctrl or F or the mouse button: fire — Space or E: use(doors, switches) — Shift: walk (always run is on, see the pause menu) — 1-7: weapons — Tab / M: map (+/-: zoom) —mouse: turn and fire — Esc: pause (save, load, options).Phones: the stick, FIRE and USE.## Licences- The engine code (`src/`, `tools/`, `tests/`): **GNU General Public License v2** — see `LICENSE`.  Copyright (C) 1993-1996 by id Software, Inc.; PHP port (C) 2026 the dmmotor authors. Every file says which  original file it comes from; the changes are the translation to PHP and to JumPHP's scenes.- The game content (`assets/wads/`): Freedoom, **BSD licence** — see `assets/wads/COPYING.txt` and the credits.- JumPHP (the rest of the repository): MIT.## Commands (from the root of the repository)```bashbin/jumphp install dmmotorbin/jumphp run dmmotor       # desktop windowbin/jumphp test dmmotor      # php -l, phpstan, game tests, smoke testbin/jumphp build:remote dmmotor && JUMPHP_WEB=remote bin/jumphp serve dmmotor```