Detecting submarines

Detecting submarines

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
submarine
AI Developer
Posts: 834
Joined: 31 Jan 2005, 20:04

Detecting submarines

Post by submarine »

Is there any way of detecting subs (not ships)?

i want to disable aai using subs until the torpedo bug will be fixed since its pretty annoying to test aai atm (manually self-destroying them)
User avatar
FizWizz
Posts: 1998
Joined: 17 Aug 2005, 11:42

Post by FizWizz »

sonar plane, both sides have them. (Unless Sonar doesn't work in Spring like it did in OTA?)

[edit]nevermind, you mean through their .fbi and such?
User avatar
SwiftSpear
Classic Community Lead
Posts: 7287
Joined: 12 Aug 2005, 09:29

Post by SwiftSpear »

There should be an underwater = 1 tag or something in spring... just test that along with weather or not the unit have movement data and you should be able to isolate subs...
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Post by SinbadEV »

another thing to check would be for units that use the torpedos... any units that use no weapons but torpedos are skipped...
edit:or do you mean because subs can only be targetted by torpedos they are "unfair to play with"... I don't think so... the player's gonna use them...
submarine
AI Developer
Posts: 834
Joined: 31 Jan 2005, 20:04

Post by submarine »

no the problem is that they cannot be destroyed atm (except by the leviathan that can destroy everything without being attacked)

so aai has dozens of submarines that remain in enemy bases after an attack (and i have to manually change teams and self-destruct them which is pretty annoying after a few games..)

ok i'll try looking for the underwater tag
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

You wont find such a tag in UnitDef, instead you have to fiddle with values such as min water plane, max water plane etc.....

TEDClass may also be worth parsing for this.... See NTAI and OTAI for the necessary code to split it up..
Post Reply

Return to “Engine”