CEG:Miscellaneous: Difference between revisions

From Spring
Jump to navigationJump to search
No edit summary
Kloot (talk | contribs)
m Reverted edits by 8611 (talk) to last revision by Flozi
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
= CEG Miscellaneous =
A collection of miscellaneous things to consider when making a CEG.
== Blending ==
== Blending ==


CEGs use the blending mode GL_ONE, GL_ONE_MINUS_SRC_ALPHA. This is in contrast to the default GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA. As far as I can tell, this means that the alpha determines how much of whatever is behind the particle will show through, but doesn't affect how the particle itself looks. If you want default blending, you'll have to scale the color components by the alpha by hand if the class you're using doesn't do it for you. (Most classes do, but CSimpleParticleSystem doesn't.) Note that an alpha of zero will cause the CEG not to be displayed at all.  
CEGs use the blending mode <code>GL_ONE, GL_ONE_MINUS_SRC_ALPHA</code>. This is in contrast to the default <code>GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA</code>. This means that the alpha determines how much of whatever is behind the particle will show through, but doesn't affect how the particle itself looks. If you want default blending, you'll have to scale the color components by the alpha by hand if the class you're using doesn't do it for you (most classes don't). Note that an alpha of 0 will cause the CEG not to be displayed at all.  


=== Z-Fighting ===
== Z-Fighting ==


A related problem is Z-fighting. If you have several high-alpha particles moving through each other, you may get an undesirable flickering effect as one particle is drawn at first, then the other. To solve this, reduce the alpha.
A related problem is Z-fighting. If you have several high-alpha particles moving through each other, you may get an undesirable flickering effect as one particle is drawn at first, then the other. To solve this, reduce the alpha.


== Things To Consider When Making a CEG ==
== Randomness ==
 
Always put a little randomness in your CEGs. CEGs are more interesting if they happen a little differently every time, especially if your CEG gets called more than once at the same time on the same screen.


=== Realism ===
== Realism ==


While it's important to make sure a CEG doesn't look completely implausible, don't get too hung up on realism. In almost any RTS, concessions are made for gameplay at the cost of a bit of realism; likewise with CEGs, you'll need to make some concessions for looking cool.
While it's important to make sure a CEG doesn't look completely implausible, don't get too hung up on realism. In almost any RTS, concessions are made for gameplay at the cost of a bit of realism; likewise with CEGs, you'll need to make some concessions for looking cool.


=== Gameplay ===
== Gameplay ==


As well as looking cool, CEGs are an important part of gameplay. They let players know when things are happening and where they are happening. CEGs should give clues as to what is happening in the mechanics of the game. A powerful weapon should have a powerful-looking CEG; a blast that affects a large area should have a large CEG. Use the alwaysVisisble and useAirLos tags where appropriate. Hopefully we will eventually have a radius operator so CEGs can automatically be scaled to the radius of the weapon.
As well as looking cool, CEGs are an important part of gameplay. They let players know when things are happening and where they are happening. CEGs should give clues as to what is happening in the mechanics of the game. A powerful weapon should have a powerful-looking CEG; a blast that affects a large area should have a large CEG. Use the alwaysVisisble and useAirLos tags where appropriate. Hopefully we will eventually have a radius operator so CEGs can automatically be scaled to the radius of the weapon.
Line 19: Line 25:
At the same time, you don't want to obstruct players' views of the game. A CEG should look cool for a moment, and then get out of the way.
At the same time, you don't want to obstruct players' views of the game. A CEG should look cool for a moment, and then get out of the way.


=== Performance ===
== Performance ==


Bascially, try not to use more particles than necessary, and try not to use them longer than necessary. Be aware of how often you expect your CEG to run; if it's a commander death or a nuclear missile, you can afford to spend some extra particles, but if it's a machine gun or a cegtag (which is called every frame), you'll want to keep it down.
Bascially, try not to use more particles than necessary, and try not to use them longer than necessary. Be aware of how often you expect your CEG to run; if it's a commander death or a nuclear missile, you can afford to spend some extra particles, but if it's a machine gun or a cegtag (which is called every frame), you'll want to keep it down.


=== Randomness ===
[[Category:CEG]]
 
Always put a little randomness in your CEGs. CEGs are more interesting if they happen a little differently every time, especially if your CEG gets called more than once at the same time on the same screen.

Latest revision as of 14:53, 1 February 2015

CEG Miscellaneous

A collection of miscellaneous things to consider when making a CEG.

Blending

CEGs use the blending mode GL_ONE, GL_ONE_MINUS_SRC_ALPHA. This is in contrast to the default GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA. This means that the alpha determines how much of whatever is behind the particle will show through, but doesn't affect how the particle itself looks. If you want default blending, you'll have to scale the color components by the alpha by hand if the class you're using doesn't do it for you (most classes don't). Note that an alpha of 0 will cause the CEG not to be displayed at all.

Z-Fighting

A related problem is Z-fighting. If you have several high-alpha particles moving through each other, you may get an undesirable flickering effect as one particle is drawn at first, then the other. To solve this, reduce the alpha.

Randomness

Always put a little randomness in your CEGs. CEGs are more interesting if they happen a little differently every time, especially if your CEG gets called more than once at the same time on the same screen.

Realism

While it's important to make sure a CEG doesn't look completely implausible, don't get too hung up on realism. In almost any RTS, concessions are made for gameplay at the cost of a bit of realism; likewise with CEGs, you'll need to make some concessions for looking cool.

Gameplay

As well as looking cool, CEGs are an important part of gameplay. They let players know when things are happening and where they are happening. CEGs should give clues as to what is happening in the mechanics of the game. A powerful weapon should have a powerful-looking CEG; a blast that affects a large area should have a large CEG. Use the alwaysVisisble and useAirLos tags where appropriate. Hopefully we will eventually have a radius operator so CEGs can automatically be scaled to the radius of the weapon.

At the same time, you don't want to obstruct players' views of the game. A CEG should look cool for a moment, and then get out of the way.

Performance

Bascially, try not to use more particles than necessary, and try not to use them longer than necessary. Be aware of how often you expect your CEG to run; if it's a commander death or a nuclear missile, you can afford to spend some extra particles, but if it's a machine gun or a cegtag (which is called every frame), you'll want to keep it down.