Latest Uploads
Still Truckin'

rychan

Curlicue Fractals

Andy_A

heroextant ... -small.png

HoboBen

image-25-0 ... 26-04.jpeg

Jayenkai

Help_Fight ... rivacy.png

Jayenkai

Gameboy...Colour!!

rychan

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 634|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Latest Posts
PIP Crap
Dabz Thu 08:56
What Size is the Image
Jayenkai Thu 02:59
Offsetting Time
Jayenkai Thu 00:30
AGameAWeek : 2016 - Part One
rychan Wed 13:10
Mystery Milk
steve_ancell Wed 04:46
RIP : Burt Kwouk
Jayenkai Tue 10:32
Vehicle For Sale
Jayenkai Tue 05:31
Unexplainable Compiler Slowdown
therevillsgames Mon 15:32
Sausage Party
Jayenkai Mon 05:09
Gameboy Racing Game in progress.
rychan Sun 16:03
More

Latest Items
Snippet : Blurring and Dripping, rectangles
Pakz Thu 05:52
Showcase : Curlicue Fractals
Jayenkai Sun 08:41
Showcase : Grey backgrounds
Pakz Sun 07:43
News : Newsletter #265
steve_ancell Fri 02:58
Showcase : Jumble Blocks
steve_ancell Mon 09:44
Showcase : Harpoons and Balls
Ninjinister Mon 07:29
Showcase : You Shall Die
rychan Sun 12:47
Showcase : Mojo2 html5 animation
Pakz Wed 14:05
Snippet : Little Spinning Grid
Pakz Wed 13:45
Snippet : Make Trees
HoboBen Tue 16:11
Showcase : No Plumbing Required
steve_ancell Mon 10:51
Blog : Feedback
Pakz Fri 14:05
Showcase : 8-Bit Boulders
steve_ancell Wed 08:19
Dev-Diary : PS2 to N64 Adapter
Jayenkai Wed 03:07
Dev-Ideas : Pixel editor
Jayenkai Mon 23:40
More

Who's Online
Pakz
Thu, at 10:17
HoboBen
Thu, at 10:11
GfK
Thu, at 10:04
Jayenkai
Thu, at 10:04
Dabz
Thu, at 08:56
spinal
Thu, at 08:56
steve_ancell
Thu, at 06:05
rockford
Thu, at 03:53
9572AD
Wed, at 22:28
therevillsgames
Wed, at 19:02
Link to this page
Site : Jayenkai 2006-Infinity | MudChat's origins, BBCode's former life, Image Scaler.