Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (120)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Tile puzzles...  (Read 4505 times)
0 Members and 1 Guest are viewing this topic.
Offline appel

JGO Wizard


Medals: 51
Projects: 4


I always win!


« Posted 2008-01-30 23:07:35 »

I'm trying to figure out how to generate a puzzle like this:

http://java4k.com/index.php?action=games&method=view&gid=119
and
http://www.leikjanet.is/?gluggi=leikir_spila&leikur=1240


The grid is of 8x8.

I thought I could simply generate a maze, and then randomly rotate the tiles/nodes.

Anyone implemented something like this before?

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline Mr_Light

Senior Duke


Medals: 1


shiny.


« Reply #1 - Posted 2008-01-30 23:48:26 »

whats the question again  Kiss

It's harder to read code than to write it. - it's even harder to write readable code.

The gospel of brother Riven: "The guarantee that all bugs are in *your* code is worth gold." Amen brother a-m-e-n.
Offline g666

Junior Duke





« Reply #2 - Posted 2008-01-31 10:48:42 »

start from some vertex and generate a tree randomly?

 Smiley

desperately seeking sanity
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline appel

JGO Wizard


Medals: 51
Projects: 4


I always win!


« Reply #3 - Posted 2008-01-31 12:46:18 »

Ok, the question is: How do I generate a puzzle like that?

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline broumbroum

Junior Duke





« Reply #4 - Posted 2008-01-31 22:20:41 »

looking at the nodes in this puzzle I'd begin resolving the puzzle first and randomizing it right after it is created...

* (~) ----+---- <o)     : this is solved  and then randomize it

       
                  |
                  |
* (~)         +           <o)      : this looks like unsolved (nodes are randomized and the light-bubbles stay).
                  |
                  |
 Cool


                                                                                                             

::::... :..... :::::: ;;;:::™ b23:production 2006 GNU/GPL @ http://b23prodtm.webhop.info
on sf.net: /projects/sf3jswing
Java (1.6u10 plz) Web Start pool
dev' VODcast[/ur
Offline jojoh

JGO Knight


Medals: 5
Projects: 7


games4j.com


« Reply #5 - Posted 2008-02-01 15:39:20 »

Cool
Smiley

I assume that he figured as much as that he had to randomly rotate the tiles. I think there is more of a problem to:
  • Generate the maze in the first place
  • Make sure there are no empty tiles
  • Make sure that all tiles will have to be used (no sections not connected to the rest of the network)
  • No dead ends
  • Same number of bulbs for each generated puzzle (or at least about the same)
  • Only one solution exists (not sure if this is NEEDED, but probably the way it should be.
  • No loops
  • ...

The code for jnetwalk was published, so hints could be in there, but it was a 4k game so he did some cheating I think.

Have not thought much about it, but I think you could create a big room and then split with a horizontal and a vertical line/wall at random places. Add 3 doors at random places on 3 different subsections of the walls. That way you can get to everywhere from everywhere. Then recursively subdivide the 4 new rooms the same way until it isn't possible to subdivide anymore. Then you should have a maze with no loops and everything connected. You are looking for a network, so replace every path with a line and remove the walls. Just place the hub at a random place and a "bulb" at every dead end. Think that should solve most of the problems. Not sure if this would only give one solution, and number of bulbs could vary, so there might be a better way to do it, but it seems like a fairly easy way to create it. I have not tried to implement anything like this, just seemed like a fun challenge to figure out. Hope I didn't overlook any problems with it.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (43 views)
2014-10-16 15:22:06

Norakomi (33 views)
2014-10-16 15:20:20

lcass (37 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (67 views)
2014-10-14 00:35:47

TehJavaDev (60 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (86 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!