1. AI War 2
  2. News

AI War 2 News

Beta 3.705 Blazing Collections And The New Spire

New beta build! https://wiki.arcengames.com/index.php?title=AI_War_2:The_Great_Refactor#Beta_3.705_Blazing_Collections_And_The_New_Spire

(Note: all savegames won't work when loaded into this version, because of the major under the hood changes. There will be another release or two like that coming up in the near future, then I'll be done with that.)

Okay, this is getting a bit ridiculous. This is five days of really intensive work (like 12-14 hour days for all five). Initially I started with a few mild bugfixes (fun!), and then I started moving in to splitting up the fallen spire faction and necromancer so that they have the new relationship that they need (cities and their mobile fleets separated out (exciting!), and I got partway through that. I also started working on modules/loadouts (even more exciting!).

Then something else grabbed my attention again: the performance of our collections (lists, dictionary, queues, stacks, etc) left a lot to be desired. The ones that were most problematic were ones from Microsoft, and the source is open. The others that were problematic tended to wrapper these problematic ones.

So at first this led into a big investigation with myself and NR SirLimbo profiling the heck out of the microsoft classes and then my adapted version that stripped out some suboptimal things in their code. In general, depending on what we were testing -- and SirLimbo had to create a new in-engine testing framework for us to be able to measure this with a sensitivity in the nanosecond range -- down to a millionth of a second or so, for our practcal measurement purposes).

The general results of that were that, on average, the worst result from my new versions on windows or OSX was about a 0% to a 2% improvement for certain activities, and then closer to a 10% improvement for others (Sort in particular). Then for certain things that have to do with initializing data to the proper size, the improvement was about 300%.

I then started porting over more data structures, and finding all sorts of really unfortunate things in there. Doing things like looping over dictionary.Keys instead of just dictionary actually is hugely slower, did you know that? It's not documented anywhere, you have to just check the code. There were a bunch of other strange gotchas.

And our own ArcenSparseLookup collection, which Keith implemented 5 years ago with notes in there saying "this is TEMPORARY, and has bad performance, will need to replace this later" has been all through our codebase. I spent the last 9 hours or so (split between last night and today) replacing that thing. It was used all over the place, and had at best half the performance of the newer version of the dictionary that I now use, before you even get into further improvements. And I did get into further improvements.

So how much faster are things? I don't rightly know! These were a thousand little paper cuts, all over the place, slowing things down. We no longer are covered in said paper cuts. Things feel snappier, but I haven't run any real stressful load cases just yet. I'll be very interested to hear what you experience.

I'm going to be out for the next day or two, but then I'm going to be circling back around to bugfixes, the fallen spire, and so on. The fallen spire _might_ be playable right now in this build, but I'm not certain. The ablity to switch which mobile fleet each city is bolstering isn't there right now, and that's the main thing I just outright didn't finish.

Anyhow, lots of exciting progress on a lot of things. I didn't really expect another digression into performance improvements, but these ones are extremely nice and are things I can carry with me into future projects, too.

More to come soon.
Enjoy!

Beta 3.704 Unexpected Turbo Sim Speed

New beta build! https://wiki.arcengames.com/index.php?title=AI_War_2:The_Great_Refactor#Beta_3.704_Unexpected_Turbo_Sim_Speed

Weeell... this is cool and unexpected. I sped up the sim last release, right? Um... well, I did it again, except even moreso this time. I am able to run 111 factions at almost full sim speed now, which is just plain insane. My framerate stinks when I do it, but that's a separate matter. We also can run far more planets than anytime in the past, so we've increased the max planet counts to 300 on all maps. It does take a more powerful computer to run these, which the game warns you about, but there's no reason for it not to be an option now.

This isn't just about crazy high planet counts or crazy high faction counts, though. This will have tangible benefits to lots of players, whether they are on weaker hardware or are just getting into giant late game battles that previously slowed down a lot, etc. It's possible that battles of sufficient size will still cause slowdown, but the effect won't be compounded by this general load, so there's a lot more margin for giant battles to take up room if they need to.

Quite aside from the above, this release contains just an absolute ton of bugfixes, almost all of which are things that resulted from the great refactor, but a few of which were much longer-standing. It's getting cleaner and cleaner, which is thanks to the folks who keep testing things out and reporting what they find. Thank you in particular to Vinco, BoBy, Arctic, whimsee, nas1m, and HarryT -- you all rock!

Let's see... I also got started on the very earliest part of modular loadouts for ships, although there's not a lot to see yet. But it's nice to be getting started on that. A new planet naming style by Angel of death is now in the game, as well.

If anyone is wondering how NR SirLimbo is coming with his work on his mods (AMU and the like), it's an impressive and intensive task that he's going through. He's documenting it on discord, and it's really awesome to see how he's not just porting things over, but rather is actively making his modding framework and tools even better than it already was.

More to come soon.
Enjoy!

Beta 3.703 Smooth Sim

New beta build! https://wiki.arcengames.com/index.php?title=AI_War_2:The_Great_Refactor#Beta_3.703_Smooth_Sim

This one does two really cool things that I didn't have on my radar, but now I'm super excited about:

