Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Tutorials
#1

How to transfer data from one level to a sub-level

Archive: 47 posts


Hey everyone. I've been working on a new game, and it's turning out to be huge. It's a diablo-style RPG, and I have already implemented 6 spells with upgrades, a questing arch, and interactive environments. Here is a video on how to transfer data from one level to another using a player's score as variables:


http://www.youtube.com/watch?v=BQtUB17psCA

If you have any questions let me know, and I'll do my best to answer them.


(Here is a video I took of my new level, but it's already very out-dated so keep that in mind. I will make a new video showcasing all of it's features when I finish the game. I'm looking forward to getting this in your hands! It's actually a lot of fun to play. )


http://www.youtube.com/watch?v=iCZjFTnb_HA
2011-03-19 13:16:00

Author:
Mako
Posts: 8


Yea it was known thing, still you sacrifice a score system a little. You can get more bits of data by using 2^x of per score sensor and treat treat score as binary code, but your idea of using decimal digits is also cool you can get 6 states with values from 0-9 and one with 0-3 and seems to be more useful for RPG's that use stat numbers then binary idea 2011-03-19 14:26:00

Author:
Shadowriver
Posts: 3991


I'll just leave this here:


http://www.youtube.com/watch?v=pLF_GsQmPdU

2011-03-19 14:31:00

Author:
comphermc
Posts: 5338


Cool. I usually don't look at other tutorials so I wasn't sure if someone had figured this out or not yet. Thanks!2011-03-19 15:51:00

Author:
Mako
Posts: 8


This is very cool. Thanks for sharing.
Also, your upcoming level sounds huge. I'll put an eye on you
2011-03-19 17:04:00

Author:
SnipySev
Posts: 2452


I'm taking the blizzard approach to announcing it, but it's going to be large. I even shrunk down the player so I could get more room. The whole idea will be to reward exploring. I want to have secret caves and ancient ruins to discover and explore in addition to the quest areas. It looks to be completely feasable so far, and I've just finished the character development so now I get to look forward to crafting the world. 2011-03-19 17:31:00

Author:
Mako
Posts: 8


This should prove to be useful for level transfer sequences for not just RPGs like Final Fantasy or Pok?mon, but also for Metroidvania games like Metroid, Castlevania: Symphony of the Night, and Cave Story. However, because score is erased once you're no longer playing that level, it cannot be used to create more permanent save files. (You'll need to use stickers or passcodes for that purpose instead.)2011-03-19 17:58:00

Author:
Shadow Wolf TJC
Posts: 72


?????????????????????????????????????2011-03-19 19:00:00

Author:
Unknown User


... and now a true Chrono Trigger Sequel can be made *crosses fingers*2011-03-19 19:18:00

Author:
supremeoverlord1
Posts: 117


Cool. I usually don't look at other tutorials so I wasn't sure if someone had figured this out or not yet. Thanks!

Well it was mostly discussed when beta was under NDA, after that interest fallen a little bit and in retail no body talked about it

In NY event MM was saying that they got under consideration to implement native solution for transferring data between levels. they said "maybe it gonna log how currently tags and tags sensors work". I would like this to be implemented in way of extra tweak in all gadgets that have state storage ability (toogles, timers, slectors etc.) in for of labales. If labales match state is set on beginig to state from last level. this is how saves could be solved to
2011-03-19 20:49:00

Author:
Shadowriver
Posts: 3991


they said "maybe it gonna log how currently tags and tags sensors work".

This would be nice, but I just wish they would allow traditional variables. If they allowed for microchips to have special names and then allow the maker to save them and ask to re-apply them, that would solve a lot of issues, but it feels like mediamolecule thinks big and plans small.

I'm currently battling with an overly-complex level design and I have no idea why it's removing textures/objects from view. I keep deleting things and it doesn't make any difference. I'm also getting weird errors with emitted objects like flat panels expanding into full-sized panels, or emitted objects shattering apart for no reason. Any quick advice?
2011-03-20 02:52:00

Author:
Mako
Posts: 8


