Live data from Hacker News

Show HN: Linjat, a small puzzle game

linjat.snellman.net

21–30 of 38 posts

Re: Show HN: Linjat, a small puzzle game

#21
post #2

This game was originally designed as a substrate for experimenting with procedural puzzle generation (for generating interesting puzzles given a rules set, not for generating new rules sets). I thought I'd post it here, since it ended up being kind of fun to play in it's own right, not just an algorithmic experiment.

I was wondering as I played it if you had come up with some 'evil' to create the levels, as each one has an element of 'gotcha' to them. Any info on how you did this? Novice programmer here, and probably not capable of understanding anything too complex, but I'd be interested if there's anything you could point me at to try to understand how you do this sort of thing.

Basically the level generator consists of three stages.

Stage one is just to generate a level by randomly placing numbers on the grid.

Stage two is to run a special solver for the puzzle, which tries to solve the puzzle the way a human would (applying different kinds of local deduction rules, e.g. "only this number can reach that dot, so that's how the line has to be drawn" or "there's not enough space to draw this line vertically, so it has to be horizontal", and then a handful more of increasing complexity). If the solver gets stuck, it adds more dots to the board, with the locations of the dots being such that they're going to provide as little information as possible at the start of the game.

That gives a seed puzzle to work with, which is solvable but usually not very interesting.

Stage three is optimizing the puzzle. That's done with what's basically a hill-climbing algorithm. So take a puzzle (either the original, or a better puzzle that's been found during the optimization) and change it a bit by moving or changing the numbers. Then run the solver again on the modified board, but with all the dots removed. If the new puzzle is solvable, it's scored on a bunch of metrics, and if it's good enough it goes into the pool of improved puzzles for the next iteration to work on.

Obviously for this to produce the feeling of gotchas, the metrics have to be chosen to match human intuition on easy vs. hard moves. That's the tricky part.

That's the gist of it. I'm planning on writing a blog post on it later with more details.

Re: Show HN: Linjat, a small puzzle game

#25
post #21

Earlier quoted context omitted.

I was wondering as I played it if you had come up with some 'evil' to create the levels, as each one has an element of 'gotcha' to them. Any info on how you did this? Novice programmer here, and probably not capable of understanding anything too complex, but I'd be interested if there's anything you could point me at to try to understand how you do this sort of thing.

Basically the level generator consists of three stages. Stage one is just to generate a level by randomly placing numbers on the grid. Stage two is to run a special solver for the puzzle, which tries to solve the puzzle the way a human would (applying different kinds of local deduction rules, e.g. "only this number can reach that dot, so that's how the line has to be drawn" or "there's not enough space to draw this l…

I am looking forward to your blog post. I tried a random Sudoku generator back in the Flash days, and all of the feedback was that players could tell the puzzles were completely randomly generated. Please ping me when the blog post is up. Thank you.

Re: Show HN: Linjat, a small puzzle game

#28

I love it. Was a bit confused at fist since the lines can be extended in both ways. Yeah, i see this as an little addictive game. Do you have it on IOS?

It's 2048 all over again.

I too had problems realising you could drag the lines in both directions, obvious after the tutorial; but who's got time for that!

Re: Show HN: Linjat, a small puzzle game

#29
post #21

Earlier quoted context omitted.

I was wondering as I played it if you had come up with some 'evil' to create the levels, as each one has an element of 'gotcha' to them. Any info on how you did this? Novice programmer here, and probably not capable of understanding anything too complex, but I'd be interested if there's anything you could point me at to try to understand how you do this sort of thing.

Basically the level generator consists of three stages. Stage one is just to generate a level by randomly placing numbers on the grid. Stage two is to run a special solver for the puzzle, which tries to solve the puzzle the way a human would (applying different kinds of local deduction rules, e.g. "only this number can reach that dot, so that's how the line has to be drawn" or "there's not enough space to draw this l…

Very enjoyable game! I'm quite interested in procedurally generated puzzles so looking forward to that blog post. I've experimented with generating and ranking Sudokus automatically in a way that attempts to reflect difficulty for a human. The goal, of course, is a Universal Puzzle Generator. I'll let you know when it's done...

Re: Show HN: Linjat, a small puzzle game

#30
post #2

This game was originally designed as a substrate for experimenting with procedural puzzle generation (for generating interesting puzzles given a rules set, not for generating new rules sets). I thought I'd post it here, since it ended up being kind of fun to play in it's own right, not just an algorithmic experiment.

Considering flagging this, I definitely do not need this in my life. Works beautifully on Android/chrome, you really nailed the user interface. Maybe add a way to mark some lines as the only possibility... Going to ruin some of my friends productivity too
Post reply on HN