1536 rooms, 4 possible entrances and 16 partitions in each room, visited status and location of player all restored. Virtual cake to anyone who can say how I did it.
Looks like you did the wall pieces like so, there are 16 points on the room that, if every piece has to exist you can use 2 bits to represent which way they point, even if you ensure that 2 pieces of wall cannot overlay each other there will be no way to block any exit from any other entrance. so it only takes 32 bits to describe the inner part of the room, deciding which exits to open take 1 bit each, that is 36 bits, 1 bit to say if it was visited, you can also have a bit to say the player is 'here' for a total of 38 bits, 5 bytes per room, 7.5k of store needed for the whole maze. I do not know if user info lets you save odd bytes encoded as chars. I am trying to work through something like this now.
@lordhershey, each room is divided into a 5x5 grid of sections. There are a possible 40 different locations for inner wall pieces (20 possible horizontally and 20 possible vertically).
Also, even a 5 bytes per room, if you could encrypt 4 bytes into one character in a string, then you will still use more than 1 character of a string per room. There are 1536 rooms, and only 250 String characters to work with. I would have to say that you are way off base as to how I did it, however.
@Rishav_Agarwal, sorry. The source will not be given until someone figures out how I was able to save the large maze using the limited storage available through UserInfo.
But i dont know about greenfoot much....plzz help me learn....i will not leak the source code......plzzzzzz......if you wish plz send it to my email id....above.....rishav.ag.070919@gmail.com!!!
I do not know anything about the user info - you only get 250 chars? Well then I would be way off. How about keep track of the random number seed that generated the maze, you can do that in 4 bytes and then use 192 bytes from rooms visited?
@lordhershey, how in the world did you come up with that!! Very close! Being the seed is a 'long' type, I had to break it up into two 'int's. I used a third 'int' for the players location. Finally, 16 bits per string character yields 96 characters. Still have available the score field, 7 general ints and 3 fifty-character Strings. I guess I will have to hurry up and document the code and upload it.
How did I come up with the idea? I remember the java.util.random which I have used in games before will always give you the same starting point if you do not seed the random number generator. I would leave it with the initial 0 seed to test since bugs had to be easy to reproduce to fix them, after I took care of them up to the point I would then I would seed the random number generator.
on each map there ar 25 elements, if im right, so you have to save a number for each cell, using characters, so if i say each single map-piece comsums 25 * 2 bits of one char letter, that means you need 7 chars for 1 map with a rest of 4 bits you can use for other info like visited or not ?! Max string length of 50 and max of string with 5 means 250 char letters devided by 7 means about 35 maps mhhmmm thats not a solution :DDD
but i think somehow like this you could have done this, maybe with bigger cells. But maybe another one already solved it i did not read de comments
@Entity1037, actually, no -- I had not seen that particular comment. However, if I had, I do not think I would have made such a fuss of having people guess how this was done.
I did a save feature in my Tangled Escape game and I used the random seed method, and used rest of data for determining the fog-of-war. This maze here is similar to my Workshop scenario where you are saving walls - which you should only need to save two walls per "cell/room" since the other two walls are shared with adjacents
Also, you might be interested in my scenario here (which is used to determine which characters are persistent with userinfo):
http://www.greenfoot.org/scenarios/10508
So you can determine the possible bitspace.
All mazes saved between Sun Apr 6 23:22:37 and Mon Apr 7 15:00:16 should be discarded and a new maze started. Visited rooms was not being saved properly. Ignore this, if you have no concern over this. Sorry for the inconvenience.
2014/4/2
2014/4/2
2014/4/2
2014/4/2
2014/4/2
2014/4/2
2014/4/2
2014/4/2
2014/4/2
2014/4/2
2014/4/2
2014/4/2
2014/4/2
2014/4/2
2014/4/2
2014/4/2
2014/4/3
2014/4/3
2014/4/3
2014/4/3
2014/4/7
2014/4/7
2017/7/25