Is it possible to prevent AI general charging to player's army?
What is the script that handles that?
thanks
Is it possible to prevent AI general charging to player's army?
What is the script that handles that?
thanks
I don't think it's possible coz CS(campaign_script.txt) only deals mainly with campaign map.
And besides i haven't seen any command to stop the AI from charging we can stop the AI missile units from Skirmishing but charging I'm not sure it's possible.
The only work around i guess can be that u set the charge distance of the bodyguard units to zero.![]()
config_ai_battle.xml... I doubt you will manage it and yet still be satisfied, so good luck!![]()
That should do the job and keep a backup if something doesn't goes accordingly.![]()
NoNo, AI still charges his general, help
Remember what Taiji said. Post #3.
One question: What do you want in positive terms?
'I don't want X' doesn't really give you an objective.
If the general is going to be stuck in one place then he's either in missile range, and an easy target, or he's not much use to his troops because he's too far away, and easy to flank with cav.
Neither of those options appealed to me when I tested them. Both made the game easier, not harder.
If generals are dying rapidly then consider improving their stats, giving them bonus hitpoints through traits, stuff like that. It's at least partly a balance issue, as opposed to an AI issue.
But also take a look at the retreat settings in config_ai_battle, they determine the distance the general retreats to. This setting also has some influence over the time the general will spend fighting before deciding to retreat.
You will probably also want to play with where they are placed in formations, since this can have a great effect on how active the general is likely to be.
Anyway, to my mind generals need to be made more robust and dynamic, rather than making them useless easy targets. A good player will capitalise on the weaknesses of a general no matter whether he charges or not, so I try to make the most of him in my system![]()
Last edited by Taiji; July 28, 2010 at 10:24 PM.
i want to prevent them to suicide especially in siege, they always die in the gateway, i want them to stay behind the battlefield and can retreat faster
Check out the AI formation file for sieges. Find where the general unit is positioned and set him to "guard" or something.
Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
dHRR 0.8 beta released! get it here
New: Native America! A mini-mod for Kingdoms America
Actually my testing shows that this makes him more likely to die because he can't kill those around him as quickly. Use formations to ensure that he is not the first through the gate, that is simple enough, and effective in my work. It's only one side of the story though, not just pushing the general back, but also pushing the inf forwards is important.
But also be very wary of battle map sizes, I seem to remember that cannon towers might well force your general off map which can cause a CTD. But even in these gate situations I still say that this is largely a balance issue.
If a game is badly balanced, and so generals are too weak to serve their function, then I think battle scripting is going to provide the only solution.
That doesn't really relate to what Konny said, but you are on to something. Unfortunately however, it is not a viable solution. The GTA settings have a relationship with engage distances. And with the GTA it is not possible to make seperate settings for settlements. So breaking it for generals in sieges also means breaking it for open field battles.
I've already told you want you want to know then:
If you don't want to play around with what I have suggested, and try to solve your problem using game balancing and the AI, then you will have to script what you want.
If so then I hope you are a good scripter, battle scripting seems to have paralysed most of this community with fear
And BTW noone who does not know everything about your unit balancing system, as well as being very familiar with the battle AI settings and functions, can give you precise solutions to battle AI problems.
Last edited by Taiji; July 30, 2010 at 09:04 AM.
I wouldn't know how to do that. The general is mounted, that means as soon as the army is moving he will be at the gates before the infantry gets there. Even if I had the infantry there first, his heavy cavalry will be pushing through any infantry already engaged at the gates getting him in the first line again.
The only way to prevent from that would be to place the enemy in a position where he won't enter fighting at all.
Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
dHRR 0.8 beta released! get it here
New: Native America! A mini-mod for Kingdoms America
@konny
Yes u are right coz when the player rallies his troops against the AI we see that the archers when fire on the general he stays put and when a certain distance between the general and troops attacking him is crossed then he charges.
So there must be some threshold for that, decreasing it will do the job.![]()
I think the problem is rather that in offensive siege (and bridge) battles the AI has all units charging headlong into the breach. The general, because of being mounted, is one of the first to enter combat - and to be killed.
It would be better to assign him a position faaaaar behind his lines and set him to "guard". This might result in him being killed by missle fire without resitance, but that's still better than 100% suicide.
Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
dHRR 0.8 beta released! get it here
New: Native America! A mini-mod for Kingdoms America
The guys with the ram, give them an escort of inf with shields. Also helps with countering sallies by the player.
I can do this without adding attributes. But that feature is unique to my system. (Until somesteals it without crediting me, as is prone to happen in this TWC community when you happen to be a coder.)
But you can just add the attribute 'has_shield' (or whatever you'd like to call it) to any unit with a shield. And then specify that attribute in the formation.
If you're saying that your unit balancing allows your general to push through any density of infantry then consider changing your unit balancing.
Last edited by Taiji; July 30, 2010 at 09:05 AM.
I don't get it: I am talking, and I the think the OP is too, about the gates being breached and the fighting has started. What use should the unit that formerly had the ram have?
I would be seriously unhappy if my statting would not allow heavy cavalry to push infantry.If you're saying that your unit balancing allows your general to push through any density of infantry then consider changing your unit balancing.
Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
dHRR 0.8 beta released! get it here
New: Native America! A mini-mod for Kingdoms America
Actually I'll change my suggestion since it was only really applicable for sally defense. My mistake, sorry for the confusion.
There is a gate assault formation. In that formation you can set up a block of inf close to the gate. This way the inf do not get peppered while ramming continues. And they are gauranteed to be first through the gate, assuming the general is placed far enough away.
Yes, I think I agree with you 100%. I make pains to ensure the same mechanic. The issue in question is whether you can force a general through very tightly packed inf easily, this is not a desireable mechanic because of it's effect at the gates. You can solve that by finely adjusting mount/inf mass.
Generals need enough mass to force through a unit or 2, so they can properly disengage on the field. But not so much mass that they can push through 4 stacked inf units in a tight place.
And I have to add that the phase requirements for the settlement assault tactic also need attention. It is often a disaster for the AI to push for the plaza when fighting at the gate continues. Because of course cav with their high mass will get to the front and do most of the fighting if it happens at the wrong time.
Last edited by Taiji; July 30, 2010 at 12:11 PM.
Possible direct means of protecting general unit without toying with stats (all mentioned before):
- changing engage-dist - very decent way, has some downsides (~20m is optimal, I used 15 and it was a bit low)
- scripts - I experimented with lots of code, but it needs to be fool-proof and can't spoil AI's battle plan, I introduced some of these changes 6 months ago, but I limited script use lately - mainly useful in sieges
- formations adjustments - mainly applicable for sieges
@Taiji
I'm not even bothered much if someone got "inspired" by my ideas since I started BAI coding (that includes using reworked siege formations with infantry protecting rams and many more). Ofc that'd change if someone started claiming authorship on some non-obvious changes.
The only thing I'd have someone hanged for is abusing my scripts.
Regards
Last edited by Germanicu5; July 30, 2010 at 10:00 AM.
I have no memory of this place.
Well actually I'd have no respect for a claim about formations belonging to someone, they're way way too obvious. It's one of the extremely easy areas of battle AI modding. There's so little to vary and all of it is pretty obvious.
Yes, possibly scripting is the only area where a creative coders like us are protected from plagiarism by this site's admin.
But to be honest I sincerely doubt it. I think you'd wind up having to 'hang' them yourself
Anyone can make the same script you made without even seeing yours. Most of it is plain to see in the battle scripts for vanilla, like the stakes deployment script you made. And the really clever stuff you've done, like the army locating I praised you for in my last PM, well seriously it's only a matter of time given a determined modder. The docudemons are available, it's only a matter of testing and trying new things, there aren't enough new things to try to assume otherwise.
Consider that noone else besides you (and now me) has bothered with battle scripting in this community. It's going to be pretty hard for you to tell what is generally obvious when your sample size is one person.
Anyway the cause of my (tiny amount of) resentment is that graphic artists get this protection when they should not be entitled to any. It's just unfair, to treat them any differently to coders, just because in their case it's easy to see when they have been ripped off.
Of course someone claiming to have originated work, and concepts, which they have copied from me is a little annoying. But it's not really important to me, because if it was then I wouldn't mod a game where everything I do is easy to examine. Plus I am naturally quite generous, like I think you are, and if it costs me nothing and earns me nothing, even more so.
To me this plagiarism stuff only becomes seriously important when we lose money from it, when copyrights come into it, and not until.
Last edited by Taiji; July 30, 2010 at 10:56 AM.