IronManBeta
Posts: 4132
Joined: 2/25/2002 From: Burlington, Ontario Status: offline
|
Oh, this is really cool. I haven't seen the game engine choke since Al Sandrik (Beachinole) created his original mammoth Fulda Gap scenario! Thank you very much for uploading the saved game. This allowed me to analyze the memory use and draw some conclusions. When the game loads under Windows 7 I see that it consumes just over 1 GB of RAM. Impressive! The max for this compile is 2 GB and the map - "Kircheim u Teck" - is a monster and is responsible for 512 MB all on its own. It is not that it is so large as that it has many layers and also cached layers at various zoom levels that builds up really quickly. First of all, this is a different memory problem from Al's. In his case, he managed to run the game out of what are called GDI handles by creating a bazillion craters on the map. Windows OS limits the number of GDI handles for each running instance to 10,000 and each screen element (in a general sense) uses one. Each animation frame, each bitmap sprite that gets drawn, every button and edit field, etc., etc. We rewrote the code so that craters were fixed in place and therefore did not need a handle anymore. That dropped the GDI count way down and in this save file it is running at 5,700 which is fine. Very large, mind you, but fine. Beyond that, the usual suspects were some of the lists of strings that I accumulate for end-of-game reporting, debugging, and just general 'track the state of the game' purposes. The big list contained 2.2 million strings of game state info. The player diaries between them had another 67,000 lines. There were also 2,879 map markers, 3,240 hexes and 391 units. The game event queue had 33,557 in it of which 33,254 were now handled and dormant. Looking at all this, I tried clearing the game state list and the two player diaries. The save file size shrank to 10% of its former self and the game loads in 542 MB of RAM instead of 1,078. CapnDarwin will help me get the file back to you. I looked at it long enough to ensure that it loads and everything *should* be fine with it but I haven't tested it properly to see. Please give it a try and let us all know how it goes. Final pro tip if you are encountering RAM shortage errors: never zoom the map past 100% to something like 140%. The RAM usage is insane (now mostly addressed in Southern Storm). In fact, no zooming is the best amount of zooming if you can live with plain old 100%. Just a pointer. Thanks for posting and I hope you are really enjoying the game. Cheers all, Rob C
|