Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (710)
Games in Android Showcase (212)
games submitted by our members
Games in WIP (784)
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 5941 times)
0 Members and 1 Guest are viewing this topic.
Offline appel

JGO Wizard

Medals: 80
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:

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?
Offline Mr_Light

Senior Devvie

Medals: 1


« 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 Devvie

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

start from some vertex and generate a tree randomly?


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

JGO Wizard

Medals: 80
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?
Offline broumbroum

Junior Devvie

« 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).


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

JGO Knight

Medals: 8
Projects: 8

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


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.

theagentd (74 views)
2017-02-18 13:42:33

theagentd (79 views)
2017-02-18 13:35:16

h.pernpeintner (1245 views)
2017-01-24 22:39:11

h.pernpeintner (1233 views)
2017-01-24 22:38:32

Galdo (1784 views)
2017-01-12 13:44:09

Archive (1899 views)
2017-01-02 05:31:41

0AndrewShepherd0 (2435 views)
2016-12-16 03:58:39

0AndrewShepherd0 (2286 views)
2016-12-15 21:50:57

Lunch (2365 views)
2016-12-06 16:01:40

ral0r2 (2154 views)
2016-11-23 16:08:26
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21 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‑
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!