How much thermo would 214,749 Score Givers (scoring 2.1 billion points!) use??? I'm guessing that amount of points being given at the same time would crash the game...who wants to try?! I've been reading up on binary It's given me a clearer view of how to deal with this...when/if I ever get there.2011-03-20 22:00:00

Author:
ballisticola
Posts: 157


How much thermo would 214,749 Score Givers (scoring 2.1 billion points!) use??? I'm guessing that amount of points being given at the same time would crash the game...who wants to try?! I've been reading up on binary It's given me a clearer view of how to deal with this...when/if I ever get there.

It's a non-issue as the score cannot go that high...
2011-03-20 22:16:00

Author:
comphermc
Posts: 5338


@comphermc - You say in your video we've only got 1 million points to play with? What do you mean by that, because you can score more than 1 million points and the max a score sensor can detect is 100,000. So I'm confused 2011-03-21 19:36:00

Author:
ballisticola
Posts: 157


@comphermc - You say in your video we've only got 1 million points to play with? What do you mean by that, because you can score more than 1 million points and the max a score sensor can detect is 100,000. So I'm confused

Maximum is 4.000.000 so you got potentially 22bits in to disposal and 7 digits. There one issue that might be a pain as you notice that, score givers supports only max 10,000 and sensors only 100,000. So without much hassle you got only, 17-bits and 5 digits in disposal, beyond you need to workaround,for example by counting how much subtracts was needed to reach lower number then 100,000, so you can guess what number was.
2011-03-21 20:28:00

Author:
Shadowriver
Posts: 3991


10 (1)
20 (10)
40 (100)
80 (1000)
160 (10000)
320 (100000)
640 (1000000)
1,280 (10000000)
2,560 (100000000)
5,120 (1000000000)
10,240 (10000000000)
20,480 (100000000000)
40,960 (1000000000000)
81,920 (10000000000000)
163,840 (100000000000000)
327,680 (1000000000000000)
655,360 (10000000000000000)

These ARE the droids (numbers) you're looking for
Am I the only one who looks at binary and sees a selector?

Of course, depending on the system you can possibly squeeze out more than 17. Not actually, but make it seem like more stuff has been remembered. Let's say you achieve 2 things, the second of which couldn't be achieve without the first, when you go through the link, the level will recognize this and changes the level accordingly. So you are left with one extra bit. This is very useful for when you want to use the same level twice, e.g. if you need to go back to find something after you've unlocked something in a previous level. And you can always use a password system, as well. You might need one anyway.
2011-03-21 22:53:00

Author:
ballisticola
Posts: 157


Sorry to double post, but that doesn't work? How do you get 17 bit? Beyond 81,920 there's no way of telling what score you had because the limit is 100,000? Don't get it? 2011-03-24 18:26:00

Author:
ballisticola
Posts: 157


I looked for them? huh? what? i know 2^x numbers (or else you replaying to someone else)

About more then 100,000, you can blindly count subtracts until score reach lower then 100.000 as i said on previous post

You can laso go lower then 10 points by analog signal, but it's quite complicated due it's only achievable "per sec" action input
2011-03-24 21:18:00

Author:
Shadowriver
Posts: 3991


No, it's alright, I was just posting the numbers for anyone who didn't know And I get the idea about subtracting


You can laso go lower then 10 points by analog signal, but it's quite complicated due it's only achievable "per sec" action input

Are you telling me you already know how to get real binary, without the zero at the end? Why isn't it written down anywhere? And it really is very easy to do.
2011-03-24 22:19:00

Author:
ballisticola
Posts: 157


Yea, there is way to use points lower then 10 but it's little complicated and can be not practical. Score giver have input action that gives every second points depending on analog signal inputed.... problem it nod give in points impliedly and "every sec" is not staring from once it start receive a signal and can happen in between secound. But you could solve this out if you sequence it right along with score sensors, thru it might take seconds to set score this way ;]

Score sensor can detect lower then 10 numbers via analog signal too, since it's outputs % to target score, so you would need to use sequencer on positional here to read the score.

But yea it might be little over complex and slow, if you really don't need those extra bits it won't be worth it
2011-03-25 02:26:00

