Open-source project
codenamecpp/carnage3d avatar
codenamecpp/carnage3d

Carnage3D: an open source remake of Grand Theft Auto running in a browser tab

Reimplementation of Grand Theft Auto 1 [GTA1]

573 stars56 forksC++MIT

At a glance

What is it?
Carnage3D reimplements the original Grand Theft Auto in C++ on Box2D, Dear ImGui and OpenGL, and the same source tree also builds to WebAssembly so it can run in a browser. It suits a programmer studying a game engine, and it still needs the original game resources to run anything.
Who is it for?
Carnage3D fits a developer who wants to read a complete game reimplementation, since the source tree shows the whole loop from input handling to rendering to audio, and who wants to see the same code run on three platforms from one repository. It does not fit a player without the original game, because the readme is explicit that the original GTA1 resources, full or demo, are required, and the demo is fetched from an archived Rockstar download rather than bundled.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 75 days ago.
What is it written in?
Mainly C++, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

A remake, and the game data has to come from somewhere

Carnage3D is an open source Grand Theft Auto 1 remake project, and the important operational detail is stated plainly further down the readme: the original GTA1 game resources are required in order to play, either the full game or the demo. The project ships no game assets. The most important configuration parameter is gta_gamedata_location, which is the location of the GTA1 gamedata resources, and the configuration itself comes from an example document at gamedata/config/sys_config.json.default that has to be copied to the same directory without the .default suffix, as gamedata/config/sys_config.json. The demo route is supported and the readme notes the demo version is still available for download from Rockstar. The status section is the other thing to read first, because it describes the project as being in a very early stage, with a video of the progress so far. The repository is MIT licensed, the primary language is C++, and the recent release tags are test_2 from 2021-09-26, test_1 from 2020-08-27 and test_0 from 2019-11-03, which is a naming pattern that says the project was still labelling its builds as experiments.

The library list is the engine design in eight bullets

The tools and technologies section is short and it describes the whole engine. Box2D does the 2D physics, which is the right choice for a game that is fundamentally a top-down world of vehicles and bodies, and it is a subdirectory in the tree under third_party. Dear ImGui provides the immediate mode user interface, which is why the project can run with a mouse and keyboard without a separate UI library. cJSON handles the game data files, and STB covers the single header libraries for images and the like. GLM is the mathematics library, GLFW the windowing and input layer, GLEW the OpenGL extension loader, and OpenAL-Soft the audio. The combination is a good description of what a small engine looks like when built by one person, and the fact that most of these are single header or small C libraries is why the whole thing can be cloned and built in one command. The topics list adds c-plus-plus, gta, gta1, reimplementation and video-game, and the licence badge in the readme shows MIT.

Building on Linux is a dependency list and a make

The Linux build is the easier of the two because the makefile is configured for the clang compiler. The dependencies to install first are listed as two commands, one for the OpenGL and general toolchain including libglew-dev, libglm-dev, libgl1-mesa-dev, xorg-dev and clang, and one for libopenal-dev. The build itself clones the repository with submodules, changes into the directory and runs make, because the Box2D dependency is a git submodule and the premake step needs the dependencies present. The makefile is worth a look because it shows the real build shape, and the release target is the shortest way to see it.

make
	$(PREMAKE_BIN) gmake --cc=clang
	make -C .build config=release_x86_64 -j$(CPUS)

It computes CPUS from nproc and finds premake5 on the path, falling back to a copy in the .build directory, and it has separate targets for a sanitised build, a debug build and a release build, each of which runs premake with the clang compiler, runs the generated makefile in .build with a configuration name such as release_x86_64 and a parallel job count, creates the bin directory if needed, and copies the resulting binary to a name like carnage3d-release. The premake target downloads a premake beta release into .build if the binary is not already present, and the box2d target configures and builds the submodule with CMake, with the documentation, unit tests and testbed all switched off.

The demo path and the command line that starts the game

The Makefile also carries the route for trying the project without owning the full game. The get_demoversion target creates a gamedata/demoversions directory, downloads the demo archive from an archived Rockstar URL into it, and unzips it there. The readme explains that you can then download and play the demo version by typing a few commands, namely make get_demoversion and make run_demoversion, and it notes that the game has to be compiled and configured before that step. The run targets are the actual launch commands, and the demo one passes both a level and the data location on the command line.

