It is currently Mon May 22, 2017 2:28 pm



Welcome
Welcome to rfobasic

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today. **You are not required to provide truthful information to any registration questions. Be whomever you wish to be.!


Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: MOL - Monsters Of the Labyrinth
Unread postPosted: Tue Dec 27, 2016 11:48 am 
Offline
User avatar

Joined: Tue Mar 05, 2013 5:19 am
Posts: 590
Location: Netherlands
Hi All,

A new game just before the end the year.
It's a maze game. I hope it's easy to find out how it works.
There are nine levels. Each higher level the maze is one cell bigger.
Mazes are completely random, so it might be possible that e.g. level 7 is
easier than level 5.....Therefore I have not implemented hi-scores etc.

The apk can be found here http://laughton.com/basic/programs/games/MOL/MOL.apk
The source and data here http://laughton.com/basic/programs/games/MOL/source/MOL.bas and here http://laughton.com/basic/programs/games/MOL/data/

FYI. The Depth-first search algorithm is used to generate a maze. The so-called
right hand rule is used to solve a maze.
I have tried recursive procedures to generate a maze. I (not sure) think these
failed due to Android stack problems.

Some shots:
Image

Image

_________________
To view all my Apps in the BASIC! repository: http://laughton.com/basic/programs/Author_Index/Aat.pdf

When Sod's Law equals Murphy's Law you are bound to be on the right track....!


Last edited by Aat on Tue Dec 27, 2016 2:37 pm, edited 1 time in total.

Report this post
Top
 Profile  
 
 Post subject: Re: MOL - Monsters Of the Labyrinth
Unread postPosted: Tue Dec 27, 2016 1:12 pm 
Offline
User avatar

Joined: Sat Oct 04, 2014 5:45 am
Posts: 639
Well done Aat !

_________________
Download and tutorial for RFODESIGNER
https://sites.google.com/site/rfodesigner/


Report this post
Top
 Profile  
 
 Post subject: Re: MOL - Monsters Of the Labyrinth
Unread postPosted: Tue Dec 27, 2016 1:17 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 5:19 am
Posts: 590
Location: Netherlands
Thanks, Emile!

_________________
To view all my Apps in the BASIC! repository: http://laughton.com/basic/programs/Author_Index/Aat.pdf

When Sod's Law equals Murphy's Law you are bound to be on the right track....!


Report this post
Top
 Profile  
 
 Post subject: Re: MOL - Monsters Of the Labyrinth
Unread postPosted: Tue Dec 27, 2016 11:33 pm 
Offline
User avatar

Joined: Mon Aug 18, 2014 1:16 pm
Posts: 1336
Supper game, Love the little man.

Must be quite a programing challenge to do all the different mazes.

Well done

Regards Roy


Report this post
Top
 Profile  
 
 Post subject: Re: MOL - Monsters Of the Labyrinth
Unread postPosted: Wed Dec 28, 2016 4:36 am 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 836
Location: France
Nice game Aat,

An impressive work as usual :shock: :)

It reminds me a code I wrote here : Maze & PathFinder where I tried the Astar algorythm.
It's very fast : less than 2 sec. for a 41 x 41 cells grid to make a maze and less than 1 sec to find a path !!!

Did you try the A-star algorythm?

Cheers

Gilles

_________________
"It is better to mobilize intelligence for stupid things, rather than mobilizing stupidity for intelligent things."
Galaxy TAB S 8.4, 2560x1600, Marshmallow 6.0.1
Galaxy Note II, 1280x720, JB4.1.2
Galaxy A3, 1280x720, Android 6.0.1


Report this post
Top
 Profile  
 
 Post subject: Re: MOL - Monsters Of the Labyrinth
Unread postPosted: Wed Dec 28, 2016 12:03 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 5:19 am
Posts: 590
Location: Netherlands
Thanks a lot, Roy and Gilles,