Author:
Shadowriver
Posts: 3991


Just wondering, but could you use different colored and labeled tags to represent score? Just have each tag sensor set up to have appropriate amount of keys? I haven't tested this yet, but it would allow extra limit if it is possible.

Basically have tag sensors check and turn off tags much like score system subracts. I know it would be more complicated, bit more thermo possibly as well. But in theory I think it would work.

In any case, I have an alternative built that doesn't use a score system and allows me to transfer whatever data I want. Instead it uses a 16 code input much like the megaman X game provided after every level. Granted it's more of a hassle than score system, but it has its advantages as well :-).

1. It is completely optional to the player.
2. It won't make annoying bubble sounds and detract from gameplay.
3. It allows permanence in the game.

I am using mine to save character development, items collected, bosses beaten, and save locations found.
I may try combining the score system with my current system to record locations of items found that do not have to be collected in order. Still testing and retesting that theory though.

Anyways, excellent tutorial nonetheless.

Shadow
2011-03-25 07:22:00

Author:
Shadow_Wolf_1987
Posts: 108


Oh you mean key/code based system huh? well that can work too, but it pain to type it everytime you change level2011-03-25 20:44:00

Author:
Shadowriver
Posts: 3991


It takes one second to encode the extra three bits. It's not exactly hard. Scaled per second will respond to the analogue signal that is input to it on every 30th simulation frame. Thus, all you need to is to feed the correct value for those three bits summed, into a sensor, for 30 frames. This has issues due to bugs in timers that cause a timer that should last for 30 frames to last for 29, giving you a 1/30 chance of failure. IIRC a sequencer will allow you to get accurate results out of the system but I might be wrong (this is going back several months). Otherwise you can generate 29 frames with a timer and a single extra frame with a pulse generator.

Also, I don't know if anyone has clocked onto this or not, but for the sake of your sanity, I'd suggsest you modify your bit weightings from:


1
2
4
10
20
40
80
160
320
640
1280
2560
5120
10240
20480
40960
81920
163840
327680
655360
1310720
2621440
5242880
10485760
20971520


to


1
2
4
10
20
50
100
200
400
800
1600
3200
6400
12800
25600
51200
102400
204800
409600
819200
1638400
3276800
6553600
13107200
26214400



The former is far more obvious, but the latter allows you to work with far less awkward values at almost stage, though there is an argument against it that it requires a larger number of blind subtractions to decode the higher values... But if you are smart you'd implement these in a tight loop anyway so it's not much effort to actually implement. on the other hand, tracking down those odd errors of 10s and 20s is just massively annoying, especially if they are in your decoding stage.
2011-03-25 21:35:00

Author:
rtm223
Posts: 6497


The way I have set mine up is really not a pain lol. It actually could theoretically take shorter amount of time than actually allowing a modern game to save using an internally built save system. Take the save system for Super Metroid for example. You step in a capsule and wait an ungodly amount of time before you can continue. My passcode system literally takes less than 4 seconds if you know the code by heart and no more than 6 seconds if you have to glance at the paper you wrote the code on. The only real issue I foresee is people cheating with sharing codes. I, of course will moderate my comments in my level, but that will not stop info from being shared elsewhere. Nonetheless, if people choose to ruin their game experience, that is ultimately their choice. Much like how Gamefaqs work. You can either cheat or you can not cheat. An issue players may have a problem with, which I won't change, is the need to write down the passcodes to progress. Many retro games required it such as Megaman, and I am not going to change it. However, I think I may try combining score logic with tag logic and my own code logic to allow items to be found in any order instead of a predestined order. My only problem right now that prevents me from doing that is letting the level know to destroy them. But if I have my code initiate a number of tags much like how the score system works I may accomplish this yet!

Shadow

Hmm, seems the limit for tag sensors limit of 100 is getting in the way of my progress...grrr
2011-03-25 23:26:00

Author:
Shadow_Wolf_1987
Posts: 108


It takes one second to encode the extra three bits. It's not exactly hard. Scaled per second will respond to the analogue signal that is input to it on every 30th simulation frame.

