For some reason, at the end of a tiring week when yawning my head off and waiting for the painkillers to finally kick in and do something about a headache, my brain decides that the best thing for me to do, rather than sleep, is to clear out Telerik and chuck AI War into the decompiler.
First impression? Arcen's coding style is quite a bit different from the last few things I've looked at. Odd mix of "this function name tells you literally everything that it does" vs. "this boolean's name is just 'number 12', go read 50 lines of code if you want to know what it's for". Also, I can now say I have finally encountered classes so huge they take a full 2.5 seconds to open. 50,000+ lines in C# -- this is going to be *hilarious* in Assembly, if it clocks in at under 3.5M lines I will be amazed. Navigating that is going to be an adventure. Cue the "I see an electrical outlet and I'm gonna stick a fork in it" laugh.
Something something this game has Excel library functionality? I wonder if that's how it does some of its "what's my best set of action options" sorting wizardry I remember seeing in a devblog post. If so, that's the most inventive use of that bane-of-my-existence program I've ever seen. (Ever seen some moron try to build a pseudo-website in Excel? And then ask you to convert it to tiff images so it can be sent to a lawyer?
I HAVE. Hate.)
HA! I was right, Threat does ignore adjacent planet player fleet strength if it thinks it's engaged in combat. What I saw in my last game was functioning normally as I suspected, there is still a hole that can be exploited to rope-a-dope the Threatfleet. I can't wait to test exactly how far that deception can be pushed.
Oo planetary reinforcement seems to be influenced by how scary the stuff the player has nearby is, I thought I detected signs of this while playing, theories were right again.
These last two findings show I can actually play mind games with this AI. I am going to get myself in so much trouble doing that and then miscalculating somehow. It's going to be glorious.
Difficulty 9 is the last step before some AIP threshold stuff starts to scale non-linearly.
Right, I said I'd look at teleporting stuff, didn't I, time to stop rifling through the AI's brain for the moment and get back on topic.
Fascinating... I think teleportation might simply be handled via a couple of blocks buried in the main unit movement function, mostly an X/Y grid coordinate update bracketed by a fade out/in of the graphic and a cooldown on how frequently it can move. I was expecting to find a dedicated teleportation function that gets called by the normal movement logic to override more ordinary movement, but apparently no.
Oh man, some of these single functions are just enormous, I can't wait to get this disassembled and see just how much space some of these reserve on the stack lol. This thing just dwarfs the last game I worked on.
Found the classes where it sets a bunch of the individual unit properties, presumably importing them from the Unity prefab xmls packed in the .assets files. It's like a text-based switchboard. It even has a block where it just runs through all the ship types to see what it's looking at, helpfully showing me what all the internal names are and how to read them to ask the game "hey, uhhh what ship am I again?". That will make manipulating individual ship properties so much less of a pain, shouldn't need to bother with hex editing prefabs and repacking them. Good, because that was NOT happening, I hate hex editing.
I like this game as a player, and I am liking what I see under the hood as a modder, after getting past the initial shock of seeing single classes almost 60K lines long in C#. I'm sure there are plenty of bear traps buried in stuff waiting for me to step in them as I wander about and mess with forces I don't fully comprehend, but eh. I'm used to that. Crashes are merely finger calisthenics for Alt+F4 and Ctrl+Alt+Del.
TL;DR: I can work with this.Sometime when I am not falling asleep on my keyboard that is.