How does MV seed its RNG?

Prescott

argggghhh
Veteran
Joined
Aug 28, 2014
Messages
506
Reaction score
422
First Language
English
Primarily Uses
RMMV
I'm curious about this. Is it based off of in game time? The system clock's time? The amount of steps you've taken? Would love some insight into this if anyone knows :)
 

Kuro DCupu

Trust me, I'm a veteran RMer
Veteran
Joined
Jul 6, 2014
Messages
480
Reaction score
1,468
First Language
Indonesia
Primarily Uses
RMMV
Which part of RNG are you talking about?
When I read the title, I was assuming the dungeon map generator.
By how you're wondering, it's sounds like you're talking about battle encounter rate.
And it's clearly shown in the map property that encounter rate are based on the number of your steps.
 

FirestormNeos

Veteran
Veteran
Joined
Jul 23, 2019
Messages
179
Reaction score
128
First Language
English
Primarily Uses
RMMV
Which part of RNG are you talking about?
When I read the title, I was assuming the dungeon map generator.
By how you're wondering, it's sounds like you're talking about battle encounter rate.
And it's clearly shown in the map property that encounter rate are based on the number of your steps.
Okay, so how about stuff like crit chance, evasion, spell reflect, hit chance, target rate, etc.?
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,531
Reaction score
1,424
First Language
English
Primarily Uses
RMMV
If you mean Math.random (how random numbers are generated in javascript, it's shrouded in mystery (probably system internals, the clock, etc) but that doesn't matter because neither the player nor the developer can influence it. If you're looking for a solution that lets you set a specific seed value, you'll have to look into other, custom PRNGs which do accept seed values.
 

Prescott

argggghhh
Veteran
Joined
Aug 28, 2014
Messages
506
Reaction score
422
First Language
English
Primarily Uses
RMMV
Oh sorry for being a little unclear, the part I'm interested about the most is determining a random variable in the "Control Variables" command. Although the other stuff would be interesting to know too.
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,531
Reaction score
1,424
First Language
English
Primarily Uses
RMMV
What I said still applies. The random number generated by control variables utilizes Math.randomInt(), a function defined in rpg_core.js that in turn uses Math.random().
 

HumanNinjaToo

The Cheerful Pessimist
Veteran
Joined
Apr 18, 2013
Messages
1,226
Reaction score
603
First Language
English
Primarily Uses
RMMV
If you’re wondering about hit chance versus evasion chance for instance, the hit chance is calculated first then the evasion chance is calculated. @bgillisp is to thank for me finding that out. So the two are calculated separately not together. The example I saw them use was 95% hit chance calculated first, then a 5% evasion calculated, so the result is not 90% chance to hit as you may at first glance assume, but actually 90.25% chance to hit (I hope I got that right :p )
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,528
Reaction score
14,261
First Language
English
Primarily Uses
RMVXA
Yep that's it. Most round it to 90% though, but it is important to note it is not just to hit - eva. You can make it that way with a plug-in though.
 

Cormorant42

Veteran
Veteran
Joined
Sep 17, 2019
Messages
113
Reaction score
54
First Language
English
Primarily Uses
RMMV
Unless I'm mistaken, a lot of RNGs use atmospheric noise as the seed for their generation, js's Math function could potentially use that as well.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,051
Messages
1,018,549
Members
137,836
Latest member
T62352536256t362
Top