New build, not nearly as exciting as yesterday, but it’s solid progress: https://wiki.arcengames.com/index.php?title=AI_War_2:The_Great_Refactor#Beta_3.741_Clogging_Holes
1. On the subject of trying to hot-reload the xml files:
I’ve made some progress on that, but there’s still more to do. There’s some added functionality I need to add, apparently, before that’s really going to work as well as I need it to. But it definitely got a lot closer today, and this took about the first half of the day to work on it. Right now if you try to hot reload xml, it will potentially lock up the game, but when you kill it and reload it, it will have what you want. I just need to fix the whole lock up part, but it’s one step at a time.
2. On the subject of the memory leaks, which still exist:
Notice I’m not saying “the memory leak” anymore? I do suspect that there was mainly one big memory leak in the past, but at this point there are definitely multiple. Some of them are caused by the semantic changes I’ve made to how we use collections — aka, in building the panopticon, I introduced new temporary memory leaks, but in exchange I gain the ability to find them and kill them, and also to improve performance in general in the future. I fixed at least six memory leaks today, none of which were the “big one” that is causing the most trouble.
Daniexpert was kind enough to provide a very useful core dump from that new feature, and by diffing that against an early-stage core dump of my own, this is how I’m not just finding the memory leaks, but also places where I can optimize capacity allocations. The side effect of the latter is that the game runs faster, and most notably that it’s wicked fast to load savegames now. I mean, it’s down from something like 1.5 seconds to 0.5 seconds; that hardly matters, but it does feel nice. And the overall ram usage being lowered, and the during-gameplay performance improvements that this also leads to, are the real win.
I’m currently going painstakingly through that one core dump, and just fixing things as I find them after careful analysis, rather than trying to find the big leak that I know is in there. Something has allocated 23 million objects when it really should be closer to three million based on another metric, and in that core dump is the answer to that question. When I find that, hopefully tomorrow or the next working day, that should be the end of the big memory leak (knock on wood). In the meantime, I don’t want to leave any smaller memory leaks around just because I’m in a hurry, so I’m taking the time to do it right.
3. On the subject of the stalling background threads:
This is really intermittent and frustrating, and requires you to more or less restart the game to get it to work properly after it happens. It only seems to happen after having loaded multiple savegames in one run of the game. While chatting with Daniexpert about the data he was able to show me from it happening to him again today, I think I may have come up with a solution for it. I’ll need to actually implement it and test it, but I’m hoping I can squeeze that in tomorrow, as well.
4. Everything else?
These items are my top priority right now until they are fixed. After that, there’s many other general bugs, and then a load of new features and things coming down the pipeline. I’m really excited about those things, but I want to finish this stuff out right and have this running really smoothly for everyone. I really have no idea how many more days of this pre-everything-else work is left, but I will be able to do daily releases like this one with updates, at least.
More to come soon.