Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#3142 closed defect (fixed)

[PATCH] game with 8 players on a giant map prints many js errors at some point

Reported by: matanya Owned by: mimo
Priority: Should Have Milestone: Alpha 19
Component: Core engine Keywords:
Cc: Patch:

Description

ERROR: JavaScript error: simulation/ai/petra/entity-extend.js line 8 TypeError?: ent is undefined

m.getMaxStrength@simulation/ai/petra/entity-extend.js:8:6 m.Army.prototype.evaluateStrength@simulation/ai/petra/army.js:94:6 m.Army.prototype.recalculateStrengths@simulation/ai/petra/army.js:86:3 m.Army.prototype.merge@simulation/ai/petra/army.js:284:2 m.DefenseManager?.prototype.checkEnemyArmies@simulation/ai/petra/defenseManager.js:181:5 m.DefenseManager?.prototype.update@simulation/ai/petra/defenseManager.js:20:2 m.HQ.prototype.update@simulation/ai/petra/headquarters.js:1801:2 m.PetraBot.prototype.OnUpdate?@simulation/ai/petra/_petrabot.js:123:3 m.BaseAI.prototype.HandleMessage?@simulation/ai/common-api/baseAI.js:83:2

Attachments (3)

commands.txt (303.5 KB) - added by matanya 5 years ago.
comands.txt
logs.tar.gz (269.4 KB) - added by matanya 5 years ago.
logs
ticket3142.diff (1.0 KB) - added by mimo 5 years ago.

Download all attachments as: .zip

Change History (9)

Changed 5 years ago by matanya

Attachment: commands.txt added

comands.txt

Changed 5 years ago by matanya

Attachment: logs.tar.gz added

logs

comment:1 Changed 5 years ago by elexis

He said he uses linux, the alpha 18 release version of 0ad and that he had this error in multiple matches.

The two html logfiles contain the exact same errors. All errors seem to be related to a missing entity.

Reportedly this error happened on a17 too.

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

comment:2 Changed 5 years ago by elexis

Replaying the commands.txt reproduces the errors!

Changed 5 years ago by mimo

Attachment: ticket3142.diff added

comment:3 Changed 5 years ago by mimo

Milestone: BacklogAlpha 19
Summary: game with 8 players on a giant map prints many js errors at some point[PATCH] game with 8 players on a giant map prints many js errors at some point

Should be fixed with the patch attached. I'll do more tests and commit it later.

The problem was that the AI is only warned of a new entity when its owner change (for historical reasons). But when an entity had no room to be spawned, it could wait several turns before being spawned (in the entitycache array) and in the meantime, the AI received some updates of entities it was not aware of.

Last edited 5 years ago by mimo (previous) (diff)

comment:4 Changed 5 years ago by mimo

In fact, the previous patch was not satisfactory as AIProxy was expecting a certain behaviour from the simulation.(i.e. setting the entity ownership on the same turn as the entity creation) and the patch tried to force the simulation to this expectation. I'm going to fix it differently by removing this expectation from AIProxy.

comment:5 Changed 5 years ago by mimo

Owner: set to mimo
Resolution: fixed
Status: newclosed

In 16467:

let AIProxy deal with new entities created without ownership, fixes #3142

comment:6 Changed 5 years ago by mimo

Thanks for the report. This is fixed in svn. A way around for A18 is refraining to train batches of 10 ships :-) because finding room to spawn all of them at once may be rather difficult.

Note: See TracTickets for help on using tickets.