Vinifera-Developers / Vinifera

Vinifera is a C&C: Tiberian Sun engine extension implementing new logics and fixing bugs.
GNU General Public License v3.0
43 stars 10 forks source link

[New Feature] Units Targeting Rework #850

Open Onidotmoe opened 2 years ago

Onidotmoe commented 2 years ago

First Check

Description

Units are pretty bad at acquiring new targets, even when in close proximity to them.

Proposed changes :

If Unit A isn't attacking anything and Unit B is and is in close proximity or both units are selected, Unit A should go and help attacking with Unit B.

If a friendly unit or building is being attacked and a unit is in close proximity, the unit will go and attack the attacker.

Close proximity could either be defined as Sight range, or a global modifier, or if the friendly unit/building that is attacking is in sight range of the idle unit.

Two main problems :

  1. Units aren't defending other units or buildings when in close range of them.
  2. Units stop fighting when they have destroyed their target(or have gotten out of sight range) but other units near them are still fighting.

Essentially if you have a group of units selected they should share the pool of targets between them. Alternatively it would be cool that when units select targets they'll consider what the enemy is currently attacking, say the enemy unit is targeting your medic, if there are 2 other units shooting at something else, your units should automatically target the unit that's attacking the medic, like a defense priority.

Proposed Code (optional)

No response

Additional Context

No response

Onidotmoe commented 2 years ago

Further rework would include some sort of threshold for when a unit is targeting another unit and is unable to hit it, after several attempts it would move to a different position and try to attack again.

Because the terrain in Tiberian Sun can be rather bumpy, units will often try to shot through those bumps or through terrain that'll block their target, causing them to get killed when they should have won, this is most notable with the Devil's Tongue Flame Tank.