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

Jayenkai

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

Jayenkai

Bumble Bee

dna

Tires

dna

Guess The Remake

rychan

Julia Set Visualer

Andy_A

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
AGameAWeek iOS Bundle
rychan Thu 08:46
Ex XBox
rychan Thu 07:54
Watch Out! Car!
steve_ancell Thu 06:34
''Unique''
spinal Wed 02:20
Legitimate Logo Services
spinal Tue 13:26
Coming soon, to a printer near you!
steve_ancell Tue 12:22
RIP : Douglas E Smith
steve_ancell Tue 12:16
Telly Picks
HoboBen Tue 09:38
Microbricks aka BingCraft aka XBlocks
spinal Tue 02:25
Preemptive Lock!
Jayenkai Mon 16:07
More

Latest Items
Blog : Bedroom 2.0
Kuron Thu 05:51
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
Showcase : Space Rocket Adventurers
HoboBen Thu 16:56
Blog : Health Update : August 2014
Jayenkai Sat 11:31
Techy : Back from Game Dev Con!
Jayenkai Sun 16:52
Family : Sunday
Jayenkai Wed 03:31
Family : Good News (for once)
Kuron Tue 15:37
Showcase : Don't Tap The Zombies
therevillsgames Mon 16:26
Showcase : Mutant Monty
steve_ancell Wed 19:26
Techy : New Laptop!?
Kuron Fri 15:52
Showcase : Ascension 2 Live Wallpaper
CodersRule Fri 13:48
More

Who's Online
Jayenkai
Thu, at 13:32
HoboBen
Thu, at 13:20
spinal
Thu, at 13:17
dna
Thu, at 12:51
Kuron
Thu, at 12:19
rychan
Thu, at 10:53
shroom_monk
Thu, at 09:48
brdtt12
Thu, at 09:08
steve_ancell
Thu, at 06:39
rockford
Thu, at 05:38
Link to this page
Site : Jayenkai 2006-Infinity | MudChat's origins, BBCode's former life, Image Scaler.