Total War: WARHAMMER II

Total War: WARHAMMER II

AI General II: Spectator Mode Advanced
 This topic has been pinned, so it's probably important
paperpancake  [developer] 9 Apr, 2022 @ 6:56pm
Status for AI General III
Current Status: AI General 3 is now released and publicly available here: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2799316652
Last edited by paperpancake; 1 Jul, 2022 @ 12:32am
< >
Showing 1-6 of 6 comments
paperpancake  [developer] 9 Apr, 2022 @ 6:58pm 
I locked this thread so that only moderators can post.

I will post here when AI General III is ready for community testing and when it is published to Steam, as well as any other major updates.

You can subscribe to this thread if you choose. I will continue to read and be encouraged by everything in the comments section, and I will occasionally reply, but I realize that not everyone wants to get so many notifications.
paperpancake  [developer] 9 Apr, 2022 @ 7:00pm 
Copied from my recent comments:

Thanks to @Deimos and @Diabloabc, I now own TWW3 and some dlc. I feel a bit embarrassed but very grateful and honored.

I spoke with prop joe. Since I am now able to mod for TWW3, and since prop joe has many projects of their own, I will be resuming the scripting for AI General. I appreciate that prop joe had been willing to step in when I thought I wasn't going to have the opportunity.

---------------------

I still have a lot of checking and updating left to do, but early signs are promising. The dev version of AI General III that I'm working on just won its first Pyrrhic Victory in a custom land battle vs AI.

I'm building AI General III using the Troy version as a base. (I felt more freedom to rework things when Troy was first released because I wasn't updating an already-existing mod used by thousands of people. Troy's version is cleaner and has fewer dependencies than II.) As part of porting this mod to III, I still need to put some Warhammer things back in. For example, AI General for Troy doesn't currently check for summoned units, and we definitely want to include that for III.
Last edited by paperpancake; 9 Apr, 2022 @ 7:08pm
paperpancake  [developer] 11 Apr, 2022 @ 4:25pm 
This is just a minor update on some preliminary progress. AI General III is still unfinished and unpublished, and I'm still spending many hours a day working it. There's nothing below that's critical for you to know now, and everything is subject to change, so you can ignore this post. But some of you have been clamoring for news, and writing can sometimes help me organize my thoughts, so here you go.

Survival Battles: I tried AI General III in a Survival Battle. It currently seems to do... ok-ish during some parts... almost as well as II does in siege and quest battles. :WH3_miao_serious: One particularly noticeable issue is that AI General III doesn't yet understand capture points nor the building-and-reinforcement stages. I **maybe** can do do something about that problem, at least. WH3 has some promising new script functions, including get_closest_capture_location. It might be possible to write "go to the capture location and chill" instructions in response to a script event. If I can, great. If I can't, then the only way to reliably get through Survival Battles might be to manually take control of your army sometimes, especially during times when there are no accessible enemy units.

Currently, you also are responsible for manually spending your own supply points during survival and siege battles. I don't expect that AI General III to handle that before it gets released, or possibly ever. It's similar to how you need to manually use army abilities in II (Black Ark bombardments or Great Vortex abilities, for example).

Siege Battles: WH3 documentation recommends against using script_ai_planner for siege batttles (same as it does for WH2), so I don't foresee an improvement in the way III will handle siege battles. But fwiw, very early tests suggest that III might work similarly to II during siege battles. As already mentioned, supply points will need to be spent manually.

You can skip the rest of this. tl;dr - I spent way too long squashing a bug: You know how programmers sometimes seem to take much longer than expected to do some things? It's often because we find evidence of an unforeseen bug and have to tear things apart to find it. Would Nurgle be the chaos god that influences noxious bugs, even digital ones? Or perhaps it's Tzeentch manipulating changes and obscuring the logic? Whichever one it is, GTFO. :WH3_boris:

The good news? I did eventually find the insidious bug that was plaguing AI General III. And it is thankfully in a file that modders have access to. I can patch it in AI General III, so it shouldn't delay the mod any more than the one weekend that it already ate. If you're curious, I reported the bug's technical details in the WH3 support forums[forums.totalwar.com].

Because I mentioned this bug so publicly, I should also mention for the uninitiated that this is a very sneaky bug, and I've created similar bugs in the past, so please don't get grumpy with CA on my behalf. Afaik, the bug doesn't (yet) affect any vanilla gameplay, so I don't think there's any way for non-technical QA to even discover this bug. And for the programmers / battle scripters, deep copy vs shallow copy bugs are notoriously difficult to spot just by looking. Consider, for example, that it took me many hours to find this bug even after I knew something was wrong. It was *visibly* causing problems for my work, I had experience modding this function in previous titles, and I even diffed the versions. With all that, the bug took still took me hours to isolate and recognize. Way too long. GTFO Nurgle. GTFO Tzeentch.

