News:

MegaGlests' game mods menu let's you install many new mods. Even more are available on the MegaGlest Wiki and the Mods forum.

Main Menu

[done]particle acceleration

Started by titi, 4 August 2014, 16:03:56

titi

There is a new pull request https://github.com/MegaGlest/megaglest-source/pull/24 about particles which can accelerate.
Please comment/discuss



Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Omega

The pull request says
QuoteFor example with negative speed + spherical shape you can make very nice effects.

I'd like to see an example of exactly what this looks like, because I'm having difficulty imagining it.

As for other use cases, attacks that shoot rockets might look interesting with acceleration. I think for really long range attacks, though (the thing I have in mind is the nuclear missile that I previously implemented in Military, which was able to target anywhere on the map), we'd need a way to specify the maximum speed, so that the projectile won't accelerate too fast. Rather, it'd start slow and eventually reach a max speed (very much like a real missile).

Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

titi_son

Quote from: Omega on  4 August 2014, 16:22:01
As for other use cases, attacks that shoot rockets might look interesting with acceleration. I think for really long range attacks, though (the thing I have in mind is the nuclear missile that I previously implemented in Military, which was able to target anywhere on the map), we'd need a way to specify the maximum speed, so that the projectile won't accelerate too fast. Rather, it'd start slow and eventually reach a max speed (very much like a real missile).
Sadly this is not for projectiles but only particles :( (unit particles and splash particles )
I may try speed-up for projectiles later.

I made a youtube video and i hope you can see what this does:

https://www.youtube.com/watch?v=jGjIlm57OTY

[spoiler=Here are the Xmls of the Examples]
The "lines"

<unit-particle-system>
    <texture value="true" path="images/particle.bmp" luminance="true"/>
<mode value="normal"/>
<primitive value="quad"/>
<offset x="-1" y="1" z="0.5"/>
<direction x="0.03" y="0" z="0"/>
<color red="1" green="1" blue="1" alpha="1" />
<color-no-energy red="0" green="0" blue="1" alpha="1" />
    <radius value="0" />
    <size value="0.1" />
    <size-no-energy value="0.4" />
    <speed value="2.0" />
<speedUp constant="0" relative="0.01"/> / <speedUp constant="0.01" relative="0"/>
<gravity value="0"/>
    <emission-rate value="0.5" />
    <energy-max value="170" />
    <energy-var value="0" />
<relative value="true" />
    <fixed value="true" />
    <teamcolorNoEnergy value="false" />
    <teamcolorEnergy value="false" />
</unit-particle-system>

The "ball":

<unit-particle-system>
    <texture value="true" path="images/particle.bmp" luminance="true"/>
<mode value="normal"/>
<shape value="spherical">
<angle value="90"/>
</shape>
<primitive value="quad"/>
<offset x="0" y="0" z="1"/>
<direction x="1.0" y="0" z="0"/>
<color red="1" green="1" blue="1" alpha="1" /> / <color red="1" green="1" blue="1" alpha="0" />
<color-no-energy red="0" green="0" blue="1" alpha="1" />
    <radius value="0.1" />
    <size value="0.1" />
    <size-no-energy value="0.4" />
    <speed value="2.0" />
<speedUp constant="-0.03" relative="-0.007"/>
<gravity value="0"/>
    <emission-rate value="0.5" />
    <energy-max value="70" />
    <energy-var value="0" />
<relative value="true" />
    <fixed value="true" />
    <teamcolorNoEnergy value="false" />
    <teamcolorEnergy value="false" />
<alternations value="1" /> / --
</unit-particle-system>

The "Ring"

<unit-particle-system>
    <texture value="true" path="images/particle.bmp" luminance="true"/>
<mode value="normal"/>
  <shape value="conical">
       <angle value="90" />
    </shape>
<primitive value="quad"/>
<offset x="0" y="-0.9" z="0"/>
<direction x="0.0" y="1" z="0"/>
<color red="1" green="1" blue="1" alpha="1" />
<color-no-energy red="0" green="0" blue="1" alpha="1" />
    <radius value="0" />
    <size value="0.1" />
    <size-no-energy value="0.4" />
    <speed value="2.0" />
<speedUp constant="0" relative="-0.05"/>
<gravity value="0"/>
    <emission-rate value="0.5" />
    <energy-max value="170" />
    <energy-var value="0" />
<relative value="true" />
    <fixed value="true" />
    <teamcolorNoEnergy value="false" />
    <teamcolorEnergy value="false" />
</unit-particle-system>


The "Crown"

<unit-particle-system>
    <texture value="true" path="images/particle.bmp" luminance="true"/>
<mode value="normal"/>
  <shape value="conical">
       <angle value="90" />
    </shape>
<primitive value="quad"/>
<offset x="0" y="0.9" z="0"/>
<direction x="0.0" y="0.1" z="0"/>
<color red="1" green="1" blue="1" alpha="1" />
<color-no-energy red="0" green="0" blue="1" alpha="1" />
    <radius value="0" />
    <size value="0.2" />
    <size-no-energy value="1" />
    <speed value="2.0" />
<speedUp constant="0" relative="-0.05"/>
<gravity value="-0.05"/>
    <emission-rate value="0.5" />
    <energy-max value="230" />
    <energy-var value="0" />
<relative value="true" />
    <fixed value="true" />
    <teamcolorNoEnergy value="false" />
    <teamcolorEnergy value="false" />
</unit-particle-system>

[/spoiler]
My first Tilseset: SPRING :) (included in Megaglest )


Secret Hint: To play online join the IRC #megaglest-lobby on freenode which is the lobby chat ingame. So you can chat with or wait for people in the lobby without running megaglest all the time.

Omega

Ah, I see what you mean now. I was assuming attack projectiles, not unit particles (any chance we could see both?). Looks good.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

titi_son

Quote from: Omega on  5 August 2014, 18:00:39
Ah, I see what you mean now. I was assuming attack projectiles, not unit particles (any chance we could see both?). Looks good.
I suppose we can. I just didn't look at it until now: :)
My first Tilseset: SPRING :) (included in Megaglest )


Secret Hint: To play online join the IRC #megaglest-lobby on freenode which is the lobby chat ingame. So you can chat with or wait for people in the lobby without running megaglest all the time.

Ishmaru

How do yo make a spherical or conical shape?

Would you mind posting those particle xmls for reference?
Annex: Conquer the World Release 4 For Pc Mac + Linux
https://forum.megaglest.org/index.php?topic=9570.0
Annex is now on Facebook!
https://www.facebook.com/AnnexConquer

jammyjamjamman

It's all in the xml examples, these are the lines in question:

<shape value="spherical">

<shape value="conical">

The ring and the crown both use the conical shape


"All right, I've been thinking. When life gives you lemons? Don't make lemonade. Make life take the lemons back! Get mad! 'I don't want your damn lemons! What am I supposed to do with these?'" ~Cave Johnson, Portal 2