Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Randomly Generated Levels for a FPS

Author
Message
Chily Dog
19
Years of Service
User Offline
Joined: 6th Nov 2004
Location: U.S.A.
Posted: 9th Nov 2005 06:22
I am working on my first FPS and I am at the level desgin stage. I thought it would be interesting to create some kind an algorithim that would randomly assemble a new level each time you ran the program or moved to the next stage in the game. This level would have to consist of a square matrixes for the floor and ceiling, and boxes for walls. The box walls would be randomly created inside the matix to form the difforent rooms, and gaps would have to be created for the person to move from room to room. This way, every time you ran the program you would playing in a new level.

I was woundering if anyone could give me some advise with making making this algorithim, and if anyone has done something like this in the past.

That you for many help you can give me.
Chily Dog
19
Years of Service
User Offline
Joined: 6th Nov 2004
Location: U.S.A.
Posted: 9th Nov 2005 06:26
Also, I'm using DB classic.
Louiz ofRohr
19
Years of Service
User Offline
Joined: 11th Nov 2004
Location:
Posted: 9th Nov 2005 08:04 Edited at: 9th Nov 2005 08:15
Quote: "if anyone has done something like this in the past."

I did.. many people did..

That's easy.. but each case is a case..
Actually nobody can make it for you if they don't know the structure of your game..
Unless you want an unflexible thing

It consists in placing each tile in order, checking for the last one, to know what comes next..
Also check for what is at left and what is at right..
.edit.
above and below as well
.edit.
Simple like that

The worst foe lies within the self..

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 12th Nov 2005 20:28
You wouldn't use a matrix for the ceiling.

In fact for indoor levels, you wouldn't use matrices at all!

Just use primitives if it has to be randomly generated, though at first glance, it doesn't look that easy a task...

TDK_Man

Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 13th Nov 2005 10:30 Edited at: 13th Nov 2005 10:34
can I beg to differ here TDK?, you can use a matrix for a ceiling, cave-run does, I have as well, it works ok, as for the rooms inside the building thing, thats simple, just make some wall-like boxes, turn half of them through 90deg, position them at random making sure none of them hit one another and they are not too close together, eg:

repeat
position object obj,x,y,z
position object prox,x,y,z
until object collision (obj,0)=0 and object collision(prox,x,y,z)=0

then make them shorter by the width of two doors, so if the walls are too close together at the ends then when you shorten em a door sized opening is made, the prox object is the same length as the wall object but as wide as two corridors, so that a wall can not be placed parallel right next too another so close you can`t walk between them, hey presto, simple room creation with guaranteed exits and no inaccesable spaces, just remember to delete or re-use the prox object after every placing or the next loop of the routine will detect the prox object as well and mess up, if you want just one end to have a door sized gap then you could resize to just a doors width shorter and reposition the wall 1/2 that distance to the left or right (seen from the walls perspective), that gives just one opening per wall, or if you want the doorway to be in the middle of the wall then after you have found a valid position, delete that wall object and make two that will occupy the same area but have an opening in the middle, you just need to fiddle a bit to get the right amount of walls inside the area to look decent.



if there is one thing I can NOT tolerate, it`s intolerant people.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 14th Nov 2005 04:24 Edited at: 14th Nov 2005 04:25
I wasn't saying you couldn't use a matrix for a ceiling - I used one myself for my Anagram Cavern game. I was just saying that in this case you wouldn't.

As Chily Dog said:

Quote: "This level would have to consist of a square matrixes for the floor and ceiling, and boxes for walls"


Then it would make more sense to make the ceiling out of a primitive too. Especially if the matrix ceiling was "square" (I assume he means 'flat' by that). If a surface doesn't need to be deformed, then a plain should be used rather than a matrix.

While the walls are being generated it would be just as quick to use a textured plain for the ceiling - and it would be faster than using two matrices if they are quite big.

TDK_Man

Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 14th Nov 2005 13:10
fair nuff, I assumed he was using the matrix for a reason, a plain is fairly obvious (I got to stop thinking for other people)



if there is one thing I can NOT tolerate, it`s intolerant people.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 14th Nov 2005 14:50
Lame Brain
19
Years of Service
User Offline
Joined: 28th Apr 2005
Location: Portland, OR
Posted: 14th Nov 2005 16:32
Check this out for some ideas:

http://www.aarg.net/~minam/dungeon_design.html

hope it helps!

Another hair-brained idear from... LAME BRAIN!

Login to post a reply

Server time is: 2024-09-24 09:38:21
Your offset time is: 2024-09-24 09:38:21