Skip to content
lowlevelmetalPublic

About

Open source midtown madness 2

Resources

Stars

8 stars

Watchers

2 watching

Forks

Repository files navigation

OpenMM2

OpenMM2 is an open source reimplementation of Midtown Madness 2 (Angel Studios / Microsoft, 2000) for modern Linux and Windows systems.

The main goal is preservation: the original game's mechanics (vehicle handling, AI, game modes and rules) should behave as they did in 2000. On top of that, OpenMM2 adds:

  • any resolution and aspect ratio, windowed or fullscreen, HiDPI aware
  • a Vulkan renderer with an automatic OpenGL fallback
  • online multiplayer over UDP with automatic port forwarding (UPnP)
  • for laughs, pedestrians that explode when you hit them (Options > Graphics > PED GIBS; off by default)
  • optional graphics effects, a photo mode and Midtown Madness 1's Chicago (see Optional extras)
  • a Windows installer, and native Linux builds

Status: early but playable. London and San Francisco, cruise, Blitz, checkpoint and circuit races, the crash courses, Cops and Robbers and online multiplayer all run from the original game data. With a Midtown Madness 1 disc, MM1's Chicago can be driven too (single player, work in progress). Behaviour is checked against the original game function by function; the results, and the gaps still open (mostly in network play), are in docs/parity/.

Optional extras

Everything here is off by default or waits for its key: unless you use it, the game looks, sounds and plays as Midtown Madness 2 did.

  • The F2 panel. Press F2 in a race for OpenMM2's graphics options and effects, in the tabs Display, Quality, Lighting, Surfaces, Image, World and Controls. The Look row sets them all at once: Original, Enhanced, or Enhanced RT. F9 switches between your settings and the original look to compare.
  • Graphics effects: sun shadows, live reflections on your car, ambient occlusion, headlights and street lamps that light the scene at night, cloud shadows, distance haze, lush grass, reflective water, wet roads, heavier rain and snow, bloom, sun shafts, heat shimmer, motion blur, colour grading, sharpening, vignette, and FXAA or TAA anti-aliasing.
  • Ray tracing: on Vulkan with a GPU that supports ray queries (VK_KHR_ray_query), the sun shadows and your car's reflections can be ray traced (the Enhanced RT look).
  • World tab: change the time of day, the weather and the traffic in the middle of a single-player race. A race changed this way is not recorded.
  • Photo mode (F8): stops a single-player race, hides the HUD and lets the camera fly free, with zoom; F12 saves the picture.
  • Free camera: swing the chase camera round your car with a gamepad's right stick, or the mouse with its right button held.
  • Gamepad menus: the left stick moves a pointer in the menus, and in a race Back opens the F2 panel and Start the race menu (when the controls leave those buttons free).
  • Keys on any screen: F10 shows the frame rate, F11 switches between a window and full screen, F12 saves a screenshot in the data folder's screenshots.
  • Chicago from Midtown Madness 1: link your own MM1 disc (see below) and MM1's Chicago joins the city list, with its 10 blitz, 10 circuit and 12 checkpoint races and cruise. It is driven with MM2's cars, physics and AI, and has MM1's sounds, speed panel and city map, drawbridges, El train and airliner, and MM1's CD music from a raw disc image or cue sheet with its audio tracks. Single player only, and still a work in progress (docs/formats/mm1city.md).

You need the original game

OpenMM2 contains no Midtown Madness 2 content: no models, textures, sounds, music or text. It loads them from your own copy of the game, which can be any of:

  • the original CD in a drive (or a copy of its contents)
  • a disc image: .iso, .bin/.cue, .img (2048- and 2352-byte sectors)
  • an existing Midtown Madness 2 installation folder (the one containing MM2CORE.AR)

For the optional Chicago, OpenMM2 also needs your own Midtown Madness 1 data: an MM1 disc image, a folder holding its CORE.AR (a disc copy or an installation), or CORE.AR itself. Choose it on the Options page with Choose disc... (it is added at the next start), or set it with [GameData] MM1Source in openmm2.ini or the OPENMM2_MM1_SOURCE environment variable. OpenMM2 contains no Midtown Madness 1 content either.

OpenMM2 never runs, modifies or bypasses the copy protection of the original executable, and it does not need a CD key. Optionally the game archives (about 400 MB) are copied to the hard disk once, so the disc or image is not needed afterwards.

This project is not affiliated with or endorsed by Microsoft, Rockstar Games or Angel Studios. "Midtown Madness" is a trademark of its respective owner.

