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
Max Headroom : GIGO
rockford Fri 15:17
Dipping My Toes in the Unity Pool
Jayenkai Fri 13:27
Kuron's Corral
Kuron Fri 10:31
Unreal and Unity : Free
Kuron Fri 07:03
RIP Maxis! :(
Jayenkai Fri 05:42
Bathrooms
Kuron Fri 05:22
Daily Doodles
Jayenkai Fri 04:00
Amiga GOD is Back in 1080p!
steve_ancell Thu 17:19
Farewell Maxis
Jayenkai Thu 12:07
Pebble Time (aka Pebble 2)
Jayenkai Thu 07:07
More

Latest Items
Woot : Three Years Later...
Kuron Fri 07:05
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
More

Who's Online
Hotshot
Fri, at 18:26
Kuron
Fri, at 18:02
rychan
Fri, at 17:48
Pakz
Fri, at 17:28
rockford
Fri, at 15:56
Jayenkai
Fri, at 15:38
Dabz
Fri, at 15:08
spinal
Fri, at 13:21
blanko1324
Fri, at 13:18
steve_ancell
Fri, at 13:05
Link to this page
Site : Jayenkai 2006-Infinity | MudChat's origins, BBCode's former life, Image Scaler.