Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
2734bea
Try every font mirror when one fails
lowlevelmetal Oct 9, 2026
13634e9
Clean up names, chat and city names that arrive from the network
lowlevelmetal Oct 9, 2026
cbd7079
Limit what one joiner can make the host relay to everyone
lowlevelmetal Oct 9, 2026
3029e41
Cap the size of messages ENet accepts from a peer
lowlevelmetal Oct 9, 2026
e15946e
Carry the host's ambient traffic to the clients of a network cruise
lowlevelmetal Oct 9, 2026
ed3d80e
Keep a return to the lobby from ending the next network race
lowlevelmetal Oct 9, 2026
31cd6de
Answer LAN queries only from the LAN, at a bounded rate
lowlevelmetal Oct 9, 2026
255e792
Check the port mapping record and router replies before using them
lowlevelmetal Oct 9, 2026
836488d
Let the ambient traffic see every player, as aiMap's player list does
lowlevelmetal Oct 9, 2026
b11efc7
Keep the driver's own race setup after a network race
lowlevelmetal Oct 9, 2026
df8b0f7
Let a kinematic network car strike at its own speed when it says so
lowlevelmetal Oct 9, 2026
622dd1c
Show another player's car this machine lacks as the default car
lowlevelmetal Oct 9, 2026
5e227d3
Cut long lobby names on a character boundary
lowlevelmetal Oct 9, 2026
97f2fb4
Drive a network race with the driver's own transmission
lowlevelmetal Oct 9, 2026
6f77448
Give Cops vs. Robbers players their team's car on every machine
lowlevelmetal Oct 9, 2026
810f5a9
Fuzz the network decoders and session handlers, refuse empty packets
lowlevelmetal Oct 9, 2026
5ac76a6
Find chat lines by serial so the lobby and race show the right ones
lowlevelmetal Oct 9, 2026
f5ee71f
Turn an address away for a minute after five wrong passwords
lowlevelmetal Oct 9, 2026
d49c2e9
Keep one race's car states out of the lobby and the next race
lowlevelmetal Oct 9, 2026
def868b
Take everyone back to the lobby when a network race cannot load
lowlevelmetal Oct 9, 2026
a69c5d7
Take the transmission the control options set into a network race
lowlevelmetal Oct 9, 2026
76e127a
Keep the input review's new lines within 110 columns
lowlevelmetal Oct 9, 2026
84fda68
Record the multiplayer network input review
lowlevelmetal Oct 9, 2026
c1918c9
Run the host's traffic and police for every player of a network cruise
lowlevelmetal Oct 9, 2026
ef83cc7
Merge branch 'integration' into worktree-agent-aac7e520ab818c4d0
lowlevelmetal Oct 9, 2026
acb820c
Meet network cars at their relative speed
lowlevelmetal Oct 9, 2026
3edfaf6
Keep network cars in step with the simulation and their snapshots
lowlevelmetal Oct 9, 2026
cb21295
Merge branch 'integration' into worktree-agent-a5f8725458890a3ae
lowlevelmetal Oct 9, 2026
6ee4244
Merge branch 'integration' into worktree-agent-abfeb133fcba73b9c
lowlevelmetal Oct 9, 2026
196a08e
Treat the shared traffic from the host as untrusted input
lowlevelmetal Oct 9, 2026
419589d
Say in the lobby why a network race could not load
lowlevelmetal Oct 9, 2026
d6520b8
Send far traffic cars' state every other message
lowlevelmetal Oct 9, 2026
455767f
Keep the single race menu's event whole after the host settings
lowlevelmetal Oct 9, 2026
793a736
Drop vehicle states stamped far from the receiver's clock
lowlevelmetal Oct 9, 2026
9d4b39e
Show the results to the last finisher when the host ends a network race
lowlevelmetal Oct 9, 2026
450795f
Trim a joiner's password as the host's is
lowlevelmetal Oct 9, 2026
e2ef716
Start a new network session without the last one's notices
lowlevelmetal Oct 9, 2026
77fc127
Record the multiplayer lobby and session flow review
lowlevelmetal Oct 9, 2026
efa4c55
Knock the host's traffic car a client's car hit on the client
lowlevelmetal Oct 9, 2026
29196f0
Merge branch 'integration' into worktree-agent-aac7e520ab818c4d0
lowlevelmetal Oct 9, 2026
d86626c
Pass every vehicle state on, late or not
lowlevelmetal Oct 9, 2026
98ae97e
Check a network cruise's police with the shared traffic on and off
lowlevelmetal Oct 9, 2026
86086ae
Describe the shared traffic of a network cruise
lowlevelmetal Oct 9, 2026
0f919c0
Merge branch 'integration' into worktree-agent-a5f8725458890a3ae
lowlevelmetal Oct 9, 2026
54ac28a
Show a cruise's shared traffic option in the lobby
lowlevelmetal Oct 9, 2026
db18f06
Wait for the racers still in a multiplayer race
lowlevelmetal Oct 9, 2026
aad848e
Test the shared traffic through two NetGames in one process
lowlevelmetal Oct 9, 2026
e328e17
Take a quitting joiner's car out of the race
lowlevelmetal Oct 9, 2026
f5ca06e
Run Cops and Robbers on the shared race clock
lowlevelmetal Oct 9, 2026
8e24712
Drop a stray blank line in the race loop
lowlevelmetal Oct 9, 2026
be7d2bf
Give the shared traffic's bandwidth with two clients
lowlevelmetal Oct 9, 2026
ad4357c
Let the network players' cars be heard
lowlevelmetal Oct 9, 2026
0b4fe05
Draw the network cars' wheels from their simulation
lowlevelmetal Oct 9, 2026
d7fb35b
Keep at most 256 unread game events
lowlevelmetal Oct 9, 2026
c2cfc5e
Add a lossy UDP relay to netprobe
lowlevelmetal Oct 9, 2026
ea3f6ec
Merge branch 'integration' into worktree-agent-a5f8725458890a3ae
lowlevelmetal Oct 9, 2026
9ecacd8
Show shared traffic as far back as the host's link needs
lowlevelmetal Oct 9, 2026
e1a238a
Record the multiplayer in-race synchronisation review
lowlevelmetal Oct 9, 2026
c029d65
Call this version 0.2.0
lowlevelmetal Oct 9, 2026
0c23b02
Keep the network tests' ports below Windows' dynamic range
lowlevelmetal Oct 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.25...4.0)

