Bounce Stuff?

Bounce Stuff?

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

Bounce Stuff?

Post by Argh »

Could somebody document how to test these:

- Added GroundBounce, WaterBounce, NumBounce, BounceSlip, BounceRebound, and bounceExplosionGenerator tags

:?:
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Did you read the changelog entry that explains what they do? What more do you need?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Er, I had to hunt it all down in FishEye:

Code: Select all

Added 5 new weapon fbi tags.
        WaterBounce and GroundBounce: Boolean to allow a projectile to bounce off of a surface. defaults to false.
        BounceSlip: Amount of lateral speed kept by the projectile after it bounces. defaults to 1.
        BounceRebound: Amount of vertical speed keeps and reverses. defaults to 1.
        NumBounce: The number of bounces a weapon will make. -1 indicates no limit. defaults to -1.

Added the ability to bounce for Torpedos, Missiles, Lasers, Cannons, and Emgs.

Added flighttime functionality to cannons.
So, lots of stuff to test, and bouncy weapons... heh, now maybe, just maybe, I can do a NoExplode cannonball that acts in a non-retarded fashion...
User avatar
MightySheep
Posts: 243
Joined: 11 Nov 2007, 02:17

Post by MightySheep »

ah so that explaines why when i shot a con vehicle with my gaurdian it bounced around around for a minute, rebounding off everything before it blew up.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Ok, just tested it, I have a few questions / quibbles:

1. There seems to be very little I can do to control the direction of the bounces, leading to some very retarded behaviors on some angles of a map's geometry. I think that we need a "BounceInertia" tag, that will override the direction returned by a bounce calculation, and swerve it back to the original line of fire. It should be a float, 0.0 (no override) to 1.0 (only changes y axis). IRL, if a heavy cannonball hits an angled surface, it may change angle somewhat, but its inertia will keep it heading more in line with the original vector than the behaviors now seen.

Moreover, there also needs to be some control over what angle will automatically cause the projectile to explode. It looks like it's about 45 degrees- but that should be controllable, imo.

2. It's clear that FlightTime, if non-zero, is now the true lifetime of a Cannon projectile. This needs to be documented- if you set Flighttime too low, then the projectile is removed from the simulation well before it reaches max range.

3. Setting up a projectile with NoExplode did not result in what I was hoping- i.e., finally, a non-hardcoded NoExplode, where it can go through multiple targets while bouncing, but does not have the "every frame I generate an explosion once I have 'landed'" behavior that is so annoying, simply because we can't mess with it at all. Can't this get fixed, by simply allowing NoExplode to work properly, and setting up a Disintegrator default that uses GroundBounce=1 + NoExplode, for backwards-compatibility?

4. On Cannon weapons, if Burnblow=1, then the projectile should die when it reaches max range... right now, Flighttime overrides Burnblow, which does not seem like correct behavior to me.

5. Apparently, somebody decided that Cannon weapons should have a range that accurately reflects the distance that they can travel, based on a 45-degree angle and the WeaponVelocity!

I understand, whoever did that, that you were trying to be cool, and get rid of the problems of "uh, it says it can go X distance, but the Unit always has to move to actually shoot". However, with the Bounce tags working, a weapon's real range can be considerably different than this calculation! Therefore, the range circle needs to reflect "true range", like it does now, but if Flighttime > 0 and BurnBlow=0, then the range circle should be WeaponVelocity * FlightTime - "true range", to arrive at something more accurate!

Moreover, changing this code means that, for my Units to engage at the proper ranges with Cannons, they must have WeaponVelocities high enough to engage, instead of the previous behavior, where the Unit would be forced to move forwards until it was really in range! This is going to result in quite a few backwards-compatibility problems in this version, I can guarantee.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

6. Tested with BeamWeapons... they work great.

So, um, can't we finally have a BeamWeapon variant that will also obey gravity? That would be great... I'd quit using the graphically-challenged Cannon class entirely, if I could have a BeamWeapon that can also obey gravity... with this Bounce stuff, all of the vector-normalization code seems to be working perfectly...
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Ok, so bounceExplosionGenerator just makes the CEG run, or does an actual explosion take place?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Argh wrote:So, um, can't we finally have a BeamWeapon variant that will also obey gravity? That would be great... I'd quit using the graphically-challenged Cannon class entirely, if I could have a BeamWeapon that can also obey gravity... with this Bounce stuff, all of the vector-normalization code seems to be working perfectly...
Maybe there will be a universal weapon if someone gets around to coding it that will let you use a ballistic projectile with laser graphics.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

<shrugs> I could just write one, supposing that somebody will be so kind as to check it over- it should be really easy to just write a new case, calling that drawing method but otherwise identical to Cannon...
User avatar
ILMTitan
Spring Developer
Posts: 410
Joined: 13 Nov 2004, 08:35

Post by ILMTitan »

Argh wrote:Ok, so bounceExplosionGenerator just makes the CEG run, or does an actual explosion take place?
They just cause a CEG to run. Without one, it can be a little difficult to understand that a cannon shot is bouncing (without using a special camera angle).
Saktoth
Zero-K Developer
Posts: 2665
Joined: 28 Nov 2006, 13:22

Post by Saktoth »

Burnblow causes a projectile to explode when it reaches its target, not when it reaches max range.

So the point at which a burnblow weapon explodes depends on where the target is in relation to its range.
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

Lurk Moar.

http://spring.clan-sy.com/wiki/Weapon_Variables

Or maybe not, depends. I haven't used burnblow much >__>
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Best solution for range issues, by far, is to set myGravity to a value lower than 0.2, forcing the weapon to achieve the desired range in every situation.

Not perfect, and I'd really like to be able to define slow-moving weapons that could have noExplode and GroundBounce=1, which right now isn't practical without also making them fall veeeeeeery sloooooowly ;)
Saktoth
Zero-K Developer
Posts: 2665
Joined: 28 Nov 2006, 13:22

Post by Saktoth »

Oh come on, you are telling me to lurk moar and then quoting the wiki?

That thing is just blatantly wrong, full of errors from top to bottom. Put burblown on a buzzsaw/vulcan or a unit with similarly colossal range and terrible accuracy, and fire it at close range. Watch what happens.
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

Oh come on, you are telling me to lurk moar and then quoting the wiki?
Yes.

Never noticed that behavior before, but if you say it is true (and you have no reason to lie), then it must be true. :-)
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Burnblow on ballistics is interpreted as flak.
Post Reply

Return to “Engine”