Installing

Windows

Run OpenMM2-<version>-windows-x86_64-setup.exe (64-bit Windows 7 or later). The installer asks where your Midtown Madness 2 files are and checks them before continuing. You can also skip that step; OpenMM2 asks on first start.

To update, run the new version's installer. It finds the installed version and updates it in its folder, keeping your settings, driver profiles, replays and game data; the game data and shortcut choices are filled in from last time, so an update is Next, Next, Install. Files that the new version no longer ships are removed. Running the same version again repairs the installation, and an older version asks before it replaces a newer one. Close OpenMM2 first: setup waits (Retry/Cancel) until it is closed.

Silent installs accept:

Option Meaning
/S silent install
/D=C:\Games\OpenMM2 install directory (must be last, unquoted)
/SOURCE=<path> game data: disc image, drive root such as D:\, or install folder
/COPYDATA copy the game archives to <install dir>\gamedata
/ALLOWDOWNGRADE replace a newer installed version (refused otherwise)
Exit code Meaning
0 success
1 cancelled or failed (for example, another program held a file open)
2 installed, but the /SOURCE game data was rejected (OpenMM2 asks on first start)
3 nothing changed: a newer version is installed and /ALLOWDOWNGRADE was not given
4 nothing changed: OpenMM2 is running

The uninstaller also stops while OpenMM2 is running (exit code 4 when run as uninstall.exe /S _?=<install dir>; otherwise it restarts itself from a temporary copy and returns at once).

A silent update keeps the last installation's choices: game data, shortcuts and developer tools. /D= naming another folder moves the installation: setup removes the old folder's program files and uninstaller but keeps its gamedata folder and openmm2-install.ini (and keeps using that game data unless /SOURCE is given), so the old folder stays only if it holds them. The installer lists what it installed in install-manifest.txt, which the next update and the uninstaller use to remove exactly those files.

The portable ZIP (OpenMM2-<version>-windows-x86_64-portable.zip) needs no installation: unpack it anywhere. Because it contains portable.txt, settings are kept in a user folder next to openmm2.exe.

Linux

Unpack OpenMM2-<version>-linux-x86_64.tar.gz and run bin/openmm2, or build from source (below). cmake --install puts a desktop entry, AppStream metadata and icons in the usual places.

Pointing OpenMM2 at the game

On first start OpenMM2 shows a setup screen for choosing the game data (run openmm2 --setup to show it again). It can also be done from a terminal:

openmm2 --check-source ~/Downloads/midtown2.iso           # is this usable?
openmm2 --import-source /run/media/$USER/MIDTOWN2          # copy archives to the user data folder
openmm2 --source /path/to/midtown2.iso                     # use for this run only

Settings live in openmm2.ini:

Platform Settings Data (imported game files, saves, logs)
Linux $XDG_CONFIG_HOME/openmm2 (~/.config/openmm2) $XDG_DATA_HOME/openmm2 (~/.local/share/openmm2)
Windows %APPDATA%\OpenMM2 %LOCALAPPDATA%\OpenMM2
Portable user\ next to the executable user\ next to the executable

A game built from source uses the per-user folders too, unless it was configured with -DOPENMM2_PORTABLE_BUILD=ON, which puts a portable.txt next to the built executable (the first build after configuring with OFF removes it again).

The Windows installer records its choice in openmm2-install.ini next to openmm2.exe; per-user settings take precedence over it.

Building from source

Requirements:

  • CMake 3.25 or newer and Ninja
  • a C++23 compiler: GCC 14+, Clang 18+ (with libstdc++ 14+ or libc++ 18+), or Visual Studio 2022 17.10+
  • glslc (shaderc) or glslangValidator (glslang) for the Vulkan shaders
  • Git (dependencies are fetched at configure time)

Other dependencies (SDL3, miniz, ENet, miniupnpc, Dear ImGui, Vulkan headers, volk, VMA, GoogleTest) are downloaded and built automatically at pinned versions. On Linux, installed SDL3 and GoogleTest packages are used when available (-DOPENMM2_USE_SYSTEM_DEPS=OFF to always build them).

Linux

# Arch Linux
sudo pacman -S --needed base-devel cmake ninja git shaderc glslang sdl3 gtest
# Fedora
sudo dnf install cmake ninja-build gcc-c++ git glslc glslang SDL3-devel gtest-devel
# Debian/Ubuntu (25.04 or newer for a recent enough compiler and SDL3)
sudo apt install build-essential cmake ninja-build git glslc glslang-tools libsdl3-dev libgtest-dev

