Opened 6 months ago

Last modified 2 months ago

#6888 reopened defect

Game desync on revision 27926

Reported by: Riesi Owned by: wowgetoffyourcellphone
Priority: Must Have Milestone: Alpha 27
Component: Core engine Keywords:
Cc: Patch:

Description

After playing some time we got a desync. I am playing with a git build from revision 27926 on Linux and the host was on the automated Windows build.

Attachments (3)

Onager shader erros -- logs and replay.zip (379.1 KB ) - added by Riesi 4 months ago.
locate_issue.diff (2.9 KB ) - added by Vladislav Belov 2 months ago.
Patch by elexis to be able to reproduce the preview bug and get a stack
simple_fix.diff (1.8 KB ) - added by Vladislav Belov 2 months ago.
Patch by elexis to fix the preview bug

Download all attachments as: .zip

Change History (26)

comment:1 by Riesi, 6 months ago

Google Drive link to the required files, because they are bigger than the 2MB attachment size: https://drive.google.com/file/d/1S0sv_YonFe4gg-jcnjoMN91V1uh7gUc-/view?usp=sharing

comment:2 by Vladislav Belov, 6 months ago

Milestone: BacklogAlpha 27
Priority: Should HaveRelease Blocker

I can reproduce the errors in visual and non-visual replays (haven't reproduced OOS yet).

comment:3 by Riesi, 6 months ago

Great. Maybe the error was the reason for the desync later? If you need anything else, I can try to provide it''''

comment:4 by phosit, 6 months ago

steps to reproduce (originaly by elexis)

  1. Start a game as the romans.
  2. Build a fortress. (You can use the "gift from the gods" cheat)
  3. Add citizen soldiers to a training-queue.
  4. Research Marian Reforms.

The bug became visible by [27900].

comment:5 by gameboy, 6 months ago

@wowgetoffyourcellphone

in reply to:  4 ; comment:6 by real_tabasco_sauce, 5 months ago

Replying to phosit:

steps to reproduce (originaly by elexis)

  1. Start a game as the romans.
  2. Build a fortress. (You can use the "gift from the gods" cheat)
  3. Add citizen soldiers to a training-queue.
  4. Research Marian Reforms.

The bug became visible by [27900].

Ok I reproduced. The issue is that the technology changes the available units as one is being trained, so its an edge case that is not accounted for. I have no idea how to account for this. I think this will be an issue if we ever want technologies that change unit availability in the way it is done in this patch. I suppose a way to solve the issue would be to change the upgrade to use instant promotion instead of changing unit availability.

in reply to:  6 ; comment:7 by phosit, 5 months ago

Replying to real_tabasco_sauce:

I suppose a way to solve the issue would be to change the upgrade to use instant promotion instead of changing unit availability.

That's a hack.

The solution I see is that when a tech is researched we remove units wich are not available anymore from all training queues.

This is by elexis:

  1. The JS Timer error is unrelated to the OOS.
  2. Just before the OOS, in the mainlog.html file of the windows player we can find a shader error: "ERROR: Program 'spirv/model_solid_player' with required defines not found." It was a siege onager that ocurred for the first time.

in reply to:  7 comment:8 by real_tabasco_sauce, 5 months ago

Replying to phosit:

Replying to real_tabasco_sauce:

I suppose a way to solve the issue would be to change the upgrade to use instant promotion instead of changing unit availability.

That's a hack.

The solution I see is that when a tech is researched we remove units wich are not available anymore from all training queues.

This is by elexis:

  1. The JS Timer error is unrelated to the OOS.
  2. Just before the OOS, in the mainlog.html file of the windows player we can find a shader error: "ERROR: Program 'spirv/model_solid_player' with required defines not found." It was a siege onager that ocurred for the first time.

Well I guess its a hack that works pretty well. I made a patch for it in case a better fix cannot be found. It might actually be better to convert the units instantly anyway, just to avoid the player's confusion.

comment:9 by Riesi, 4 months ago

Any news on the Marian Reforms bug?
I have finally a working Phabricator account, so I got the notifications from:
https://code.wildfiregames.com/D5206

As far as I can tell the MR is done, but sits there for a few weeks already.

Would be cool to get this bug squashed :)

comment:10 by Stan, 4 months ago

You should ask on that differential directly, answering sends an e-mail, shows it in the home left queue, and potentially triggers interest :)

comment:11 by Riesi, 4 months ago

I was able to get the siege onager error once on my Linux box when trying to build it with the Legionary, but after it appearing once it doesnt come up anymore. I guess due to caching the shaders?

in reply to:  11 comment:12 by Vladislav Belov, 4 months ago

Replying to Riesi:

I was able to get the siege onager error once on my Linux box when trying to build it with the Legionary, but after it appearing once it doesnt come up anymore. I guess due to caching the shaders?

Do you have logs from that run? Also did you have a shader error when it happened?

comment:13 by Riesi, 4 months ago

I attached the files now that the bug tracker doesnt throw a page not found at me finally (this happens quite often?!?)

To reproduce the Onager Error:
1) delete the .cache/0ad folder content
2) run the game with Vulkan
3) start a game with Romans
4) "gift from the gods"
5) Marian Reforms from the fortress
6) build an Onager with your Legionaries
7) the moment you click the Onager icon the error should appear

Last edited 4 months ago by Riesi (previous) (diff)

comment:14 by Vladislav Belov, 3 months ago

There are at least 3 issues in this ticket:

  1. OOS. It happens with all renderer backends.
    1. Triggered by preview of the siege onager (introduced by r27900), it's the first and only case when a unit places another unit with a BuildRestrictions component.
    2. Steps above about technology changes.
  2. SPIR-V errors for Vulkan backend. They don't affect the OOS above. Errors are fixed in 0.27.22 of the 0ad-spirv mod (you need to download the new version from mod.io).
  3. Errors in Timer.
    ERROR: Error in timer on entity 3876, IID81, function ProgressTimeout: TypeError: item is undefined Trainer.prototype.Progress@simulation/components/Trainer.js:666:19 
    ProductionQueue.prototype.Item.prototype.Progress@simulation/components/ProductionQueue.js:128:31
    ProductionQueue.prototype.ProgressTimeout@simulation/components/ProductionQueue.js:423:16 Timer.prototype.OnUpdate@simulation/components/Timer.js:140:44
    

comment:15 by real_tabasco_sauce, 3 months ago

I think items 2 and 3 are dealt with now (patch and new spriv update). How should I go about testing the OOS? will it work with an AI opponent in a multiplayer game? Also, where is the .cache/0ad file typically stored for macos?

comment:16 by Freagarach, 3 months ago

[11:16:34] <elexis> #6888 the only difference in the OOS dumps is RNG
[11:16:59] <elexis> the cause is that wow introduced a unit that is built by a unit, but the "building preview code" is only made for buildings
[11:17:53] <elexis> one of the components of the preview unit is somehow calling a random function that it isnt allowed to, while building previews dont

comment:17 by wowgetoffyourcellphone, 3 months ago

Owner: set to wowgetoffyourcellphone
Resolution: fixed
Status: newclosed

In 28021:

[Gameplay][fix] Use a promotion approach for Roman reforms special tech

Patch by: @real_tabasco_sauce
Accepted by: @borg-, @Riesi, @wowgetoffyourcellphone
Comments by: @phosit, @vladislavbelov

Differential Revision: https://code.wildfiregames.com/D5206
Fixes #6888

comment:18 by Vladislav Belov, 2 months ago

Priority: Release BlockerMust Have
Resolution: fixed
Status: closedreopened

The OOS problem isn't fixed yet.

in reply to:  18 ; comment:19 by real_tabasco_sauce, 2 months ago

Replying to Vladislav Belov:

The OOS problem isn't fixed yet.

I guess the only other cause could be that the template still has the build-restrictions section. https://code.wildfiregames.com/D5245

in reply to:  19 comment:20 by Vladislav Belov, 2 months ago

Replying to real_tabasco_sauce:

I guess the only other cause could be that the template still has the build-restrictions section. https://code.wildfiregames.com/D5245

No, we have a random selection in the Identity.

comment:21 by real_tabasco_sauce, 2 months ago

Ok, then why does this not happen with other siege units? There shouldn't be a preview unit is the unit can no longer be built. My last two patches have completely removed onager construction, so that they behave exactly like the other siege units.

Last edited 2 months ago by real_tabasco_sauce (previous) (diff)

in reply to:  21 comment:22 by Vladislav Belov, 2 months ago

Replying to real_tabasco_sauce:

Ok, then why does this not happen with other siege units? There shouldn't be a preview unit is the unit can no longer be built. My last two patches have completely removed onager construction, so that they behave exactly like the other siege units.

Because only that unit was able to build another unit. Removing that possibility only hides the problem but doesn't fix it. Because adding another unit in the future (maybe mod) with such possibility will reveal the problem again.

comment:23 by real_tabasco_sauce, 2 months ago

ah I see. Sorry for the misunderstanding.

by Vladislav Belov, 2 months ago

Attachment: locate_issue.diff added

Patch by elexis to be able to reproduce the preview bug and get a stack

by Vladislav Belov, 2 months ago

Attachment: simple_fix.diff added

Patch by elexis to fix the preview bug

Note: See TracTickets for help on using tickets.