gameboy Posted September 13, 2012 Author Report Share Posted September 13, 2012 Well, now, we should do? How do we solve this problem, when will this be resolved? :taz: :bangin: Quote Link to comment Share on other sites More sharing options...
myconid Posted September 13, 2012 Report Share Posted September 13, 2012 historic, what you are saying makes sense and I think I agree. It doesn't really matter what solution we choose, as long as we don't prevent anyone from modding the game in ways we didn't expect. Anyway, back to this bug report. The error is reported on line 160 of pathplacer.js. The problem function looks like a variation of the Bresenham algorithm for creating paths (I think), and the error occurs on this line:retVec.push(new PointXZ(x, z));which simply adds a 2D point to a variable-sized array. Inspecting the array before the crash on the Alpine* maps (with a "very large" map size), I get a size in excess of 500k points! For reference, a "very large" map is 448 tiles wide, so there are no more than 200k points in the map, so there's something weird going on there. Moreover, the function seems to be called several times with gradually-increasing path sizes, which is definitely something that could result in OOM errors with a non-compacting GC.So, either it's something wrong with the algorithm, and it needs to be fixed, or, the 500k+ points are actually correct output, and the function should be changed to return the path one segment at a time to reduce memory usage (i.e. turn it into an object or closure or similar).Who's the maintainer of the RM scripts, btw? Spahbod? 1 Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted September 13, 2012 Report Share Posted September 13, 2012 Now we're getting somewhere Thanks for looking into it. I wrote an early version of the pathplacer but haven't followed it's use in the game and I definitely didn't check its memory usage. Spahbod would be the maintainer of most random maps, FeXoR also contributes to parts of it. Quote Link to comment Share on other sites More sharing options...
gameboy Posted September 18, 2012 Author Report Share Posted September 18, 2012 This problem is what is the solution? We need to wait for how long? Quote Link to comment Share on other sites More sharing options...
FeXoR Posted October 17, 2012 Report Share Posted October 17, 2012 (edited) Is the AI runtime the same as the rmgen runtime? I haven't looked too deep into those parts of the engine, but I was under the impression they were separate.Though I don't like it you are right. Player AIs code is "loosely" bound to the engine to make it a threaded process later in developement (when we get to this point), which is OK but IMO not optimal. RMGEN is run before the engine is started and generates a map that afterwards is loaded by the engine (which I think is a bad choice). The reason why I don't like it is that the programmer does not have full access to all the games content (and things are rewritten in all the parts if needed).I'm sorry to say I have no quick answer. I build my own function to place paths in the RMS "Deep Forest" and are not familiar with the pathplacer.js. Trying to figure out what's wrong...EDIT: This error only appears on giant maps for me. On very large maps its working fine with the seeds I tried. It's more like normal that giant maps throw with an OOM error than an exception x). I think reworking all maps to make sure everything works fine on giant maps is not the best idea (though I did it for my RMSs). I agree with myconid to raise the memory for the Javascript runtime engine (Spidermonkey?). I don't really mind if it is set automatically or can be set in a config file. I'd say the best way to do it would be to target automatic settings but to fix it "easy" and quick add a property in a config file. If it's set to 0 automation is enabled (default). Otherwise it's set to the given value in kilobyte (or whatever is preferred).This ofc. doesn't fix the initial bug that paths have more points than a giant map ^^. Didn't find it yet.EDIT2: The number of totalSteps can be greater than the distance from the start to the end of the "path" if Waviness and/or Smoothness are > 4. In "Alpine Valley" in line 247 (create hills), 266/270 (create passages) and 289 (create rivers) the Smoothness is 9 on giant maps. The Waviness is 0.4 and so the numSteps is "only" about distance/10 (+1, irrelevant on big maps) and numISteps about twice the distance. So totalSteps are about 2/10*distance*distance (which should be OK) and will be about 50k for giant maps. BUT then lines of the paths in x direction are drawn - though the tiles in y direction the path contains is MUCH smaller than the 50K (512 at max for giant maps). So many tiles are drawn multiple times. Checking the output with added debug code before PathPlacer.place returns it's value retVec:var duplicatedPoints = 0;for (var i = 0; i < retVec.length - 1; i++){ for (var j = i+1; j < retVec.length; j++) { if (retVec[i].x == retVec[j].x && retVec[i].z == retVec[j].z) { //log("PathPlacer.place: Duplicatd values found: retVec[" + i + "] and retVec[" + j + "] are " + retVec[i].x + "/" + retVec[i].z + " and " + retVec[j].x + "/" + retVec[j].z); duplicatedPoints++; break; } }}log("PathPlacer.place: " + duplicatedPoints + " of " + retVec.length + " points are duplicated");...shows that most of the tiles are duplicated (duplicated tiles may be 1 bigger but that doesn't matter). Part of the mainlog:Creating hills...PathPlacer.place: 5152 of 5859 points are duplicatedPathPlacer.place: 7792 of 8539 points are duplicatedPathPlacer.place: 1928 of 2209 points are duplicatedPathPlacer.place: 1503 of 1795 points are duplicatedPathPlacer.place: 4372 of 5066 points are duplicatedPathPlacer.place: 4935 of 5365 points are duplicatedPathPlacer.place: 7124 of 7759 points are duplicatedPathPlacer.place: 4916 of 5399 points are duplicatedPathPlacer.place: 1337 of 1589 points are duplicatedPathPlacer.place: 7229 of 7846 points are duplicatedPathPlacer.place: 231 of 363 points are duplicatedPathPlacer.place: 4094 of 4670 points are duplicatedPathPlacer.place: 3442 of 3805 points are duplicatedPathPlacer.place: 5485 of 6087 points are duplicatedPathPlacer.place: 4376 of 4779 points are duplicatedCreating passages...PathPlacer.place: 5763 of 6978 points are duplicatedPathPlacer.place: 6841 of 8052 points are duplicatedCreating rivers...PathPlacer.place: 6559 of 7274 points are duplicatedPathPlacer.place: 2050 of 2424 points are duplicatedPathPlacer.place: 2649 of 3238 points are duplicatedPathPlacer.place: 1243 of 1576 points are duplicatedSo the problem is in the function "PathPlacer.place".I don't really get the function so perhaps historic_bruno or Spahbod could fix it more sane.OFC I could just remove the duplicated tiles from the return value by skipping the "y lines" and "x values in that line" already added. Edited October 18, 2012 by FeXoR Quote Link to comment Share on other sites More sharing options...
gameboy Posted October 18, 2012 Author Report Share Posted October 18, 2012 Hello, I would like to ask: which you modify a file, you solve this problem?I think when the game to load large map, the game will appear this error I said, the last game crashes! Quote Link to comment Share on other sites More sharing options...
Spahbod Posted October 18, 2012 Report Share Posted October 18, 2012 FeXoR: Thank you. I think we must stop the duplicates from the beginning. We must consult with historic_brunno about this first. Quote Link to comment Share on other sites More sharing options...
FeXoR Posted October 22, 2012 Report Share Posted October 22, 2012 Hello, I would like to ask: which you modify a file, you solve this problem?The file I modified was 0ad\binaries\data\mods\public\maps\random\rmgen\pathplacer.jsI have no good solution to it so it's not fixed (see Spahbod's last post).FeXoR: Thank you. I think we must stop the duplicates from the beginning. We must consult with historic_brunno about this first.That would be the best solution Quote Link to comment Share on other sites More sharing options...
gameboy Posted October 25, 2012 Author Report Share Posted October 25, 2012 Well, this issue will be resolved when? Thank you! Quote Link to comment Share on other sites More sharing options...
gameboy Posted November 4, 2012 Author Report Share Posted November 4, 2012 This problem seems to have been forgotten,This problem how to solve? Can be around this? Thank you! Quote Link to comment Share on other sites More sharing options...
Loki1950 Posted November 4, 2012 Report Share Posted November 4, 2012 I do not think that it has been forgotten but as stated earlier it is not trivial and therefore requires some hard thought to solve try that with only a few hours a week to work on it because you have pay the rent with your day job.Enjoy the Choice 1 Quote Link to comment Share on other sites More sharing options...
gameboy Posted November 5, 2012 Author Report Share Posted November 5, 2012 I want to know, we need to wait for how long? Thank you! Quote Link to comment Share on other sites More sharing options...
zoot Posted November 5, 2012 Report Share Posted November 5, 2012 I want to know, we need to wait for how long? Thank you! Until it's done If you want to be sure it is fixed, you need to file a ticket on Trac. Quote Link to comment Share on other sites More sharing options...
gameboy Posted November 25, 2012 Author Report Share Posted November 25, 2012 This problem has not been resolved, and how should we do? Quote Link to comment Share on other sites More sharing options...
ribez Posted November 26, 2012 Report Share Posted November 26, 2012 (edited) edit: Edited November 26, 2012 by ribez Quote Link to comment Share on other sites More sharing options...
ribez Posted November 26, 2012 Report Share Posted November 26, 2012 This problem has not been resolved, and how should we do? Until it's done If you want to be sure it is fixed, you need to file a ticket on Trac. Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted December 2, 2012 Report Share Posted December 2, 2012 (edited) yes, use a Ticket, i try to fix you, with a Programmer friend.The game had many bugs, in this pc can support New Graphic Water Waves and my game crashes, but i wait some else fix that is very delicate.And I Want Town Bell and Call of Arms buttons since Alpha 9. but i have to wait, the good way to fix issues in this game is Searching people that want help with this project. Edited December 2, 2012 by Lion.Kanzen Quote Link to comment Share on other sites More sharing options...
gameboy Posted December 2, 2012 Author Report Share Posted December 2, 2012 Thank you,Lion.Kanzen! You are a good man! :pleasantry: Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted December 2, 2012 Report Share Posted December 2, 2012 Thank you,Lion.Kanzen! You are a good man! :pleasantry: but put more info, you are using what OS? what version of game? you upload a error logs? Quote Link to comment Share on other sites More sharing options...
gameboy Posted December 5, 2012 Author Report Share Posted December 5, 2012 Sorry, These files are not generated. Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted December 23, 2012 Report Share Posted December 23, 2012 what os use you. in win7 thee logs generates in C:\Users\user\AppData\Local\0ad\logs Quote Link to comment Share on other sites More sharing options...
fabio Posted March 8, 2013 Report Share Posted March 8, 2013 Since no one still did it, I opened a ticket myself (#1856). 1 Quote Link to comment Share on other sites More sharing options...
fabio Posted March 11, 2013 Report Share Posted March 11, 2013 This is fixed in alpha13, see the ticket for more info. 1 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.