fa icon indicating copy to clipboard operation
fa copied to clipboard

Automatically rotate units with angle limits towards targets

Open lL1l1 opened this issue 1 year ago • 3 comments

Issue

Cybran carrier, Monkeylord, and Othuum have weapons with angle restrictions that require the unit to face a certain direction maximize DPS, but there is no simple way of doing so. In particular they don't attack optimally even when idle, which feels more like an oversight in their AI design rather than them staying still so that the player can micro them better later (whenever that will happen).

Description of the proposed changes

Adds SlavedToBody = true and appropriate SlavedToBodyArcRange values so that the units can hit moving targets while turning. The Monkeylord turns off its auto rotation when the laser is firing because it has a low 25 turn rate and its rotation is quite critical in micro (similar logic to Fatboy only rotating on attack orders).

Testing done on the proposed changes

The units can hit a spirit moving around the unit at max range.

(Ythotha is not part of these changes, it is just here for comparison since it is an existing auto rotating unit)

https://github.com/user-attachments/assets/b09b042e-0e13-4b4e-aefe-8035e1d551a5

https://github.com/user-attachments/assets/770e2b5f-341d-4fa7-a95c-a0abf81a5a80

Additional context

Discord discussion on the topic.

Checklist

  • [x] Changes are annotated, including comments where useful
  • [x] Changes are documented in the changelog for the next game version

lL1l1 avatar Sep 07 '24 21:09 lL1l1

I can't find the discussion on discord, the link doesn't do anything for me. I don't recall reading about it either.

Tagada14 avatar Sep 16 '24 15:09 Tagada14

The link should go to the balance discussion channel on september 3rd. It wasn't a thread in the balance team channel.

lL1l1 avatar Sep 16 '24 21:09 lL1l1

I guess "it" is the body? It's not entirely clear.

"It" is the heading of the unit, so usually the body.

I don't understand SlavedToBodyArcRange at all. What does this range do and how did you determine what values to use?

When targets are outside the range, the weapon will cause the unit to rotate towards the target to keep the target within the range. I determined it by moving a Spirit (aeon land scout, very fast) around the edge of the range at max range, and making sure that the weapon can still fire constantly while the target moves around the edge of the angle limits because the weapon has to have space within its angle limits to lead the target, while the unit angles itself without leading the target.

lL1l1 avatar Sep 21 '24 00:09 lL1l1