#3450 closed defect (fixed)
[PATCH] OOS on rejoin - UnitMotion - passability map changed recently
Reported by: | elexis | Owned by: | wraitii |
---|---|---|---|
Priority: | Release Blocker | Milestone: | Alpha 19 |
Component: | Core engine | Keywords: | |
Cc: | Patch: |
Description (last modified by )
Got this oos on rejoin on r17067.
The only difference is passability map changed recently
in UnitMotion
.
I rejoined twice, no commands were issued before the first rejoin and it didn't give an OOS. But then I moved the unit three times, rejoined and got this error.
The serializationtest fails on turn 37.
Attachments (6)
Change History (27)
by , 9 years ago
Attachment: | commands.txt_oos_dump_diff_r17067.7z added |
---|
comment:1 by , 9 years ago
Owner: | set to |
---|
comment:2 by , 9 years ago
Description: | modified (diff) |
---|---|
Summary: | OOS on rejoin - UnitAI - passability map changed recently → OOS on rejoin - UnitMotion - passability map changed recently |
comment:4 by , 9 years ago
Reproduce: Move a unit and rejoin or do a serializationtest on that commands.txt.
comment:5 by , 9 years ago
Contrary to the host, the rejoined client enters GetPassabilityGrid
with m_Grid
not being initialized, thus calling UpdateGrid()
, which in the end emits the CMessagePassabilityMapChanged
message which sets that passability map changed recently
variable to true.
comment:6 by , 9 years ago
Keywords: | patch review added |
---|---|
Summary: | OOS on rejoin - UnitMotion - passability map changed recently → [PATCH] OOS on rejoin - UnitMotion - passability map changed recently |
Having fix ideas in the shower is a nice way to start the day.
by , 9 years ago
Attachment: | OOS_fix.patch added |
---|
comment:8 by , 9 years ago
Does terrain flattening influence recalculated passability maps? (AFAIK is is not supposed to so that's why this question on recalculated passability maps in general)
comment:9 by , 9 years ago
elexis: not really because I got the idea before reading your comment, but it's nice if you get to know the pathfinding code a tad more :)
FeXoR: we don't have terrain flattening, and now that you mention it it will become even harder to have it with the new pathfinder.
comment:10 by , 9 years ago
Noooooooooooooooooooooo...
If we can't have #2264 that means we cannot have bridges either, doesn't it ? :(
comment:12 by , 9 years ago
Keywords: | review removed |
---|
comment:13 by , 9 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:14 by , 9 years ago
comment:15 by , 9 years ago
Owner: | removed |
---|---|
Status: | reopened → new |
I won't have time for programming anymore during the upcoming months.
by , 9 years ago
Attachment: | oosdump_micro_r17129.7z added |
---|
Building house on turn 1. OOS on turn 2. Not OOS afterwards!
comment:17 by , 9 years ago
That cheat is not even necessary. Placing a foundation and waiting one turn is sufficient to trigger the OOS.
Use #3460 to only check after the second turn (i.e. m_TurnNumber > 1
). The serializationtest will not fail if you skip checking the first two turns.
This means the OOS endures only one turn. Made some brief multiplayer tests and didn't get the OOS. This is consistent with the theory of having that OOS only for one turn.
This probably means that the message in r17097 (= commit above) arrives one turn late.
comment:18 by , 9 years ago
By adding debug output, you can see that in the primary simulation (== host), the CMessagePassabilityMapChanged
is both sent and received on turn 1 (the turn where the foundation was placed). But in the secondary simulation (== rejoined client), the message is not being sent at all!
Turn 1 (200)... PRIMARY SIMULATION SENDING MESSAGE UnitMotion MessageReceived: m_PassabilityMapChangedRecently = true SECONDARY SIMULATION Simulation2.cpp(323): Assertion failed: "0 && (L"Serialization test failure")"
Thus m_PassabilityMapChangedRecently
will never be set true
for the rejoined client, while it is true
for the host.
As the comment added in r17097 / r16998 mentions, the message is only being sent if !m_ObstructionsDirty.globallyDirty
:
// Notify the units that their current paths can be invalid now. // The passability map will be globally dirty after init, or rejoining, loading a saved game, etc. // In those situations the paths can't be invalid.
It might be true that there is no need to inform the units that their path can be invalid. Yet we need to have the same value for PassabilityMapChangedRecently
(otherwise OOS, despite having the same waypoints).
by , 9 years ago
Attachment: | t3450_do_not_serialize_m_PassabilityMapChangedRecently_v1.patch added |
---|
Resolves the discrepancy by just not serializing that value. Works all commands.txt
files linked but needs further testing. Could there be a case where serializing that state is required?
comment:19 by , 9 years ago
Keywords: | review added |
---|
comment:21 by , 8 years ago
Keywords: | patch review removed |
---|
FYI this has been fixed by removing the message entirely, the core origin of the OOS has NOT been fixed. I haven't looked enough into the code to guarantee that a similar function won't cause a similar OOS in the future, but for now we are good.
The
passability map changed recently
part inUnitMotion
of entity2393
is wrong. It is the id of the entity that was moved. It istrue
for the rejoined client, butfalse
for the host.