Page 1 of 1

[HGE]Understanding Magic_SetRandomMode (SOLVED)

PostPosted: Wed Mar 24, 2010 2:29 am
by sonictk
Hello. I have another question about Magic Particles.

Currently, I have a scenario in which I would like to reuse a particle effect multiple times (e.g. flames for torches). However, currently all the flames are playing in exactly the same way as they are created.

Rather than creating several types of flames and introducing randomness in the movement through the usage of the "Random sequence number" property in the Magic Particles editor, I was hoping to use Magic_SetRandomMode instead to achieve the same effect. However, even when Magic_SetRandomMode is set to true, the behaviour is still the same. Should this be the case?

Basically does Magic_SetRandomMode have the same effect as the "Random sequence number" property in the editor?

Re: [HGE]Understanding Magic_SetRandomMode

PostPosted: Wed Mar 24, 2010 12:18 pm
by Odin_KG
Hello

I verified the work of Magic_SetRandomMode. This function works without problems. I used attached file for test and added the line Magic_SetRandomMode(emitter->GetEmitter(),true); in HGE-wrapper.

Basically does Magic_SetRandomMode have the same effect as the "Random sequence number" property in the editor?

No. Magic_SetRandomMode allows to use chaos in emitter. This mode uses function rand() of C.

Re: [HGE]Understanding Magic_SetRandomMode

PostPosted: Thu Mar 25, 2010 10:22 am
by sonictk
No. Magic_SetRandomMode allows to use chaos in emitter. This mode uses function rand() of C.

When you say 'use chaos in emitter', does it mean that if the same emitter is created twice, both emitters will process their particles differently, thus the final look of both emitters will be different?

Re: [HGE]Understanding Magic_SetRandomMode

PostPosted: Thu Mar 25, 2010 9:06 pm
by Odin_KG
When you say 'use chaos in emitter', does it mean that if the same emitter is created twice, both emitters will process their particles differently, thus the final look of both emitters will be different?

"Magic_SetRandomMode(emitter->GetEmitter(),true)" influences on diagrams with two lines (green and blue) only. You can't create very different emitters with help this function.

I tried to explain more detailed, but it is difficult for me:
If you use two line (green and blue) on the diagram then the value is selected between blue and green lines randomly. But random digits is selected with help formula. "Random sequence number" - is start value for random digits. If you change "Random sequence number" then you specify new sequence of random digits for emitter, but this sequence will be identical always. API allows to you to turn off identical sequence of random digits.
This property influences on diagram with green and blue lines only.

Re: [HGE]Understanding Magic_SetRandomMode

PostPosted: Mon Mar 29, 2010 7:11 am
by sonictk
If you change "Random sequence number" then you specify new sequence of random digits for emitter, but this sequence will be identical always. API allows to you to turn off identical sequence of random digits.

Thank you for the explanation! :D That's what I mean. I need to turn off the identical sequence of random digits so that properties such as no. of particles emitted, size etc. will be different every time the emitter is created. So should I use Magic_SetRandomMode to achieve this?

Re: [HGE]Understanding Magic_SetRandomMode

PostPosted: Mon Mar 29, 2010 1:28 pm
by Odin_KG
Thank you for the explanation!

My English is not enough for difficult explanation :-)

I need to turn off the identical sequence of random digits so that properties such as no. of particles emitted, size etc. will be different every time the emitter is created.

Magic_SetRandomMode does not influence on creating of emitter. This function influences on identical sequence of random digits only. If size of particles is selected randomly from 1 to 10 and the formula selects the sequence of digits: 5.5, 6.7, 1.3 etc, then after Magic_SetRandomMode this sequence will be turned off: ?, ?, ? etc (from 1 to 10).

Re: [HGE]Understanding Magic_SetRandomMode

PostPosted: Fri Apr 09, 2010 6:56 am
by sonictk
After some tinkering, I managed to get randomness to work. Thank you! :D

Re: [HGE]Understanding Magic_SetRandomMode (SOLVED)

PostPosted: Mon Apr 12, 2010 11:54 pm
by Odin_KG
It is well :-). Glad to hear it.