That's not quite right. The time at which the score is added is relative to the time the Score Giver was created, not the global simulation time. It seems as if the time offset to the next trigger point is stored internally in whatever C struct represents its state, and that value is serialized when captured. Also, the time is unaffected by pausing the simulation.

This means you can place a chip containing, say, a Tag Sensor feeding into a Score Giver, and if you capture it when there's a very small amount of time on its internal clock, you can then re-emit it (in this case near a Tag whose analog value is set to the relative amount of points you want to give) whenever you like, and the Score Giver will always give the points at the same time offset from the emission time, which means you can make the time taken to grant the score completely deterministic, and much less than one second.

Capturing it at the right time can be tricky tho'.
2011-03-26 19:54:00

Author:
Aya042
Posts: 2870


5242880
10485760
20971520

How??? You can't go over 4 million??? Other than that it's alot easier
2011-03-26 23:23:00

Author:
ballisticola
Posts: 157


1 million max, with multiples of ten. That's 100,000 different combinations, right? Or am I doing the math wrong?2011-03-28 14:40:00

Author:
Flamento
Posts: 352


I thought I saw someone say that you could keep the score system, but now I've reread all messages in the entire thread and didn't see it.

The way it's presented in both comphermc's video and in the topic creator's video is that the scoring system is used to transfer this data. It seems if you have more points than the binary or decimal systems that are described here are expecting it will not work. The videos didn't say anything regarding this.

Is there a way you could do this and still have a normal score system? Shadowriver said you sacrifice the score system a little but it seems like if you use these methods you have to have the exact score it's expecting so that it works?
2011-03-28 17:00:00

Author:
Unknown User


Is there a way you could do this and still have a normal score system?

You simply restrict your data to the high-order bits. For example, if it's not possible to score more than 10,000 points in your level, then you can optionally add 10,000 to the score before traversing the level link, detect to see if the score is greater than or equal to 10,000 in the sublevel, and subtract 10,000 if so. Ditto for 20,000, 40,000, etc.
2011-03-28 18:07:00

Author:
Aya042
Posts: 2870


How??? You can't go over 4 million???

Oh yeah, sorry posted it in a rush

@Aya, that's interesting about the score givers. Last time I tried to actually force them to desync was during the early stages of the beta when I was playing around with the level data concepts and I could not, for the life of me, get them to trigger out of sync with each other. Maybe something changed, or I was just being a spazz. Not sure which
2011-03-28 19:30:00

Author:
rtm223
Posts: 6497


1
2
4
10
20
40
80
160
320
640
1280
2560
5120
10240
20480
40960
81920
163840
327680
655360
1310720
2621440

1
2
4
10
20
50
100
200
400
800
1600
3200
6400
12800
25600
51200
102400
204800
409600
819200
1638400
3276800

Actually, if you want to use all the numbers you can't use the last of both sets, because you go over 4 million, depends how you use them.

10, 20, 50. Good spot with those Does this work?

-3276800
-1638400
-819200
-409600
-204800
-102400
-51200
-25600
-12800
-6400
-3200
-1600
-800
-400
-200
-100
-50
-20
-10
-4
-2
-1
1
2
4
10
20
50
100
200
400
800
1600
3200
6400
12800
25600
51200
102400
204800
409600
819200
1638400
3276800

That's only if you can have a minus score...I don't know?
2011-03-28 23:32:00

Author:
ballisticola
Posts: 157


I never heard of negative score, but if it's somehow possible, it would still only add one bit. Your list wouldn't work because when the same positive and negative value bits are active, the values cancel each other out. The whole trick behind the binary number range is that with adding any combination of them together you can still break them up into the individual values again.2011-03-29 11:12:00

Author:
Rogar
Posts: 2284


Yeah, I gathered that as soon as I thought about it for a second

Anyway, is it possible to transfer this:-

Health (10 levels)
Weapon (10 levels of power)
Weapon 2 (10 levels of power)
ID Cards (like in MGS, 10 levels)
Progression (10 levels)
Score (10 levels)
2011-03-29 14:11:00

Author:
ballisticola
Posts: 157