I'm glad to see that CA has been updating script_ai_planner. It suggests that script_ai_planner is still relevant, which is hopeful news for mods that use it. Instead of getting grumpy, I want to celebrate and encourage the devs to dig into this more and more. It fuels my fantasy that somday, AI Planner functionality might once again be exposed to the players as official parts of the vanilla Total War experience. Then I will be free from this mod! Freeeeeee! :WHII_BallAndChain: ;P
paperpancake  [developer] 17 Apr, 2022 @ 12:06pm 
This post has no critical information. tl;dr - I'm still working on AI General III.

I was hoping to have better news for you by now. I've spent a lot of time on this, but I ran into some dead ends and had to retrace my steps. I'm still experimenting. Once I figure it out, the solution will probably seem obvious to me and I will wonder why I didn't try it sooner.

I got my hopes up last post when I got it working in a custom land battle without any summoned units, transformations, reinforcements, choke points, capture points, or other special situations. But porting the mod for more complicated situations is proving a bit more troublesome. It's hard for me to predict how much longer it will take.

AI General III has been delayed by a few things. A significant one is that WH3 changed the Unit Card UI. You might have heard that modders are excited because we have more information about the UI in WH3 than was readily accessible before. That really is great news. Unfortunately for AI General III, Unit Cards still seem to have special handling in the C++ code, but they are being used differently now than it was in previous titles. Modders like me work with Lua scripts that run on top of the C++ code. Even though I am familiar with C++, I don't think modders have a (legal) way to access the underlying C++ code (unless we apply to work at CA or something). If I'm mistaken, please let me know. But that means that my recent work on this mod has involved a fair amount of trial, and error. :stress:

In previous titles, Spectator Mode and AI General relied heavily on the Unit Card UI for more than just the obvious. Hambango used the Unit Card UI to identify which units were on the field and to track reinforcements and summons. When I started updating and enhancing these mods, I couldn't find a better way in the Lua layer to listen for unit reinforcements and summons. (There was a has_deployed function in lib_battle_misc, but it wasn't performing as I needed it to in all situations when I first tested it. That was a while ago, though.) Now that the Unit Card UI has changed, I've been exploring multiple different ways to track units. The good news is that CA appears to have made a lot of improvements. But even positive changes can take time for me to learn and incorporate.

While I want to avoid forking the project into two mods that would need to be developed and maintained separately, I'm not opposed to eventually releasing a basic AI General III with the intention of updating it with more advanced features. AI General II has always had many... quirks (to put it mildly), but many of you still choose to use it. Many were using Hambango's original versions well before I started updating and enhancing the mod. I suppose it's reasonable to give you the same choice for III. What features are initially released will come down to which features are easy to port and which ones are hard. But I feel that I need to at least get some of the basic stuff to work more consistently than it does now before I release it.

When I started contributing to AI General II, I was already familiar with a lot of the functions that I needed in WH2 because I had created the Find Idle Units mod. I've had WH3 for less than 2 weeks, so there's a lot to learn. Steam tells me that I have 30 hours in the game, and almost all of that has been learning about new game modes, exploring new functionality, working on the mod, or testing updates I've made. And that doesn't count the time that I've spent working on the mod without the game running. I might have to take a break for a few days and play the game just for fun. ;P

I also spent some time troubleshooting a hardware issue not specific to this game. That set me back a day or so. Bleh. :/

I appreciate how encouraging and supportive most of you have been about this. :WH3_clasp:
paperpancake  [developer] 24 Apr, 2022 @ 3:56pm 
AI General 3 is still unfinished, but an early access version is now available using this link: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2799316652. You might wish to wait for it to improve before you use it. This mod is intentionally unlisted while I get more feedback from some of you. That means that you cannot find the mod unless you have a direct link.

Do not use the link above if you are allergic to reading.

I spent a lot of time on this mod in the few weeks after I was given WH3 -- learning about WH3, developing, and testing. My pace is unsustainable for me in the long-term, so development on AI General 3 will likely slow down a bit. I can make no promises about future development, but I do anticipate that I will continue working on the known issues and improving the mod gradually. If you think you would speed things up by collaborating or taking over this mod, feel free to contact me about it. This mod requires familiarity with scripting and already has over 1500 lines of custom script, so please be ready to show me another mod with battle scripts that you’ve made.

For those of you that don't want to use an unfinished mod, I will try to remember to post again in this discussion when (if?) this mod ever reaches major release milestones.

If you are desperate to try AI General 3 in multiplayer even knowing that it might be ruinous, contact me on Discord through the Modding Den to offer yourself as a guinea pig tester.
Last edited by paperpancake; 25 Apr, 2022 @ 1:47am
paperpancake  [developer] 1 Jul, 2022 @ 12:33am 
AI General 3 is now released and publicly available here: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2799316652
< >
Showing 1-6 of 6 comments
Per page: 1530 50