First, the performance of the entire simulations should now be better. You heard me! Giant planet counts, giant battles, whatever. I'm not saying it will be buttery smooth on every machine, but it should be somewhere between moderately to drastically improved, depending on your machine. A lot of the reasons why I was able to do this have to do with the timings of triggering sim steps, and less to do with the actual sim steps themselves. Essentially we had some dead air time (less than fully utilized CPU) between certain types of actions. Those gaps are now closed, so your CPU will run flat-out when it has to. Also along with this, you can now see (by right-clicking the clock in the bottom left) how close your simulation is to being at the point where it would start slowing down. Nifty!

Secondly, the speed of the simulation is measured more accurately AND it does a much better job of sticking closer to 100% sim speed when things are going well. It averages between 99-103% now, whereas previously it was almost always 95%. That 5% drop was causing visual micro-stutters in the movement of ships, so now things move much more smoothly around. I've tested this at 30, 60, and 100 fps.

There are a number of notable bugfixes in this one, including the fix to the "AIP goes up by 10 every time I load a save" bug, and errors with wave and spire debris notifications.

I also made two new youtube videos today to help modders and faction designers understand the intricacies of multiplayer and threading in the game as much as I can:

https://youtu.be/EV2WTB5l0vA

https://youtu.be/7JxIbYIy_2I

And for those who would rather skip that degree of info dump, there are diagrams: https://wiki.arcengames.com/index.php?title=AI_War_2:The_Great_Refactor#New_Diagram_For_Modders.2FProgrammers:_AI_War_2_Threading_Model

I am now done with all of the videos and similar supplemental materials I had planned for modders, which is excellent. Now I can really continue to focus just on bugfixes and other improvements.

At the moment I know there must be plenty of bugs in here, but there have been very few reports. If you have some spare time and would be interested in testing, please do give the latest betas a play!

More to come soon.
Enjoy!

Beta 3.702 Bugfixes And Mod Conversion

New beta build! https://wiki.arcengames.com/index.php?title=AI_War_2:The_Great_Refactor#Beta_3.702_Bugfixes_And_Mod_Conversion

This one is mostly bugfixes, but also converts the Civilian Industries mod to work in the new framework. There's a four and a half hour video where you can watch me doing that, if you're inclined.

This also specifically disables all of the other code mods that are known to not work. They are still distributed to you, but if you go in the file system and get them to be enabled again, all you'll get is errors. So... uh... maybe wait for the mod authors to get those updated first. Non-code mods largely were not affected at all, but now there's no longer a case of you having to wonder "should this mod work, or should it error?" If a mod that you see in the distributed list from us is broken now, we want to hear about it.

On that subject NR SirLimbo is working like crazy to get his selection of popular mods ported over, but it's going to be a TON of work. He's been building his own modder framework on top of our codebase (that's what "AMU" is for), and so naturally that's a lot more difficult to port over than a "traditional native code mod" like Civilian Industries. You can keep up with his progress and send him encouragement on the modding section of our discord server, but he's estimating it may take him a couple of months of very intensive work to get it all going again (after all, unlike me, this isn't his fulltime job, and that's still with him really working like crazy on his projects).

This build fixes most of the really major bugs that I am aware of, although I am aware of several that I didn't have time to fix today. I'll get those tomorrow, along with continuing on with whatever else is new. Thank you to everyone doing the testing on this new code framework!

Once the errors start quieting down, then some of the other exciting things I have planned are going to get some attention, like loadouts for fallen spire ships, better fallen spire fleet organization/setup, and... well, there's a whole list of things prior to DLC3, and then there's DLC3 stuff as well. Expert mode will be getting some more attention soon, too, but it's all mostly based around how long I am responding to bugfixes. I'm definitely pleased with where things are, overall, at the moment. The game is going through those first bumpy bits after a major transition, but it's not quite as bad as I had feared it might be (so far -- it's early yet).

Enjoy!

Beta 3.701 Natural Object Order

New beta build! https://wiki.arcengames.com/index.php?title=AI_War_2:The_Great_Refactor#Beta_3.701_Natural_Object_Order

This one is just bugfixes, as you might expect. I also made something like 4 hours of video tutorials on how to mod the game and how to use a variety of the code, which you can check out if you're into that sort of thing. The goal of that was to help ease the transition for existing modders into the new framework.

The number of bugs that people found were not overwhelming in number, which is nice, but I think at least part of that was because the ones that were found were severe enough to prevent too much testing. Ironically, most of those really severe bugs were just a few small things that were pretty easy to fix, so... well, that's a good thing.

The really big culprit was that I had allowed NaturalObject (aka no ownership) units to be in any order, rather than always being the 0th faction in the list, and that caused all sorts of crazy bugs if you happened to have it out of position 0 in your new save. If it was in position 0, then a lot of those same things were fine.

Other bugs included a few xml typos, a couple of years-old bugs that just became relevant but were not new, and some places where I had switched something to a new more efficient format, but the old format would throw an error if it was still called, and there were still some lingering calls to them.

All in all, so far none of the bugs were really very time consuming to fix, but as noted they were severe enough to really prevent deep testing by very many people. Hopefully this build is a lot more straightforward for people to test further with.

Thank you for the help with testing!
Enjoy!