"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
Conversation
Okladnoj
force-pushed
the
okji/deterministic-math-v3
branch
from
June 20, 2026 00:14
094e5bd to
0491578
Compare
Okladnoj
force-pushed
the
okji/deterministic-math-v3
branch
from
June 21, 2026 11:27
0491578 to
4f74525
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
for (Int x = 0; x <= y; ++x)(Bresenham midpoint)for (Int x = 0; x < cellRadius; x++)(original EA code)Real cellWorldX = x * cellSize;(without offset)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