Oh darn, I was planning on using it to save inventory
You could still do this. Not sure what your idea for inventory, but you could store your whole inventory as a single value.
For instance if you have say... 8 different items(9 if you count empty) and 5 inventory slots.
Assuming 0 is your standard for an empty slot...
Slot1 = Has a value between 1-8 (ItemType1=1;ItemType2=2;ItemType3=3...)
Slot2 = Has a value between 9-72 (ItemType1=9;ItemType2=18;ItemType3=27...)
Slot3 = Has a value between 73-584 (ItemType1=73;ItemType2=146;ItemType3=219...)
Slot4 = Has a value between 585-4680 (ItemType1=585;ItemType2=1170;ItemType3=1755...)
Slot5 = Has a value between 4681-37448 (ItemType1=4681;ItemType2=9362;ItemType3=14043...)
Your minimum to maximum value for your inventory would be 0-42792.
So you can expand on this idea and have like 50+ items with like 8-10 inventory slots but since there is some max value limitations you'd have to store your inventory in multiple values.
I thought about making a pokemon game using this concept, so you can save your pokemon as well ask their stats/level. Its just such a big concept for 1 person to make alone though that I passed on the idea.
So I randomly generated a number between 0-42792: 34519
You read this by starting to check for largest value first which would be your ItemType8 for Slot5.
That value is 37448(4681*8) which is too large to divide into 34519.
The first value that can divide into it is 32767(4681*7;Slot5*ItemType7).
So now that you know Slot5 is ItemType7. You must now find the remaining value of your inventory 34519-32767=1752.
1752 is above the minimum value for Slot4 so you know you have an item in slot4. Going to gloss over the rest.
1752-1170(Slot4*ItemType2 Value)=582 [Slot4 has ItemType2]
582-511(Slot3*ItemType7 Value)=71 [Slot3 has ItemType7]
71-63(Slot2*ItemType7 Value)=8 [Slot2 has ItemType7]
8-8(Slot1*ItemType8 Value)=0 [Slot1 has ItemType8]
Once you reach a value of 0 you have fully loaded your inventory.
I'm sure this type of system has a name for this method but I haven't no idea. I just am aware of its existence and how to use it, but not its name.
You could build on this concept to like 50+ Items and 10+ Item Slots, but with the max value restriction of 10000000 you have to use multiple values.
I even though of a doing a Pokemon map, being able to save the level/stats of the pokemon that you have captured to the next game to continue training them.
Because of this you could have battles that would take you maybe like 50-200+hrs of gameplay before you can beat them like the Elite 4 or something like that.
And even have PvP so theres a competitive drive to keep playing. Anywho... Goodluck if you going to use this. If you need help just ask.
Post has been edited 2 time(s), last time on Jun 16 2019, 1:31 pm by iDoodler.
Noob Map Maker