Log in

View Full Version : Research - The AI and skirmishing units



Jambo
05-01-2007, 12:55
Right, this has been an issue for longer than I can remember for TW games, and it's still not great in Med II.

The issue is that for certain skirmishing units - those with a short missile range - the AI just cannot use them properly. It moves them into range to engage with their missiles, but the range is too short and they skirmish. The net result is they don't actually throw anything and instead engage in their perpetual seesawing motion. This doesn't affect mounted skirmishing units simply because they can throw use their missiles whilst on the move. For infantry skirmishers it's another matter altogether - here's a list of the obvious offenders that I can think of (AI does sometimes use javelin units ok):


All infantry javelin units
Handgunners
Naffatun


The last two are just downright awful in the hands of the AI. There is some new code at the start of the battle_config file but it's not overly clear how changing this code for skirmishers would impact on the game as a whole and it's probably a rather arduous task to find out. For instance they might have ramifications on other aspects .... However, there are some steps we can take to somewhat alleviate this problem for the AI:

1. Increase the range of their missiles so the range they skirmish at isn't as close to the max range of their missiles. This should stop the seesawing action but the AI will probably still use them poorly.

2. Add "start_not_skirmish" on the unit's attribute line. Most of these short range missile units have ok melee stats anyway and this option definitely allows the AI to use them. Only sticking point is human player's cavalry, but I guess that just depends on how the AI uses them...

I currently use option 2. Anyone any other suggestions?

HoreTore
05-01-2007, 13:39
How 'bout making them able to fire on the move, like the mounted ones? For javelins and naffatuns, it makes perfect sense IMO. I can't see any reason why they should have to stand still to shoot, particularly the javelin, you'll throw it a lot better on the move.

But is it possible to do that?

Daveybaby
05-01-2007, 13:58
I dont think option 1 is really viable... long range naffatun :shocked2: - might as well just replace them with rocket launchers.

FactionHeir
05-01-2007, 19:32
Wouldn't work Hore Tore, as that's animation based. Of course you could mount those units onto an elephant (slow speed) with no mass and extra hp, but that would be kind of awkward.

Option 2 sounds most reasonable to me, unless you want to change skirmish distances, but changing those is basically making the unit more vulnerable to charges, so with 2 at least they'll get off a volley.

Agent Smith
05-01-2007, 20:18
Wouldn't work Hore Tore, as that's animation based. Of course you could mount those units onto an elephant (slow speed) with no mass and extra hp, but that would be kind of awkward.

Option 2 sounds most reasonable to me, unless you want to change skirmish distances, but changing those is basically making the unit more vulnerable to charges, so with 2 at least they'll get off a volley.

Actually, wouldn't HoreTore's idea work based upon how javelins are actually thrown to achieve greater distances? Using a running start before throwing gives you a lot more power behind the javelin rather than standing still while throwing it. If you allowed the animation to start earlier, couldn't you get that effect so the javelin is throw right at the point where the skirmish distance is met, so they retreat and start over?

Lusted
05-01-2007, 20:37
No doesn't work like that, the firing animations for all units are based on the unit being static, but with cavalry the units are mounted so whilst the soldier is still, the mount moves.

HoreTore
05-01-2007, 21:14
I'll wait for someone to alter the animations then...

Agent Smith
05-02-2007, 02:12
No doesn't work like that, the firing animations for all units are based on the unit being static, but with cavalry the units are mounted so whilst the soldier is still, the mount moves.

Then all you need to do is make from the wait up a "rider" and from the waist down a "mount" for animation purposes :laugh4:

Could you imagine a skirmisher running in one direction while his torso is turned around 180 degrees the other way, all while throwing a javelin?

sunsmountain
05-02-2007, 08:24
Hi all, just wanted to pop by and say that I stopped playing this game because of the lacking AI (and other time constraints, but i still play games). Hopefully the next incarnation of the TW genre will be better...

kind regards,

suns

Jambo
05-05-2007, 12:39
It appears adding the "start_not_skirmish" attribute doesn't really work for the AI. The AI will simply re-enable this during a battle!

So, I decided to take a closer look at the battle_config file and in particular this series of entries for gunpowder infantry units:

<gunpowder>
<!-- ignore targets at a distance greater than the maximum range times this scale factor -->
<max-range-scale>1.5</max-range-scale>

<!-- must skirmish if within this range -->
<min-range>40</min-range>

<!-- stop at this distance if the enemy is blocking the path -->
<min-stopping-range>50</min-stopping-range>

<!-- time to react to being intercepted -->
<collision-reaction-time>12</collision-reaction-time>

<!-- retreat buffer time -->
<retreat-time>14</retreat-time>

<!-- don't skirmish until attackers are within this fraction of the missile range -->
<range-factor>
<moving>1.1</moving>

<shooting>0.80</shooting>
</range-factor>
</gunpowder>

Take a look at the "moving" entry under "don't skirmish until attacks are within this fraction of the missle range." It has a value of 1.1 which to me doesn't make much sense and may be the cause of the seesawing action. As I udnerstand it, this entry means that a moving skirmishing unit shouldn't skirmish until an enemy unit is within 1.1 x its missile range. If true, this explains why a moving skirmish unit with a low missile range weapon (e.g. hand gunners) can never reach a suitable distance which will allow them to stop and fire again after skirmishing.

Anyway, I modded this to 0.8 and this seems to make them work much better. After skirmishing a value lower than 1.0 will then allow them to return to their missile range distance or the distance mentioned in "stop at this distance if the enemy is blocking the path."