Latest Uploads
Nom nom nom

Jayenkai

Rainbow Trout

Pakz

King Salmon

Pakz

Snooker

Jayenkai

You've ... o have you

Jayenkai

Merry Xmas

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
rockford


WW Entries : 3
We discussed something like this before - socoder.net/index.php?topic=2308&seenpost=26508#26508
Posted : Monday, 07 May 2012, 14:15 | Permalink
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
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 640|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Latest Posts
RIP : Neil Fingleton
rockford Sun 15:31
AGameAWeek : 2017 - Part One
Jayenkai Sun 10:10
RIP : Bill Paxton
Jayenkai Sun 09:18
Happy Birthday, Pakz
Jayenkai Sun 01:57
Happy Birthday, Jayenkai
Krakatomato Sat 13:06
Switchmas
rockford Fri 02:25
What Have You Done? - Feb 2017
zzoom Thu 22:46
Hurricane Doris vs Shed Roof
rockford Thu 02:38
PIP Crap
Jayenkai Wed 16:45
SSL Options
Jayenkai Wed 11:31
More

Latest Items
Blog : mini project
spinal Sun 10:13
Showcase : Blockman Returns
Jayenkai Fri 03:04
Snippet : Wall Tracing on Random Maps (rpg)
rskgames Wed 22:48
Snippet : Path Following
Pakz Mon 16:25
Dev-Diary : PS2 to N64 Adapter
spinal Mon 01:53
Snippet : Flowers (Jan 2017)
Kuron Thu 01:13
Showcase : Clusters of Hex
therevillsgames Mon 15:01
Article : Maths 101 - Episode 1: Basic Trigonometry
shroom_monk Sun 14:07
Article : Maths 101 - Episode 5: Line Intersection
shroom_monk Sun 14:02
Dev-Diary : Normals and Dot products
Pakz Sat 20:37
Pets : Molly On The Couch
Jayenkai Thu 04:32
Showcase : Between Space
Pakz Sun 12:55
Snippet : Additive Particle Flames
Pakz Fri 18:12
Snippet : Maze 2d - Recursive Backtracker
Pakz Sun 07:34
Woot : My Music
Jayenkai Sat 14:20
More

Who's Online
Jayenkai
Sun, at 16:29
shroom_monk
Sun, at 16:09
rockford
Sun, at 15:32
Andy_A
Sun, at 14:41
spinal
Sun, at 10:54
steve_ancell
Sun, at 09:43
Pakz
Sun, at 09:39
rskgames
Sun, at 08:36
Krakatomato
Sun, at 05:59
HoboBen
Sat, at 21:07
Link to this page
Site : Jayenkai 2006-Infinity | MudChat's origins, BBCode's former life, Image Scaler.