Skip to content
vlangPublic

About

Doom 3 engine and base game translated to V with c2v

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Doom 3 in V

The Doom 3 engine and base game translated from C++ to V with c2v. The source is based on dhewm3 1.5.5.

All 277 translated engine and game files share one V module. For example, ui__FieldWindow.v corresponds to upstream neo/ui/FieldWindow.cpp. 0_globals.v contains shared types, globals, and helpers; 0_external.c.v contains declarations for system and C library APIs. The small native support files under native/ implement stb image/Vorbis codecs, miniz, and MiniZip file I/O. A separate dhewm3 checkout is not needed to build.

Build

This generated translation currently targets macOS arm64. Its system API layouts and platform defines are for that target; Linux, Windows, and Intel macOS need a translation for their platform.

Build verified on 2026-10-01 with latest upstream V e733bff683bbff778de86933878bca9e849675bb, using its -old-compiler compatibility mode, Apple Clang 21, SDL2 2.32.72, and OpenAL Soft 1.25.2. ./build.sh exits successfully and the resulting arm64 executable prints the expected --help output (upstream exits with status 1 for help). Headless dedicated startup with demo00.pk4 and +quit also exits with status 0 after initializing the filesystem, game classes, and scripts.

Install the latest V from the V repository, plus Xcode command line tools and the dependencies:

brew install sdl2 openal-soft pkg-config
git clone https://github.com/vlang/doom3.v
cd doom3.v
./build.sh

The build script discovers Homebrew's OpenAL installation and raises the compiler stack limit. It uses latest V's -old-compiler compatibility mode: the default compiler currently rejects the translated class inheritance as ambiguous methods. Allow several minutes and substantial free RAM for compilation.

tools/clang-opt compiles the generated C with -O2 -ffp-contract=off. Disabling fused floating-point operations matches the native engine's rounding. The build uses V's default garbage collector; -prod is avoided because its root registrations exhausted the collector's root table in the original build.

For a direct build without C optimization:

export PKG_CONFIG_PATH="$(brew --prefix openal-soft)/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
ulimit -s 65520
v -old-compiler -g -cc clang -o doom3 .

Two method parameters use the underlying RenderEntity_s and RenderView_s types rather than their C typedef aliases, to match the V interface signatures. The string-list comparator likewise uses explicit &&IdStr parameters to avoid the compatibility compiler treating a pointer alias as a value receiver.

Run

Game assets are not included. Put the Doom 3 game .pk4 files in base/, or use demo00.pk4 from the Doom 3 demo. You can also set fs_basepath to an existing directory containing base/.

./doom3 +set fs_basepath "$PWD" +set fs_savepath "$HOME/.doom3-v" \
  +set fs_configpath "$HOME/.doom3-v" +set r_fullscreen 0

For the demo, append +map game/demo_mars_city1. Its other maps are game/demo_mc_underground and game/demo_mars_city2.

Savegames use the translated structure layout and are not interchangeable with native dhewm3 saves. Saving and loading within the translated game is supported.

Origin and license

This is an altered source version, translated to V from dhewm3 commit 455b88e8dff2be822f08eb498f51b383e851fa38 using c2v (translation output out-m56).

Doom 3's original engine and game code is Copyright (C) 1999–2011 id Software LLC, a ZeniMax Media company. dhewm3 changes and bundled libraries retain their respective upstream copyrights.

See LICENSE for GPL version 3 and the original Doom 3 additional terms, and UPSTREAM-NOTICES.md for the preserved upstream library notices. Bundled native libraries also retain their licenses in their source files. Game data is distributed separately under its own terms.

About

Doom 3 engine and base game translated to V with c2v

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages