Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3110 closed defect (fixed)

Petra errors when starting with no entities

Reported by: historic_bruno Owned by: mimo
Priority: Should Have Milestone: Alpha 19
Component: AI Keywords:
Cc: Patch:

Description

This should never happen on real maps, but I was lazy and made a test map with too many players and not enough entities, and got these errors:

WARNING: PlayerID 3 | Petra error: it does not know how to interpret this map
WARNING: JavaScript warning: simulation/ai/common-api/terrain-analysis.js line 442 reference to undefined property this.regionLinks[startRegion]
ERROR: JavaScript error: simulation/ai/common-api/terrain-analysis.js line 442 TypeError: this.regionLinks[startRegion] is undefined m.Accessibility.prototype.getTrajectToIndex@simulation/ai/common-api/terrain-analysis.js:442:1 m.HQ.prototype.regionAnalysis@simulation/ai/petra/startingStrategy.js:182:9 m.HQ.prototype.gameAnalysis@simulation/ai/petra/startingStrategy.js:10:2 m.PetraBot.prototype.CustomInit@simulation/ai/petra/_petrabot.js:90:3 m.BaseAI.prototype.Init@simulation/ai/common-api/baseAI.js:64:2 InitGame@simulation/helpers/InitGame.js:72:2
WARNING: PlayerID 4 | Petra error: it does not know how to interpret this map
ERROR: JavaScript error: simulation/ai/common-api/terrain-analysis.js line 442 TypeError: this.regionLinks[startRegion] is undefined m.Accessibility.prototype.getTrajectToIndex@simulation/ai/common-api/terrain-analysis.js:442:1 m.HQ.prototype.regionAnalysis@simulation/ai/petra/startingStrategy.js:182:9 m.HQ.prototype.gameAnalysis@simulation/ai/petra/startingStrategy.js:10:2 m.PetraBot.prototype.CustomInit@simulation/ai/petra/_petrabot.js:90:3 m.BaseAI.prototype.Init@simulation/ai/common-api/baseAI.js:64:2 InitGame@simulation/helpers/InitGame.js:72:2
WARNING: PlayerID 5 | Petra error: it does not know how to interpret this map
ERROR: JavaScript error: simulation/ai/common-api/terrain-analysis.js line 442 TypeError: this.regionLinks[startRegion] is undefined m.Accessibility.prototype.getTrajectToIndex@simulation/ai/common-api/terrain-analysis.js:442:1 m.HQ.prototype.regionAnalysis@simulation/ai/petra/startingStrategy.js:182:9 m.HQ.prototype.gameAnalysis@simulation/ai/petra/startingStrategy.js:10:2 m.PetraBot.prototype.CustomInit@simulation/ai/petra/_petrabot.js:90:3 m.BaseAI.prototype.Init@simulation/ai/common-api/baseAI.js:64:2 InitGame@simulation/helpers/InitGame.js:72:2
WARNING: PlayerID 6 | Petra error: it does not know how to interpret this map
ERROR: JavaScript error: simulation/ai/common-api/terrain-analysis.js line 442 TypeError: this.regionLinks[startRegion] is undefined m.Accessibility.prototype.getTrajectToIndex@simulation/ai/common-api/terrain-analysis.js:442:1 m.HQ.prototype.regionAnalysis@simulation/ai/petra/startingStrategy.js:182:9 m.HQ.prototype.gameAnalysis@simulation/ai/petra/startingStrategy.js:10:2 m.PetraBot.prototype.CustomInit@simulation/ai/petra/_petrabot.js:90:3 m.BaseAI.prototype.Init@simulation/ai/common-api/baseAI.js:64:2 InitGame@simulation/helpers/InitGame.js:72:2
WARNING: PlayerID 7 | Petra error: it does not know how to interpret this map
ERROR: JavaScript error: simulation/ai/common-api/terrain-analysis.js line 442 TypeError: this.regionLinks[startRegion] is undefined m.Accessibility.prototype.getTrajectToIndex@simulation/ai/common-api/terrain-analysis.js:442:1 m.HQ.prototype.regionAnalysis@simulation/ai/petra/startingStrategy.js:182:9 m.HQ.prototype.gameAnalysis@simulation/ai/petra/startingStrategy.js:10:2 m.PetraBot.prototype.CustomInit@simulation/ai/petra/_petrabot.js:90:3 m.BaseAI.prototype.Init@simulation/ai/common-api/baseAI.js:64:2 InitGame@simulation/helpers/InitGame.js:72:2
WARNING: PlayerID 8 | Petra error: it does not know how to interpret this map
ERROR: JavaScript error: simulation/ai/common-api/terrain-analysis.js line 442 TypeError: this.regionLinks[startRegion] is undefined m.Accessibility.prototype.getTrajectToIndex@simulation/ai/common-api/terrain-analysis.js:442:1 m.HQ.prototype.regionAnalysis@simulation/ai/petra/startingStrategy.js:182:9 m.HQ.prototype.gameAnalysis@simulation/ai/petra/startingStrategy.js:10:2 m.PetraBot.prototype.CustomInit@simulation/ai/petra/_petrabot.js:90:3 m.BaseAI.prototype.Init@simulation/ai/common-api/baseAI.js:64:2 InitGame@simulation/helpers/InitGame.js:72:2

Change History (6)

comment:1 by agentx, 9 years ago

I'm not sure how to deal with this too. I think for map designers any error message in the console is good enough. Beside documented minimal map requirements for bots, what do you expect as a helpful response?

The thing is the less is on the map the more code is needed to find that slim theoretical path to boot up an AI.

comment:2 by historic_bruno, 9 years ago

Honestly, as a player I don't expect any response :) AI developers might want to know about terrain analysis and starting entities, but there wouldn't be warnings for non-AI players with no entities. Maybe when saving the map in Atlas, but not once the game is started.

The AI should simply do no work unless it somehow obtains entities, but that could only happen with triggers(?), but that is an edge case of an edge case.

comment:3 by mimo, 9 years ago

Owner: set to mimo
Resolution: fixed
Status: newclosed

In 17033:

petra: exit immediately when no entities, fix #3110

comment:4 by mimo, 9 years ago

Milestone: BacklogAlpha 19

comment:5 by brian, 9 years ago

In AoK, I had to create a hidden unit somewhere (usually in a corner surrounded by cliffs) so that the computer player would not be defeated. I would use triggers to create an army later (with a countdown delay). Worked great for siege maps where you had a limited time to prepare. Will this still be possible after the recent changes or will it require hiding a unit as before?

comment:6 by mimo, 9 years ago

Well, petra is presently not really suited for such a game mode. We would anyway need to adapt it or have a specialized AI for that purpose.

Note: See TracTickets for help on using tickets.