@Gilles - I remember you wrote a maze program. During the search for various algo's I did not come
across one called the A-star. Now I know the name I will try to find out more about it.
If I can't figure it out I will have a look at your source (and maybe come up with questions.... :oops: ).

@ Roy - the different mazes are all generated by the same routine.....and yes, it was a pleasant challenge!

thanx again guys,

Aat

_________________
To view all my Apps in the BASIC! repository: http://laughton.com/basic/programs/Author_Index/Aat.pdf

When Sod's Law equals Murphy's Law you are bound to be on the right track....!


Report this post
Top
 Profile  
 
 Post subject: Re: MOL - Monsters Of the Labyrinth
Unread postPosted: Wed Dec 28, 2016 12:21 pm 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 836
Location: France
Yes Aat, when you want.

I'm confident : the parts MazeGenerate: & pathfindOK: of my code could be used with some little modifications in your.

Cheers

Gilles.

_________________
"It is better to mobilize intelligence for stupid things, rather than mobilizing stupidity for intelligent things."
Galaxy TAB S 8.4, 2560x1600, Marshmallow 6.0.1
Galaxy Note II, 1280x720, JB4.1.2
Galaxy A3, 1280x720, Android 6.0.1


Report this post
Top
 Profile  
 
 Post subject: Re: MOL - Monsters Of the Labyrinth
Unread postPosted: Wed Dec 28, 2016 3:20 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 5:19 am
Posts: 590
Location: Netherlands
Hi Gilles,

I've taken a look at your source code. I am ashamed to say I did not have a look at it before.......
Of course it's hard to completely understand it.
I now understand you use the A* algo for solving the maze (not creating it). It sure is fast.
The way you create the maze is similar to the way I did it. Though I am not sure it's DFS.
In a nutshell: randomly visiting all cells, looking at neighbours and removing walls.

Anyway, I really enjoyed making the routines. I used the Wikipedia definitions of DFS and right hand rule
as a starting point.

Regards, Aat

_________________
To view all my Apps in the BASIC! repository: http://laughton.com/basic/programs/Author_Index/Aat.pdf

When Sod's Law equals Murphy's Law you are bound to be on the right track....!


Report this post
Top
 Profile  
 
 Post subject: Re: MOL - Monsters Of the Labyrinth
Unread postPosted: Thu Dec 29, 2016 1:23 am 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 836
Location: France
Hi Aat,

Aat wrote:
In a nutshell: randomly visiting all cells, looking at neighbours and removing walls.
just doing this are you sure to always have a solution for the maze?

I do not know either if I used the Depth First Search algorithm, but you understand everything about my code.
It does not bother you if I try to write this game on my side?

Cheers

Gilles

_________________
"It is better to mobilize intelligence for stupid things, rather than mobilizing stupidity for intelligent things."
Galaxy TAB S 8.4, 2560x1600, Marshmallow 6.0.1
Galaxy Note II, 1280x720, JB4.1.2
Galaxy A3, 1280x720, Android 6.0.1


Report this post
Top
 Profile  
 
 Post subject: Re: MOL - Monsters Of the Labyrinth
Unread postPosted: Thu Dec 29, 2016 5:00 am 
Offline
User avatar

Joined: Tue Mar 05, 2013 5:19 am
Posts: 590
Location: Netherlands
Salut Gilles,

Quote:
just doing this are you sure to always have a solution for the maze?

Yes, the way of randomly going through the cell grid ensures there's always a solution.

Quote:
It does not bother you if I try to write this game on my side?

Do go ahead! I am sure it can become better.
If you want the maze to be rectangular i.s.o. square you will have to add something. At the
moment x and y directions are treated the same.
If you want the maze to be more oriented in one direction, you can add weighing factors to
influence the randomness.
I look forward to your implementation!

Cheers, Aat

_________________
To view all my Apps in the BASIC! repository: http://laughton.com/basic/programs/Author_Index/Aat.pdf

When Sod's Law equals Murphy's Law you are bound to be on the right track....!


Report this post
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
suspicion-preferred