playMaker

Author Topic: Send Random Event... isn't random  (Read 650 times)

Twood

  • Junior Playmaker
  • **
  • Posts: 76
Send Random Event... isn't random
« on: September 24, 2021, 09:57:08 PM »
So I was using send random event with weights on some FSMs and the results seemed broken.

Trying to figure that out, I made a demo that does nothing but pick 1 out of 3 events, at weight .33 each... look at the results? (I typed their names a bit differently so it's easy to read patterns.) This random generator is running in large streaks of the same result constantly?

I noticed the random event option without weights has a "no repeats" option which is nice but also eliminates some occurrences of natural repeats. It's kind of ok, far better than streaks, but like I said a little bit unnatural as well.

So what do people usually use for randomness if it has to run a lot (this is for an AI decision tree, so bad randomness is flat out noticeable)... is it a unity issue?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Send Random Event... isn't random
« Reply #1 on: September 25, 2021, 08:15:11 AM »
Hi.
Its dependent of a seed and can have large streaks. and it's indeed a unity thing.

What you can do is add a 'counter' in your loop so if a streak is happening you can limit it.

you can use a int add/int compare for each event and set int to 0 on other events when event x is triggered.

you can also use True Random Pro
It has playmaker actions

Twood

  • Junior Playmaker
  • **
  • Posts: 76
Re: Send Random Event... isn't random
« Reply #2 on: September 25, 2021, 12:54:42 PM »
you can use a int add/int compare for each event and set int to 0 on other events when event x is triggered.

Yes indeed this will ultimately work out :)