RNG: Difference between revisions

3 bytes removed ,  12 October 2018
m
remove stub tag
(lots of data and math)
m (remove stub tag)
Line 1: Line 1:
{{stub}}
'''RNG''' or '''Random Number Generation''' is the game's method of generating a pseudorandom short. By doing this, the game can make things like dust movement seem random<ref>https://www.youtube.com/watch?v=MiuLeTE2MeQ</ref>.
'''RNG''' or '''Random Number Generation''' is the game's method of generating a random short. By doing this, the game can make things like dust movement seem random<ref>https://www.youtube.com/watch?v=MiuLeTE2MeQ</ref>.
==Technical description==
==Technical description==
The RNG variable is a short, which is a number from 0 to 65535 inclusive. When an [[object]], [[snow]], or something else wants to call RNG, it takes the current RNG value and runs it through the '''RNG function''', below. It uses the result in its own calculations and also stores the result to the RNG variable. Thus, the RNG variable is equal to the last used RNG value. Every [[frame]], every object is iterated through in order of [[object slot]]s and may choose whether to call RNG once, multiple times, or not at all.
The RNG variable is a short, which is a number from 0 to 65535 inclusive. When an [[object]], [[snow]], or something else wants to call RNG, it takes the current RNG value and runs it through the '''RNG function''', below. It uses the result in its own calculations and also stores the result to the RNG variable. Thus, the RNG variable is equal to the last used RNG value. Every [[frame]], every object is iterated through in order of [[object slot]]s and may choose whether to call RNG once, multiple times, or not at all.