Just a quick note about BOS aiming

Just a quick note about BOS aiming

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
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Just a quick note about BOS aiming

Post by Argh »

I've been able to write a BOS script that will prevent units from aiming lower than a certain angle- keeping them from ever firing. This was a superficial problem with certain NanoBlobs units, and I'm quite glad I actually found a solution to this problem.

I'm pretty sure this code won't work in OTA, because it doesn't check things with SIG_AIM functions often enough, but it works just fine in Spring.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Ok, my dreams for FINALLY having the ability to keep units from aiming down through themselves are partly realised.

Yeah, that also means that we can have a MINIMUM RANGE.

The bad part? Very simply, there is exactly ONE type of weapon that will actually obey its script and return proper values without hanging.
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

o.0 Interesting, you know there is a minweaponangle tag right?

Or is it different from that?

Cuz things aiming through themselves isn't cool....
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post by Gnomre »

Spring doesn't read minbarrelangle.

Also, what's so hard about if(pitch < desiredangle) { return FALSE; } if(pitch > desiredangle) { do normal stuff and return TRUE; } ? Does exactly what you just described, and should be foolproof--well, maybe not quite, I think pitch is measured oddly in spring, but once you work out that oddness it'd be foolproof since it's consistent oddness.

The only problem is that you can't break a unit's lock on a target from the script, this is why script based arcs are bad--in both engines. If a unit gets locked on, then moves in close enough the the unit with the min angle, it won't decide to aim at a new target since it now can't fire at the old one. A well microed assault could effectively jam and make limited angle weapons totally useless. We either need a way to tell units to pick a new target from the script, or it needs to be properly coded in so they do that themselves without our prodding.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Gnome, what I wrote is pretty close to what you're describing. Only problem is... that it doesn't work, period, with most of the weapon types in Spring. The script part works, but it never seems to get a good fire state and locks up, even if the angles are now correct.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

And, I should add... telling it to cancel SIG_AIM doesn't seem to work. I would've thought that cancelling that state, or making it conditional, would do the trick, but no.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Maybe the best way to deal with this would be two things:

A MinimumRange tag, so that ballistic weapons do a check against the range, and if less than X, then they pick another target, or wait.

A TargetLock tag, that specifies the maximum time that a weapon may lock on given target. After that, the weapon is forced to start the target-selection procedure over again.

Both things wouldn't cost a great deal more CPU than the current methods, and they'd allow us to get rid of a lot've headaches.
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

Argh wrote:A MinimumRange tag, so that ballistic weapons do a check against the range, and if less than X, then they pick another target, or wait.
Spring has such a tag, but as to whether or not it does as you described, I am uncertain.
Argh wrote:A TargetLock tag, that specifies the maximum time that a weapon may lock on given target. After that, the weapon is forced to start the target-selection procedure over again.
This would also fix that "get a defender (or any other non-mobile unit with a turret) to target the enemy com so you can see where it is for as long as that defender lives" exploit.
User avatar
Aun
Posts: 788
Joined: 31 Aug 2005, 13:00

Post by Aun »

Guessmyname wrote:This would also fix that "get a defender (or any other non-mobile unit with a turret) to target the enemy com so you can see where it is for as long as that defender lives" exploit.
Alphabeta fixed that, IIRC.
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

The what?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post by smoth »

Argh, using a script limited fire arc is REALLY bad... I have done it in the past on the magella tank. I have since moved to using the limited fire arc feature of spring. The patch for this will make the unit behave as desired when using a limited fire arc.
User avatar
Aun
Posts: 788
Joined: 31 Aug 2005, 13:00

Post by Aun »

Guessmyname wrote:The what?
Units stop targetting a unit when it moves out of radar/LOS range.
Post Reply

Return to “Engine”