Latest Uploads
terraintest.png

GfK

RobotMindsv18

gameleaper

Chariot racing

gameleaper

LandOfTheFlies

gameleaper

Dungeon Ga ... n Progress

rychan

image-17-0 ... -18-36.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
Server Fuckup
HoboBen Sat 14:20
Great Big Youtube thread
Jayenkai Sat 13:12
Lego Lights
rockford Fri 06:28
PlayStation Unearthed...?!
Jayenkai Fri 03:18
Apple Music
spinal Tue 13:30
Finishing off things, who'd have thought!
rockford Tue 10:01
Coding For Fun...
rockford Tue 09:56
No Everything!
rychan Tue 08:33
Drunken Purchases
Dabz Tue 04:59
Musician for Hire
Pakz Tue 04:23
More

Latest Items
Showcase : SpikeDislike3
rychan Sun 13:51
Showcase : Daily Dungeon
rychan Sun 10:26
Rant : Refresh Creations -> Refresh Games
rychan Sun 08:20
Link : Ban gay marriage?!
steve_ancell Sat 18:01
Article : Advanced BBCode
Jayenkai Sat 06:02
Showcase : Snake Me Do
rychan Thu 15:04
Blog : Back on the run
rychan Wed 13:31
Showcase : 3DRetroPrivateer41
gameleaper Sat 09:02
Showcase : HexWarrior
rockford Fri 11:43
Showcase : RobotMinds
gameleaper Thu 14:50
Showcase : isometric prototype
realtime Thu 01:57
Blog : 3DRetroPrivateer41
gameleaper Wed 20:10
Showcase : WarTactical
gameleaper Wed 19:32
Showcase : TheLandOfTheFlies48Bee
gameleaper Wed 19:17
Dev-Diary : Helichopper stuffs
GfK Sun 06:07
More

Who's Online
Jayenkai
Sat, at 14:23
HoboBen
Sat, at 14:20
GfK
Sat, at 14:20
spinal
Sat, at 14:18
rockford
Sat, at 12:43
steve_ancell
Sat, at 12:18
rychan
Sat, at 11:38
Tikihead
Sat, at 09:43
Pakz
Sat, at 08:58
Dabz
Sat, at 08:05
Link to this page
Site : Jayenkai 2006-Infinity | BBCode's former life, Image Scaler.