Charas-Project

  • Home
  • Help
  • Search
  • Calendar
  • Login
  • Register
*
Please login or register.

Login with username, password and session length
 

News:

Click here to join us on IRC (#charas on irc.freenode.net)!



  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • Stupid randomizer (Help needed)
« previous next »
  • Print
Pages: [1]

Author Topic: Stupid randomizer (Help needed)  (Read 5420 times)

Offline zuhane

  • Freakalicious
  • Leader
  • *
  • Posts: 2,192
  • Kill me
Stupid randomizer (Help needed)
« on: August 23, 2010, 02:39:53 PM »
Hey peeps! Has anyone noticed that on RPG Maker, when you set a variable at a random value, for example, between 1-100,
that it never really varies. It nearly always lands in the 50-80 area and never any lower. I thought it could be used to generate
random results, but it doesn't seem to.

I've created a Zone Icon which has a 30% chance of appearing when you attack in my game. The code is as follows:

<>Variable Operation: Zone Icon Chance - Set, Random 1-100
<>Branch if Zone Icon Chance is Less Than/Equal To Raw Power Chance (Which is 30)
 <>Switch Operation: Raw Power Success
 <>
: End

Shouldn't that technically mean that there's a 30% chance of it appearing? It appears about every 8 or 9th time I attack.
When I check the variable by pressing F9, Zone Icon Chance is nearly always around the 50-80 mark. Why? Is there a better
way to randomize something?!
Logged
Geese ruined my life.

https://soundcloud.com/tom-kingston-3/geese

Offline MissingName

  • Here you go. Juicy Fruit. Happy?
  • Exemplar
  • *
  • Posts: 1,919
  • The scotch is well hidden. So scram.
Re: Stupid randomizer (Help needed)
« Reply #1 on: August 23, 2010, 04:22:27 PM »


Sorry, couldn't resist the Peep joke...
Logged
<sig></sig>

Offline zuhane

  • Freakalicious
  • Leader
  • *
  • Posts: 2,192
  • Kill me
Re: Stupid randomizer (Help needed)
« Reply #2 on: August 23, 2010, 05:35:58 PM »
It's fine :P

But the problem still stands tall. Anyone have a clue how to sort this out?
Logged
Geese ruined my life.

https://soundcloud.com/tom-kingston-3/geese

Offline Prpl_Mage

  • Administrator
  • Sage
  • *
  • Posts: 7,645
  • The Administrator Mage
    • Check out our itch website
Re: Stupid randomizer (Help needed)
« Reply #3 on: August 23, 2010, 06:37:03 PM »
Just set the variable to 1-3. and have the check look for either 1, 2 or even 3. It's one out of three that it is right.
It's the same thing but more accurate. When you have large numbers it is logical that it lands on the thigns in the middle.
It isn't % we're taking about. We're talking about a random number.
And 33% is the same as 1 in 3.
Logged
Cool RPGM Project!
Sprite till you die

Oh my god, this was ...10 years ago...

Offline zuhane

  • Freakalicious
  • Leader
  • *
  • Posts: 2,192
  • Kill me
Re: Stupid randomizer (Help needed)
« Reply #4 on: August 23, 2010, 08:58:30 PM »
Sorry, Purple. I should have elaborated a little more. That does work. However, the variable
"Raw Power Chance" can be upgraded, making it more likely to appear. This means that
it needs to be adjustable by slight percentages, meaning that I have to keep the scale on 1-100!
Logged
Geese ruined my life.

https://soundcloud.com/tom-kingston-3/geese

Offline Prpl_Mage

  • Administrator
  • Sage
  • *
  • Posts: 7,645
  • The Administrator Mage
    • Check out our itch website
Re: Stupid randomizer (Help needed)
« Reply #5 on: August 23, 2010, 10:14:21 PM »
Then I'll try to look into it.
Logged
Cool RPGM Project!
Sprite till you die

Oh my god, this was ...10 years ago...

Offline zuhane

  • Freakalicious
  • Leader
  • *
  • Posts: 2,192
  • Kill me
Re: Stupid randomizer (Help needed)
« Reply #6 on: August 23, 2010, 10:36:51 PM »
Thanks a lot. It's just weird how inaccurate it is.
Logged
Geese ruined my life.

https://soundcloud.com/tom-kingston-3/geese

Offline fruckert

  • Star-Star-Star-Star
  • Sage
  • *
  • Posts: 8,148
  • Not intended for public consumption
Re: Stupid randomizer (Help needed)
« Reply #7 on: August 23, 2010, 10:50:11 PM »
That's because computers aren't naturally random, and random numbers in general tend to kind of pile up in the middle of the group anyways.
It's essentially unfixable unless you know how to program a god into a computer.
Logged
Quote
Ellie: I had a slice of ham in my hand. I was going to drop it, so I slapped it hard. It attached itself to the wall

Offline MissingName

  • Here you go. Juicy Fruit. Happy?
  • Exemplar
  • *
  • Posts: 1,919
  • The scotch is well hidden. So scram.
Re: Stupid randomizer (Help needed)
« Reply #8 on: August 23, 2010, 10:52:37 PM »
I've had it show up 92 out of 100 three times in a row, something else twice and then 92 a couple more times.

A suggestion (but I have yet to test this theory): Try generating your var between 0 and 1000.  Then divide that by 10.  I dunno.
Logged
<sig></sig>

Offline Prpl_Mage

  • Administrator
  • Sage
  • *
  • Posts: 7,645
  • The Administrator Mage
    • Check out our itch website
Re: Stupid randomizer (Help needed)
« Reply #9 on: August 24, 2010, 12:17:00 AM »
Quote from: MissingName on August 23, 2010, 10:52:37 PM
A suggestion (but I have yet to test this theory): Try generating your var between 0 and 1000.  Then divide that by 10.  I dunno.

Might as well set it between 1-10 and then multiply it by 10.
at least it won't be 31,32,,33. It will just be 10,20,30,40,50,60,70,80,90 and 100. Might work with the formula you got.

I was about to give up on this till my mate Missingname here came with the inspiration.
Logged
Cool RPGM Project!
Sprite till you die

Oh my god, this was ...10 years ago...

Offline zuhane

  • Freakalicious
  • Leader
  • *
  • Posts: 2,192
  • Kill me
Re: Stupid randomizer (Help needed)
« Reply #10 on: August 24, 2010, 01:21:42 AM »
Actually, with that in mind, I could try it with 1-20. It might give a more ranged scope at that level. At
least I can give the character small 5% chance upgrades. Thanks guys. This might work. I'll keep you posted.
Logged
Geese ruined my life.

https://soundcloud.com/tom-kingston-3/geese

  • Print
Pages: [1]
« previous next »
  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • Stupid randomizer (Help needed)
 

  • SMF 2.0.10 | SMF © 2015, Simple Machines
  • XHTML
  • 2O11
  • RSS
  • WAP2
  • Simple Machines Forum