Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Chat / Maze Generator and 3D Conversion

Author
Message
puzzler2018
User Offline
Joined: 8th Oct 2017
Location:
Posted: 7th Jul 2018 16:40
Hello

Ive managed to solve a backtracking algorithm to create mazes and generate save file, load file and convert to 3D


Generator itself with a save function (to Level1.Dat this can be changed to suit your needs) - stores in your Appdata area



A loader of the saved file Level1.Dat - the file you create from the above app will need to be moved into this apps media folder to load it



A 3D Generator from a saved Level1.dat - again, copy a generated file to this apps media folder



Must admit, its nothing dramatically fancy - thats for you to decide how to take it from here, this is just to get you started

Ive added an already pre-generated level1.dat files, so can test them each on the loader and 3D one
Enjoy

PS.. England might go through!!! - Yeah!

Attachments

Login to view attachments
fubarpk
AGK Developer
Gold Codemaster
13
Years of Service
Recently Online
Joined: 11th Jan 2005
Location: Adelaide
Posted: 7th Jul 2018 22:03 Edited at: 7th Jul 2018 22:05
great work with the maze generator

Hahahaha I left it to go then started trying to solve the maze, thinking go from top left to bottom right and I was lost
but great stuff. I will take bread crumbs next time
fubar
puzzler2018
User Offline
Joined: 8th Oct 2017
Location:
Posted: 7th Jul 2018 22:26
Thank you
puzzler2018
User Offline
Joined: 8th Oct 2017
Location:
Posted: 7th Jul 2018 22:34 Edited at: 7th Jul 2018 22:35
I used algorithm from https://en.wikipedia.org/wiki/Maze_generation_algorithm

Particularly
Quote: "
Recursive backtracker on a hexagonal grid

The depth-first search algorithm of maze generation is frequently implemented using backtracking:

Make the initial cell the current cell and mark it as visited

While there are unvisited cells

If the current cell has any neighbours which have not been visited

Choose randomly one of the unvisited neighbours

Push the current cell to the stack

Remove the wall between the current cell and the chosen cell

Make the chosen cell the current cell and mark it as visited

Else if stack is not empty

Pop a cell from the stack

Make it the current cell
"
puzzler2018
User Offline
Joined: 8th Oct 2017
Location:
Posted: 7th Jul 2018 22:48 Edited at: 7th Jul 2018 22:50
The generation aspect is not really for live maze generation must admit or Loading of an App - any game used by this would require pre-generated mazes

eg

Level1.dat
Level2.dat
Level3.dat
...
...
...
...
Level100.dat

d each of the levels pre-generated in any levelled game.

Im sure you all get my meaning.
fubarpk
AGK Developer
Gold Codemaster
13
Years of Service
Recently Online
Joined: 11th Jan 2005
Location: Adelaide
Posted: 7th Jul 2018 23:13
Quote: "Im sure you all get my meaning.
"

Yep

Quote: " I will take bread crumbs next time "

Thats an idea for a game with it. You could have a path of bread crumbs and position birds or something that move around the maze eating the bread
crumbs. I will have a good look at your Algorythm some time as that could also work for moving other things moving in the maze perhaps following lilke
bread crumbs but keeping a mark on where they have been basically working the maze out in relation to where you are located.



fubar
puzzler2018
User Offline
Joined: 8th Oct 2017
Location:
Posted: 7th Jul 2018 23:27
lol

world is your oyster or your own creations with it now x
puzzler2018
User Offline
Joined: 8th Oct 2017
Location:
Posted: 14th Jul 2018 23:24
I must say the generation is somewhat theraputic to watch and quite exciting for it to try and reach the blank spaces.
fubarpk
AGK Developer
Gold Codemaster
13
Years of Service
Recently Online
Joined: 11th Jan 2005
Location: Adelaide
Posted: 15th Jul 2018 00:09
Quote: "I must say the generation is somewhat theraputic to watch"

I thought that to when I first saw it. ( a great piece of code)
fubar
Cliff Mellangard 3DEGS
Developer
12
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 17th Jul 2018 12:39
Loving it...
Always wanted to do one but never got to it
puzzler2018
User Offline
Joined: 8th Oct 2017
Location:
Posted: 18th Jul 2018 22:09 Edited at: 18th Jul 2018 22:11
Thanks- you will need to make adjustments to the 3D world one, but the principle is there - fit to your requirements if you use it
Cliff Mellangard 3DEGS
Developer
12
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 22nd Jul 2018 01:11
i used your sample for a small game prototype…..
Will try to upload it in a few Days...
Iam cutting away a few bugs Before..
a very simple old school rpg