project(OpenMM2
VERSION 0.1.0
VERSION 0.2.0
DESCRIPTION "Open source reimplementation of Midtown Madness 2"
HOMEPAGE_URL "https://github.com/lowlevelmetal/OpenMM2"
LANGUAGES C CXX)
Expand Down
22 changes: 14 additions & 8 deletions cmake/Fonts.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,22 @@ function(openmm2_fetch_archive name sha256)
endif()
set(archive "${OPENMM2_FONT_CACHE}/${name}.download")
foreach(url IN LISTS ARGN)
file(DOWNLOAD "${url}" "${archive}" EXPECTED_HASH SHA256=${sha256} STATUS status TIMEOUT 120
INACTIVITY_TIMEOUT 30)
# The hash is checked after the download: with EXPECTED_HASH a failed
# download is a CMake error ("cannot compute hash on failed download"),
# which ends the configure before the other mirrors are tried.
file(DOWNLOAD "${url}" "${archive}" STATUS status TIMEOUT 120 INACTIVITY_TIMEOUT 30)
list(GET status 0 code)
if(code EQUAL 0)
file(REMOVE_RECURSE "${dir}")
file(ARCHIVE_EXTRACT INPUT "${archive}" DESTINATION "${dir}")
file(REMOVE "${archive}")
file(TOUCH "${dir}/.complete")
set(${name}_DIR "${dir}" PARENT_SCOPE)
return()
file(SHA256 "${archive}" actual)
if(actual STREQUAL sha256)
file(REMOVE_RECURSE "${dir}")
file(ARCHIVE_EXTRACT INPUT "${archive}" DESTINATION "${dir}")
file(REMOVE "${archive}")
file(TOUCH "${dir}/.complete")
set(${name}_DIR "${dir}" PARENT_SCOPE)
return()
endif()
set(status "SHA256 ${actual}, expected ${sha256}")
endif()
message(STATUS "Font download failed from ${url}: ${status}")
endforeach()
Expand Down
14 changes: 13 additions & 1 deletion docs/ai.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,19 @@ MM2's pedestrians (build 3393, **MM2** unless marked):
* Pedestrians are not collidable: cars drive through them (no ragdoll in
MM2). They ignore each other and other cars.

**Deviations** (marked in the code): a single player; the ground and wall
**Players.** MM2's traffic is written for a list of players (aiMap +0x170,
`aiMap::AddPlayer` / `RemovePlayer`, at most four): each player's room
populates its roads with that player's bit in each road's mask
(`aiPath::AddAmbPlayer` / `RemAmbPlayer`), a road no player keeps is emptied,
and the goals walk the list for the first player in a car's way, keeping its
index for `aiGoalAvoidPlayer` (aiVehicleSpline +0xe6). A single-player game
has one; `ai::Traffic` keeps 16 slots for the shared traffic of a network
cruise (an OpenMM2 extra), whose other players `World::setOtherPlayers`
adds. The pedestrians stay the local player's (each machine its own, as in
MM2's network games).

**Deviations** (marked in the code): a single player (but the traffic's
list, above); the ground and wall
probes need the game's collision (`World::setProbe`), otherwise heights come
from the sidewalk lines and there are no walls; the props come from the
game (`Pedestrians::setObstacles`; inferred: the race's own props are placed
Expand Down
7 changes: 5 additions & 2 deletions docs/frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,11 @@ vehicle|showcase|options|graphics|audio|control|customize|about|crashintro|
crashlondon|crashsf|sessions|quit|message|delete>`,
`mode:<cruise|blitz|circuit|race|crash>` and `city:<map>` (both apply the race
defaults), `vehicle:<name>`, `go` (start the race), `result:<position>`,
`nav:<up|down|left|right|accept|back|tab>`, `wait:<frames>`. Consecutive
`nav:` commands need a `wait:1` between them.
`nav:<up|down|left|right|accept|back|tab>`, `wait:<frames>`, `wait:race`
(until a race has been driven). Consecutive `nav:` commands need a `wait:1`
between them. The script runs once per process: after a race the menus carry
on with the commands that followed the one that started it. The multiplayer
commands are in docs/multiplayer.md.

## Not yet done

Expand Down
5 changes: 4 additions & 1 deletion docs/gamemodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,10 @@ player's target. When the host leaves the race everyone returns to the
lobby (`BeDone(1)`, Quit2Lobby). A multiplayer race has no traffic,
pedestrians, police or racers (the race modes load no AI map); multiplayer
cruise and Cops and Robbers keep only the pedestrians
(`mmGameMulti::Init` zeroes the traffic, cop and opponent densities).
(`mmGameMulti::Init` zeroes the traffic, cop and opponent densities). As an
OpenMM2 extra, a multiplayer cruise with the host's SHARED TRAFFIC option (on
by default) has the host's traffic and police for everyone
(docs/multiplayer.md, "Shared traffic"); off, it is MM2's.

**Winning** (`mmSingleCircuit::ProgressCheck`, `mmSingleRace::ProgressCheck`):
places 1-3 for amateurs, 1st for professionals, hard-coded; MM2 does not
Expand Down
Loading
Loading