bash
	./bin/carnage3d-release
	./bin/carnage3d-release -mapname SANB.CMP -gtadata "gamedata/demoversions/GTAECTS/GTADATA"

Those two lines also map onto the command line parameters section. The -mapname argument selects a specific level, with SANB.CMP given as the example, and -gtadata specifies the game data location. The -numplayers argument enables split screen, with up to four players supported, and the readme lists a split screen test screenshot from Windows.

Controls and the input configuration you can rewrite

The controls are described as similar to the original, and the list is short. The arrow keys walk and drive, space slides on a car, enter enters or exits a car, tab enables or disables the car emergency lights if present, and Z and X change the current weapon with Ctrl to shoot. In the Free Look camera mode you move with W, S, A and D. There is also support for Xbox compatible gamepads, and to enable it or change the default key bindings you create a config file at gamedata/config/inputs.json, copying the inputs.json.default template and modifying it as you wish. The separate input file is the same design decision as the JSON game configuration: the defaults ship with the repository, and the behaviour lives in a file you own, so a rebuild does not lose your changes. The windowing and input come from GLFW and the audio from OpenAL-Soft, and the immediate mode interface from Dear ImGui is what lets the same configuration approach work for the interface as for the keys.

One source tree, three targets, including a browser build

The most striking claim in the readme is that thanks to modern technologies it is now possible to play directly in a web browser, with a link to a WebAssembly build. It was tested in Chrome 85 64 bits and Firefox 81.0.1 64 bits, and the readme says it will not work in Edge. The tree explains how: a wasm directory and a web directory sit alongside src, third_party and gamedata, and there is a CMakeLists.txt at the top level, so the same C++ sources are compiled to WebAssembly for the browser build. The platform badge lists Windows and Linux, and the readme says the project was tested on Ubuntu Linux, Windows 7 and Windows 10. The Windows build needs Visual Studio 2015, and it has a different dependency setup: before compiling you add a system environment variable named __SDKDIR__ pointing at the directory where the dependencies live, namely GLEW, GLM and OpenAL-Soft. The Linux build does not need that because the libraries come from the distribution packages, which is a small but real difference between the two build paths.

Editorial conclusion

Carnage3D fits a developer who wants to read a complete game reimplementation, since the source tree shows the whole loop from input handling to rendering to audio, and who wants to see the same code run on three platforms from one repository. It does not fit a player without the original game, because the readme is explicit that the original GTA1 resources, full or demo, are required, and the demo is fetched from an archived Rockstar download rather than bundled. Before you build it, install the listed Linux dependencies and note that the makefile is configured for clang, copy the sys_config.json.default file to sys_config.json and point gta_gamedata_location at your own game data, and read the project as unfinished, since the readme describes it as being at a very early stage.

Frequently asked questions

What is Carnage3D?

It is an open source remake of Grand Theft Auto 1 written in C++. It uses Box2D for physics, Dear ImGui for the interface, GLFW and GLEW for windowing and OpenGL, OpenAL-Soft for audio, and the same sources also build to WebAssembly so the game can run in a browser.

Do I need the original GTA 1 game to run Carnage3D?

Yes. The readme states that the original GTA1 game resources are required, either the full game or the demo, and the project ships no game assets. The demo can be fetched with the make get_demoversion target, and the data location is set with the gta_gamedata_location parameter.

How do I build Carnage3D on Linux?

Install the dependencies with apt, including libglew-dev, libglm-dev, libgl1-mesa-dev, xorg-dev, clang and libopenal-dev, then clone the repository with submodules, change into it and run make. The makefile is configured for the clang compiler and builds Box2D through CMake first.

What command line options does Carnage3D support?

The -mapname argument selects a specific level, for example -mapname SANB.CMP, -gtadata gives the game data location, and -numplayers enables split screen with up to four players supported.

Can Carnage3D run in a browser?

Yes, through a WebAssembly build, which the readme says was tested in Chrome 85 and Firefox 81.0.1 on 64 bits and will not work in Edge. The repository has wasm and web directories and a top level CMakeLists.txt for that target.

Official sources

  1. codenamecpp/carnage3d on GitHub
  2. Issues
  3. License: MIT
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/codenamecpp-carnage3d.svg)](https://hysenlabs.com/projects/codenamecpp-carnage3d)

Was this useful?