cmake --preset linux-gcc-release          # or linux-clang-release, *-debug
cmake --build --preset linux-gcc-release
ctest --preset linux-gcc-release

Binaries end up in out/build/<preset>/bin. Without presets, the usual cmake -S . -B build -G Ninja && cmake --build build works as well.

Windows (MSVC)

Install Visual Studio 2022 with the "Desktop development with C++" workload and the Vulkan SDK (for glslc). From a "x64 Native Tools Command Prompt":

cmake --preset windows-msvc
cmake --build --preset windows-msvc-release
ctest --preset windows-msvc-release

Visual Studio can also open the folder directly and use the same presets; windows-vs2022 generates a .sln instead.

Cross-compiling for Windows (MinGW-w64)

sudo pacman -S mingw-w64-gcc        # Debian/Ubuntu: mingw-w64 (GCC 14+ needed)
cmake --preset mingw-cross-release
cmake --build --preset mingw-cross-release

If Wine is installed, ctest --preset mingw-cross-release runs the tests through it.

Tests with the original game data

Tests that need the retail files are skipped unless OPENMM2_GAME_DATA points at a disc image, disc or installation:

OPENMM2_GAME_DATA=~/Downloads/midtown2.iso ctest --preset linux-gcc-release

The tests that need Midtown Madness 1's data (the MM1 formats and Chicago) likewise read its archives from OPENMM2_MM1_SOURCE (an MM1 disc image, a folder holding CORE.AR, or CORE.AR itself) and are skipped without it.

Packages

cpack --preset linux-release                              # .tar.gz (Linux)
cpack --preset windows-portable                           # portable .zip (MSVC)
cmake --build --preset windows-msvc-release --target package_installer   # setup .exe

The installer is built from packaging/windows/openmm2.nsi and needs NSIS 3 (makensis); CMake finds it in Program Files\NSIS or on PATH. A native makensis also works when cross-compiling. The icon artwork is in packaging/icons (render-icons.sh regenerates the bitmaps from the SVG).

packaging/windows/test-installer.sh <build dir> tests the installer under Wine: new installations, updates (also from the last release's installer), repair, downgrades, a running game, a failed game data copy, moving with /D=, uninstalling, and the wizard's pages. It uses synthetic game data, so it needs no game files. It needs Wine, a MinGW-w64 C compiler and makensis (MAKENSIS=<path>, or MAKENSIS_WINE=1 with the Windows makensis.exe); the script's header lists its options. CI runs it on the MinGW build.

packaging/windows/test-installer.sh out/build/mingw-cross-release

mm2tool

mm2tool is a developer tool for looking inside the game data:

mm2tool source                                   # list detected game sources
mm2tool ls midtown2.iso 'tune/*.vehcarsim'       # all archives mounted as the game sees them
mm2tool cat midtown2.iso tune/vehicle/vpbug.vehcarsim
mm2tool extract midtown2.iso local/extracted 'city/*'

Run mm2tool without arguments for the full list of commands, among them some for Midtown Madness 1's data (mm1cityinfo, bmsinfo, mm1tex and others), which read your MM1 disc's archives. Keep anything you extract out of the repository (the local/ folder is ignored by Git).

Contributing

See CLAUDE.md for the project rules and code layout, and docs/ for architecture notes and file format documentation. In short: no game data in the repository, no circumvention of the original game's copy protection, and behaviour that is inferred rather than known is marked as such.

Credits

  • dwolp contributed the OpenMM2 Enhanced fork (github.com/dwolp/OpenMM2, proposed in issue #10), merged into this version: Chicago from Midtown Madness 1, the graphics panel and render effects, ray tracing, the photo mode, gamepad menus and more.
  • Open1560 by Brick (GPL-3.0), the Midtown Madness 1 reimplementation on the same Angel engine. Parts of OpenMM2 are ported from it, as each such file says: among them the engine's random numbers, the AI racers, police, HUD, particles and bangers, parts of the game audio, and the MM1 code behind the Chicago support. The first versions of the cameras and the trailer joint followed it too (docs/camera.md, docs/physics.md).

License

OpenMM2 is free software, released under the GNU General Public License, version 3 or later (see LICENSE). Binary packages include the licences of the bundled third-party libraries in licenses/.

About

Open source midtown madness 2

Resources

Stars

8 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages