Page 1 of 1

Opaque Sloped 3D Floors in GZDoom

Posted: Sat Apr 03, 2010 3:38 pm
by MartinHowe
Calling all GZDoom wizards!

Please can any body point me in the right direction here?
I'd like to have houses with rooves sloped to an apex in the usual way. Cross section:
(The bottom two vertical walls are normal sectors (floor=128,ceil=384))
Image
I know sloped 3d floors are allowed if they are 100% opaque but how on earth would
one tell the engine this arrangement? After all, there are two apex lines involved, since
the 3d floors have non-zero thickness.

Has anybody done this?

(At least if it's impossible, knowing so would save me time from trying to do it)

Re: Opaque Sloped 3D Floors in GZDoom

Posted: Sat Apr 03, 2010 3:40 pm
by Enjay
It's pretty easy. For a complicated example, look at the second map in my Burghead mod. If you hold on for a few minutes. I'll put up a simpler example.

Re: Opaque Sloped 3D Floors in GZDoom

Posted: Sat Apr 03, 2010 3:50 pm
by MartinHowe
Thx Enjay. I have got it to work with the 3D floors not sloped, at least. Be interested to see how you did it :)

Re: Opaque Sloped 3D Floors in GZDoom

Posted: Sat Apr 03, 2010 4:13 pm
by Enjay
Here you go. :)

The key is making sure that the control sectors are aligned with where the slopes will appear in game.

[edit]ack, I just noticed that you have dimensions on your sketch. The example uses different dimensions, but the principle is sound.[/edit]

Re: Opaque Sloped 3D Floors in GZDoom

Posted: Sat Apr 03, 2010 4:30 pm
by MartinHowe
Thanks very much - will take me while to understand it, but its a long weekend... :D

Re: Opaque Sloped 3D Floors in GZDoom

Posted: Sat Apr 03, 2010 5:02 pm
by Enjay
This explanation may help a little:
Spoiler:
1 is a pair of sloped control sectors for a 3D floor. The long sectors in the middle are what actually form the slope. The small squares at the end provide the heights to slope the control sector to. The main reason for #1 existing is because I wanted the area under the eves outside the building to be slightly brighter than inside the building. Otherwise the eve areas could have received the same tag as the building. To this end, these sectors have a light level of 144.

2 is a pair of sloped control sectors very much like 1. There are 2 key differences. 1) the light level is darker (128) and 2) each side has 2 3D floor lines. Most of the building is covered by the lines with tags 1 or 2. However, I wanted a doorway and that needed an additional pair of tags.

Areas 1 and 2 would look something like this in elevation:
Spoiler:
3 is a pair of 3D floors to make the area above the door which is also a 3D floor. These are only sloped on the top because the door should have a horizontal lintel.

it looks something like this in elevation:
Spoiler:
Remember, the floors only appear in the areas tagged in the play sector, but all the slopes need to be made the same gradient and orientation to match up. So, even if you are only using a little bit of that slope in the play area, it is easiest to make a full slope and match it up to the others out of sight in the control sectors.

4 has almost nothing to do with the 3D floors. It is just there to slope the gable ends of the building. Because none of those sectors are beside anything that could be used as a height reference, this seemed an easy way to do it. There are other methods. However, this method made it nice and easy to make all the slopes and control sectors the same size to guarantee that all the gradients and alignments are the same.

it looks something like this in elevation.
Spoiler:

Re: Opaque Sloped 3D Floors in GZDoom

Posted: Sat Apr 03, 2010 6:11 pm
by Gez
Enjay wrote:Remember, the floors only appear in the areas tagged in the play sector, but all the slopes need to be made the same gradient and orientation to match up. So, even if you are only using a little bit of that slope in the play area, it is easiest to make a full slope and match it up to the others out of sight in the control sectors.
Alternatively: [wiki]Plane_Copy[/wiki]. :wink:

Re: Opaque Sloped 3D Floors in GZDoom

Posted: Sat Apr 03, 2010 6:24 pm
by Enjay
Indeed. Personally, I find the method that I used in the example easiest because its mechanical nature makes sense to me but, yes, Plane_copy or slope things would do the job and may be preferred by some people and be unquestionably preferable in some situations.

Re: Opaque Sloped 3D Floors in GZDoom

Posted: Sun Apr 04, 2010 12:28 pm
by MartinHowe
Thx for the explanations. I managed it right with slope floor to here and such (things only), but that only works if you don't want the triangle part between the roof and the base. Slope Copy might be useful in general though, have to check it out.

EDIT:
Preliminary screenshot:
Image

Re: Opaque Sloped 3D Floors in GZDoom

Posted: Mon Apr 12, 2010 6:11 pm
by MartinHowe
I need to sleep so won't go into detail right now; however, it is possible to do this with just three control sections (each having a left side and a right side) for the roof. The idea is to have the roof as a self-contained unit, then build up the walls and floors separately (allows multistory buildings). If you want a front/back window in the roof triangle, it gets a bit more complicated, but the engine can do it (I know because I made one!).

Image

EDIT: (window in roof triangle and two floors):
Image

Re: Opaque Sloped 3D Floors in GZDoom

Posted: Wed Apr 14, 2010 5:19 am
by MartinHowe
We have a project thread, yay!