Latest Uploads
Kuron Cap Get!

rychan

Merry Christmas

Jayenkai

Invasion V ... tup screen

rychan

image-07-1 ... -20-59.jpg

Jayenkai

PixeLink - ... oween 2014

rockford

PixeLink P ... zle Editor

rockford

Forum Home

PlayMyCode: Tiled Procedural Caves/Maps

UserMessage
Posted : Monday, 07 May 2012, 03:09 | Permalink
Krakatomato


A few months ago I was playing around with procedural cave generation and came across an idea by Noel Berry that used the concept of "miners" to create the map. I knocked up a prototype using PlayMyCode which produced the following:



Obviously, the above is pretty ugly and needs to be tiled to look more like a map. The usual approach is to use a shedload of nested if/else statements, but last night I came across this incredible idea:

www.saltgames.com/2010/a-bitwise-method-for-applying-tilemaps/

so I applied it (very quickly I might add) to the above map generator and ended up with:



(Use the arrow keys to move the map around and hold down shift and press up or down to scale it)

The tiling code is ridiculously short and simple - amazing

The source code is available on PMC.
Homepage : http://www.fivesprites.com
Posted : Monday, 07 May 2012, 12:57 | Permalink | Mark Here
rockford


We discussed something like this before - socoder.net/index.php?topic=2308&seenpost=26508#26508
Posted : Monday, 07 May 2012, 14:15 | Permalink | Mark Here
Krakatomato


Thanks for the excellent link - provides greater detail to the other I posted
Homepage : http://www.fivesprites.com
Posted : Tuesday, 08 May 2012, 10:21 | Permalink | Mark Here
daniel11111112


awesome ive been thinking of starting a dungeon crawler/rpg but didnt know how to do a randomly generateing map so ill try this :3
Latest Posts
Daily Doodles
Jayenkai Fri 05:14
FauxLego
Kuron Thu 18:11
Great Big Youtube thread
Jayenkai Thu 14:51
Happy Birthday Pakz
Pakz Thu 11:37
Beating the Invading Army
rockford Thu 07:05
What Have You Done - Feb 2015
Jayenkai Thu 05:40
Pebble Time (aka Pebble 2)
spinal Wed 13:46
Kuron's Mum
Kuron Wed 11:57
''Is SoCoder Down?''
Kuron Wed 05:24
Hospital Visit - Feb 2015
spinal Tue 13:35
More

Latest Items
Snippet : IFS Fractal Viewer
Andy_A Mon 14:20
Snippet : Rotating Sphere
Andy_A Tue 14:25
Showcase : Futrino
Jayenkai Thu 06:16
Showcase : Millenipede
Steve Elliott Mon 17:44
Showcase : Flappy New Year
rychan Wed 02:49
Snippet : Simple stack-based interpreter
tbohon Wed 12:08
Link : Protolol
Afr0 Tue 10:53
Showcase : Santa's Workout 2
jayparker Tue 00:43
Dev-Diary : Stripping it All Away
Jayenkai Mon 01:57
News : Newsletter #245
rychan Fri 06:36
Showcase : GPS Fun Runner 3D
zzoom Wed 15:35
Showcase : The Biggest Snowman
rychan Mon 01:06
News : Newsletter #243
Dabz Thu 03:29
Dev-Diary : Scaling Back
rychan Wed 14:33
Showcase : Alpha Collexion
rychan Wed 06:23
More

Who's Online
Jayenkai
Fri, at 09:24
steve_ancell
Fri, at 08:53
Dabz
Fri, at 07:41
rockford
Fri, at 06:35
Kuron
Fri, at 06:08
shroom_monk
Fri, at 05:51
spinal
Fri, at 03:09
blanko1324
Thu, at 20:56
Pakz
Thu, at 11:37
Krakatomato
Thu, at 11:05
Link to this page
Site : Jayenkai 2006-Infinity | MudChat's origins, BBCode's former life, Image Scaler.