To get the numbers 0-10 (or 1-10) you'd need 4 bits for each variable, so no, 6x4 bits wouldn't fit. However, you can save some space. Try to squeeze some of the values into a range of 1-8 so they only take up 3 bits. And maybe the ID cards can be mapped linearly to the game progress, saving you a variable. And if you're moving to another sublevel at a specific point in the progress, you don't actually need to transfer the progress, it's implicit.2011-03-29 14:32:00

Author:
Rogar
Posts: 2284


If I were to actually do that, I would take out the ID Cards and Score, so it would be easy at 16 bit (no subtracting blind numbers ) I've actually just found out about using the binary numbers to represent the actual binary...I missed it because I was thinking in a completely different direction...which itself has found a fantastic new way of doing things

The real reason I chose those 6 was for sneaky reasons , mainly because it can't be done (originally I thought it would take 60 bits not 24 ), so it's a loaded question Which can mean only one thing...
2011-03-29 20:13:00

Author:
ballisticola
Posts: 157


This one thing being... you've got a better solution? 2011-03-29 21:02:00

Author:
Rogar
Posts: 2284


Forgive me if I'm wrong, but encoding 1,000,000 states... shouldn't be anywhere close to "impossible" right? Especially in the case where there is a clear groupings with of 6 lots of 10? No one is forcing you to encode in binary, y'know

That was just the original proposed solution based upon the assumption that one might wish to encode a certain number of independent boolean variables, what with LBP logic being so largely centered around booleans.
2011-03-29 21:07:00

Author:
rtm223
Posts: 6497


Ah, right. Ballisticola was being tricksy. Powers of 10 would work, yeah. Still, some of those values are likely to be in the range 0-10, so obviously I wasn't going to think of encoding in tens.

Just trying to be helpful and see what you get? *grumble*
2011-03-29 21:20:00

Author:
Rogar
Posts: 2284


Explain to me how you do this...

Health (10 levels)
Weapon (10 levels of power)
Weapon 2 (10 levels of power)
ID Cards (like in MGS, 10 levels)
Progression (10 levels)
Score (10 levels)

...without binary? I don't think there's any doubt that you NEED to use binary
2011-03-29 21:24:00

Author:
ballisticola
Posts: 157


Ooooh, snap! That's like three mistakes in one thread so far... Looks like I'm outa here! Or not...


@ballsticola: Assuming your values are in the range 0-9, or 1-10 (rather than 0-10) you can encode in powers of 10. So, just taking 2 types of data, health and weapon and working with the assumption that you arent' going to progress through levels with 0 health and that you always have a weapon:

1 health = 0pt
2 health = 1pt
...
10 health = 9pt

1 weapon = 0pt
2 weapons = 10pt
...
10 weapons = 90pt

so 7 weapons and 5 health would give a score of 70+5 = 75.



Of course, this assumes that a) as rogar pointed out, you have 0-9, or 1-10 as your ranges and b) that you can't have a random selection of weapons... i.e. that you would never have weapon 4 without also having weapons 3,2 & 1 OR the alternative is that if you have weapon 4 then you have no other weapons.


