Question concerning forming slopes in realtime in the game..
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
-
mikenet2007
- Posts: 340
- Joined: Wed Jan 24, 2007 8:54 pm
Question concerning forming slopes in realtime in the game..
Ok this is what I want to do in my map. It takes place in a volcanically active area and there is a part where an earthquake occurs after the player is inside a building.
What I want to do is have a portion of the exterior of the building to appear to have collapsed. Now I figure I can achieve this by using a simple drop sector, but to make this effect look best the top of the building that was originaly flat and level needs more than to just be lowered. I want it tilted down on its front side as well.
So in other words I need to know how to have a sector that was originally flat, become tilted. The player wont actually see this occur because they will be inside when this happens, so if there is some kind of trick to achieve this, that would be worth hearing as well.
One other thing I need to know is how to change the texture of a flat. I want to have the building to appeared to have spit out rocks on the ground surrounding where it collapsed. that means using small rising sectors that will be the bits ejected from the building. but the textures on the tops of each of these rising sectors will have to change to something that matches its sides, "a rock like texture" so is there anyway to change the appearance of a floor texture in the game?
Thanks
What I want to do is have a portion of the exterior of the building to appear to have collapsed. Now I figure I can achieve this by using a simple drop sector, but to make this effect look best the top of the building that was originaly flat and level needs more than to just be lowered. I want it tilted down on its front side as well.
So in other words I need to know how to have a sector that was originally flat, become tilted. The player wont actually see this occur because they will be inside when this happens, so if there is some kind of trick to achieve this, that would be worth hearing as well.
One other thing I need to know is how to change the texture of a flat. I want to have the building to appeared to have spit out rocks on the ground surrounding where it collapsed. that means using small rising sectors that will be the bits ejected from the building. but the textures on the tops of each of these rising sectors will have to change to something that matches its sides, "a rock like texture" so is there anyway to change the appearance of a floor texture in the game?
Thanks
- Kappes Buur
-

