This site requires JavaScript, please enable it in your browser!
Greenfoot back

bourne's Comments

Back to bourne's profile

Did you try again? I had some difficulty with this when I first uploaded this. Try logging out and back in. The only way that happens is if the following returns false: UserInfo.isStorageAvailable()
Some nice submitted maps. Will probably work on pulling data to include in upload next. Got most of it down already. Just need to try to incorporate some sort of management for Users over their maps. (probably will distinguish maps - from individual sets - by name. i.e. Saving of same map name will overwrite). But now I should study for finals...
Kinda guessed on a suitable length capacity, and included ability to skip over some bits that don't compress nicely. But of course a chaotic map won't compress well. Made sure that if the compression fails to actually shorten the data, then it isn't applied.
I rearranged the data so all the horizontal wall bits were together, followed by all the vertical wall bits, followed by the Game Object position place holder bits (that can reference their data which follows at end by ordering). Figure best way to get groups of same bit values together. So it compresses by run-length encoding. Will be using one of the UserInfo's ints to store syntax version.
I believe I got a compression working. Gonna test it some more. A blank map cost is at 224.
If you haven't already done so, please make a map to share with everyone. Thanks.
Yes. Characters 0 - 127 (excluding 13) are persistent through save/load. But you also have to exclude 92 (by itself it seems okay, but fails when followed by anything). So you have to adjust your final string of bits to never include these. Basically I parsed my string of bits and when found a leading 6 bits that could lead to one of the characters, I include these 6 bits plus a bit that makes it not one of these characters, incrementing index only by 6. Then have to accommodate when loading, looking for the leading 6 bits, ignoring the 7th. Doesn't happen too often, but will break your reader / saved data.
@darkmist255 Thanks! @Builderboy2005 Have you tried putting something together already? There's a couple characters you have to avoid when generating the final Strings to be saved.
I did just realize the wall bits don't have to be split up - was just the convenient thing for when writing/reading the Game Objects at the same time.