There is nothing stopping you using any number base that you wish to and even mixing number bases if you want. Generally fitting the encoding to the data will give a more efficient solution in terms of wasted space in your available data (though having binary as your catch-all has it's attraction too). You could comfortably have a 3 groups of 10 states (like the example above) filling 0-999 and then start some binary encoding from 1000 upwards.
2011-03-29 21:42:00

Author:
rtm223
Posts: 6497


This is a good game this It's the "I know something, but I don't know if you know the same thing" game

Health (10 levels)
Weapon (10 levels of power)
Weapon 2 (10 levels of power)
Weapon 3 (10 levels of power)
Weapon 4 (10 levels of power)
Weapon 5 (10 levels of power)

I've changed it so you can better understand, but they could be anything. I'm saying you can have ANY or ALL of the weapons at ANY time. Also as a note, level 1 is not having the gun at all, so there are really 9 levels of power

EDIT
I think you know what I know I'm still writing it all out though
2011-03-29 21:53:00

Author:
ballisticola
Posts: 157


Again sorry for the double post and if it repeats stuff, I was halfway through it while speaking about it. But it's still interesting

01-02-03-04-05-06-07-08-09-10-11 - Health
12-13-14-15-16-17-18-19-20-21-22 - AK47
23-24-25-26-27-28-29-30-31-32-33 - Progression
34-35-36-37-38-39-40-41-42-43-44 - Score

You're on your last legs, so you have 10% health = 2
You've been sensible and upgraded your AK47 to 100% = 22
You're halfway through the game = 28
You've scored 60,000 points (each level is 10,000) = 40

Add them together you get 92 and is the only way you can get 92.

That's what I thought, I was completely convinced, I thought it could go on right up to 2 million...until I found 92 another way, that's why people use binary numbers, but binary numbers are limited and just get bigger...we don't have bigger, we hit 4 million and even that is still difficult.

22 bit is our limit, and you can actually do it the normal way just using 16 bits (which I just worked out ). But no matter how many tricks you pull it isn't quite enough for me, I want more. But there is no way around it...or is there?

First you need to think about binary, but not the numbers we use, actual binary:-

1 = 1
10 = 2
100 = 4
1000 = 8
10000 = 16
100000 = 32
1000000 = 64

1 = On and 0 = Off, we write it as 1 (ONE) because it's easier, but it could just as well be X or +. The number 1 is not important, it just represents On.

Having said that those numbers are still numbers and more importantly they are pure binary. Let's go back to my example and expand it a bit:-

Now I have 6 different stats I want remembering. Which effectively is 60 pieces of information (or 24 bit), with Zero being the default that you start with (alive, with no guns or ID Cards, having not scored or progressed). By Progression I mean, just because you do something in the game it doesn't mean it's irreversible and you might have to redo or fix a mistake.

00-01-02-03-04-05-06-07-08-09 - Health
00-01-02-03-04-05-06-07-08-09 - Weapon (Levels of power)
00-01-02-03-04-05-06-07-08-09 - Weapon 2 (Levels of power)
00-01-02-03-04-05-06-07-08-09 - ID Card
00-01-02-03-04-05-06-07-08-09 - Progression
00-01-02-03-04-05-06-07-08-09 - Score

Firstly, this system works by using one number from each row, it can only work this way and makes no sense anyway, you can't have different states for one stat.

Now the maths. Remember that 1 represents On and is also very handy for us as something we can score on the scoreboard...but so is 2, 3, 4, 5, 6, 7, 8 and 9 (all the way up to 999 in fact). They can also represent On.

http://i465.photobucket.com/albums/rr19/ballisticola/BinaryGrid1.jpg
So placed into a grid each set of numbers can be used together without interfering (as long as you use one from each row).

For me it's a far more flexible system and only needs a selector to switch between each state. Also you can change the last row to:-
100,000, 200,000, 400,000, 800,000, 1,600,000 or even remove it and extend the...
5th row 10,000, 20,000, 40,000, 80,000, 160,000, 320,000, 640,000, 1,280,000
4th row - 1,000, 2,000, 4,000, 8,000, 16,000, 32,000, 64,000, 128,000, 256,000, 512,000, 1,024,000.
3rd row - 100, 200, 400, 800, 1,600, 3,200, 6,400, 12,800, 25,600, 51,200, 102,400, 204,800, 409,600, 819,200, 1,638,400.
2nd row - 10, 20, 40, 80, 160, 320, 640, 1280, 2560, 5120, 10240, 20480, 40960, 81920, 163840, 327,680, 655,360, 1,310,720.

That's if you want to use binary to do other stuff. And in terms of this setup, adding 1,600,000 is the best you can get (although, it's only 1 bit more and messing about with 1,600,000 points is probably not worth it ). As Rogar has stated, using 0-7 is probably the most efficient and you don't even need the grid system (you don't need the grid, it's just easier), you just need 18 bit and the other 4 can be used for another row.

If you want to go above 9 levels you can, but it cuts down the number of rows, until 999 where you have two rows to play with. You can't go over 6 rows though.

