View Single Post
Old 02-17-14, 06:10 PM   #2164
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
Makes sense to me. The one doubt I have is: are engagements bi-univocal in game? In other words: if an unit is attacked, does it aumatically lock its guns on the attacker? This is probably of secondary importance for surface engagements, but crucial for aircraft turrets to be used correctly during dogfights
Didn't see anything in SHCollisions.act or SH5.exe that says once unit takes damage from something then lock onto that unit. The game engine is pretty simple in how it determines the unit a unit is tracking/engaging:
- derive list of active game units (some units can be excluded from this list)
- iterate over list of active game units derived:
-- iterate over all sensors of the current unit
--- iterate over all active game units derived for each sensor to see if sensor detects it
--- if sensor detects it then add to list of detected units

Check all detected units to see which one was detected the 'strongest'. Place pointer to this unit in unit's contact detected 'slot'.
TheDarkWraith is offline   Reply With Quote