wraitii Posted March 25, 2013 Report Share Posted March 25, 2013 Might be able to fix those, but I fear this will be mildly hard to do, and not before this WE. Probably should un-default Aegis then. Quote Link to comment Share on other sites More sharing options...
gameboy Posted March 25, 2013 Author Report Share Posted March 25, 2013 (edited) Oh,My god, the abolition of the default Aegis? I think you should have a better way to solve these problems, I will look forward to the good news for you, my friend! Edited March 25, 2013 by gameboy Quote Link to comment Share on other sites More sharing options...
feneur Posted March 25, 2013 Report Share Posted March 25, 2013 Oh,My god, the abolition of the default Aegis? I think you should have a better way to solve these problems, I will look forward to the good news for you, my friend!Not the abolition, just possibly the delaying Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted March 25, 2013 Report Share Posted March 25, 2013 yeah, not delete the ai, and someone can work in jubot? Quote Link to comment Share on other sites More sharing options...
zoot Posted March 25, 2013 Report Share Posted March 25, 2013 someone can work in jubot? What for? Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted March 26, 2013 Report Share Posted March 26, 2013 What for? i was love that Ai. was my first Challenge. and someone can learning about ai and improved to modern API. Quote Link to comment Share on other sites More sharing options...
wraitii Posted March 30, 2013 Report Share Posted March 30, 2013 I've committed a fix for the specific error above, but there could be others remaining. I'm at home till monday, won't have much time but some quick fixes could be done.Please play the game, try to save/load regularly (particularly interested in games when Aegis prepares an attack, or when it has started an attack: the army should stall and do nothing, but should be reused for the next plan.) If you encounter errors, I'm interested in the saved game. Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted March 30, 2013 Report Share Posted March 30, 2013 Thanks Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted March 31, 2013 Report Share Posted March 31, 2013 Please play the game, try to save/load regularly (particularly interested in games when Aegis prepares an attack, or when it has started an attack: the army should stall and do nothing, but should be reused for the next plan.)This is indeed what happens in my tests.In one game, it failed to load the saved game:ERROR: JavaScript error: simulation/ai/qbot-wc/qbot.js line 327 TypeError: myKeyEntities.toEntityArray()[0] is undefined ([object Object],[object Object])@simulation/ai/qbot-wc/qbot.js:327ERROR: AI script Deserialize call failedWARNING: JavaScript warning: simulation/ai/qbot-wc/qbot.js line 287 reference to undefined property this.pathInfoERROR: JavaScript error: simulation/ai/qbot-wc/qbot.js line 287 TypeError: this.pathInfo is undefined ()@simulation/ai/qbot-wc/qbot.js:287 ([object Object],[object Array])@simulation/ai/qbot-wc/qbot.js:90 ([object Object])@simulation/ai/qbot-wc/qbot.js:156 ([object Object],[object Object])@simulation/ai/common-api-v3/base.js:66 @:0...quicksave-0002.zipIn another test, quickload worked, but with the following warnings repeated:WARNING: JavaScript warning: simulation/ai/qbot-wc/attack_plan.js line 708 reference to undefined property this.path[0][0][1]WARNING: JavaScript warning: simulation/ai/common-api-v3/utils.js line 11 reference to undefined property b[1]...quicksave-0002.zip Quote Link to comment Share on other sites More sharing options...
wraitii Posted April 1, 2013 Report Share Posted April 1, 2013 Thanks for the report. I can't seem to load the saved games, is there something special about quicksaves?I can't think of any reason for your first error, frankly, it seems like it should only happen if the AI no longer has entities. Your second one is annoying too as it probably should not happen either...Given what time I have, I'm not going to be able to go through and properly fix those, so I suggest switching back qBot in the meantime (and/or add to Aegis' description that it doesn't really support saved games.) Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted April 1, 2013 Report Share Posted April 1, 2013 I don't think anyone wants to switch back to qBot, since Aegis is so much improved, I think we can live with saving not working perfectly for A13, and can mention that in the release announcement and in the AI description. Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted April 1, 2013 Report Share Posted April 1, 2013 Also, I have been looking into full AI state serialization after fixing #407, it seems feasible but possibly inefficient and it may require some redesign of the AIs, since they have unfortunately been written with the assumption that full serialization is impossible or ignored that it might be possible in the future. (I've mostly worked on qBot in my testing because it's simpler, but it should be possible to port most changes to Aegis as well). I would like to at least make this possible for A14 and then we can decide what is the best course for the AIs (personally I think automatic full serialization is much preferable to the current piecemeal, hacky, broken approach). Quote Link to comment Share on other sites More sharing options...
zoot Posted April 1, 2013 Report Share Posted April 1, 2013 I guess currently the serialization is 'opt-in'. To improve efficiency compared to full serialization, perhaps it could be made 'opt-out'? Like, a given variable will be saved by default, unless a certain callback returns false. Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted April 1, 2013 Report Share Posted April 1, 2013 Right, but that variable would have to be initialized with something on or prior to deserialization, otherwise the AI would try to access it and spew thousands of undefined property warnings I tried to mix these approaches, but I think that references to those excluded objects might still be part of the AI state and so they would get serialized (which is why I say the AIs have been designed without considering these issues and it might not be trivial now to solve them). Quote Link to comment Share on other sites More sharing options...
wraitii Posted April 1, 2013 Report Share Posted April 1, 2013 I think opt-in is likely better for AIs. But yes, the current system was quickly done and is fairly ugly.It is indeed not too trivial to fix those issues. It basically requires Ais to save things sanely, but to recreate them sanely... Basically instead of the "do everything in the constructor" approach, we would require a "Init" function that is only called once at game start, and which deserialization simply overrides with the deserialized contend. Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted April 7, 2013 Report Share Posted April 7, 2013 Good news on AI serialization. When I was testing before, I forgot that I had debug annotations turned on in the serializer, which made it generate much more data, more slowly. It needs a lot of real-world testing but so far I haven't gotten any errors and qBot seems to continue seamlessly after loading. The other good side of proper serialization is that rejoining multiplayer games with AIs will work without OOS errors. The bad side is that every 20 turns in multiplayer games, it does a full state serialization for OOS checking and there will be a noticeable stutter if the process takes too long.For saved games, I think the data size and time required are very reasonable, it's only for others things (serialization test, OOS checking) that it may pose a problem. Maybe we can leave out parts of the state in those special cases. For instance, it's not clear to me that the AI state needs to be part of the OOS check, as they run asynchronously (eventually in a separate thread) and can only interact with the simulation through network commands - so any OOS errors will be detected there. Or we could have 3 types of simulation state checks: minimal (currently checks only entity positions), standard (all but AIs) and full (all state including AIs), and do the full check even less frequently.I will continue tweaking things and post a WIP patch on Trac. The new code I've added may need optimizing in places, but I think most of the slowness is due to the greatly increased amount of data processed (7 qBots on a giant map will produce 30+ MB state, Aegis could be even more). Quote Link to comment Share on other sites More sharing options...
wraitii Posted April 7, 2013 Report Share Posted April 7, 2013 If you need some input about not saving things or optimizing thsize, feel free to ask. Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted April 8, 2013 Report Share Posted April 8, 2013 So Philip and I discussed this more today and came to agreement that:1.) the time and space required are reasonable for saved games,2.) it's nowhere near fast enough for full OOS checking, but also3.) full OOS checking is really only desirable and practical during development and once AIs are multithreaded, that will add additional latency which is unacceptable, so4.) it's probably best to not serialize the AI state for OOS checking.In other words the special case should be full OOS checking which can exclude any components we want, while allowing us to benefit from automatic AI serialization in all other cases. AI devs will be especially pleased with this, as they will have only a handful of general rules to remember and won't typically need to write custom (de)serialization code (hopefully never).I have yet to attempt to convert Aegis or the other AIs to test them. Mostly it's a tedious process of going through and testing for any (de)serialization errors or class like objects that weren't registered, and fixing those problems.Also a heads-up: with Yves work on upgrading Spidermonkey, the AI framework may need some substantial changes related to sharing data between script contexts. Not sure on the details but apparently new Spidermonkey is stricter about that. Quote Link to comment Share on other sites More sharing options...
gameboy Posted April 8, 2013 Author Report Share Posted April 8, 2013 Error again:<p class="error">ERROR: JavaScript error: simulation/ai/common-api-v3/gamestate.js line 584TypeError: template is null ()@simulation/ai/common-api-v3/gamestate.js:584 ([object Object],[object Object])@simulation/ai/qbot-wc/economy.js:180 ([object Object],[object Object],[object Array])@simulation/ai/qbot-wc/economy.js:1199 ([object Object])@simulation/ai/qbot-wc/qbot.js:228 ([object Object],[object Object])@simulation/ai/common-api-v3/base.js:66 @:0</p><p class="error">ERROR: JavaScript error: simulation/ai/common-api-v3/gamestate.js line 584TypeError: template is null ()@simulation/ai/common-api-v3/gamestate.js:584 ([object Object],[object Object])@simulation/ai/qbot-wc/economy.js:180 ([object Object],[object Object],[object Array])@simulation/ai/qbot-wc/economy.js:1199 ([object Object])@simulation/ai/qbot-wc/qbot.js:228 ([object Object],[object Object])@simulation/ai/common-api-v3/base.js:66 @:0</p><p class="error">ERROR: JavaScript error: simulation/ai/common-api-v3/gamestate.js line 584TypeError: template is null ()@simulation/ai/common-api-v3/gamestate.js:584 ([object Object],[object Object])@simulation/ai/qbot-wc/economy.js:180 ([object Object],[object Object],[object Array])@simulation/ai/qbot-wc/economy.js:1199 ([object Object])@simulation/ai/qbot-wc/qbot.js:228 ([object Object],[object Object])@simulation/ai/common-api-v3/base.js:66 @:0</p><p class="error">ERROR: JavaScript error: simulation/ai/common-api-v3/gamestate.js line 584TypeError: template is null ()@simulation/ai/common-api-v3/gamestate.js:584 ([object Object],[object Object])@simulation/ai/qbot-wc/economy.js:180 ([object Object],[object Object],[object Array])@simulation/ai/qbot-wc/economy.js:1199 ([object Object])@simulation/ai/qbot-wc/qbot.js:228 ([object Object],[object Object])@simulation/ai/common-api-v3/base.js:66 @:0</p><p class="error">ERROR: JavaScript error: simulation/ai/common-api-v3/gamestate.js line 584TypeError: template is null ()@simulation/ai/common-api-v3/gamestate.js:584 ([object Object],[object Object])@simulation/ai/qbot-wc/economy.js:180 ([object Object],[object Object],[object Array])@simulation/ai/qbot-wc/economy.js:1199 ([object Object])@simulation/ai/qbot-wc/qbot.js:228 ([object Object],[object Object])@simulation/ai/common-api-v3/base.js:66 @:0</p><p class="error">ERROR: JavaScript error: simulation/ai/common-api-v3/gamestate.js line 584TypeError: template is null ()@simulation/ai/common-api-v3/gamestate.js:584 ([object Object],[object Object])@simulation/ai/qbot-wc/economy.js:180 ([object Object],[object Object],[object Array])@simulation/ai/qbot-wc/economy.js:1199 ([object Object])@simulation/ai/qbot-wc/qbot.js:228 ([object Object],[object Object])@simulation/ai/common-api-v3/base.js:66 @:0</p> Quote Link to comment Share on other sites More sharing options...
gameboy Posted April 13, 2013 Author Report Share Posted April 13, 2013 (edited) This error occurs! :rtfm: Edited April 13, 2013 by gameboy Quote Link to comment Share on other sites More sharing options...
gameboy Posted April 14, 2013 Author Report Share Posted April 14, 2013 <p class="error">ERROR: JavaScript error: simulation/ai/qbot-wc/qbot.js line 327TypeError: myKeyEntities.toEntityArray()[0] is undefined ([object Object],[object Object])@simulation/ai/qbot-wc/qbot.js:327</p><p class="error">ERROR: AI script Deserialize call failed</p><p class="warning">WARNING: JavaScript warning: simulation/ai/qbot-wc/qbot.js line 287reference to undefined property this.pathInfo</p><p class="error">ERROR: JavaScript error: simulation/ai/qbot-wc/qbot.js line 287TypeError: this.pathInfo is undefined ()@simulation/ai/qbot-wc/qbot.js:287 ([object Object],[object Array])@simulation/ai/qbot-wc/qbot.js:90 ([object Object])@simulation/ai/qbot-wc/qbot.js:156 ([object Object],[object Object])@simulation/ai/common-api-v3/base.js:66 @:0</p><p class="warning">WARNING: JavaScript warning: simulation/ai/qbot-wc/qbot.js line 287reference to undefined property this.pathInfo</p><p class="error">ERROR: JavaScript error: simulation/ai/qbot-wc/qbot.js line 287TypeError: this.pathInfo is undefined ()@simulation/ai/qbot-wc/qbot.js:287 ([object Object],[object Array])@simulation/ai/qbot-wc/qbot.js:90 ([object Object])@simulation/ai/qbot-wc/qbot.js:156 ([object Object],[object Object])@simulation/ai/common-api-v3/base.js:66 @:0</p><p class="warning">WARNING: JavaScript warning: simulation/ai/qbot-wc/qbot.js line 287reference to undefined property this.pathInfo</p><p class="error">ERROR: JavaScript error: simulation/ai/qbot-wc/qbot.js line 287TypeError: this.pathInfo is undefined ()@simulation/ai/qbot-wc/qbot.js:287 ([object Object],[object Array])@simulation/ai/qbot-wc/qbot.js:90 ([object Object])@simulation/ai/qbot-wc/qbot.js:156 ([object Object],[object Object])@simulation/ai/common-api-v3/base.js:66 @:0</p> Quote Link to comment Share on other sites More sharing options...
wraitii Posted April 14, 2013 Report Share Posted April 14, 2013 I believe this is the same error as the one you've already posted. If I recall correctly historic_bruno is giving a look at AI serialization right now, I'm not too sure, though. Quote Link to comment Share on other sites More sharing options...
gameboy Posted April 14, 2013 Author Report Share Posted April 14, 2013 The problem is how to solve? Save the game and then load it gets error! Quote Link to comment Share on other sites More sharing options...
Yves Posted April 14, 2013 Report Share Posted April 14, 2013 It looks like this happened when loading a saved game.In this case it's a known issue.EDIT: I didn't see these replies before posing.@gameboy: You can't solve it unless you change the code. I think qbot should work with saved games. Quote Link to comment Share on other sites More sharing options...
gameboy Posted April 14, 2013 Author Report Share Posted April 14, 2013 (edited) Hi,Yyes!Take a look at this post in the forum: http://www.wildfireg...pic=17152&st=40 Edited April 14, 2013 by gameboy 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.