Cliff Mellangard 3DEGS
Developer
12
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 22nd Jul 2018 10:25
Here it is and keep in mind that this where mocked up i a few Days only to try a concept for a pocket rpg..
https://play.google.com/store/apps/details?id=com.play8bitars.narpg
puzzler2018
User Offline
Joined: 8th Oct 2017
Location:
Posted: 22nd Jul 2018 10:29
Wow - and you did this using my generator - thats super impressive. Im happy to have helped
Cliff Mellangard 3DEGS
Developer
12
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 22nd Jul 2018 10:34
The game would not exist without your code
Art work is stuff i have purchased thats why it where pretty fast to do
puzzler2018
User Offline
Joined: 8th Oct 2017
Location:
Posted: 22nd Jul 2018 10:40
Jst tried it and I dont have a clue what to do - its just spining around in circles and not going anywhere - but then im not one for playing games - I just create them lol
Cliff Mellangard 3DEGS
Developer
12
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 22nd Jul 2018 12:23
That sounds weird
You tilt the phone up or down to move forward or back..
divided the screen in left and right for turning
Does it constantly keep on turning on your device?
wath device do you have?
puzzler2018
User Offline
Joined: 8th Oct 2017
Location:
Posted: 22nd Jul 2018 12:39
Yeah ive got it now. I forgot to tap to change its direction and then tilt forward and back to move forward or backward in the direction

Cheers - its quiet fun
Cliff Mellangard 3DEGS
Developer
12
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 22nd Jul 2018 12:59 Edited at: 22nd Jul 2018 13:00
Made a Quick instruction



Iam going to add alot next week because iam away today to party all day


Its the sharing of code samples i love about the tgc forum …
i would never figure the maze generator out
puzzler2018
User Offline
Joined: 8th Oct 2017
Location:
Posted: 22nd Jul 2018 13:09
Thanks Cliffe - great tutorial

I would never knew how to do it too, not without The Coding Train youtuber
Cliff Mellangard 3DEGS
Developer
12
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 23rd Jul 2018 23:35
You should put this in the codebase on the tgc site?
fubarpk
AGK Developer
Gold Codemaster
13
Years of Service
Recently Online
Joined: 11th Jan 2005
Location: Adelaide
Posted: 28th Jul 2018 04:25 Edited at: 28th Jul 2018 08:54
Always wanted to do a 3D puzzle well last night I stopped procrastinating and got to work
and wanted to show my progress it is very short but i took advantage of using includes so
to test it you will have to make a project and add the following files

Labrynth 3D

main.agc



Declarations.agc


CreateMaze.agc



I had to invert the maze drawing so as rotations of sprites would be correct etc
How to play
Start at bottom left of maze and work your way to top right corner
If you take to long a munchkin will eat you he eats everything in site
including the trail of bread crumbs you leave behind


The maze is generated real time i still need to not use the save load method
I am currently using
fubar
fubarpk
AGK Developer
Gold Codemaster
13
Years of Service
Recently Online
Joined: 11th Jan 2005
Location: Adelaide
Posted: 28th Jul 2018 04:27 Edited at: 28th Jul 2018 04:44
Wasn't trying to copy your idea Cliff hence why mine is a bit different, yours was just so good it inspired me
and you have made use of really good controls I feel and I love your popup enemies too
fubar
puzzler2018
User Offline
Joined: 8th Oct 2017
Location:
Posted: 29th Jul 2018 06:46
Wow thats super cool too - I love them both and when your enemy starts eating those pips, he comes and gets you thick and fast, as much that we need to stop concentrating on
taking it nice and steady around the maze to fast and furious.

Well done to both of you
fubarpk
AGK Developer
Gold Codemaster
13
Years of Service
Recently Online
Joined: 11th Jan 2005
Location: Adelaide
Posted: 29th Jul 2018 09:19
Thanks Puzzler

I also went for the classic look think I prefer this Character that gets you rather than the werewolf I originally did
fubar

Login to post a reply

Server time is: 2018-08-14 10:19:38
Your offset time is: 2018-08-14 10:19:38