RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
in base 4 i'm 5. (how to count in bases)

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 87
RIP w-hat the fork
Alrighty, so, I have been away for a while, and decided since because you all miss me, that I would give ya people a tutorial!
This is more of a math tutorial than a RMXP tutorial, and I am not sure if anyone might use it, but it is the thought that counts.
So, modulus, rarely used by most, mainly because people don't know what to use it for (or what it does)
Know, before I continue, this tutorial is going to be written from the perspective that you already know what modulus (or mod) is.
There is a good tutorial explaining it here at RMRK.net, so look around.

Know, this tutorial is going to tell you how to count in a base of your choice.
Base is a hard word to define, so here's an example. most people count in base 10, which means they count up from 1 to 9 before advancing to the next digit. Binary, is in base 2, you count 0 to 1 then go to the next digit.
Time counts in seconds up to 60 before going to the next digit, or timestep if you say (minutes, hours)

So, say you want to make the colour of an object one number. Well, it is possible. with counting in base 256.
This means we count from 1, to 255 before advancing to the next digit.
So, we count from 1-255 for R. (assuming we are using RGB values)
So, 256 would be green, right?
yes, 256 would be R-0, G-1, and B-0
257 would be G - 1, and R - 1.
Why?
Well, maybe explaining this formula would clear things up.

N = R + G * 256 + B * 65536

N is the number that stands for the RGB value, when counting in base 255.
(R)(G * 256)(B * 65536)
R is the first digit, G is the second, blue is the third.
I am going to make a comparison to our normal base ten, which is what everyone counts by.
So, the first digit is 1-255, or in base 10, 1-9 is the first digit.
Now, the second digit is is G * 256. where did 256 come from? well, it is + 1 to the first digit. just like in base 10! (second digit is + 1 to the highest possible value of the first digit, 9 + 1 = 10, or what we are going to count by for our second digit)
So, what we do in any base is multply  X * ([highest value of first digit] + 1)
so, say in base 10 we have 4 for the first digit, and 5 for the second (54), what it really is is 4 + (5 * 10)
Understand?
have I lost you?
If not, continue on.

Now you have the concept down, then lets advance to our next digit, and how it is determined.
It is determined by multiplying by 65536. you may be thinking, "65536? but that isn't the highest value of the possible previous digit plus 1!"
So, let me say this, "it's not".
What it is is the highest value of the previous digit, ADDED to the highest value of the rest of the other previous digits.
so, 65536 is ([256 * 255] + 255) or 2562.

Now, we know how to figure out the equation, and how to apply it to our base.
Using this method, you can create any basem with any amount of digits.

So, the problem is how to decrypt this new code, isn't it?
Well, it involves some math, using divide, floor, and modulus.
Floor is basically just taking off the decimals of a number.
using the previous base 255 example:

floor(N / 65536) = B
so the floor makes B not be a decimal number.

to find G, we actually need to find a new variable, which has no name, so we will call it V. (for variable :D)

Mod(N/65536) = V
so, the remainder of of the division of N by 65536.

G = floor(V / 256)
R = mod (V / 256)

we can know find each digit of our base.

so...
tl;dr
I explained a way to calculate base's and how to decrypt them.
This can be useful for currency's.
so if your country in your RPG doesn't count 100 cents to the dollar, but say 255 cents to the dollar, then you can use this idea.
Not that useful, but something that is nice to know
Huge sig is huuuuge.

****
Bitch
Rep:
Level 87
Bits'n'Pixels
That was waaaaay too numbery for my head   *is scared*

********
Licks
Rep:
Level 91
Sexual Deviant
So what does this do

**
Rep:
Level 87
RIP w-hat the fork
this does nothing, it is just a tutorial explaining something that you can utilize.
Huge sig is huuuuge.