Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#4279 closed defect (fixed)

OOS on rejoin - vision range techs not taken into account

Reported by: elexis Owned by: elexis
Priority: Release Blocker Milestone: Alpha 21
Component: UI & Simulation Keywords:
Cc: Patch:

Description

In this svn r18830 game on a skirmish map, someone rejoined and triggered an OOS which is reproducible with the rejointest. The simstate differs in the vision range part (80m vs 88m) vision range and different dirty visibilities.

The vision range difference must come from the tower range upgrade. Notice some OOS issue with the range techs was already fixed in r16401.

Attachments (8)

oos_Dizaka.7z (1.2 MB ) - added by elexis 8 years ago.
oos_caledonian.7z.001 (2.0 MB ) - added by elexis 8 years ago.
oos_caledonian.7z.002 (2.0 MB ) - added by elexis 8 years ago.
oos_caledonian.7z.003 (1.4 MB ) - added by elexis 8 years ago.
visualreplay+savegame_v1.patch (2.0 KB ) - added by elexis 8 years ago.
Loads a savegame from a given binary serialized simstate (with a fix for cinematic manager to work with non-visual rejointest simstates), then visually replays the given commands.txt on that savegame.
update_vision_on_ownershipchange_v1.patch (2.3 KB ) - added by elexis 8 years ago.
No clue whether that works, since I can't reproduce the error without the rejointest yet.
commands.txt (28.9 KB ) - added by wraitii 8 years ago.
Minimal example to reproduce
vision_range_tooltip.diff (2.5 KB ) - added by elexis 8 years ago.
Shows the vision range in the selection details, revealing the bug on ownership change.

Change History (15)

by elexis, 8 years ago

Attachment: oos_Dizaka.7z added

comment:1 by elexis, 8 years ago

r18394 introduced a vision range upgrade of the tower r13400 introduced the outpost tower vision which yields the same OOS in another reproduction

Last edited 8 years ago by elexis (previous) (diff)

comment:2 by elexis, 8 years ago

In attachment:oos_Dizaka.7z

  • the blue player (me) researched the tower range tech
  • a CC of the green player (Cesar) was destroyed
  • thus 3 towers changed ownership to gaia
  • one tower was captured by me, the other 2 were captured by Cesar and then by me again
  • the vision range of these three towers differs in the simstate
  • can't reproduce it by repeating these steps

by elexis, 8 years ago

Attachment: oos_caledonian.7z.001 added

by elexis, 8 years ago

Attachment: oos_caledonian.7z.002 added

by elexis, 8 years ago

Attachment: oos_caledonian.7z.003 added

by elexis, 8 years ago

Loads a savegame from a given binary serialized simstate (with a fix for cinematic manager to work with non-visual rejointest simstates), then visually replays the given commands.txt on that savegame.

comment:3 by elexis, 8 years ago

Summary: OOS on rejoin - different tower vision rangeOOS on rejoin - vision range techs not taken into account
  • The OOS on the caledonian maedows game occured with r18830.
  • The skirmish map derived from the random map looks identical for the first 10-30min, but somehow it is incorrect as the replay with that map shows siole won by wonder victory, while in the original game all wonders were removed until the game ended.
  • The map is very slow to work with (much slower than the other upload, as we have to wait for turn 8504 also)
  • By applying attachment:visualreplay+savegame_v1.patch​ and passing `-load="/path/to/state.before.a" -replay-visual="/path/to/commands_replayme.txt" one can insta load the scene at the affected turn
  • The rejointest yields a failure, where the vision range of some entities affected by techs differs between host and rejoined client; for example an advanced heliot skirmisher, outposts, but weirdly also a tower foundation with 8m (tech affected) vision range! All of the entities I've checked were owned by gaia.
    @@ -478549,11 +478549,11 @@
         flags: 1
         scripted visibility: 0
         key: 48297
         x: 186.74796
         z: 217.469
    -    vision: 0
    +    vision: 8
         visibilities: 2863311530
         size: 6
         retain in fog: 1
         owner: 0
         in world: 1
    @@ -482366,11 +482366,11 @@
         flags: 1
         scripted visibility: 0
         key: 49070
         x: 43.74256
         z: 1080.32483
    -    vision: 0
    +    vision: 8
         visibilities: 2863311530
         size: 5
         retain in fog: 1
         owner: 0
         in world: 1
    
Last edited 8 years ago by elexis (previous) (diff)

by elexis, 8 years ago

No clue whether that works, since I can't reproduce the error without the rejointest yet.

comment:4 by elexis, 8 years ago

Tower foundations with 8m vision range: #4283 are not related to the OOS because, but a separate bug. (CCmpVision doesn't distinguish between foundations and finished constructions (like f.e. the Armour component does). Since the Identity and Vision component is copied by the TemplateManager, the tower range tech tech affects the vision of the foundation).

by wraitii, 8 years ago

Attachment: commands.txt added

Minimal example to reproduce

by elexis, 8 years ago

Attachment: vision_range_tooltip.diff added

Shows the vision range in the selection details, revealing the bug on ownership change.

comment:5 by elexis, 8 years ago

Owner: set to elexis
Resolution: fixed
Status: newclosed

In 18833:

Take vision range techs into account on ownership change (capturing or defeat). Solves an OOS, reviewed by wraitii, fixes #4279, refs #3989.

comment:6 by fatherbushido, 8 years ago

dont forget to update tests for the tooltip (even if we don t display it in game it s nice to have it in the dev overlay) edit: ah i didn t notice it was only for debugging!

Last edited 8 years ago by fatherbushido (previous) (diff)

comment:7 by elexis, 8 years ago

Method:

  • By adding printfs to all calls that change m_Range, I found that on the OOS turn of the first replay, the vision range is changed to a different value for the rejoined client by an MT_ValueModification.
  • That message was sent by another player having finished the research of the the persian archery range upgrade on that turn.
  • Because the message is broadcasted and because the vision component doesn't check whether it was affected by the query at all, the vision range of the tower/outpost is reloaded when the other vision range upgrade is finished.

Reproduce:

  1. Build Outpost and Tower with player 1
  2. Research the vision range tech at the Outpost
  3. Build Outpost with player 2
  4. Use the "wololo" cheat to capture the tower with player 1

Result: Player 1 owns the tower, but the vision range didn't change and is at 80m despite the player having researched the tech (seen with vision_range_tooltip.diff​).

  1. Rejoin with another client.

The client will see the upgraded vision range (120m) while the non-rejoined client still has the old vision range (80m). No OOS is triggered yet, because the Vision component isn't serialized and because the RangeManager still uses the old data which is identical to both clients.

  1. Research another vision range affecting tech, f.e. the tower range tech. This one will trigger the range manager to update and cause an OOS.
Last edited 8 years ago by elexis (previous) (diff)
Note: See TracTickets for help on using tickets.