#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)
Change History (9)
by , 9 years ago
Attachment: | commands.txt added |
---|
comment:1 by , 9 years ago
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.
by , 9 years ago
Attachment: | ticket3142.diff added |
---|
comment:3 by , 9 years ago
Milestone: | Backlog → Alpha 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.
comment:4 by , 9 years ago
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:6 by , 9 years ago
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.
comands.txt