FALL Event control

FALL Event control

Requests for features in the spring code.

Moderator: Moderators

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

FALL Event control

Post by Argh »

Going to ask again, might as well. I want more control over Pieces affected by FALL events:

1. Gravity control, so that I can make things happen at epic slow paces, or lightning quick.

2. Bounce control, so that if I don't want everything acting like a rubber ball, it won't.

3. Size control, so that giant thin things don't constantly clip terrain.

4. Spin control, so that if I just want to give things a tiny amount of spin, to make it look real, I can.

It really frustrates me, that FALL doesn't obey a map's gravity, spins at a retarded pace that looks stupid with large, heavy objects, bounces things like rubber, sends things clipping through the ground, because the origin is the only point that counts for contact purposes (with long thin things, it's obviously not calculated correctly)... and generally acts very badly, and there aren't any ways to fix it, other than just not bothering to use it :P
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: FALL Event control

Post by Argh »

Ok, took a look at PieceProjectile.cpp.

It looks like most of the things are right there- what we need, instead of the old, primitive FALL, is a callin:

call-script spring_PieceProjectile(myPieceName, 40, 128, 15, 8, 1, 1024, 1, 2, 1024+1)

Where the values coorespond to:

Piece Name

Gravity: overriding map.gravity, which, I must add, is not working correctly, I've tested that.

Spin Amount (in radians, so 128 is slow)

Initial Speed (in linear units, so 15 is really slow)

Friction: (I'm thinking linear units, 0 means when it hits the ground it goes through it, period, otherwise it bounces at X - current value here, so this projectile would bounce 14 times)

CEG Trail Value (1024 or higher, calls Unit CEG, if set to 0, nothing)

Radius of projectile: (linear units, so 8 == footprint-sized sphere)

Decay Event:
(boolean)

If Decay Event TRUE, then perform one of the following: (1 = SHATTER, 2 == CEG)

If 2, above, then perform specified Unit CEG.

Most of what I'd like is already in Spring already, I just need a way to send it parameters. For a tall thin heavy thing (like, I dunno, a giant radio antenna) I could give it a spin high enough to make it fall on its side, small gravity to make it fall in "slow motion" to give it the feel of epic size, a size of 8, so that it's going to bounce only when most of it looks like it hit the ground, barely any impulse, and a strong decay, so that it bounces, barely, one time, then decays into a CEG event that looks like dust along the length of the object.

Extra bonus points, if I could make it play a sound when it bounces.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: FALL Event control

Post by KDR_11k »

Also needs angle so not everything goes off into a random direction. Your friction doesn't make sense IMO, sounds like a bounce count but IMO that should be TTL and two additional values for the bounce friction.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: FALL Event control

Post by Argh »

You're right. Sorry, I'm very tired (and grumpy). You get the basic idea, though- we have most of the code already, mainly we just need a method. It'd be slow, but I don't want to use this for basic stuff, just for complex events where I'm not happy doing it with BOS because it's too damn slow.
Sheekel
Posts: 1391
Joined: 19 Apr 2005, 19:23

Re: FALL Event control

Post by Sheekel »

Any update on this?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: FALL Event control

Post by Argh »

Nothing, basically, so far as I know. Too bad, too, I have a lot of stuff that would benefit.
Sheekel
Posts: 1391
Joined: 19 Apr 2005, 19:23

Re: FALL Event control

Post by Sheekel »

Yeah...our explosions still look as though they belong in a 2.5-D game, not a 3D one...they dont seem to compete visually with other RTS games and our modders have little control over them
Last edited by Sheekel on 31 Jan 2009, 02:16, edited 2 times in total.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: FALL Event control

Post by KDR_11k »

Theydo obey gravity, the force of gravity is just very weak on most maps.
Sheekel
Posts: 1391
Joined: 19 Apr 2005, 19:23

Re: FALL Event control

Post by Sheekel »

I stand corrected
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: FALL Event control

Post by Argh »

Please? I just need a Lua callin for the initial impulse, gravity multiplier, and elasticity...
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: FALL Event control

Post by Kloot »

I added a few LuaSynced callouts for your amusement:

Code: Select all

GetProjectileType(number pid) --> boolean weapon, boolean piece | nil
GetProjectileName(number pid) --> string | nil
GetProjectileGravity(number pid) --> number g | nil
GetProjectileSpinAngle(number pid) --> number a | nil
GetProjectileSpinSpeed(number pid) --> number v | nil
GetProjectileSpinVec(number pid) --> number x, number y, number z | nil

SetProjectileGravity(number pid, number g) --> nil
SetProjectileSpinAngle(number pid, number a) --> nil
SetProjectileSpinSpeed(number pid, number v) --> nil
SetProjectileSpinVec(number pid, number x, number y, number z) --> nil
SetProjectileCEG(number pid, string cegtag) --> nil
Besides GetName, {Get, Set}Gravity, and SetCEG, these apply _only_ to piece projectiles, so use them wisely (GetProjectileType will tell you what kind ProjectileCreated gave birth to).
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: FALL Event control

Post by Argh »

Yay! Now I can destroy buildings using physics!
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: FALL Event control

Post by Argh »

OK, I've finally gotten around to testing this.

Bad news.

The impulse of the Piece explosion is variable, and seems to have nothing to do with anything that I can control (at least, I haven't found a way yet).

[EDIT]Spring.SetProjectileVelocity, duh... meh, long day...[/EDIT]


So, I can make stuff slowly fall, spin only on the Y axis and generally behave like they should... but they float upwards and outwards, which looks pretty awful.

Also, I discovered that the Piece's initial vector is the spin vector, not the original vector of the Piece. So I can't, say, make it spin very slightly in the X / Z but more in the Y, without ending up with Pieces facing every which way, which is a lot more obvious when they move more slowly.

Can't fix this until I can alter the vector of the projectile when it's created, and force it to (0,1.0,0).

Also also, EXPLODE_ON_HIT doesn't work (forgot about that never working), so Piece projectiles with low gravity values may end up bouncing in a very unrealistic-looking fashion.

[EDIT]Spring.SetProjectileCollision will provide a good fake for this, hopefully.[/EDIT]



Code attached.
Attachments
PieceProjectiles.lua
(2.51 KiB) Downloaded 7 times
Post Reply

Return to “Feature Requests”