AI Angle Of Release

Users who are viewing this thread

Blaine

Sergeant
Is it possible to change the AIs maximum angle of release for bows and crossbows? From what I can see, the AI appears to only fire about 20(?) degrees or so in height in order to achieve its maximum range, and I'd like to play around with seeing how the AI behaves when it can fire at 45 degrees to achieve the absolute maximum range; trying to search for similar topics showed nothing. Anyone know if this is even possible to change or have any thoughts on it? I want to see what it's like when a hail of arrows literally rains from above from a long distance away.

To better explain, in this image, I have only observed the AI being able to fire similarly to what the top shows, but I'd like to see the AI be able to do 45 degree shots such as what the bottom shows: https://mathspig.files.wordpress.com/2012/04/arrow-1.jpg
 
They aim however they can hit strait forward, if you are trying to role play, these are small battlefields, and they have enough range to shoot a little high, not at 45 degree angles. Maybe try making a bigger Battle Size location.
 
Average said:
They aim however they can hit strait forward, if you are trying to role play, these are small battlefields, and they have enough range to shoot a little high, not at 45 degree angles. Maybe try making a bigger Battle Size location.

The maps are plenty big enough because I've tried on a completely flat map. I myself can aim 45 degrees and pull off a 300m shot, yet the AI will only begin firing their arrows at say ~150-200m depending on the "speed" of their bow and never fire at high angles.
 
I'd also like to know if this is possible, I've editted arrow speed to around half the original speed making arrows have a greater arch when used by the player, but for the AI it simply means a shorter range, when they are on a hill or firing at enemy on a wall the arrows projection looks really nice, it does mean higher angles will be less accurate but I think that'd be for the best.
 
You could give invisible arrows coded to do zero damage to enemy agents, but make their bow add a normal missile with sometimes a wider angle to the ground when shooting. Calculating the ideal speed and angle they "want" to shoot with would be difficult that way, though.
 
Hello, I have accidentally gotten a semi decent start of a system to get archers to lob their shots, possibly over walls.
You can make agents target a dummy scene prop which is between them and the enemy, the agent will always target the prop despite it being out of range/unable to hit it.
GTzgKea.jpg

Agents aim for the prop at 45 degrees, possible for higher aiming but 45 gives max range.

RMh59Nv.jpg

Agents release.

7eJrQ35.jpg

Arrows land with a good grouping

lGi1Bd8.jpg

The dummy scene prop is 100m from the agents at a height of 100m creating a release angle of 45 degrees, creating a max range of 200.
The agents arrows fall well shot of the dummy scene prop.

This testing if done within the tutorial map so far, I'm not sure how to implement this to anything usable so far but the theory is at least there, more powerfull bows and arrows may need to be tweaked as this would double the range of arrows on flat ground and potentially allow agents to fire over walls (agents can see dummy prop, target agents can see dummy prop, arrows have clear line of site)
There is only 1 dummy prop present in testing so the arrows fire across one another but correctly land at the opposite side.
 
ShaunRemo said:
Hello, I have accidentally gotten a semi decent start of a system to get archers to lob their shots, possibly over walls.
You can make agents target a dummy scene prop which is between them and the enemy, the agent will always target the prop despite it being out of range/unable to hit it.
GTzgKea.jpg

Agents aim for the prop at 45 degrees, possible for higher aiming but 45 gives max range.

RMh59Nv.jpg

Agents release.

7eJrQ35.jpg

Arrows land with a good grouping

lGi1Bd8.jpg

The dummy scene prop is 100m from the agents at a height of 100m creating a release angle of 45 degrees, creating a max range of 200.
The agents arrows fall well shot of the dummy scene prop.

This testing if done within the tutorial map so far, I'm not sure how to implement this to anything usable so far but the theory is at least there, more powerfull bows and arrows may need to be tweaked as this would double the range of arrows on flat ground and potentially allow agents to fire over walls (agents can see dummy prop, target agents can see dummy prop, arrows have clear line of site)
There is only 1 dummy prop present in testing so the arrows fire across one another but correctly land at the opposite side.

If i understood correctly, we will place a dummy near the enemy, and we will make the archers shoot that dummy being not cared the shooting range. Right ?
 
Not really, a dummy at the enemy the archers will shoot at it and the arrow fall short,
The dummy needs to be in the centre of the two and the height of the dummy will determine the angle of release.
I haven't yet explored what the calculations would be to achieve accurate shots would be as each weapon is different.
 
Shaun and Hyper,
How are you getting your archers to target a dummy Total War style?
I didn't know that was possible in MB; I tell them where to stand and can't do anymore.
Can you point to a mod or thread where they have this working?
That would revolutionize the battles.
 
I think with that operations, it is possible;

Code:
(agent_set_attack_action, <agent_id>, <direction_value>, <action_value>), # canceling any act with putting -2 to direct_value, and putting 0 to act_value for ready and release
(scene_prop_set_team, <scene_prop_id>, <value>), # so making the dummy enemy of our archers
(position_get_x, <destination_fixed_point>, <position>), # Returning the position X coordinate (to the east, or to the right) with fixed point.
(position_get_y, <destination_fixed_point>, <position>), # Returning the position Y coordinate (to the north, or forward) with fixed point
(position_get_z, <destination_fixed_point>, <position>), # Returning position Z coordinate (to the top) with fixed point.

Maybe its more than these ops.
 
I'm using the tutorial as a testing ground because the archer automatically targets a scene prop. the relevant code is here, and a dummy target might not be necessary the earlier code had

(agent_set_slot, ":cur_agent", slot_agent_target_prop_instance, ":best_instance"),


which is how I thought the agent was targeting but further down they get the position of the scene prop so dummy scene prop is irrelevant, more a dummy position.

(agent_set_look_target_position, ":cur_agent", pos1),
(agent_set_attack_action, ":cur_agent", 0),


You can look up the code in mission templates just find "tutorial_archer_1" for the relevant code.
 
The picture of those archers getting ready to loose their arrows looks really cool >.>.  If you find a way to get this into SP battles I will be happy!
 
Nice! This is very interesting - could it somehow be combined with dstemmer's Command Cursor mod so you can call your archers to shoot where you want?
 
Back
Top Bottom