Latest Uploads
image-17-0 ... -18-36.jpg

Jayenkai

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

Jayenkai

Kuron Cap Get!

rychan

Merry Christmas

Jayenkai

Invasion V ... tup screen

rychan

image-07-1 ... -20-59.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
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Latest Posts
Jayenkai's Daily Blog! Attempt #3923
Jayenkai Mon 03:12
Great Big Youtube thread
Jayenkai Sun 15:30
Random Purchase : Tassimo
Jayenkai Sun 04:46
Happy Birthday, Steve Elliot
Steve Elliott Sat 03:23
Unity 3D Tutorials
Hotshot Fri 15:39
Updating Direct X?
Hotshot Fri 14:32
What Retro Music are you listen to?
Jayenkai Fri 14:27
SciFi Movie Polls
rockford Fri 13:25
Daily Doodles
Jayenkai Thu 02:59
Taming of the Cockatiel
rockford Thu 00:17
More

Latest Items
Showcase : Crime (reloaded)
rockford Wed 07:30
Blog : Back on the run
rychan Wed 03:16
Showcase : Blockman Forever
Steve Elliott Sun 12:42
Snippet : Lotto Number
Jayenkai Thu 15:14
Showcase : Invisible Munky 2
Jayenkai Thu 04:52
Blog : New Fence..
steve_ancell Wed 11:28
Snippet : Rotating Sphere
Dabz Sun 19:36
Woot : Three Years Later...
Kuron Fri 07:05
Snippet : IFS Fractal Viewer
Andy_A Mon 14:20
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
Showcase : Santa's Workout 2
jayparker Tue 00:43
Dev-Diary : Stripping it All Away
Jayenkai Mon 01:57
More

Who's Online
Jayenkai
Mon, at 04:58
rockford
Mon, at 03:51
ferdi
Mon, at 03:14
shroom_monk
Mon, at 00:48
Steve Elliott
Mon, at 00:38
spinal
Sun, at 23:44
HoboBen
Sun, at 21:00
blanko1324
Sun, at 19:33
steve_ancell
Sun, at 17:42
rychan
Sun, at 16:33
Link to this page
Site : Jayenkai 2006-Infinity | MudChat's origins, BBCode's former life, Image Scaler.