Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 02/21/26 19:15
Camera always moves upwards?
by clonman. 02/21/26 09:29
Zorro version 3.0 prerelease!
by TipmyPip. 02/20/26 13:22
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 7,008 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Designing the logic for randomized dungeons... [Re: ratchet] #400007
04/24/12 18:52
04/24/12 18:52
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
all of this is extremely interesting to me ,if someone nails it
and decide to upload it on the forums i would love checking it out

even games in thiere simplest form can be complicated hey!

i was thinking having rooms with certain tiles with values that qualify
as connection points ,these connection points being for generating
pathways between rooms and some rooms having more than one connection
doors are then obviously where the connection tiles are located,
so the rooms are then generated at their random positions/orientations/sizes
then pathfinding connects them from connection to connection generating tiles bla bla..

layer/array 1:
--------------
lets say walls=0
and paths=1

now the paths that connect the rooms
are generated on this layer/array which makes tiles of value 1's
also some random connection point's are placed throughout the grid
which also generated paths to other (already placed) random connection points
which will basicly make some useless corridors that lead no where

a invert function then inverts all 1's to 0's efectively creating walls around
the paths which is basicly corrodors rite

now theres another layer/array where the rooms are placed on which have also a
value like 2's for walls and 3's for open area inside room, then this
layer/array gets passed over the layer/array 1 overwriting all the walls with
this layer/array's data which places the rooms and paths/walls into one layer

but im just rambling anyway.
haha holy crap i just realised the garbage that came from my mind here

Last edited by Wjbender; 04/24/12 20:38.

Compulsive compiler
Re: Designing the logic for randomized dungeons... [Re: ratchet] #401541
05/21/12 12:55
05/21/12 12:55
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
It's been a while since I had time to check the forums, thankyou everyone for your input! Oh, and Legend of Grimrock did catch my eye on launch and I had a look at it. Lots of great ideas there!


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: Designing the logic for randomized dungeons... [Re: Carlos3DGS] #401551
05/21/12 13:56
05/21/12 13:56
Joined: Jul 2005
Posts: 187
L
lostzac Offline
Member
lostzac  Offline
Member
L

Joined: Jul 2005
Posts: 187
Still working on mine, and I do intend to upload it when I am done for the community. I was optimizing hallways to give them more a random shape, and working on a multi-texture shader (Idea to give levels more randomness, select random textures from a group and place them...this way a sewer tileset could have dirty, clean, ect ect looks to it without having to have a whole new tileset for each look)


John C Leutz II

Re: Designing the logic for randomized dungeons... [Re: lostzac] #401554
05/21/12 15:27
05/21/12 15:27
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
I stuck to the approach of dividing it by "sections" and creating each section randomly like you suggested, but took a different approach on the hallway generation and how sections connect to eachother.

I declare two small arrays I use for creation purposes besides the big array containing the actual map.

Code:
#define mapsize 256 //65536 tiles in total
#define macrosize 8 //64 sections in dungeon (rooms with hallways)
#define microsize 32 // 1024 tiles per section
//mapsize must be macrosize*microsize

int map[mapsize][mapsize][2]; //floors, walls/doors/funriture/etc...
int macromap[macrosize][macrosize][4]; //zonetype, roomtype, prevx, prevy
int micromap[microsize][microsize][4]; //tiletype, ???, prevx, prevy



"map" is to store my final map, and has two levels. One for floor tile info and one for objects/walls above the floor.

"macromap" is used to decide how secctions connect to eachother

"micromap" is not necessary but it makes creating each section easier and faster

-First I use a modified version of my maze generator to fill in "macromap" that will control what sections connect to which and in what order.

-"micromap" will be reused alot (each time I generate a new section). I place a room randomly in micromap, create a random door on one of the four walls of the room, and then create hallways filling up the rest of "micromap" using a different modified version of my maze generator (starting from the room door). Then I place all that section information in the cuadrant it belongs in the big map and re-use micromap for another section.

-Last I connect the different sections (independant room & maze hallway sectors) acording to the information in "macromap".

Feel free to take a look at my old "maze generator" video in my first post. Note that macromap and micromap are generated with different modified versions of my old "perfect maze" algorithm. It is called perfect maze because if you choose any two points in the maze there is one (and only one) path to get there. If you are interested in how it works the concept is quite simple and I will be happy to explain.

Also, my big map is not actually an array of simple integers, it is an array of a custom struct that contains different tile information along with visibility, transparency, and passability flags for my other algorithms I am working on (custom tile sets, line of sight and pathfinding).


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Page 2 of 2 1 2

Moderated by  checkbutton, mk_1 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1