Total War: WARHAMMER III

Total War: WARHAMMER III

AI General 3
 This topic has been pinned, so it's probably important
paperpancake  [developer] 1 Sep, 2022 @ 12:36pm
FAQs
Multiplayer? Please, please?

Multiplayer is now enabled, but it only works in some situations. Please see this multiplayer discussion.


This mod isn't working. Help?

Try these troubleshooting steps.


How do the hotkeys compare to the old Spectator Mode II hotkeys?

Spectator Mode - With nothing selected, press Shift+F10
Hero Mode - With the hero selected, press Shift+F10
Reinforcement Mode - Ctrl+A to select all your units, then Shift+F10
Turn Off AI Control - With nothing selected, press Shift+F9

You can even configure AI General 3 to automatically start every battle in one of those modes if you want. :)


Why does this mod use the AI Planner instead of the AI that enemies use?

The AI Planner is accessible to scripted mods. (Longer answer in this discussion.)


The AI is doing a stupid thing. Can you make the AI better?

tl;dr - Me? No. Another modder? Maybe...

I would love if someone found something I've missed to that would improve the AI or allow me to give the units to a better AI. In my personal games, I use AI General sparingly because I also am disappointed in AI General's decision-making.

Some users have reported that the SFO mod improves AI General's decision-making. If true, then there might be moddable functionality that I don't know about. CA has given modders more to work with in WH3 than in WH2, and they have added some for modders with some WH3 updates.

I've lost momentum on modding (in part due to past modding limitations and in part due to health). I still hope to maintain this mod and maybe make small improvements here and there so that the players that enjoy it can keep using it. But if another modder has ideas and wants to fork this or make a spiritual successor to this mod, please feel free.

AI problems fall into at least four categories:

  1. If the underlying problem turns out to be how units are given to the AI Planner, then I might be able to do something. For example, in WH2, I was able to fix when units stopped getting new orders from AI General II because that was a problem with how the old version was originally giving units to the AI. However, this usually isn't what people mean when they ask this question.

  2. If the problem is related to how a unit is categorized in the database, another mod or submod could change that. I'm hesitant to change these database values directly in AI General 3. (Among other reasons, it would be bad for compatibility with some other mods, including overhauls.) The "Ai Usage Group" field is found in the land_units table, and it references the ai_usage_groups table. There are also other files that might affect the AI's decisions. You are welcome to experiment.

  3. If the problem is within CA's Script AI Planner, then the answer is "maybe, but not easily, and it probably won't happen at this point." AI General creates a way for players to interface with CA's AI Planner, but I don't have access to the code that controls the AI Planner. Modders can access the Lua script and the database, but not the underlying C++ code. To directly control this mod's decisions, I would need to write my own version of the AI Planner. I don't yet know whether that's even possible given what modders can access, but in WH3 it might be easier than it was in WH2 because CA has made more information accessible to modders.

    To the people comparing AI General between games: the changes in how the units act has been thanks to CA, not to me or any other modder (provided that the units are receiving orders at all and as long as the mod does not cause a script break or cause a crash). Keep in mind that CA did not make their AI Planner available in the unmodified game, either because they know it's quirky or because they designed it for a different purpose than AI General.

    I'm looking into the possibility of creating my own AI Planner for the most problematic units (like horse archers that fire while moving, and like characters that aren't engaging in combat). The idea would be to give most units to CA's AI Planner and give the problematic units to my custom AI Planner. I do not yet know how feasible this is, and it is beyond the initial scope of this mod. If I did this at all, it would be a slow process. I am not promising anything. The main takeaway here is that I don't think it's possible for me to change CA's AI Planner. If I don't like how it controls a unit, I believe that I would have to write my own.

  4. Right now, the only decision-making that AI General 3 directly controls is what happens at the end of the battle after victory is declared. More on that in the next question.


How does AI General II decide how to chase enemies at the end of the battle?

AI General 3 goes through a list of enemies in order and assigns the closest friendly unit under its control to attack that enemy. (There's some extra logic for unusual cases, but that's the basic idea.) This is also how AI General worked in the previous versions of AI General and Spectator Mode, as well.

While this behavior kind of works, it's not ideal. AI General 3 might assign a slow unit to chase a fast one that it can't reach when it has a target that it can. Or it might tell your unit to chase something far away just because nothing else you have is closer.

I'm aware of this and have talked with others about it. In WH2, modders didn't have easy access to some basic information about the units from within a script. In WH3 we have more information, so there's a small chance that I might improve this in a future update. Again, no promises, especially since I have lost a lot of my modding motivation.


How do I report a bug?

Have you already tried all the troubleshooting steps I mentioned in one of the first FAQs above? If so, create a discussion here or message me on Discord (paperpancake5#2391). Replay files can be helpful.

If possible, it also helps if you disable all mods except this one and try to reproduce the bug. This helps me know whether the bug is due to a bad interaction between mods.
Last edited by paperpancake; 13 Dec, 2024 @ 2:17am
< >
Showing 1-3 of 3 comments
paperpancake  [developer] 1 Sep, 2022 @ 1:06pm 
(reserved)
Last edited by paperpancake; 21 Oct, 2022 @ 2:31pm
shadow_sc 13 Apr, 2023 @ 11:06pm 
I tried to make an auxiliary mod to improve ai general's performance. As mentioned in issue 2, I found that some units are not categorized to the best type. I tried to edit the Ai Usage Group field, but found that this affects enemy's behaviours as well, and maybe more than ai general lol.
I don't think this makes any sense, I want to challenge enemy's general, but not to fight with myself. Can ai general use different tactics from the enemy?
paperpancake  [developer] 14 Apr, 2023 @ 5:41pm 
Ah. Changes would affect the enemy AI, too, and I can see why that might be not what you'd want. As far as I know, there isn't a way to deliberately change the behavior of AI General without also affecting the enemy AI.
< >
Showing 1-3 of 3 comments
Per page: 1530 50