Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

998174 Posts in 39144 Topics- by 30553 Members - Latest Member: drako30

April 18, 2014, 12:05:49 AM
TIGSource ForumsDeveloperTutorialsBraving Procedural Generation
Pages: [1] 2 3 ... 30
Print
Author Topic: Braving Procedural Generation  (Read 146353 times)
ChevyRay
Guest
« on: March 10, 2009, 08:43:01 PM »

I've written yet another article Smiley this one is less technical, and contains an ActionScript source for my previous cave-generation algorithm.

Latest Article



This time, I featured a lot of the source files and images posted here. Keep showing your stuff, guys Smiley this is a great topic so far!



----------



New tutorial/experimentation is up. Smiley

This time it's creating heightmaps and applying mathematical curves to optimize them!





----------



I wrote a very large article today documenting my first experiences with procedurally generated content for games, and thought I'd share it here. While it's not technically a tutorial, I explain a lot of the methods I used and how I went about getting my fingernails dug into this world of game development that I've been sidelining for so long.

http://properundead.com/2009/03/cave-generator.html

Basically, I wrote this to show how procedural programming can be broken down and understood, even by an amateur programmer (aka. me) using GM. I think a lot of indie developers life myself daydream games with these kinds of systems, but get intimidated by worlds like "procedural" and "algorithm", and I wanted to tame the concepts down a bit.

I tried making the articles as rhetoric as they are technical, so they can be understood from both frames of mind Smiley and I think a lot can be learned just from reading into another person's learning experience.

So I'm sharing mine with you.



« Last Edit: August 12, 2011, 12:23:08 PM by ChevyRay » Logged
Lynx
Level 5
*****


Upstart Feline Miscreant


View Profile WWW Email
« Reply #1 on: March 10, 2009, 11:05:06 PM »

Great job!  Fascinating to see how you went about iterating your cave generation system.
Logged

Currently developing dot sneak - a minimalist stealth game
Lynx
Level 5
*****


Upstart Feline Miscreant


View Profile WWW Email
« Reply #2 on: March 10, 2009, 11:27:44 PM »

Some additional thoughts:

* It'd be useful to identify caves somehow as distinct areas.

* Caves that are far from the path might be candidates for 'grand treasures' - treasure chests in the center, with guardian monsters

* Following the A* path, you could place guardian monsters at the ends of those caves

Let's say the entrance is always in 'cave 1'.  Then you expand from there and identify all other squares with at least 3 open squares adjacent as also 'cave 1'.

Squares with only 2 open squares are considered to be tunnels.  Follow and mark them so you don't visit them again, but don't assign them to caves.

Keep a running count of how many cells each cave has.  This lets you decide how many monsters a cave needs to feel 'populated'.  Caves of low size are just swellings within tunnels and can be disregarded.

This algorithm might need some tweaking since it'd count that big area in the example where the red square is as one big cave, but there's a 2-wide tunnel.

Totally untested idea, inspired by your procedural map generation article. Smiley
Logged

Currently developing dot sneak - a minimalist stealth game
Eclipse
Level 10
*****


0xDEADC0DE


View Profile WWW Email
« Reply #3 on: March 11, 2009, 03:21:12 AM »

very nice article Chevy, congrats and tophats to ya  Gentleman
Logged

<Powergloved_Andy> I once fapped to Dora the Explorer
Ataraxia
Level 0
**


View Profile Email
« Reply #4 on: March 11, 2009, 08:01:02 AM »

Awesome! Thanks a lot for this, I've been wondering how to do this kind of thing for a little while!
Logged
george
Level 7
**



View Profile Email
« Reply #5 on: March 11, 2009, 11:19:45 AM »

Great looking caves, and I like this 'rhetorical' style!  Beer!
Logged
William Laub
Level 10
*****


Gold Cray


View Profile WWW Email
« Reply #6 on: March 11, 2009, 11:56:33 AM »

This is very nice. I've spent months working on algorithms with similar ideas but never managed to come up with something so simple nor so effective.

Edit: A quick python implementation of your algorithm made this in a matter of seconds. It's already much closer a decent 2d platformer cave than anything of my algorithms, and it runs hundreds of times more quickly.

« Last Edit: March 11, 2009, 01:24:00 PM by Gold Cray » Logged

Digital Modular Theremin: A new KiNd of Theremin<br />C C++ Python Verilog Java VBA C# Fortran
ChevyRay
Guest
« Reply #7 on: March 11, 2009, 02:08:27 PM »

Nice, cold cray! :D

Yeah, my favorite thing about the cave algorithm was how fast it was. Even if I add a recursive check to keep it from being too small, it still finds an appropriate size and creates it within a second.
« Last Edit: March 11, 2009, 04:55:03 PM by ChevyRay » Logged
Kneecaps
Level 3
***



View Profile Email
« Reply #8 on: March 11, 2009, 05:36:11 PM »

Awesome!  I've never been able to completely figure out PG, and you made the explanation really simple.  After following the terrain thingy, I duplicated the method in Flash.  Click to generate a new map.  It takes about a second to generate for me due to the size of the map (and because I could probably make some more optimizations).

Thanks for the article!
Logged
ChevyRay
Guest
« Reply #9 on: March 11, 2009, 05:42:17 PM »

Well, procedural generation is something that can be approached in countless different ways, all I did was show a couple particular methods that I used and tried to explain them in a simple way to show people that PG is a fun game to play Smiley

I'm really glad to see people learning and benefiting from this, though!

EDIT: That works very nicely, Kneecaps.
Logged
ஒழுக்கின்மை
Level 10
*****


Also known as रिंकू.

RinkuHero
View Profile WWW Email
« Reply #10 on: March 11, 2009, 11:16:57 PM »

It takes me less than a second, it seems to generate as fast as I can click. Maybe my CPU is just better at it or something. Really nice though. Any chance you could let us see the source code?
Logged

Hayden Scott-Baron
Level 10
*****


also known as 'Dock'


View Profile WWW Email
« Reply #11 on: March 12, 2009, 12:56:19 AM »

Excellent article, thanks for sharing!

'Random caves' are on my shortlist for techniques I'd like to develop. I suspect I'll give them a go at some point after I ship the game I'm working on.
Logged

Mipe
Level 10
*****


Migrating to imagination.


View Profile
« Reply #12 on: March 12, 2009, 01:30:57 AM »

The site seems unresponsive.  Undecided
Logged
ChevyRay
Guest
« Reply #13 on: March 12, 2009, 01:41:14 AM »

Server's down right now Sad sorry guys. I'll post here when it comes back up.
Logged
ChevyRay
Guest
« Reply #14 on: March 12, 2009, 03:47:00 AM »

Okay, the site is working again!
Logged
Pages: [1] 2 3 ... 30
Print
Jump to:  

Theme orange-lt created by panic