Missile Behavior (general rant... er, request)

Missile Behavior (general rant... er, request)

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Missile Behavior (general rant... er, request)

Post by Argh »

Basically, I hate the way guided missiles work in Spring. I am sorry in advance to whomever coded it- it's not personal. It's just been something I've sat on for awhile, and since most of the other minor stuff that drives me crazy has been fixed, I thought I'd put this on the table.

They're the category of weapons I've had the biggest fights with, frankly.

Here are my gripes:

1. The twisted polygons used for the smoketrails are surprisingly CPU-intensive, and drag framerate down. Personally, I'd rather have the whole smokepuff thing work like it did in OTA, but with some twists:

A. Desync it, because it's just eyecandy.
B. Don't draw shadows. Another big drain on the ol' GPU.
C. Allow us to specify the texture, or better yet, a texture set.
D. Allow us to specify a smokepuff rate, climb, and decay time, or better yet, allow us to specify a customexplosiongenerator as the smokepuff, so that we can customise it however we want.

In short, instead of a "one size fits all" approach to the whole smoke-trail thing, forcing us to use a variety of not-attractive kludges, give us flexible options. I wouldn't mind the stretched polygon so much if it didn't seem to cause so much lag whether or not it is visible- and, did I note that it draws a shadow whether or not the trail can be seen? Sigh.

2. Wobble needs an additional control: "wobbletime", that determines when the missile wobbles (picks a random vector). Right now, Spring uses a formula for this that is much more complex than it needs to be- it just needs a simple timer. Set the default to 3 seconds, so that the Raven's rockets behave about like they used to, but make it customizable. Short times would make missiles using Wobble act a lot more like GravityAffected projectiles with Accuracy settings >0, whereas setting a very long time might cause errors only on a small percentage of flights.

3. When a missile misses its target, it should become GravityAffected and just drop. The current behavior, where it circles and eventually times out and goes some random direction, is hardly realistic, and eats up valuable CPU/GPU. Not to mention occasionally killing the launching unit :P

4. When a missile's target dies, the missile should continue on the same vector it was on until WeaponTimer expires, then drop as above. This would make units all firing at the same leading aircraft a LOT more effective, because their shots might actually hit something :P



In short, I want missiles that:

1. Don't draw shadows beneath them. That's one-liner.
2. Allow for custom smokepuff behavior. Personally, the more I think about it... just let us define a custom explosiongenerator, and that'll get the job done. Really.
3. Don't use the bending polygons. Looking at the code for the missiles... it's really quite cumbersome code.
4. Have non-borked code to handle misses.

That last bit, I'll admit, is hard- how does a missile "know" it missed? Well, I'd like to propose a solution:

1. Allow game designers to assign a "search sphere radius" to each missile.
2. If the missile arrives at the predicted XYZ position of the target, but does not collide with something, then it searches that radius and picks up the nearest enemy.
3. It continues this until it either cannot find a target or the Flighttime ends, whichever comes first. Then it falls to the ground, using the current vector and speed.

Doing the above would lead to far fewer wasted shots, would allow designers to have very dumb (but CPU-sparing) missiles that never found a valid target if they missed, or very smart ones that could retarget over a wide area, wasting the minimum number of shots. If the designer set the value to 0, it'd always just drop if it didn't collide, meaning it would usually drop in the direction of the enemy.

Getting rid of the polygon-twisting code and shadows would speed up these projectiles quite a bit, which I think would more than offset the costs associated with smarter smokepuffs.

At any rate, I can do some of this- some of it's trivial. Designing the search is probably not, but that's the only really hard part, I think.
espylaub
Posts: 205
Joined: 01 May 2006, 11:35

Post by espylaub »

The continue-on-your-vector-when-you-miss thing would be a blessing in itself. The rest sounds great too. I would leave trail shadows in as a graphics option, because they do look incredibly sweet when your system can handle them.
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

+1, more options to make stuff with...
User avatar
Fanger
Expand & Exterminate Developer
Posts: 1509
Joined: 22 Nov 2005, 22:58

Post by Fanger »

IM for all of that, and Also can we have just regular inaccuracy/sprayangle with missile weapons.. cause atm the only way to make them inaccurate is with the wobble tag and that is hardly what people want..
Arco
Posts: 75
Joined: 17 Jun 2006, 16:28

Post by Arco »

I think both the "become dumbfire after missing target" and "search for new possibly-hittable target" methods should be implemented, since I can easily imagine wanting both properties in a single mod. It's not even that hard to determine whether a missile "missed" or not in the first case. Just analyze the current vector of the weapon versus the direction towards the target. If the target is "behind" the missile, that means the missile has flown past and missed. Make it dumb and drop to the ground. If the target is still ahead, keep aiming for it.

