Latest Uploads
PixeLink - ... oween 2014

rockford

PixeLink P ... zle Editor

rockford

PixeLink

rockford

image-21-0 ... -21-29.jpg

Jayenkai

image-15-0 ... -19-40.jpg

Jayenkai

image-15-0 ... -20-07.jpg

Jayenkai

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
Little Lever News
rockford Fri 03:53
RIP : Jay's Nan
rockford Fri 03:46
Scary Music
rychan Fri 03:21
Happy Birthday MagicMan
Kuron Fri 02:35
SoCoder Feature Request
Kuron Fri 00:34
Happy Halloween from Kuron
Kuron Thu 22:45
Tim Cook Comes Out
HoboBen Thu 22:30
Happy Halloween
Kuron Thu 19:24
Tabitha
rychan Thu 15:16
What they promise - and what they deliver...
steve_ancell Thu 14:08
More

Latest Items
News : Newsletter #241
steve_ancell Thu 20:46
Snippet : Monkey Framework - HTML Layout
steve_ancell Thu 08:35
Woot : Update on hand issues
Kuron Fri 10:34
News : Newsletter #240
steve_ancell Fri 05:29
Techy : My Newest Toys
Jayenkai Sun 04:16
News : Newsletter #239
Jayenkai Sat 05:34
Showcase : Preppie!
Jayenkai Fri 13:00
Rant : I Stubbed My Toe...
steve_ancell Tue 09:47
Blog : Bedroom 2.0
Kuron Mon 18:59
Link : Message(s) from the grave
Jayenkai Tue 09:27
Blog : 20 Years Ago....
steve_ancell Mon 15:28
Life : Back Online
Kuron Tue 11:48
Showcase : Munky Blocks DX
Jayenkai Mon 07:06
Showcase : Little Nemo's Nightmare
Jayenkai Sat 04:14
News : Newsletter #234
rychan Fri 08:02
More

Who's Online
Jayenkai
Fri, at 04:27
shroom_monk
Fri, at 04:23
rockford
Fri, at 03:53
HoboBen
Fri, at 03:42
Kuron
Fri, at 03:41
rychan
Fri, at 03:23
waroffice
Fri, at 02:47
spinal
Fri, at 01:58
Krakatomato
Fri, at 01:45
Socoder
Fri, at 00:14
Link to this page
Site : Jayenkai 2006-Infinity | MudChat's origins, BBCode's former life, Image Scaler.