Opened 12 years ago

Closed 11 years ago

#1681 closed defect (fixed)

Serialization test fails due to projectiles

Reported by: historic_bruno Owned by: Jonathan Waller
Priority: Must Have Milestone: Alpha 12
Component: Core engine Keywords:
Cc: Jonathan Waller Patch:

Description

Apparently projectiles are using model (VisualActor) data that influences the simulation via a projectileID. Models shouldn't influence the simulation because they aren't synchronization safe, but this test in particular is failing because it creates a secondary simulation to compare the predicted simulation state with the actual one. This secondary simulation has no visual components, which would cause e.g. CCmpProjectileManager::LaunchProjectile to silently return 0 for an ID, which wouldn't match up with the actual projectileID.

It's very easy to reproduce this:

  • set CSimulation2Impl::m_EnableSerializationTest to true and rebuild
  • create a test scenario with a ranged unit
  • attack a target, and the test fails

I'm attaching the oos logs anyway, and here is the diff between the debug state logs:

--- debug.after.a	2012-09-24 17:32:36.730352300 -0400
+++ debug.after.b	2012-09-24 17:32:27.636832200 -0400
@@ -69430,7 +69430,7 @@
           "x": 0.9986754490469063,
           "z": 0.051452380615089145
         },
-        "projectileId": 1
+        "projectileId": 0
       }
     ],
     "8": [
@@ -69451,7 +69451,7 @@
           "x": -0.9993504712481683,
           "z": 0.03603658718668677
         },
-        "projectileId": 2
+        "projectileId": 0
       }
     ]
   }

Attachments (1)

oos_log.zip (70.2 KB ) - added by historic_bruno 12 years ago.

Download all attachments as: .zip

Change History (4)

by historic_bruno, 12 years ago

Attachment: oos_log.zip added

comment:1 by historic_bruno, 12 years ago

Cc: Jonathan Waller added

I'm thinking this is also the cause of OOS errors during rejoin (to reproduce, start a multiplayer game with no AIs but have some ranged unit attacks going on while the client disconnects and rejoins). Either the projectile code needs to be redesigned or the projectileID needs to be a non-synced variable somehow.

Last edited 12 years ago by historic_bruno (previous) (diff)

comment:2 by historic_bruno, 12 years ago

Milestone: BacklogAlpha 12
Priority: Should HaveMust Have

comment:3 by Jonathan Waller, 11 years ago

Owner: set to Jonathan Waller
Resolution: fixed
Status: newclosed

In 12865:

Network synchronise the projectile id to prevent out of sync errors. Fixes #1681

Note: See TracTickets for help on using tickets.