I've been trying to create binary storage in Super Mario Maker for almost three years
now.
No matter what I tried nothing worked so far, so far.
But recently we found out about global ground and track memory which suddenly opens up millens
of new ways to build Mario Maker contraptions, and which finally allows us to store Information
in, at least somewhat usable ways.
In this video we are going to take a look at different ways to store information in
super mario maker, we will take a look at read and writable binary storage, at a super
useless contraption that is able to shift bits and we will discuss what the heck binary
storage actually is.
Just before we start I want to give a quick shoutout to Mario Maker creator Giant.
He's the creator that built the calculator that went viral, and has built some insanely
clever and awesome stages, including a freaking rubik's cube and shift puzzles in Mario Maker.
He's been using global ground and elb manipulation in his courses long before I figured it out,
and I learned about a lot of the tricks that we are going to use in this video by taking
a look at his levels!
I highly recommend everyone to check his user profile out, you can find the link in the
description, his levels are beyond amazing!
So with that being said.
Are you ready?
Let's do this!
Okay so first let's take a look at a simple way to count globally, before we take a look
at real binary storage.
Here Mario finds himself in front of a super simple contraption.
There is a shell that is blocked by four bullet blasters, and there is a pow block.
If Mario triggers all four skeleton roller coasters at the bottom, then the pow-block
becomes triggered.
Nothing too fancy so far.
The cool thing about this contraption is that it works globally, as soon as it was loaded
in once.
All items here stand on top of blue platforms on tracks, and are therefore stored in the
track memory and never despawn.
So if Mario goes to the far right here, and triggers the four skeleton roller coasters,
the pow block should activate as soon as the platforms reach their destination.
Hooray!
This allows us to store the information globally how many skeleton roller coasters were activated,
and to trigger a pow block once this number reaches four.
That's something that could be really useful for a couple of stages, but that's no real
binary storage since the information stored in this cell cannot be accessed nor really
manipulated.
This functions more like a relational operator that tests, if the amount of skeleton roller
coasters triggered is equal four.
And if true triggers a pow block.
That's useful but not fancy enough!
Only real binary storage is fancy enough!
Okay so what is binary storage.
Well it's actually surprisingly simple.
So storage is storage, and a binary number is a different representation of numbers.
So the number system we use in everyday life works on a base of ten.
We have ten different numbers, 0 to 9 which represent 10 different values.
If we count higher than 10 then we simply add a new number base 10 in front of our previous
number.
So the number 13 can also be read as 10 plus 3, and the number 9352 can also be read as
9000 + 300 + 50 +2, or as 9*10^3 + 3* 10^2 + 5*10^1 + 10^0.
I know that sounds super ultra boring, but stay with me for a moment because it's honestly
truly fascinating and understanding this can really help in super mario maker and math!
The thing is while our number system based on ten makes a lot of sense for everyday use,
a computer can't understand it on it's most basic level.
On its most basic level a computer is only able to understand if there is electricity
or not.
There are only these two states, either there is electricity and this is represented by
a 1, or there isn't which is often represented by a 0.
But a modern computer is able to store this information millions and millions of times.
So the thing is the information 1 or 0 can be represented in a different numerical system
then ours, the binary system.
That's a numerical system that uses a base of two, instead of a base of 10.
So instead of the numbers 0 to 9 we only use the two numbers 0 and 1 to represent information.
And instead of adding a new number everytime we count up to a new power of 10 we add a
new number every time we reach a power of 2.
So our number 1 is the same in binary and in our common numerical system, but as soon
as we count to two the representation changes.
Our numerical system has a number for two but the binary system hasn't so we write
a new 1 in front of the old number.
Meaning we represent a power of 2.
Anyones head ouching?
Let's take a quick look at a small mario maker trick, and come back here later!
Usually when an item enters a vertical track piece the item always cycles downwards.
It doesn't matter how the track is shaped, it will always cycle downwards.
But sometimes we want items to travel upwards instead.
Luckily there is a neat little trick, because this platform actually decides to cycle upwards.
The reason why this platform is different is because this platform hit the very bottom
of the track piece.
Whenever an item on tracks lands on the very bottom of a track piece it will cycle upwards.
We can even manipulate the layout of a track so that we can always control how items behave.
Useful isn't it, we'll use this trick a lot in a moment.
Okay back to number theory!
So in binary every number represents a power of two instead of a power of 10.
The number 13 looks like this in binary.
1011 which means 8 + 0 + 2 +1 or 1*2^3 + 0*2^2 + 1*2^1 + 1*2^0.
And this is what 9352 looks like 0010 0100 1000 1000.
It's actually super easy to calculate with such numbers but I'll spare you for the
moment.
So computers store information, like numbers in this way, and finding a way to represent
information in such a way in super mario maker is the basis to create actual computers.
One such number is called a bit and eight such numbers in a row are referred to as bytes.
Okay so what we need to built in Mario Maker is a storage cell, where we can write different
bits, and then are able to read the stored information, so that we are able to use it.
So here's the first thing I tried.
Don't be afraid of all the tracks, it's super simple.
The idea here is to change the position of the bullet blaster when a blue platform is
triggered.
A blaster to the left represents a one and a blaster at the right represents a 0.
There are two input tracks, if a platform on the right input track is triggered the
blaster is set to 1 and if a platform on the left is triggered the blaster is reset to
0.
Because of this we are able to flip flop the bullet blaster from set to reset, awesome
isn't it.
Let's call this a Set Reset Flip Flop.
The blasters stand on top of firebars so that they are on global ground and don't despawn.
Okay so currently both blasters are set to 0, but to our plumbers right is actually a
small contraption that allows us to set the bits remotely.
If Mario wants to change the bits he simply needs to activate the corresponding platform.
So here he set one bit to 1 and one to 0, and if we run back, hooray!
One bit is set and one isn't.
Cool isn't it!
But there is a problem, currently we are able to write information into our storage but
there is no way to retrieve the information stored again.
That's about as useful as wikipedia with no access to it.
Luckily there is actually a way to built readable storage as well.
Here we use a slightly optimized version of the Set Reset Flip Flop from before.
It works the same way as before, but this time the two positions are closer together,
you'll see why in a second.
Other than that it's the same, we can set bits to one by using one input line, and set
them to 0 by using the other one.
Super simple, isn't it.
Here we have four such storage cells wired together, so we are able to store up to 16
different values in this array.
But the cool thing is that we are not only able to store this information here, we are
also able to read it again.
So let's say Mario wants to store the number six.
In order to do so he needs to set the two bullet bits in the middle of the storage array.
Cool six is set.
Up here we have an output platform, if Mario activates this platform then the value stored
in the storage cell gets read and is displayed in binary afterwards.
There is only a small problem, it takes half a minute to read a simple number.
Sorry about that but as it turns out Mario Maker isn't the fastest hardware for calculation.
But eventually, hooray, our number appears.
We are able to further work with this number but let's first check out how the reading
works.
It's actually ridiculously simple!
There are pow blocks which live on top of the bullet blasters.
The reading platform simply picks them up and transfers them to the output.
If a blaster is not set then the pow block gets lifted but drops back down again because
there is an evil ice block, blocking him.
If a bullet bit is set however then there is no evil ice block blocking the platform,
which allows it to kidnap the poor pow block.
The platform is set up in such a way that each pow is picked up at the corresponding
bit spot.
Okay so what are we able to do with this binary information.
Well not much currently, but at least a little bit.
First it's incredible easy to build a bit mask which can be used to test for specific
bits.
If we want to test whether the least significant bit is set, that's the one to the far right,
then all we need to do is to block this specific bit, and if it is set then the pow block drops
down.
Whenever the least significant bit is set, then the number stored is uneven, and whenever
it is not set then the number is an even number.
So for example we can have a door that only opens up if Mario stores an uneven number
into the storage.
Awesome!
Where things become really interesting is if we find a way to perform logical bit operations
onto our information.
Okay so bit operations.
There are, if we simplify things a little bit, four main ways to manipulate sets of
binary information.
There is the NOT operator, which complements every information stored.
So every 1 becomes a 0 and every 0 a 1.
There is the AND operator that takes two binary numbers and outputs which bits are set in
both numbers.
So for example if we take the number 1011, and the number 0111 then we get the number
0011, because only the last two bits are set in both numbers.
Then there is the OR operation that returns true if either one of the two bits is set
or both.
So if we take 1001 and 1100 for example we get the number 1101 since only the second
bit isn't set in any of the inputs.
And then there are bit shifts.
A bit shift basically shifts all bits stored in a number towards the right or towards the
left.
Since the binary numeral system works at a base of two this means that shifting a number
to the left always multiplies it by two, and shifting a number to the right always divides
it by two, the same way that shifting a number to the right or left in our numerical system
multiplies or divides a number by ten, since our numerical system works at a base of 10.
Okay, so why do I tell you about these four operators, well because if we found a way
to recreate all these operations in super mario
maker, then we would actually have, kind of an assembly language for super mario maker,
which would be one of humanity's stranger achievements, but suuuuper awesome!
So I spent more time than I'm willing to admit trying to find a way to perform those
four operations onto pow blocks on top of blue platforms and I sadly was only able to
recreate a single one of those operations.
We'll take a look at that in a second, but if anyone of you wonderful ladies and gentleman
wants to toy around with this and finds a way to perform these operations on data stored
on top of a blue platform please let me know about it that would be awesome.
But first let's take a look at another use case of information stored in such a way.
Here we have a simple password system.
To Mario's right and left are four question blocks, and there are two locked doors.
If Mario wants to unlock these doors he needs to enter two binary numbers into each set
of four question blocks.
The key is only rewarded if the sum of both numbers entered is exactly 15.
So here Mario for example entered 11 and four.
11+4 is 15.
Once our plumber entered the two numbers he is able to activate the two platforms close
to the numbers, which loads both numbers into the sum checking system at the top.
Afterwards our plumber is finally allowed to activate the last blue platform, this one
starts the super complicated sum calculation.
The sum calculation is actually so complicated that calculating this only once takes about
half a minute!
But after these 30 seconds Mario is rewarded with the exit key, since he entered a sum
of 15 into the contraption, hooray!
If Mario entered a wrong sum then nothing would have happened.
The reason why this works is surprisingly simple.
So first we load both numbers onto platforms at the top, this is just so that we have them
up there for the calculation.
Then we test whether input one XOR input two outputs a combination where every bit is true,
and if this is the case we reward mario with a key.
Which is a very complicated way of saying we are building a bridge for this goomba.
Only if the sum of both numbers is 15 there is no gap in the path, nor is there a p-switch
which blocks our math calculating goomba!
Awesome isn't it.
Okay so finally let's take a look at the one bit operation I managed to recreate in
Mario Maker.
Bit shifts!
Here Mario first needs to run to the right so that everything gets loaded once.
Then our plumber is able to input a binary number by activating skeleton roller coasters
at the bottom.
Each roller coaster represents one bit where the one to the far right represents the least
significant one.
Our plumber decided to input the number 14.
And then, then there is this platform.
This platform is a marvelous masterpiece of goomba engineering.
Because this platform, divides every number entered by two!
But not only is this platform able to perform second class math tasks, it also does so within
only 17 seconds.
Wow, what a machine!
So after seventeen seconds the platform comes back and now the number 7 is displayed!
But how was this incredibly potent platform able to perform such a complicated task within
such an absurdly short amount of time?
Well the answer is, because it right shifted the input once.
All bits were shifted to the right once, which equals a division by two.
But the best part has yet to come, because this platform is not only able to perform
this action once, but as many times as desired.
If Mario wants to shift the seven again, all that he needs to do is to run to the right
so that the platform reloads, and then he is able to activate it again.
So this time we have a problem.
If we divide 7 by two the result is 3,5, but our binary numbers aren't able to represent
numbers with one decimal place.
Because of this it drops the rest of the division into this spot, which represents 0.5 and then
it outputs three, which is once again the right result.
If we divide the number once again it outputs 1 and shows us once again that there was a
rest.
Awesome isn't it!
So how does all of this work?
Well it's once again super simple!
First we load in the four p-switches.
P-switches which were spawned out of a question block or a note-block never despawn, and stay
loaded forever.
That's incredible useful for a like billion different things and we will use this a lot
in the future!
Shoutout again to giant, that's one of the tricks I learned when checking out his awesome
stages!
Then we use the skeleton roller coasters to get our p-switches set and into position,
the roller coaster just picks them up and drops them at the right spot and then, then
the surprisingly simple shifting magic happens.
We drop everything that is on top of the platform.
The least significant bit gets picked up by a conveyor belt if it is set, and then we
pick up all the p-switches once again, but first the platform moves one block to the
left.
The platform then cycles back and drops everything where it picked it up, but now it's shifted
to the right by one.
Okay so that's all about binary storage I was able to recreate.
If someone of you wonderful ladies and gentleman finds new tricks, using these tricks please
let me know about it.
I hope you enjoyed this little video, if you enjoyed it don't forget to leave me a thumbs
up and maybe you feel especially confused today and want to hit the subscribe button
as well.
I hope that you have a wonderful day and to see you soon.
Goodbye!
Không có nhận xét nào:
Đăng nhận xét