2025-07-18 12:43 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000347Spring engineGeneralpublic2008-09-20 13:22
ReporterArgh 
Assigned Toimbaczek 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000347: Aircraft with "fighter" behaviors lock onto non-valid targets
DescriptionAircraft with the "fighter" behaviors (i.e., no dropped weapon defined and no HoverAttack defined) will still attempt to "dogfight" with fighters, even if their weapons are defined in a way that specifically forbids it.

I.E., if OnlyTargetCategory = Ground and the aircraft encounters another aircraft, it will still try to attack it, even though it will never complete because the other aircraft is not part of the "Ground" category.

If you folks want to see a sample of this behavior, I can set something up for you later on, but basically it's target-selection problem that leads to bad behavior.
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0000489

Argh (reporter)

This problem is even worse than I feared. It appears that any units with restricted-arc weapons will "target" units that they will never be allowed to shoot, ever :-P IOW, this behavioral problem does not just affect aircraft- it also impacts on ground units, and is a problem with restricted-arc weapons or with OnlyTargetCategory.

~0000490

Kloot (developer)

Last edited: 2006-12-29 14:45

Unless I'm missing something, all weapons call into CWeapon::TryTarget() before firing, which does check if the target unit falls inside the weapon's onlyTargetCategory:

    if (unit && !(onlyTargetCategory & unit->category))

A sample XTA scenario where this happens would be appreciated. :)

~0000510

Nemo (reporter)

For an example (not XTA, sorry), load up any recent version of Spring:1944 (usually found here: http://aata.tauniverse.com/spring/ - bigger one is older version + content, smaller one is patch to newer version), type .cheat then .give m4a1. Then, .give p51d. Finally give the M4A1 to the other team and tell the p51d to either attack them or patrol around them. The P-51 is set up to ONLY target aircraft, thus it will 'ghost strafe' (make an attack run, but since it can't fire..do nothing) the tanks until it gets shredded by their AA MGs.

Changing it so that units ignored things outside of their onlytargetcategories for attacking movement (IE tanks driving towards flags which are only targetable by infantry, the 'ghost strafing' of fighter planes) would be VERY helpful.

~0000519

Kloot (developer)

I downloaded the mod and its update, but the P51's don't make any ghost runs at all... in fact, they're quite happy to open up on the tanks, whether I tell them to attack or just to patrol. Are you sure the p51d is the unit that misbehaves like this?

~0000520

KDR_11k (reporter)

I could never get OnlyTargetCategory to work, it only works if I set it per weapon.

~0000522

Nemo (reporter)

My apologies, turns out the onlytargetcategories aren't set properly on the P-51d

The P-38g (heavy fighter) will serve as an example though. unitname: p38g.

all of its weapons (rather than just one like on the p51d, whoops >_<) are set to only target aircraft.

Sorry about that. Found me a bug in the mod though, heh.

~0000833

Argh (reporter)

OnlyTargetCategory works just fine, when we're talking ground-->ground interaction. And BadTargetCategory also works just fine. With aircraft, it's all screwy, though. Would you guys like a quick build of NanoBlobs with this feature enabled, to see what I'm talking about without having to mess with a lot of things? XTA just doesn't make use of this feature really, it's a lousy mod to look at for functionality of these sort of things tbh.

~0001377

tvo (reporter)

Yes a test case with unambiguous instructions on how to reproduce would be nice (if this still happens that is.)

~0001381

thor (reporter)

It definitely still happens. In NOTA 1.32, .give corgryp and give it a patrol order above any enemy ground unit. It will target it even though its weapon is anti-air only.

~0002599

Argh (reporter)

This is resolved.
+Notes

-Issue History
Date Modified Username Field Change
2006-12-27 08:28 Argh New Issue
2006-12-29 10:34 Argh Note Added: 0000489
2006-12-29 14:42 Kloot Note Added: 0000490
2006-12-29 14:45 Kloot Note Edited: 0000490
2007-01-03 02:49 Nemo Note Added: 0000510
2007-01-03 16:00 Kloot Note Added: 0000519
2007-01-03 17:13 KDR_11k Note Added: 0000520
2007-01-04 01:03 Nemo Note Added: 0000522
2007-03-27 05:53 Argh Note Added: 0000833
2007-10-29 21:00 tvo Note Added: 0001377
2007-10-29 21:00 tvo Status new => feedback
2007-10-30 04:09 thor Note Added: 0001381
2008-09-20 06:23 Argh Note Added: 0002599
2008-09-20 13:22 imbaczek Status feedback => resolved
2008-09-20 13:22 imbaczek Resolution open => fixed
2008-09-20 13:22 imbaczek Assigned To => imbaczek
+Issue History