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

Comments for UserInfo Jumbo Maze Demo

Return to UserInfo Jumbo Maze Demo

danpostdanpost

2014/4/2

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.
lordhersheylordhershey

2014/4/2

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.
danpostdanpost

2014/4/2

@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.
danpostdanpost

2014/4/2

@lordhershey, the one thing that you did get right -- 1 bit per room for visited.
Can i get its source code plz......my email id is rishav.ag.070919@gmail.com......PLzzzzzzzzzzzz.....help me
danpostdanpost

2014/4/2

@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!!!
lordhersheylordhershey

2014/4/2

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?
danpostdanpost

2014/4/2

@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.
danpostdanpost

2014/4/2

@Rishav_Agarwal, do not fret, the source will be included soon.
lordhersheylordhershey

2014/4/2

You just helped me figure out how I am going to save the maze in Bezerk. Thanks :D
lordhersheylordhershey

2014/4/2

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.
Entity1037Entity1037

2014/4/2

danpost you got this idea from my comment on bezerk, didn't you?
PointifixPointifix

2014/4/2

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
danpostdanpost

2014/4/2

@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.
Entity1037Entity1037

2014/4/2

Good point...
bournebourne

2014/4/3

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
bournebourne

2014/4/3

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.
bournebourne

2014/4/3

Oh I didn't realize you were restricting your maze into actual "rooms"
A new version of this scenario was uploaded on Thu Apr 03 04:23:43 UTC 2014
danpostdanpost

2014/4/3

Now you can view the codes of the Maze and Menu classes from the menu screen.
A new version of this scenario was uploaded on Thu Apr 03 04:58:25 UTC 2014
A new version of this scenario was uploaded on Thu Apr 03 05:05:36 UTC 2014
A new version of this scenario was uploaded on Sun Apr 06 23:22:37 UTC 2014 Added some gems that need to be collected.
A new version of this scenario was uploaded on Sun Apr 06 23:49:01 UTC 2014
danpostdanpost

2014/4/7

Any mazes saved between Sun Apr 06 23:22:37 and Sun Apr 06 23:49:01 should be discarded and a new maze started. Sorry for the inconvenience.
A new version of this scenario was uploaded on Mon Apr 07 15:00:16 UTC 2014
A new version of this scenario was uploaded on Mon Apr 07 15:11:03 UTC 2014
danpostdanpost

2014/4/7

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.
nizatenizate

2017/7/25

Does the userInfo save to the greenfoot server or to our personal computers?