View Full Version : AI using guard mode at inopportune moments
TWFanatic
07-24-2008, 18:06
Is there any way to make the AI stop using guard mode? This is why I ask:
https://img365.imageshack.us/img365/6839/rometw2008071913472636ew5.jpg
It is really quite annoying to have enemy formations perpendicular to mine.
I’ve heard that the formations file controls this. If that is so, what area do I need to edit?
Thanks in advance.
Are you using any mini-mod formation files? I have this problem all the time and I've used several formation minimods, such as Darths and Sinhuts(sp?). So if you aren't, it must be hard coded or something. On larger battles it doesn't seem to make as much difference, I usually try to approach the AI head on, unless I'm trying to exploit there guard mode.
TWFanatic
07-25-2008, 02:51
The answer to your question is yes, but I get the problem with the vanilla formation files too.
I had this very much with Sinuhet's files, but not with Darth's. I think it is triggered by the default-melee-stance (or what is it called), that Sinuhet uses very much and Darth not at all.
TWFanatic
07-25-2008, 16:00
Thanks konny, I'll try Darth then.
EDIT: Hey! I use Darth.
Lysander13
07-25-2008, 22:37
The code for guard mode is prevalent in all formations. EB's, Darth's, Sinuhet's and going back to Vanilla Formations. The problem isn't with any of those formations themselves, even vanilla formations for that matter. None of them handle it any better than the other. Because it isn't a formations problem, IMO. The problem is that the player has the significant advantage of when to toggle guard mode on and off during the course of battle at will. Where as the AI, it's painfully apparant, does not have the capability of being as selective. So when the defend flag in the formations is toggled, so to speak, units that are called upon to use guard mode stay stuck in it because the AI cannot discern when it should rid itself of it. That is, until the formation toggles again to attack or attack/defend. Which usually will not happen unless the player disengages, is routed or of course the AI is routed. Removing all instances of guard mode from the code for the AI is not much better either. Particularly in the case of phalanx and heavy spearmen units, where they clearly benefit from it's use. Especially in the front lines or when attempting to hold the center. It can even benefit from it in trying to hold a flank if it get's into position quick enough. That is until it's obvious they should clearly get out of it. I once played around a lot with this and if IIRC, noticed some really strange things, particularly with spearmen and pikemen by removing all instances of guard mode from the formations. Especially with front line units who are the first to engage in melee. Guard mode is great for the player. The AI unfortunately doesn't get the same benefit from it as the player in the same fashion. As it is a "linear thinker" by design, no matter the obsticles or drubbing it's taking and doesn't enjoy the luxury of being as creative as the player with it. Formations won't fix this and not using it at all in the code hampers the AI even further. If there is such a thing. At least in my opinion anway.
TWFanatic
07-25-2008, 23:40
Interesting post Lysander, thanks for the info.
As a three-year multiplayer veteran, I have to disagree about guard mode: non-Macedonian phalanx (units without the phalanx special ability) fight considerably worse with guard mode on in almost all circumstances. I would rather just remove guard mode altogether as an option for the AI (except with Macedonian phalanxes) if possible. How might one go about this?
Che Roriniho
07-25-2008, 23:51
DarthFormations is utterly amazing. I wholly reccomend it for anyone.
Thanks konny, I'll try Darth then.
EDIT: Hey! I use Darth.
Oh? I had the same problem when changing from EB formations to Sinuhet's: nearly all AI units were in guard mode. The problem disappeared when changing from that to Darth's formation.
Che Roriniho
07-26-2008, 13:57
Oh? I had the same problem when changing from EB formations to Sinuhet's: nearly all AI units were in guard mode. The problem disappeared when changing from that to Darth's formation.
I would honestly avoid Sinuhet's formations, I just find they don't qork as well as Darth's. This isn't to say that they're bad, just that Darth's are so much better.
Lysander13
07-26-2008, 17:34
The code for guard mode is prevalent in all formations.
Pardon me for qouting myself. I do so only to retract the above comment. As it is completely false. Konny and TWF got me curious about this again as it's been awhile since i really played around with this and i posted really out of memory as oppose to fact. So i played around with it a bit last night. First of all, the code for guard mode is not prevalent in all formations...ie...EB, Darth, Sinuhet, & Vanilla. As a matter of fact here's the actual breakdown of how many times guard mode is called for in the code in the various formations.
Sinuhet Formations: 174
Darth Formations: 38
EB Formations: 5
Vanilla Formations: 0
Obviously, this is a big difference and by definition Konny is absolutely correct. Sinuhet does call for it more. A few things to note here are that the Sinuhet file is significantly bigger than the other 3. Especially EB's and Vanilla's. So there are more fomations and oppurtunities to call for guard mode.....here's the thing though. In messing around and running a few tests last night. The AI still has the ability to call for guard mode, whether the code is in the formation or not, when the defend flag is toggled in the formation set. Which is why i remembered it happening in all formations and from faulty memory claimed the code was prevalent in all them. Which of course from looking at the above numbers is absolutely incorrect. The question for me here is, especially since i use Sinuhet Formations...How much better off will the AI be if one doesn't call for guard mode at all or very little in the formation file and leave it totally to the AI? Really, i'm just talking about Sinuhet Formations here since the other 3 use it very little if at all. Darth Formations uses it only for the Greek and Makedonian Formations for the most part by the way, with phalanx units featuring heavily.
This may require a bit of testing....Gah!! Testing formations is so annoying.....:wall:
I found that Sinuhet's file did the AI better on small scale defensive battles because it tended to keep its formation much better. When holding a line of three or four units against an enemy of three or four units, guard mode isn't the worst to toggle on. But that becomes a serious problem in large scale battles because having twenty units on the field on either side requires more movement, and will lead more often to flanking situations, even if the player, like me, in general avoids to much flanking against the poor AI.
TWFanatic
07-27-2008, 01:24
Interesting finds Lysander.
Darth Formations uses it only for the Greek and Makedonian Formations for the most part
Would it be possible to remove guard mode from all units except for Macedonian phalanxes?
Woreczko
07-27-2008, 11:39
Actually macedonian phalanxes do better without the guard mode. In phalanx they will keep formation anyway, and with guard off they kill faster. Guard mode is best used, when you want to hold the line as long as possible with inferior troops.
Would it be possible to remove guard mode from all units except for Macedonian phalanxes?
I think this is triggered by the "default_melee_state defend". When you remove it from all units save the long pike phalanx, you should have it. As far as I know, what is not much in modding the formations file, triggering any default_melee_state will disable the others for the AI. That would be "default_melee_state engage_at_will" would disable guard mode.
TWFanatic
07-27-2008, 17:28
Thanx, I'll try that Konny.
vBulletin® v3.7.1, Copyright ©2000-2025, Jelsoft Enterprises Ltd.