The "smart" behavior of searching for an available target if the original target isn't found would be a godsend for effectiveness of Mercuries and Screamers in AA, that's for sure. It's a pain to build a network of expensive missile towers, only for all of them to shoot at one aircraft, kill it, and let the entire rest of the swarm through. (More intelligent networked target selection would be even better, but is far more complicated.)
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

I liked my drunken missiles... but agreed.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Bind missile smoketrails to the custom particle stuff, and add a bouncey settings to particles so they can bounce off of the ground, and an emit rate specifying how often particles are emmitted, allowing for better launch sequences, such as a big lift off followed by a continuous decay untill it spurts little puff sand crashes into the ground after hitting nothing....
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

This would be awesome
User avatar
aGorm
Posts: 2928
Joined: 12 Jan 2005, 10:25

Post by aGorm »

The shadows are the only point I disagree on, you should be able to specifie if it sould have them. That way weedy trails on mini rockets dont slow down the comp, but a huge super nuke can have a realy nice vertical lanch that would obviolsy blot out the sun...

aGorm
User avatar
mehere101
Posts: 293
Joined: 15 Mar 2006, 02:38

Post by mehere101 »

Actually, while you guys are ripping code out with an axe... Add a more flexible interception system!
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

Yes! Flexible interception system!
User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Post by MadRat »

A simple tag in the weapon tdf definition, MissType, could define the miss behavior you want:

0 - Continue on vector
1 - Find new target
2 - Turn and continue to burn

Do the missiles in Spring even fight gravity? I'm not really excited about missile wars between different ground units like TA used to become. And I don't care to a certain extent how its easier to deal with L1 armor units in XTA solely using the longer distances of missiles compared to similar L1 guns. I always thought of missiles as being little drones in free flight with freedom to turn, whereas rockets usually have some kind of inertial free flight system to keep them halfway decently on a straight line. In this way a Jethro should be an air unit killer (and woefully bad at straight los hots) and rocket units should be the tank killers.

Anyone here ever play an old side scroller game on the Apple IIe called Star Blazer? Late in the game you had to dodge missiles that would continue to burn and turn after a miss, but whether you could out manuever them was more basically a function of using tactics so that gravity made their return attack as wide as possible, and the missiles would run out of fuel and drop short of you.

I also like the idea in my own thread on air units to have missiles with an option to require the shooter to be alive in order for guidance to work. It might only come into play a few times in a game but that could be the difference in a game between a great player and a simply lucky player.
bwansy
Posts: 385
Joined: 02 May 2006, 05:21

Post by bwansy »

There sould also be a new tag e.g. "GuidanceType" that defines the guidance method:

0 - Shoot-and-forget: the missile tracks the target no matter what (until it hits, misses or runs out of fuel).
1 - Guided by shooter: the shooter dies, the missiles loses guidance.
2 - Guided by radar/sonar/sight: when the target is undetectable anymore, the missile loses its target.

For 1 and 2, the missiles which have lost guidance would be considered to be "missed", and its subsequent behavior would be decided by MissType mentioned before by MadRat.
User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Post by MadRat »

I do like your perspective on this problem solving collaboration. Someone said earlier in another thread that it would be nice to have a way to define a straight shot that's unguided and then when it goes so far the guidance turns on, which could make your list a fourth potential GuidanceType. You'd almost want to break them up where you could use more than one behavior. If you defined each one by a power of 2 then a simpler AND statement could detect the settings that are pertinent.

1 - Shoot-and-forget: the missile tracks the target no matter what (until it hits, misses or runs out of fuel).
2 - Inertial Free Flight before homing
4 - Guided by shooter: the shooter dies, the missiles loses guidance.
8 - Guided by sight: when the target is undetectable anymore, the missile loses its target.
16 - Guided by sonar: when the target is undetectable anymore, the missile loses its target.
32 - Guided by radar: when the target is undetectable anymore, the missile loses its target.

Combined you could do something like a torpedo with a GuidanceType of 19. (Think options 1 + 2 + 16 = 19) Your torpedo might swoop out a screen away then its sonar guidance kicks on and it looks for the nearest available target.

What is great about your ideas is that you can almost make separate sight-guided and radar-guided missiles for air to air combat. You could also make separate sonar-guided and sight-guided underwater torpedoes. The possibilities are so wide open!
Post Reply

Return to “Feature Requests”