Jump to content

Future improvements to attack move


Yekaterina
 Share

Recommended Posts

Dear developers:

 

Even though the game is already very well programmed, I noticed some strange behaviour in soldier units when I attack move (ctrl+right click): some soldiers prefer to capture enemy buildings instead of killing the nearby enemy units, while others stand there and do nothing instead of fighting. Their reluctance to fight the enemy units first has resulted in many unnecessary casualties, therefore I believe that we should prioritise the enemy units over structures. Furthermore, I saw my archers shooting at enemy rams instead of soldiers even though I did attack move on of their units, which is utterly a waste of arrows.

When I order the soldiers to attack move on units some distance away, I often find a group of them standing idle half way, which again results in more casualties at the front line. Often this is caused by the one of the enemy unit being killed already, or for some unknown reason they were distracted on their way there. So my suggestions for improvements are the following:

1. Change attack priority: soldiers always should attack living enemy soldiers and cavalry first, then women. Only attack siege and buildings if they have been specifically ordered to.

2. Please fix the stopping half way bug. If the targeted enemy is dead, at least walk towards the pointed location then attack what's left there... please just don't stand there and do nothing...

3. All of my soldiers should focus near the point where I right clicked instead of being distracted and going elsewhere.

In addition, rams and elephants seem to get stuck between units too often, such that they cannot reach the enemy building that they have been ordered to attack. Hopefully there is a way to resolve this.

 

Best,

Helicity

Link to comment
Share on other sites

Thank you for your reply!

16 minutes ago, Yekaterina said:

I think the solution is in UnitAI.js

 

Where can I find this file?

 

16 minutes ago, Yekaterina said:

Can you provide some logs or replays?

I'm afraid that my replay files are completely fragmented  because I disconnected in almost every match. Nevermind the details, the 4 changes I proposed should be doable without having to look at my replays right? I think they are quite general changes to the code.

Link to comment
Share on other sites

Hello @Helicity and thank you for your feedback,

attack-move is indeed partly broken, there have been several attempts at fixing it, but there can be quite some edge cases we need to work with. We would love seeing the solution either as a mod or a patch submitted on Phabricator. :)

Here is the most recent file: https://code.wildfiregames.com/source/0ad/browse/ps/trunk/binaries/data/mods/public/simulation/components/UnitAI.js, where "WALKINGANDFIGHTING" is attack-move. As for the preference to certain units, you can define those in the templates in the Attack component.

See also e.g. https://code.wildfiregames.com/D3853 for an attempt at improving walk-and-fight behaviour. This is not merged because the method used is very expensive, computationally.

  • Like 1
  • Thanks 2
Link to comment
Share on other sites

2 hours ago, Freagarach said:

Although I'm not a programmer myself, I think this file offers some clues: there are some behavioral controls in the stances settings, which means adjusting these would help. So far the violent mode seems the most appropriate for invading the enemy base, because of "targetAttackersAlways": true,"

If we can use different combinations of true and false here then we can construct the ideal mode of operation for these units:

"ideal": {
			"targetVisibleEnemies": true,
			"targetAttackersAlways": true,
			"respondFlee": false,
			"respondFleeOnSight": false,
			"respondChase": true,
			"respondChaseBeyondVision": false,
			"respondStandGround": true,
			"respondHoldGround": true,
			"selectable": true
		},

 

  • Like 1
Link to comment
Share on other sites

On 12/02/2023 at 6:12 AM, Helicity said:

some soldiers prefer to capture enemy buildings instead of killing the nearby enemy units,

Hi @Helicity,

While other issues you mentioned may still be present, you can use "Attack-move (Units Only)"

This option is unbound by default in the hotkeys, so I just swapped it for "Attack-move". The units only version is much better to be honest, and I think it should be probably be bound by default.

  • Thanks 1
Link to comment
Share on other sites

16 minutes ago, real_tabasco_sauce said:

Maybe it wasn't for me because my config was carried over from earlier alphas.

Well, unless overwritten in user.cfg it should pick up changes to default.cfg. Best to keep those changes in user.cfg you really like deliberately in local.cfg and delete user.cfg once in a while or at latest when 0ad is acting up.

For completeness https://code.wildfiregames.com/rP15671

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...