- Posts: 4201
- Joined: Thu Jul 17, 2003 12:19 am
- Graphics Processor: nVidia (Legacy GZDoom)
- Location: British Columbia, Canada
- Contact:
Slopes are set up at the time the map starts up and cannot be build ingame
However, since the change happens while the player is inside a building, you could use a silent transport to an "after effect" area upon leaving the building.
As for the flat change, if you still need it then, http://www.zdoom.org/zdkb/zdoom20.html
However, since the change happens while the player is inside a building, you could use a silent transport to an "after effect" area upon leaving the building.
As for the flat change, if you still need it then, http://www.zdoom.org/zdkb/zdoom20.html
There has been an unfulfilled promise of slopes that can be modified ever since slopes were introduced.
How would they be implemented... actually, I haven't got a clue. Perhaps if you used a lineid and then gave the line a slope special the floor would instantly slope to whatever the current floor/ceiling heights are using the same calculations as they would do at level initialisation.
I'd like to be able to do 2 things: take a flat sector and slope it (somehow) during the game and also I'd like to be able to move the floor/ceiling of a sector that already has a slope to change the angle of the slope.
What I mean by the second one is, lets imagine a sector with floor height 64 that has been sloped to the adjacent floor of 0. If you raise the floor of the slope during the game (let's keep it simple, and raise it by 64) you'd currently end up with a step of 64 units at the bottom edge of the slope, and then the sector would slope up to a floor height of 128 from 64. Now, that is very useful, I have used it a lot and I wouldn't want it to change. However, I'd also like to be able to move the floor up but keep the bottom edge of the slope at 0. So the slope would change from running to 0-64 to 0-128 and not run from 64-128.
Perhaps an additional parameter could be added to slope lines? If set to 0, the slopes would behave as they do now. If set to something else, the slope would monitor the adjacent sector and match it accordingly. Maybe that would be silly - a mapping feature constantly monitoring a situation - calculation overhead?
Or perhaps just using a lineid is the way to go. Whenever you initialise a slope, either at level startup or by setting a line to be a slope, it would match the adjacent sectors in the normal way. Every time you set the special, the line re-adjusts to whatever the current situation is.
As for slope "things" I'm even less sure because I don't use them that often and am therefore less familiar with what they do.
How would they be implemented... actually, I haven't got a clue. Perhaps if you used a lineid and then gave the line a slope special the floor would instantly slope to whatever the current floor/ceiling heights are using the same calculations as they would do at level initialisation.
I'd like to be able to do 2 things: take a flat sector and slope it (somehow) during the game and also I'd like to be able to move the floor/ceiling of a sector that already has a slope to change the angle of the slope.
What I mean by the second one is, lets imagine a sector with floor height 64 that has been sloped to the adjacent floor of 0. If you raise the floor of the slope during the game (let's keep it simple, and raise it by 64) you'd currently end up with a step of 64 units at the bottom edge of the slope, and then the sector would slope up to a floor height of 128 from 64. Now, that is very useful, I have used it a lot and I wouldn't want it to change. However, I'd also like to be able to move the floor up but keep the bottom edge of the slope at 0. So the slope would change from running to 0-64 to 0-128 and not run from 64-128.
Perhaps an additional parameter could be added to slope lines? If set to 0, the slopes would behave as they do now. If set to something else, the slope would monitor the adjacent sector and match it accordingly. Maybe that would be silly - a mapping feature constantly monitoring a situation - calculation overhead?
Or perhaps just using a lineid is the way to go. Whenever you initialise a slope, either at level startup or by setting a line to be a slope, it would match the adjacent sectors in the normal way. Every time you set the special, the line re-adjusts to whatever the current situation is.
As for slope "things" I'm even less sure because I don't use them that often and am therefore less familiar with what they do.
For setting slopes, I think the answer is obvious:
Slope_Plane_Align(lineID, floor, ceiling [, tag])
Slope_Floor/Ceiling_To_Here(lineID, tid [, tag])
Slope_Floor/Ceiling_Copy(tag, tid) or (tag1, tag2)
Slope_Floor/Ceiling_Tilt(tid, angle, pitch [, tag])
Slope_Floor/Ceiling_Line(lineID, tid [, tag])
Actions requiring tids would need appropriate map spots. Optional tag sets the sector to be adjusted if other than the one where the tid/lineID resides.
As for moving slopes, I'm less sure. Perhaps something like Slope_Recaulculate(tag, bool on/off) which would set the tagged sector to change slope when the constucts that define its slope also change? I'm not sure if the engine has any useful way of storing the necessary information to make that work.
Slope_Plane_Align(lineID, floor, ceiling [, tag])
Slope_Floor/Ceiling_To_Here(lineID, tid [, tag])
Slope_Floor/Ceiling_Copy(tag, tid) or (tag1, tag2)
Slope_Floor/Ceiling_Tilt(tid, angle, pitch [, tag])
Slope_Floor/Ceiling_Line(lineID, tid [, tag])
Actions requiring tids would need appropriate map spots. Optional tag sets the sector to be adjusted if other than the one where the tid/lineID resides.
As for moving slopes, I'm less sure. Perhaps something like Slope_Recaulculate(tag, bool on/off) which would set the tagged sector to change slope when the constucts that define its slope also change? I'm not sure if the engine has any useful way of storing the necessary information to make that work.
- Kinsie
- Posts: 7402
- Joined: Fri Oct 22, 2004 9:22 am
- Graphics Processor: nVidia with Vulkan support
- Location: MAP33
- Contact:
I think the reason given for no realtime sloping in the past has been calculating thing physics on a changing slope would be a right pig to code?Graf Zahl wrote:Although slopes are created at map start there is no technical reason that would prevent realtime changes.
One of the most basic ways could be if the sector the Plane Align line is on raises or lowers. As far as slopes that aren't attached to a sector/line, Risen's suggestion sounds reasonable.Graf Zahl wrote:But how would you want this to be implemented? You need some reference to get the slope from if you don't want to specify the actual math involved yourself.
Re: Question concerning forming slopes in realtime in the ga
Here are the steps:mikenet2007 wrote:So in other words I need to know how to have a sector that was originally flat, become tilted.
- 1. Create the wall that you want to become a slope.
2. Create another sector with the same attributes as the wall sector (i.e., same floor & ceiling heights) and join the two together. For all practical purposes the two sector will look like a single sector.
3. Assign the Plane_Align special to the linedef that is common to the two sectors.
4. When you want the slope to occur you active a floor_lower script to lower the wall sector. Because the linedef already has the Plane_Align special assigned to it, the lowered wall sector will be sloped.
-
mikenet2007
- Posts: 340
- Joined: Wed Jan 24, 2007 8:54 pm