I'm working on another way to do more. With different classes and XP progression.
2011-04-01 18:53:00

Author:
ballisticola
Posts: 157


That's kinda what I told you to do

6 variables that can each take 10 states is 106 = 1,000,000. So you need 1,000,000 points to encode that data.


As ever, it depends what your data is. If you are encoding individual boolean (TRUE/FALSE) variables, then binary is better. If you need to encode 6 variables, each with ten states then base 10 works. The theory is no different.
2011-04-01 19:23:00

Author:
rtm223
Posts: 6497


I'm working on another way to do more. With different classes and XP progression.

Let me save you some time here. There's actually a scientific way to calculate information - content or capacity, to quantify the amount of information in bits. You see, the reason why people like to use bits to talk about storing data is because the bit - a 1 or 0, yes or no, true or false - is the smallest unit of information. I won't go into the math of how to calculate the amount of information in your example (for one, I can't remember any of it ), but you can get a fair estimate through reasoning.

For example, to see how much storage a progress counter with values 1-10 would use, look at the range 1-16 first. We know 1-16 can be encoded in 4 bits, so 1-10 can also be stored in 4 bits. But doing that, the codes for 11-16 would remain unused. There is still some room for more information. So you can see there is actually less than 4 bits required to store values 1-10. The trick is in finding the right way to encode it, to make use of those spare "fractions of a bit". Like the encoding Rtm suggested.

But more importantly, you can also tell that 1-10 won't fit in the range of 1-8 as encoded by 3 bits, so 1-10 must require more than 3 bits of information. Now you can calculate a lower boundary for the amount of bits required to store a number of variables. For instance, 7 variables of 1-10 will take at least 21 bits, and 8 will take at least 24. This means we don't even need to try fitting 8 variables of range 1-10 into a high score of 4 million (about 22 bytes), which saves us a lot of wasted time.

Fortunately for your ambitions (but unfortunately for your sanity perhaps ), this is not the whole story. The above assumes that all combinations of values for all variables are possible, and equally likely to occur. But if, for example, you can only get Weapon A to level 6 when you reach Progress level 8, every code that has Weapon A at level 6 or higher and a Progress level in the range 1-7 will never occur in reality. That means the score values for these are useless, non-information, that could be used for something else. If Weapon A and Progress both had values of 1-8, you can conclude that the amount of information in the combination of Weapon A and Progress is less than 6 bits (the amount in two unrelated variables of 1-8). Again, the trick is in finding a way to encode your variables more efficiently.

To make a long story short, I guess I'm just trying to say that there is a definite limit to the amount of information you can store in the score value, and while binary isn't necessarily the best way to encode variables, it does help you estimate if your plans will fit. And if they won't fit, try making some room by adding some rules/design choices that limit the combinations of variables that are allowed.


P.S. I hope the logic people will forgive me for not using 0-based ranges, but it seemed to only make things more complicated.
2011-04-01 22:44:00

Author:
Rogar
Posts: 2284


That's kinda what I told you to do

I swear I was halfway through it before speaking to you It just seemed a waste to spend days writing it The theory is the same because both are binary, just in a different system

You've got something there Rogar Although, my idea is totally different and so complexed I haven't worked out how to do it yet That's why I talked about what you said about 3 bit data. The power of 10 system works really well (and is easy) but you are wasting 48 of your numbers...even though the system makes you...but binary can't do it in the same way, because that too wastes numbers. So I'm trying to get maximum efficiency, where every bit is not wasted.
2011-04-02 18:01:00

Author:
ballisticola
Posts: 157


Is there going to be an MP system so you cant just spam magic, meaning you would have to use Items such as MP recovery items (Ethers) and since your trying to make a Diablo type game Im not quite sure how that is as Ive never played the Diablo Series, I was always more of a Final Fantasy guy but so far this level looks amazing!2011-05-08 15:05:00

Author:
Wlachen
Posts: 45


I'll just leave this here:


http://www.youtube.com/watch?v=pLF_GsQmPdU



Couldn't help but laugh
2011-05-10 14:03:00

Author:
Jakeamorris25
Posts: 72


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.