Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Occasional Incorrect Start Position #20

Open
Jazcash opened this issue Aug 30, 2024 · 0 comments
Open

Occasional Incorrect Start Position #20

Jazcash opened this issue Aug 30, 2024 · 0 comments

Comments

@Jazcash
Copy link
Member

Jazcash commented Aug 30, 2024

Randomly decided to investigate what's causing this bug more closely, which leads to incorrect start positions showing on the website:

image

I believe the culprit stems from this section of engine code: https://github.com/beyond-all-reason/spring/blob/2ef0794f99d9215f44c07ec7aae57fe8c4600caa/rts/Net/NetCommands.cpp#L517-L528

The ingame UI doesn't allow players to place outside of their start box, but clients still send STARTPOS commands anyway, and the engine clamps/ignores them here.

Because the demo parser doesn't know the exact dimensions of the map, along with start box sizes always being on a scale of 0-200, but with STARTPOS position data being absolute map locations - I don't think this problem is solvable without a game or engine change.

Invalid start pos placement could be caught client side before they're sent over the network, but there could still be oddities with the final placement, e.g. if the player doesn't pick a spot at all and the game decides for them. So unfortunately I think the best solution to this problem is writing a gadget to SendLuaRulesMsg the one, true spawn position of each player's commander once the game starts, so it can be parsed from the replay.

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

No branches or pull requests

1 participant