Question concerning forming slopes in realtime in the game..

Archive of the old editing forum
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.
Locked
mikenet2007
Posts: 340
Joined: Wed Jan 24, 2007 8:54 pm

Question concerning forming slopes in realtime in the game..

Post by mikenet2007 »

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
User avatar
Kappes Buur
 
 
Posts: 4201
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada
Contact:

Post by Kappes Buur »

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
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Although slopes are created at map start there is no technical reason that would prevent realtime changes. 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.
User avatar
Enjay
 
 
Posts: 27296
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Post by Enjay »

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.
User avatar
Risen
Posts: 5263
Joined: Thu Jan 08, 2004 1:02 pm
Location: N44°30' W073°05'

Post by Risen »

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.
User avatar
Kinsie
Posts: 7402
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33
Contact:

Post by Kinsie »

Graf Zahl wrote:Although slopes are created at map start there is no technical reason that would prevent realtime changes.
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: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.
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.
User avatar
Phobus
Posts: 5984
Joined: Thu May 05, 2005 10:56 am
Location: London
Contact:

Post by Phobus »

@Enjay: Set the slope for a line between two flat sectors, and then changing the height of the sector being sloped to would remove the worry for 1, as it'd then become 2.
User avatar
ReX
Posts: 1584
Joined: Tue Aug 05, 2003 10:01 am
Location: Quatto's Palace
Contact:

Re: Question concerning forming slopes in realtime in the ga

Post by ReX »

mikenet2007 wrote:So in other words I need to know how to have a sector that was originally flat, become tilted.
Here are the steps:
  • 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.
I think this is what Phobus said too.
User avatar
Phobus
Posts: 5984
Joined: Thu May 05, 2005 10:56 am
Location: London
Contact:

Post by Phobus »

It should be noted that the current set up won't allow that to happen though, as slopes don't change in real time... I tried it before.
User avatar
Enjay
 
 
Posts: 27296
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Post by Enjay »

True, and any dynamically changing slopes should be an addition to the current system rather than a replacement for it. The current system is useful for a whole number of possibilities that I have already used it for.
User avatar
Nash
 
 
Posts: 17505
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

If real-time slopes are implemented, I want to make warbling water surfaces. =D
mikenet2007
Posts: 340
Joined: Wed Jan 24, 2007 8:54 pm

Post by mikenet2007 »

Well, I suppose I'll just stick with multiple drop sectors. I think I can get it to look decent if I use many of them that are oddly shaped. It didn't look like to me that there was any current way to achieve a changing slope. Unless I read something wrong.
User avatar
Risen
Posts: 5263
Joined: Thu Jan 08, 2004 1:02 pm
Location: N44°30' W073°05'

Post by Risen »

To be clear, there is no way to adjust the slope of a sector during gameplay.
Locked

Return to “Editing (Archive)”