Ribbon effects.

Ribbon effects.

Requests for features in the spring code.

Moderator: Moderators

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

Ribbon effects.

Post by smoth »

Image
IN BEFORE SOME IDIOT SUGGESTS CEG EMIT DOES THIS!

I am not sure if anyone has the time or energy to add this as a patch to spring, but a ribbon effect would be fantastic. Some ideal tags would be:

Repeat // bool to say if ribbon texture should repeat
Stretch //bool, texture stretches ribbon length
Blendmode // option to specify: subtractive, additive or overlay
texture // texture for ribbon
length //how long in game units is it?
width //how wide is it
[Krogoth86]
Posts: 1176
Joined: 23 Aug 2007, 19:46

Re: Ribbon effects.

Post by [Krogoth86] »

Ehm - could you please explain in detail what exactly you ask for here? Because to my mind this beam effect can be done with the new LargeBeamLaser tag... :?
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Re: Ribbon effects.

Post by Gnomre »

And when the unit, you know, turns?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Ribbon effects.

Post by smoth »

Image

I don't know how it is done, I always assumed it was a poly strip. A ribbon effect works much like a ribbon attached to something. When the unit turns it bends see above shot for another example with bending ribbons.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Ribbon effects.

Post by Argh »

It's just a poly strip, like the poly strip for the missile trails.

Tbh, that looks like a job for LUA, to me.

That code in the missile stuff could almost be ported straight over to unsynched LUA with only minor rewrites, given that you'd mainly just need to grab some of the math from the includes and rewrite the syntax. I may get to that at some point, when I'm working on the aircraft for P.U.R.E. again, if nobody else does anything.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Ribbon effects.

Post by KDR_11k »

Ah okay, units, not weapons.

Doesn't CA already do this with LUPS?
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Ribbon effects.

Post by jK »

I always wanted to write such a fx class for the wingtips of planes
(like supcom it has), but the Lua API is still missing some functions
to do so.

The issue is that you need to know the exact model piece position
you want to attach the fx to. To do so you need the offset and rotation
of the model piece (doable) and the unit's upright coords (not
doable).

So you can try to determine it with GetUnitHeading() etc., but those
calls don't work always (i.e. they don't work for planes).
LUPS had such issues with 75b2, so there are now the new
gl.UnitPieceMultMatrix() and gl.UnitMultMatrix() calls, but they do an
opengl modelview transformation, so you would have to save for
each polystrip vertex a 4x4 matrix or (what is much harder) you have
to extract the wanted information from the matrices.

Also there is the possiblity to determine the piece position in synced
lua code with Spring.GetCOBUnitVar(), but then you would have to
send it to the unsynced side etc. and like the GetUnitHeading variant
it doesn't always return valid positions.


So atm it isn't possible to do something like that in Lua, but I will
write a patch soon (my bug list is long ;)), so we will have something
like that hopefully in 76b2.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Ribbon effects.

Post by Argh »

I've already figured out a way to do this, with one tiny LUA check, COB, and emit-sfx.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Ribbon effects.

Post by AF »

explosion generators are hardly useful for this because you either get a pretty looking effect that involves way too many particles that makes the polystrip method look like a quantum computer from the year 30,129 in terms of speed, or the fugly trails that seem to be in every mod where you see individual particles despite it supposed to be looking like a trail which means a smooth blur not individual blobs.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Ribbon effects.

Post by Argh »

Well, it's not quite as cool as a true polystrip, to be sure. However, it's not too bad. I'll look at the polystrip code when I get home, it's probably possible to do that by getting exact part locations from COB and delivering them to LUA...
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Ribbon effects.

Post by jK »

Argh wrote:.. it's probably possible to do that by getting exact part locations from COB and delivering them to LUA...
jK wrote:Also there is the possiblity to determine the piece position in synced
lua code with Spring.GetCOBUnitVar(), but then you would have to
send it to the unsynced side etc. and like the GetUnitHeading variant
it doesn't always return valid positions.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Ribbon effects.

Post by Argh »

I would think that the main issue is with GetUnitHeading, given what you're saying. Delivering that via COB isn't that big of a deal- just do some simple trig and get a vector that's entirely accurate. Slow math, not something you want to update very often, but perfectly doable.

You're not going to want to show these ribbons unless your aircraft is moving at something close to cruising speed, anyhow. The only reason why I even want to do a polystrip is because of joins, the rest of it's not a real issue, tbh.

I'm kind've concerned about the polystrips being a mess in terms of CPU usage, though, like the polystrip code for MissileWeapons (the CPU gained back by finally being able to turn that off almost offset the CEGtag stuff in P.U.R.E.)- is there a way to do those transforms on the GPU? That'd be ideal.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Ribbon effects.

Post by smoth »

smoth wrote:IN BEFORE SOME IDIOT SUGGESTS CEG EMIT DOES THIS!
Argh wrote:I've already figured out a way to do this, with one tiny LUA check, COB, and emit-sfx.
WE HAVE A WINAR!
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Ribbon effects.

Post by Argh »

The sad part is that solving this was easy, but it got me looking at the aircraft code again, because tests quickly showed that every aircraft's velocity was increasing at precisely the same rate :P
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Ribbon effects.

Post by smoth »

You didn't solve anything. This was a feature request, not a how does I make a lumpy looking trails using a ceg. Unless you created a ribbon effect, which you didn't if you used ceg.

furthermore, I would prefer if the ribbons were a feature of the engine and not lua. I would have posted this in the lua forum if I was looking for a lua solution. Lua is interpreted/compiled/whatever at runtime. A hardcoded feature is more efficient, many mods are going to have shit tons of lua as are the maps they are in. I am afraid of putting too much in lua, both because I am not convinced it is stable and I to not want too much activity in lua as we are already eating ~10-15 fps with simple things like ui. However, JK, if you have something similar done, can I look at it to see how you did it? I am not doing any lua effects any time soon but I am curious about how these things are written.

*jk, not trying to sound rude, I am just in a hurry, and I needed to type ir really quick
User avatar
Fanger
Expand & Exterminate Developer
Posts: 1509
Joined: 22 Nov 2005, 22:58

Re: Ribbon effects.

Post by Fanger »

Argh you cant make a "solution" if you havent solved the problem by what your doing..

Why must everything be hack workaround.. no we need an actual ribbon code entered into the engine.. that can be textured, and controlled with tags in weapons and for units as well..

WE NEED RIBBON!!!
Image
User avatar
Relative
Posts: 1371
Joined: 15 Oct 2006, 13:17

Re: Ribbon effects.

Post by Relative »

Woah, what is that from?
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Ribbon effects.

Post by imbaczek »

Fang: actually, Lua can do everything that the engine can that's going to be needed to solve this problem, so a prototype in Lua won't hurt and may in fact be enough.
User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

Re: Ribbon effects.

Post by Zpock »

It's easy to do in LUA if you know a little math. More flexibility than anything hardcoded too.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Ribbon effects.

Post by smoth »

would you mind doing an example? Also could it be attached to a projectile?
Post Reply

Return to “Feature Requests”