gameboy Posted March 29, 2014 Report Share Posted March 29, 2014 @MIMO: I started a new game, a warning message appears:<h2>0 A.D. Main log (warnings and errors only)</h2><p class="warning">WARNING: JavaScript warning: simulation/components/TechnologyManager.js line 124reference to undefined property template.requirements</p><p class="warning">WARNING: JavaScript warning: simulation/components/Player.js line 385reference to undefined property this.diplomacy[idx]</p><p class="warning">WARNING: JavaScript warning: simulation/components/Player.js line 478reference to undefined property this.diplomacy[id]</p><p class="warning">WARNING: JavaScript warning: simulation/components/ProductionQueue.js line 111reference to undefined property template.Promotion</p><p class="warning">WARNING: JavaScript warning: gui/session/input.js line 1086reference to undefined property ev.hotkey</p><p class="warning">WARNING: JavaScript warning: simulation/ai/petra/queueplan-building.js line 58reference to undefined property this.buildingsBuilt</p><p class="warning">WARNING: JavaScript warning: gui/session/input.js line 487reference to undefined property entState.unitAI</p><p class="warning">WARNING: JavaScript warning: simulation/components/GuiInterface.js line 934reference to undefined property this.entsRallyPointsDisplayed</p><p class="warning">WARNING: JavaScript warning: gui/session/input.js line 422reference to undefined property entState.resourceGatherRates</p> Quote Link to comment Share on other sites More sharing options...
gameboy Posted March 29, 2014 Report Share Posted March 29, 2014 @Friends: About loading and saving issues, it is indeed an important question, we all expect to solve this problem in a new AI Petra. I hope this feature early date. Quote Link to comment Share on other sites More sharing options...
Yves Posted March 29, 2014 Report Share Posted March 29, 2014 @gameboyThe warnings you reported today aren't related to the new AI.I've committed the SpiderMonkey upgrade yesterday and it enables some more warnings.We plan to look at these and solve them properly.EDIT: well one was... but it looks like mimo fixed it. Quote Link to comment Share on other sites More sharing options...
gameboy Posted March 29, 2014 Report Share Posted March 29, 2014 (edited) @Yves: But in the game, some of the new warning appears again:<h2>0 A.D. Main log (warnings and errors only)</h2><p class="warning">WARNING: JavaScript warning: simulation/components/TechnologyManager.js line 124reference to undefined property template.requirements</p><p class="warning">WARNING: JavaScript warning: simulation/components/Player.js line 385reference to undefined property this.diplomacy[idx]</p><p class="warning">WARNING: JavaScript warning: simulation/components/Player.js line 478reference to undefined property this.diplomacy[id]</p><p class="warning">WARNING: JavaScript warning: simulation/components/ProductionQueue.js line 111reference to undefined property template.Promotion</p><p class="warning">WARNING: JavaScript warning: gui/session/input.js line 1086reference to undefined property ev.hotkey</p><p class="warning">WARNING: JavaScript warning: gui/session/input.js line 487reference to undefined property entState.unitAI</p><p class="warning">WARNING: JavaScript warning: simulation/components/GuiInterface.js line 934reference to undefined property this.entsRallyPointsDisplayed</p><p class="warning">WARNING: JavaScript warning: gui/session/input.js line 422reference to undefined property entState.resourceGatherRates</p><p class="warning">WARNING: JavaScript warning: simulation/components/GuiInterface.js line 667reference to undefined property template.icon</p>s<p class="warning">WARNING: JavaScript warning: simulation/helpers/Commands.js line 222reference to undefined property cmd.metadata</p><p class="warning">WARNING: JavaScript warning: simulation/components/ProductionQueue.js line 540reference to undefined property data.target</p><p class="warning">WARNING: JavaScript warning: gui/session/selection_details.js line 214reference to undefined property entState.attack</p><p class="warning">WARNING: JavaScript warning: gui/session/input.js line 494reference to undefined property entState.rallyPoint</p><p class="warning">WARNING: JavaScript warning: simulation/components/GuiInterface.js line 1724reference to undefined property waterPoints[start]</p><p class="warning">WARNING: JavaScript warning: simulation/components/UnitAI.js line 5392reference to undefined property this.heldPosition</p><p class="warning">WARNING: JavaScript warning: gui/session/messages.js line 357reference to undefined property msg.guid</p> Edited March 29, 2014 by gameboy Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted March 29, 2014 Report Share Posted March 29, 2014 We plan to look at these and solve them properly. @Yves: But in the game, some of the new warning appears again: Which is exactly what Yves said. We need to investigate if these warnings are bugs or harmless. This may take a few days. Now I suggest to get back on topic. Which is discussing the new Petra AI, without the saved-game issue, as that's an issue that's a problem for all AIs. Quote Link to comment Share on other sites More sharing options...
gameboy Posted March 29, 2014 Report Share Posted March 29, 2014 (edited) @sanderd17:OK, my friend sanderd17!@MIMO:Thank you very much ongoing efforts to build Petra AI. We are all very much looking forward to your early implementation supports saving and loading of the AI​​, Edited March 29, 2014 by gameboy Quote Link to comment Share on other sites More sharing options...
gameboy Posted April 1, 2014 Report Share Posted April 1, 2014 Warning again:<h2>0 A.D. Main log (warnings and errors only)</h2><p class="warning">WARNING: JavaScript warning: gui/session/input.js line 1086reference to undefined property ev.hotkey</p><p class="warning">WARNING: JavaScript warning: simulation/ai/common-api/terrain-analysis.js line 137reference to undefined property this.map[index]</p><p class="warning">WARNING: JavaScript warning: simulation/ai/common-api/terrain-analysis-pathfinder.js line 207reference to undefined property this.widthMap[index]</p> Quote Link to comment Share on other sites More sharing options...
leper Posted April 15, 2014 Report Share Posted April 15, 2014 Got a new error (commands.txt attached) (r14932)ERROR: JavaScript error: simulation/ai/petra/defenseManager.js line 343 TypeError: target.attackRange(...) is undefined m.DefenseManager.prototype.checkDefenseStructures@simulation/ai/petra/defenseManager.js:343 m.DefenseManager.prototype.update@simulation/ai/petra/defenseManager.js:20 m.HQ.prototype.update@simulation/ai/petra/headquarters.js:1712 m.PetraBot.prototype.OnUpdate@simulation/ai/petra/_petrabot.js:182 m.BaseAI.prototype.HandleMessage@simulation/ai/common-api/baseAI.js:83commands.txt Quote Link to comment Share on other sites More sharing options...
gameboy Posted April 15, 2014 Report Share Posted April 15, 2014 @leper: Today I tested the latest Svn14933, the game appeared a new warning:<h2>0 A.D. Main log (warnings and errors only)</h2><p class="warning">WARNING: JavaScript warning: simulation/helpers/Commands.js line 222reference to undefined property cmd.metadata</p> Quote Link to comment Share on other sites More sharing options...
niektb Posted April 15, 2014 Report Share Posted April 15, 2014 Is not related to AI. Quote Link to comment Share on other sites More sharing options...
Radagast. Posted April 15, 2014 Report Share Posted April 15, 2014 (edited) AI also uses Command.js: It's about training a unit. The Metadata seems missing. But why is not obvious from your error message gameboy. Can you post the commands.txt? var cmpTechnologyManager = QueryOwnerInterface(ent, IID_TechnologyManager); if (cmpTechnologyManager.CanProduce(cmd.template)) { var queue = Engine.QueryInterface(ent, IID_ProductionQueue); // Check if the building can train the unit if (queue && queue.GetEntitiesList().indexOf(cmd.template) != -1) queue.AddBatch(cmd.template, "unit", +cmd.count, cmd.metadata); } else if (g_DebugCommands) { warn("Invalid command: training requires unresearched technology: " + uneval(cmd)); }Look for the file:logs/sim_log/<number>/commands.txt Edited April 15, 2014 by Hephaestion Quote Link to comment Share on other sites More sharing options...
niektb Posted April 15, 2014 Report Share Posted April 15, 2014 Hephaestion, this is warning generated by the new SpiderMonkey. Quote Link to comment Share on other sites More sharing options...
Radagast. Posted April 15, 2014 Report Share Posted April 15, 2014 Thx. I didn't play the game for months. So the Spidermonkey doesn't allow passing undefined values anymore? Now I begin to understand agentx ... or am I getting it wrong again? Quote Link to comment Share on other sites More sharing options...
Stan` Posted April 15, 2014 Report Share Posted April 15, 2014 I think that's what they said. Quote Link to comment Share on other sites More sharing options...
mimo Posted April 20, 2014 Author Report Share Posted April 20, 2014 Got a new error (commands.txt attached) (r14932)ERROR: JavaScript error: simulation/ai/petra/defenseManager.js line 343 TypeError: target.attackRange(...) is undefined m.DefenseManager.prototype.checkDefenseStructures@simulation/ai/petra/defenseManager.js:343 m.DefenseManager.prototype.update@simulation/ai/petra/defenseManager.js:20 m.HQ.prototype.update@simulation/ai/petra/headquarters.js:1712 m.PetraBot.prototype.OnUpdate@simulation/ai/petra/_petrabot.js:182 m.BaseAI.prototype.HandleMessage@simulation/ai/common-api/baseAI.js:83Thanks leper for the report and the commands.txt. The error was because Petra was assuming that buildings with an ArrowMultiplier had necessarity a ranged attack. It seems that this is true for all, except colonies (ptol and sele).I suppose that it is intended for colonies to not have any attack (it is explicitely disabled), but for consistency shouldn't we also remove the ArrowMultiplier for garrisoned units ?In any case, I will add an additional test on the ranged attack. Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted April 20, 2014 Report Share Posted April 20, 2014 Imo, the entire buildingai should be disabled if a building has no attack. Maybe a warning can be added to buildingai if this happens.We shouldn't waste resources on components that aren't used. Quote Link to comment Share on other sites More sharing options...
mimo Posted May 18, 2014 Author Report Share Posted May 18, 2014 A new major upgrade of Petra AI has just been commited in svn. It features a first version of naval support, as well as some bug fixes. Tests (specially that no regression were introducedfor land maps) would be very usefull. In case of errors, please provide the commands.txt file and the version of your svn build. Concerning naval maps, there are a few known issues - ship combat is not yet implemented (ship are mainly used for transport of armies in oversea attacks) - path finding issues with ships blocking themselves - the placement of defensive structure (tower and fortress) is not adapted for small islands, so the AI rarely built them - carthage does not yet use shipyard, so does not have war ships - trade is quite broken in naval maps - the reaction of the AI to its ennemies actions is still quite dumb Finally, if anybody want to help and improve this AI, all these issues are a good way to start. I can point you to the right file and piece of code if needed. 7 Quote Link to comment Share on other sites More sharing options...
wraitii Posted May 27, 2014 Report Share Posted May 27, 2014 I would suggest making Petra the default bot in A17. Aegis hasn't been really updated in A16, and Petra seems to me like the most resilient and efficient bot at this point. 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted June 4, 2014 Report Share Posted June 4, 2014 I would suggest making Petra the default bot in A17. Aegis hasn't been really updated in A16, and Petra seems to me like the most resilient and efficient bot at this point.Done in r15282. Quote Link to comment Share on other sites More sharing options...
anotherone Posted June 24, 2014 Report Share Posted June 24, 2014 Petra likes to build civ. centers very near my under-construction civ. center. This leads to competition to see who can build their civ. center the fastest, especiallly on maps where the players start out near each other (team oasis). Maybe add a filter to not allow civ. centers to be build within a certain radius of another civ. center that is under construction. Quote Link to comment Share on other sites More sharing options...
mimo Posted June 24, 2014 Author Report Share Posted June 24, 2014 Do you mean when you are allied with the AI ? or enemy ?If it happens when allied, there is already a minimum distance with allied cc, but this can be increased.if it happens when enemy, I guess that's part of the game: it is up to you to prevent this to happen by destroying its foundation In principle, Petra is not "attracted" by other cc, but by good location, and fighting for a good location is expected. 2 Quote Link to comment Share on other sites More sharing options...
anotherone Posted June 26, 2014 Report Share Posted June 26, 2014 Do you mean when you are allied with the AI ? or enemy ?I was allied with Petra at the time.If it happens when allied, there is already a minimum distance with allied cc, but this can be increased.Where can it be increased? Quote Link to comment Share on other sites More sharing options...
3FFA Posted June 26, 2014 Report Share Posted June 26, 2014 (edited) Got an error where the ai couldn't find the path and decided it was going to go into the bottom right corner of the world in a 3 player map(with a river going through the map to separate the 3 players and an upper area that needs ships to access). At first it seemed like it was being really smart and going below my base(thus around my wooden wall I made for defending against it) but then I noticed an error in the top left of 'can't find path'. At first I thought this was related to his other army he had attacked with at the same time(Yes 2 full armies of same unit composition) that I noticed had broken through my gate while I was managing resource gatherers. It wasn't long however before I noticed his whole army on the bottom was trying to go through the bottom left corner of the map as if it were able to use that as a path to get to the enemy in the top right corner. He then continued to add another army to this group at which point I decided to exit since the game was going on for a long time and I didn't feel like playing with a buggy ai that loved attacking me Note: This was using the Mac version of alpha. Edited June 26, 2014 by 3FFA Quote Link to comment Share on other sites More sharing options...
mimo Posted June 26, 2014 Author Report Share Posted June 26, 2014 I was allied with Petra at the time.Where can it be increased?It has to be changed in the code. Checking back, the present minimal distance with allied cc is 120 m which is quite small I agree. I will increase it to 200 m.Is this 120 m what you had ? Quote Link to comment Share on other sites More sharing options...
mimo Posted June 26, 2014 Author Report Share Posted June 26, 2014 Got an error where the ai couldn't find the path and decided it was going to go into the bottom right corner of the world in a 3 player map(with a river going through the map to separate the 3 players and an upper area that needs ships to access). At first it seemed like it was being really smart and going below my base(thus around my wooden wall I made for defending against it) but then I noticed an error in the top left of 'can't find path'. At first I thought this was related to his other army he had attacked with at the same time(Yes 2 full armies of same unit composition) that I noticed had broken through my gate while I was managing resource gatherers. It wasn't long however before I noticed his whole army on the bottom was trying to go through the bottom left corner of the map as if it were able to use that as a path to get to the enemy in the top right corner. He then continued to add another army to this group at which point I decided to exit since the game was going on for a long time and I didn't feel like playing with a buggy ai that loved attacking me Note: This was using the Mac version of alpha.Going to the corner like that usually means that its destination is undefined.If you have the commands.txt file and the revision version that you used, i can have a look at it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.