Procedural!

Published February 28, 2007
Advertisement
While I've always thought it would be fun to design fiendish puzzles for my game - I've always thought it would be orders of magnitude cooler to have the computer do it for me. The idea that there's a little Dungeon Master sitting behind the scenes thinking up cool puzzles and encounters for me to play through, crafting a little world just for me to explore.

There are lots of cool games which do things along these lines: Elite, Diablo, Nethack, Fate, Elder Scrolls, etc ... but pretty much all of them boil down to just randomising the landscape in which you fight randomised things for randomised items. Now don't get me wrong, I played Diablo ruthlessly until I had Windforce at my side and a keychain full of my friend's ears: but I really long for the exploration and puzzles that filled the isometric adventures of yesteryear: Head Over Heels, Fairlight, The Great Escape, Little Big Adventure. I want to be able to walk into a room in my own game, and scratch my head wondering what to do next.

So how exactly can I get the computer to actually assemble one of these isometric puzzles, or any puzzle for that matter? It's easy to just drop a few random objects onto some randomly placed platforms in a randomly shaped room, with some random doors to other random rooms - but how can the computer tell this is even traversable, yet alone a challenge for the player? How can the computer actually create a challenge - rather than just re-hashing pre-programmed/pre-assembled sections or hoping something clever emerges from the noise?

Well - a few weeks ago, I hatched a cunning plan that I'm hoping will get me there. It's a big multi-layered algorithm, but it should be quite easy to teach it how to use new objects, new characters, new art assets, new capabilities - so the generated levels will scale with me as I add new things into the game. It should also be quite easy to tune the output, asking it to generate a hard level, versus an easy one, a combat heavy one versus a more cerebral one. It's going to be a big project - I'm thinking around the order of a year.

The first step (of many, many steps) is to teach it how to turn a logical description of an area into a real scene the character can run about in. There are lots of ways to skin this cat, but the solution I'm playing with is kind of like a constraint based physics solver ... although the solver is more directed and focuses on detecting cases where there are no solutions. I've only just started, but here are the first procedurally generated rooms. They're still quite unrefined, but just seeing a navigatable environment that I didn't layout by hand myself was really satisfying. The key thing to note is that while these look like randomly scattered tiles - the computer understands what they are and where the player will be able to move. Indeed, it's constrained them so you can only get where it wants you to be able to get.

x

x

x

x

x

It still generates quite a few messy rooms (that are still valid, just very busy and/or hard to comprehend from an isometric perspective) - but I'll hold off adding more constraints to clean these up until I get a few more elements into the solver. The next step is to give the computer a purpose for the environment it's creating: get the player to this door, or item.


Cheers!



Previous Entry A mansion in the slums
Next Entry Proce-door-al
0 likes 6 comments

Comments

Ravuya
Too cool. You should keep us updated on how you're doing it; formulas and all.
February 28, 2007 08:33 PM
shadowcomplex
Way too cool (including the last post's screenshots as well).

I second Ravuya's desire to see the underbelly of such a beast.
February 28, 2007 09:06 PM
Prinz Eugn
I was going to say just "Cool," but I see that would be unoriginal.

So: Awesometacular.
February 28, 2007 11:27 PM
Aardvajk
Fascinating stuff. I normally check this journal because I adore your graphics but this constraints-based procedural generation stuff sounds really ambitious and interesting.

I've actually been playing a PC port of Head Over Heels recently and it is still as good as ever [smile].
March 01, 2007 04:00 AM
Milkshake
Thanks for the positive comments gents!

As far as this whole underbelly thing goes - let me get it doing something cool first!!! It's still very early days and what I have now is really just a proof of concept of a very small part of the algorithm. I've already started pulling it apart to generalise the solver to handle doors and multiple paths, and multiple characters, etc - so everything's really in flux at the minute. As I said (especially with a new bubby on the way), I'm guessing there's a year's work under the hood here, and right now I'm on day 4. If you have any specific bits you're interested in, ask away though.

And EasilyConfused - can I sign you up as my first alpha tester? You'll unfortunately need to wait a while, but Head Over Heels is exactly the kind of magic I'm trying to capture, so I'd love to get feedback on things which just don't "feel" right from other fans of that game when the time comes.
March 01, 2007 08:55 AM
Aardvajk
Quote:Original post by Milkshake
And EasilyConfused - can I sign you up as my first alpha tester? You'll unfortunately need to wait a while, but Head Over Heels is exactly the kind of magic I'm trying to capture, so I'd love to get feedback on things which just don't "feel" right from other fans of that game when the time comes.


That would be great. I grew up on Head Over Heels on the ZX Spectrum back in the golden days of computing.

Drop me a PM if you want to talk about this further. I don't have a vast amount of time to commit but I'd be overjoyed to alpha test this for you.
March 01, 2007 10:43 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

Moose Sighting

1343 views

Constraints

1512 views

Moose

1249 views

Melon Golf

1792 views

Toon

1312 views

Spaceships

1064 views

Rendering Pt2

1157 views

Hardware Shaders

1191 views
Advertisement