Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#3399 closed defect (fixed)

[PATCH] OOS on rejoin - percentage of map controlled

Reported by: elexis Owned by: elexis
Priority: Must Have Milestone: Alpha 19
Component: UI & Simulation Keywords:
Cc: Patch:

Description

<   "peakPercentMapControlled": 0,
<   "teamPeakPercentMapControlled": 0
---
>   "peakPercentMapControlled": 1,
>   "teamPeakPercentMapControlled": 1

Details will follow.

Refs #3321 #3378

Attachments (4)

oosdump_r16988.7z (1.2 MB ) - added by elexis 9 years ago.
Sample for r16988. Set of commands not minimized yet. Can't do serializationtest because of #3400.
3399.patch (921 bytes ) - added by s0600204 9 years ago.
The afore-mentioned patch-to-be.
commands_cheatphase.txt (1.3 KB ) - added by elexis 9 years ago.
Uses cheat to change phase on turn 0, serializationtest error on turn 1. r17131
t3399_serialize_mapcontrol_trigger_v1.patch (1.1 KB ) - added by elexis 9 years ago.
Fixes the OOS in case we would not commit #3525. If we commit that, then this patch is not necessary anymore (at least for this particular case where we age using a cheat). We might want to serialize it anyway, as there might be other unidentified cases.

Download all attachments as: .zip

Change History (13)

by elexis, 9 years ago

Attachment: oosdump_r16988.7z added

Sample for r16988. Set of commands not minimized yet. Can't do serializationtest because of #3400.

comment:1 by s0600204, 9 years ago

mimo on #0ad-dev:

could it be that the first computation is done on the square map, before recognizing it is a circular map?

Full points. ;)

Yes, the problem appears to be that the cost grid for territories is sometimes calculated whilst the map is still a square, and is then not recalculated after the map is reshaped into a circle.

Oddly enough, its the host that ends up with an incorrect cost grid - the rejoined client is calculating the grid correctly, albeit on the second go.

Coincidentally, I found that the map "Greek Acropolis Night (2)" also suffers from the same OOS problem.

The solution given in the soon-to-be-attached patch is to subscribe to and listen for a message that is transmitted when a map has changed shape, and to recompute the cost grid after receiving it.

by s0600204, 9 years ago

Attachment: 3399.patch added

The afore-mentioned patch-to-be.

comment:2 by s0600204, 9 years ago

Keywords: review patch added

comment:3 by leper, 9 years ago

Owner: set to leper
Resolution: fixed
Status: newclosed

In 16990:

Recompute the cost grid in the TerritoryManager when needed. Patch by s0600204. Fixes #3399, #3400.

comment:4 by leper, 9 years ago

Keywords: review removed

by elexis, 9 years ago

Attachment: commands_cheatphase.txt added

Uses cheat to change phase on turn 0, serializationtest error on turn 1. r17131

comment:5 by elexis, 9 years ago

Priority: Release BlockerShould Have
Resolution: fixed
Status: closedreopened

Couldn't reproduce the error by phasing without cheats (yet?).

<   "peakPercentMapControlled": 5,
<   "teamPeakPercentMapControlled": 5
---
>   "peakPercentMapControlled": 9,
>   "teamPeakPercentMapControlled": 9

by elexis, 9 years ago

Fixes the OOS in case we would not commit #3525. If we commit that, then this patch is not necessary anymore (at least for this particular case where we age using a cheat). We might want to serialize it anyway, as there might be other unidentified cases.

comment:6 by elexis, 9 years ago

Keywords: review added
Priority: Should HaveMust Have
Summary: OOS on rejoin - percentage of map controlled[PATCH] OOS on rejoin - percentage of map controlled

comment:7 by Stan, 9 years ago

Owner: changed from leper to elexis
Status: reopenednew

comment:8 by JoshuaJB, 8 years ago

Resolution: fixed
Status: newclosed

In 17171:

Fix #3525 and #3399 by recalculating territories on request to GetTerritoryPercentage. Patch by elexis

comment:9 by Josh, 8 years ago

Keywords: patch review removed

I decided to adopt #3525's fix over this one. Thanks for the patch anyway.

Note: See TracTickets for help on using tickets.