[HGE]Understanding Magic_SetRandomMode (SOLVED)

All information about Magic Particles: news, question, comments, etc.

[HGE]Understanding Magic_SetRandomMode (SOLVED)

Postby sonictk » Wed Mar 24, 2010 2:29 am

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?
Last edited by sonictk on Fri Apr 09, 2010 6:57 am, edited 1 time in total.
sonictk
 
Posts: 28
Joined: Sun Feb 07, 2010 6:31 am

Re: [HGE]Understanding Magic_SetRandomMode

Postby Odin_KG » Wed Mar 24, 2010 12:18 pm

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.
Attachments
random_test.zip
(7.67 KiB) Downloaded 3327 times
User avatar
Odin_KG
Administrator
Administrator
 
Posts: 255
Joined: Sat May 09, 2009 10:53 pm

Re: [HGE]Understanding Magic_SetRandomMode

Postby sonictk » Thu Mar 25, 2010 10:22 am

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?
sonictk
 
Posts: 28
Joined: Sun Feb 07, 2010 6:31 am

Re: [HGE]Understanding Magic_SetRandomMode

Postby Odin_KG » Thu Mar 25, 2010 9:06 pm

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.
User avatar
Odin_KG
Administrator
Administrator
 
Posts: 255
Joined: Sat May 09, 2009 10:53 pm

Re: [HGE]Understanding Magic_SetRandomMode

Postby sonictk » Mon Mar 29, 2010 7:11 am

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?
sonictk
 
Posts: 28
Joined: Sun Feb 07, 2010 6:31 am

Re: [HGE]Understanding Magic_SetRandomMode

Postby Odin_KG » Mon Mar 29, 2010 1:28 pm

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).
User avatar
Odin_KG
Administrator
Administrator
 
Posts: 255
Joined: Sat May 09, 2009 10:53 pm

Re: [HGE]Understanding Magic_SetRandomMode

Postby sonictk » Fri Apr 09, 2010 6:56 am

After some tinkering, I managed to get randomness to work. Thank you! :D
sonictk
 
Posts: 28
Joined: Sun Feb 07, 2010 6:31 am

Re: [HGE]Understanding Magic_SetRandomMode (SOLVED)

Postby Odin_KG » Mon Apr 12, 2010 11:54 pm

It is well :-). Glad to hear it.
User avatar
Odin_KG
Administrator
Administrator
 
Posts: 255
Joined: Sat May 09, 2009 10:53 pm


Return to Magic Particles

Who is online

Users browsing this forum: No registered users and 2 guests