Latest Uploads
Merry Christmas

Jayenkai

Invasion V ... tup screen

rychan

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

Jayenkai

PixeLink - ... oween 2014

rockford

PixeLink P ... zle Editor

rockford

PixeLink

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
Making with Marmalade
Dabz Mon 12:15
Festive Pics
Kuron Mon 11:44
Advent Calendars 2014
Kuron Mon 11:37
Glasgow Bin Lorry Crash
Dabz Mon 10:36
For High-Level Nerds or Above
Kuron Mon 08:23
How nerdy are you?
9572AD Mon 06:43
Smash Bros 3DS/WiiU
Jayenkai Mon 03:45
Foodless
rychan Mon 02:28
NerdBlock
Kuron Sun 08:04
Penguin Party
rychan Fri 04:17
More

Latest Items
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 : Santa's Workout 2
Jayenkai Wed 08:10
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
Life : Health Update
rockford Thu 12:41
Blog : Powerball Hack
steve_ancell Tue 18:47
Hols : Advent Calendars
rychan Wed 04:56
Life : MIA until better
Jayenkai Mon 07:03
News : Newsletter #241
steve_ancell Thu 20:46
Snippet : Monkey Framework - HTML Layout
steve_ancell Thu 08:35
:
Wed 17:00
More

Who's Online
Kuron
Mon, at 12:18
Jayenkai
Mon, at 12:17
Dabz
Mon, at 12:15
rockford
Mon, at 11:09
Eikon
Mon, at 10:24
rychan
Mon, at 09:57
steve_ancell
Mon, at 09:52
HoboBen
Mon, at 07:18
9572AD
Mon, at 07:16
Krakatomato
Mon, at 05:19
Link to this page
Site : Jayenkai 2006-Infinity | MudChat's origins, BBCode's former life, Image Scaler.