Super Mario World - Random Number Generation
5 okt 2016
290 664 visningar
How does random number generation work in Super Mario World? It's all explained right here.
LINKS
Twitter (updates): twitter.com/RetroGameMechEx
Patreon (support): www.patreon.com/rgmechex
Discord (discussion): discord.rgmechex.com
INLINE LINKS
Learn more assembly instructions: Coming soon!
SMW Yoshi Clips Explained: seworld.info/will/e63bu9CuoZWquJ8/video
SMW Powerup Incrementation Explained: seworld.info/will/iqmvkpfOi4R0uok/video
I was currently looking into implementing the code myself and I noticed there slipped in a mistake in the Java code shown in the video. You are XORing the same array value with itself, which results in all zeros. It should be rng[0] ^ rng[1], right?
4:22 what language is used?
Me: hearing EOR instead of XOR Me: * insert suprised pikachu face *
Is the on-screen code at 4:57 pseudocode or an actual language?
I understand subpixels as a luck factor, since it's just down to a game having more precise movement than the graphics allow the player to (normally) manipulate. But I don't get speed oscillation
I feel like i’m watching a video for school, but in a good way
Wait...Magikoopa is a GIRL?
Well kamek isn't idk about that specific magikoopa
Speedrunners should be watching this so they can truly understand RNG so they don't spam the use of the word as their excuse for failures.
Nah bro it stands for American Sign Language
HIS FIRST VIDEO :)
Jesus loves you, so consider him today! You don’t know how much time you have left, so don’t put it off until tomorrow.
Urchins can also blink in practice in SMW, though.
Wow this makes me a lot smarter
Well this would be needed for one part of my dream to come true
Why aren't the other SMW videos available anymore?
@Retro Game Mechanics Explained Awesome! Love the content.
Are you talking about the ones shown at the end of the video? They are on my other channel--made before RGME existed! seworld.info/section/PLZctv-xoGbfUolvrW5YTi9J1KnY0l0Xch.html
Still patiently waiting on the "Learn More Assembly Instructions" link in the description. Though you're still producing great content, so I'm willing to wait as long as it takes. Plus, it's not as if there aren't other resources on the 65816/5A22 that explain the instructions and much more.
Hey. I know this is an old video. But the java program is displaying only a lot of zero's. I changed the last line of tickRNG to: rng[2+y] = (byte) (rng[0] ^ rng[1]); And it worked perfectly. I hope it helps
I love this. Assembly is still the dark arts for many people, and it's often brushed over or dumbed down, so to have it explained this way is very helpful. More please!
This man has an exceptional "lecturer" voice! 🙌👍
I have an arabian girlfriend... i think i can hear her "S" is ticking...
I thought magikoopa was a dude.
my original impression from the thumbnail was that there is a tiny asian in the cartridge that solves a rubiks cube repeatedly, and the random number is how many milliseconds it takes to solve it each time
I know this is off topic, but his videos are so cleanly edited.
Nice
I played the game long enough to know some of those events ARE NOT RANDOM!
Wait, I thought magi-koopas were male and just Kamek was female?
@Matthew Jones Kamek is male. Kamella is the female one. But yeah, I’ve definitely always considered Magikoopas male by default. So, other than that bit of trivia, you just voiced my sentiments 👍🏻.
i have never ever even thought about checking candle animations and lava splash. This is kind of wild since the snes allowed for a kind of limited ammount of code
Im taking an intro to machine code class, and somehow this is all clicking in my head!
aw i wanted to see the first two luck based events lol is/will there be another vid abt that
Bit stands for Bit test asdasd
this is too compleceted for me
10:08 For some reason I find this hilarious.
Nice.
Does anyone know how to find his speed running channel?
"Asl = Arithmetic Shift Left" Me: "Asl = Age Sex Location"
A simple lute
Anglo-Saxon Literature
A sS funnLy meme
American Sign Language
I’m too stupid to understand these videos, but still am entertained.
@Nothing\ You are welcome my friend. I will continue to spread positivity
@ShadowPersonOfTheUnknown Thank you. I very much appreciate your genuine compliment. Such things are rare on SEworld comments, or the internet in general. So it's quite a welcome change. Keep spreading that positivity, bro. Cheers. =D
@Nothing\ I have to agree with Evan or a random guy that dose not upload Hayward (lol). You're quite knowledgeable, and that's not sarcasm.
Me too. Some of these I can understand though.
@Nothing\ I fully agree. Practice, and *ONLY* practice makes perfect. No-one’s born a blacksmith.
@6:10 It should be (note the index 0): rng[2+y] = (byte) (rng[0] ^ rng[1]); instead of: rng[2+y] = (byte) (rng[1] ^ rng[1]);
Me, knowing nothing about coding or computing, absorbing close to no information: Omg...The RNG...
All of the constant RNG calls call the RNG on 2^n frames.
11:47 Pac-Man?
I think that the best RNG would be produced by a mic, temperature, and light sensor combo. Although the mic itself would be pretty good, but all it takes is the internet to crack that kind of RNG, so maybe software RNG based off of the inputs would be a better option.
I wanna learn more about assembly
Magikoopa is female?
That's my thought exactly.
Arithmetic Shift Left (ASL).... Was this mispronounced (arithmetic as in math) or is it just a different *arithmetic"?
I wonder, couldnt the RNG-seed just get updated after every frame as well by taking values from other registers? Like Marios position, powerup state or a combination to avoid running into a predictable state?
@Minjae Song sadly true..
@Ben They totally could have done that but some reason that "some value" is always zero, as we know :\
@Minjae Song hm... different alternative could be that at each level start, you seed your RNG with some values that you have been tracking.
Ben Probably devs thought that's too much work AND performance drop for some inconsequential effects in the game. Even though the RNG seems cheap computationally, calling it every frame would make them not-so-cheap, especially with our poor 65C816
how do you edit your vídeos?
Hello, could you make an assembly tutorial for beginners? I know it is not exactly related to your channel, but it still is. For example you could teach us program mos 6502 processors since many consoles used those back in the 8 bit times
@Retro Game Mechanics Explained Thank you so much, this will surely help a lot of us to understand everything better. 👍
Yes, this has been the plan ever since I started the channel. I've recently started working on it, but it may be a longer while until it is released since I want to have at least one unit complete before uploading them, as opposed to uploading them as I make them (to ensure the flow and progression is correct).
1:00 3rd slot is nice
What is the middle game at 13:21 (the one that looks like a Yoshi FPS)?
@Retro Game Mechanics Explained Cool, thanks for the response! I somehow missed that one. I vaguely remember hearing about it but never played it.
Yoshi's Safari
Learn more assembly instructions [edit: wasn't made] and youtube removed the annotations feature :(
btw, I really liked the videos you did end up making and found them really intresting. So no pushing mm.
Oops, that what I meant to point out, but somehow i forgot to write the whole sentence XD.
To be fair, I still haven't made the video it was meant to link to...
Your understanding into the details on this is mind blowing. I'm impressed!
This is surprisingly similar to DooM, but DooM does a preset deck style rng of a pre generated table of numbers instead of pulling from an actual equation everytime
cool video bros
why they didn't use the user input as a source of entropy to seed the PRNG? For example, every time the user presses a button, the current value of the internal H/V counter latch is captured and sent to the PRNG
@Retro Game Mechanics Explained I see. Anyway, very accurate and in-depth explanations on your videos, very well made, congrats!
Well in this case, it's not possible since controller button presses don't generate interrupts--the controller doesn't tell the CPU that a button was pressed, rather the CPU checks on the controller when it needs to. But in general, latching the H/V counters is possible. I believe Yoshi's Island does this, just during the generation routine instead of on a button press.
1:02 Nice Nice Nice Nice
RNG in TF2's fighting mechanics is bullshit.
13:23 What's the game in the middle. Is that a Super Mario Kart ROM hack? Edit: The game is called Yoshi's Safari. It's a SNES Super Scope On-Rails Shooter.
It's called yoshi's safari
Never knew Kamek was a she.
My boss calls the RNG to determine whether or not I get a raise, it never calls back tho.
I dug through reality and broke the wrong block, now I'm laid off. oops
Does he also call RNG to determine, whether or not he fires you?
It sounds like it's calling to the wrong area in the ROM. You might need to pipe through the floor to reach the ROM and break the block that keeps returning as a 0 for a raise. I warn you though, if you aren't careful you'll corrupt reality.
Part 2?
Category: *_P e o p l e a n d b l o g s_*
In video about numbers and software.
Is Magikoopa canonically female? I always assumed male, with that Merlin the Magician get-up
Nerd! .... Absolutely beautiful analysis
0:56 69 XD
I really appreciate your channel. Love how you get into the details
My god man, you're a mad genius.
I turned on captions just to see if RNG would be read as orangy
Me and Orangey are gonna go get stoned Bubs
Lol
Despite Super Mario World supposedly being rushed, they sure did put a lot of effort into those birds on Yoshi's House.
I actually challenged myself by replicating this in Minecraft 1.14.2
Rng example the Dino torch
I'm not sure if your formula at 5:26 works when the 7th bit of T_n is set. Evaluating floor((255-2*T_n)/32) mod 2 when the 4th bit of T_n is not set and the 7th bit is set comes out to 1 when it should be 0, floor((255-256)/32) = floor(-1/32) = -1 = 1 mod 2. And if both the 4th and 7th bit is set, floor((255-288)/32) = floor (-33/32) = -2 = 0 mod 2. Unless I'm reading it wrong and it's round towards zero / truncate?
Just .... awesome, thanks.
11:47 Pac-man!
I am the only person that appreciates this, but thanks for using an actually possible Rubik’s cube position in the video. 1:03
Resetting the RNG at the end of each level seems like kind of an odd choice to me.
Until you consider that SMW was made to be a game, not an engine. Things like the Super Koopas have to be placed exactly the same at the start of some levels - same with the boo clouds.
I like the intro sounds, glitched extended 1up sound from SMB3
Thanks for the assembly code from the SMB3 rom! It's great to see deep explanations for this cool stuff!
What is the real purpose of the RNG function returning two random values? Why would you need two results for every call when most calls only need one value?
This reads like a scientific paper, this is really incredible.
So... is it: Yellow koopa - random turn-arounds Green koopa - no turn-around Red koopa - turn-around when approaching a ledge Blue koopa - when hit, spawns a strong koopa that kicks shells. Rainbow koopa?
Rainbow Koopa? You mean what happens when an unshelled one gets into a yellow shell?
No, the yellow koopa has randomised turns
If i remember right the yellow koopa follows you
Everybody knows RNJesus controls RNG
But first we need to talk about parallel universes Kappa
talk about sonic 1 finall boss random pistons
Wait a minute... FISHBONES CAN BLINK?!
@iBrow no, watch the video closely... They use a different method than the wall-traversing enemies, and you can SEE them blink
no. he said only the hot heads can blink, but the others still call rng because they share a bit of the code with hot heads
0:58 *laughs at 69*
Next time, can you do something on subpixels? Thx!
There was alot more random things in this than I expected, and most of them are completely pointless lol.
I didn't know the yellow koopa even turned around lol.
Oh boy, I can't wait to learn more assembly instructions!
We need to learn reality-assembly to call the assembly video
Guess you can, or, must, because that still hasnt happened.
13:37 Well, I have a question: Those gambling machines with video poker (which you see a lot in Las Vegas) - are they truly random? Is that an example of hardware-based? Because I assume that they would legally have to be in order to be considered “fair”. Thanks, ~J.J.
Things like slot machines get regular inspections to ensure they are operating as they should. So the answer to your question is yes. It would depend on the implementation on whether it was hardware- or software- based, but I would guess that if it were software-based, it would be much more complex than what was shown in this video.
It's impossible for the rubik's cube at 1:28 to be in that state - and it just so happens the piece that you remove is the incorrect one :P
Dude....how old are you.....??? This is a panty dropper if I ever saw one!
You could also use the system clock to generate the seed bytes. That would still be psuedorandom but would be much more difficult to find repeats.
The implementation of RNG routine, with the XOR and the repeated values resembles the structure of some hardware entities called Linear Feedback Shift Registers, or LFSR. These are widely used for pseudo random number generation in programmable hardware devices, such as FPGA. Could you confirm? Btw Great video!
I understand so little of these videos... But I watch them nonetheless.
I have no idea how this makes sense but I still want to watch??
6:13 Uncuddled curly braces; shame, great shame.
How about Unix-esque entropy?
uses a 3x3 for a metaphor for the randomness me, a cuber: THAT AIN'T RANDOM!!!!!!
Oh boy! ASM tutorial coming soon!
True RNGs require additional hardware, and hardware costs money per cartridge, while PRNG has a constant cost independent of how many copies you sell