Skip to content

"Polishing" deterministic math during an actual LAN game session between native macOS GO at 30 FPS and Windows TSH - #10

Open
Okladnoj wants to merge 2 commits into
xezon:xezon/wip-deterministic-math-v3from
Okladnoj:okji/deterministic-math-v3
Open

"Polishing" deterministic math during an actual LAN game session between native macOS GO at 30 FPS and Windows TSH#10
Okladnoj wants to merge 2 commits into
xezon:xezon/wip-deterministic-math-v3from
Okladnoj:okji/deterministic-math-v3

Conversation

@Okladnoj

Copy link
Copy Markdown

I performed detailed testing of a real native game, without any wrappers, Wine, or Parallels, between Mac and Windows.

Since the native Mac port is a fork of GeneralsOnlineDevelopmentTeam/GameClient, I tested Mac on this branch:
https://github.com/OKJID/GameClient/tree/okji/test/deterministic-math-v3

The branch is heavily covered with logs. And yes, I also moved the math from Xezon's branch into the GOD-team project fork, but this is unlikely to be suitable for the Windows team, because the Mac port is a complete mess. There is too much code there to even dream about merging it back into GeneralsOnlineDevelopmentTeam/GameClient...

In parallel, I tested Windows here:
https://github.com/Okladnoj/GeneralsGameCode/tree/okji/test/deterministic-math-v3

This is a fork from Xezon. This branch is heavily polluted with debug commits. The current PR is simply the cleaned-up result after testing.

Math-related desyncs have been fixed, and it is possible to play between Mac and Windows for hours even with a bad network. But there is one BUT... if you open the map from the Strategy Center, the game crashes. The problem here is not math, but different logic code.

In PartitionManager, there are two differences between GOD-team and TSH:

  1. The first one is in PartitionManager.cpp:1862
  • TSH/Win: for (Int x = 0; x <= y; ++x) (Bresenham midpoint)
  • GOD/Mac: for (Int x = 0; x < cellRadius; x++) (original EA code)
  1. The second one is in PartitionManager.cpp:1901-1907
  • TSH/Win: Real cellWorldX = x * cellSize; (without offset)
  • GOD/Mac: getCellCenterPos(x, y, ...)lo.x + x * cellSize (with offset)

And here I do not have the authority to change anything. If only the math from TSH is moved into GOD, then everything should already work between GO players. If/when the TSH code gets into GOD, compatibility will be absolute with both GOD and TSH in any configuration.

I did not encounter any more desyncs. Of course, I did not test every game scenario: different generals, all their abilities, plus the superposition of their combinations. But I have already spent too much time on testing and debugging, so it is time to deliver the result...

Here I am attaching two replays from the Mac side and the Windows side, from their shared game, where the crash happens because the map is opened through the Strategy Center:
temp_reps.zip

@Okladnoj
Okladnoj force-pushed the okji/deterministic-math-v3 branch from 0491578 to 4f74525 Compare June 21, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant