Baron of Hell
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > WADs & Mods > Dear community, have BETTER tri-directional moving floors
 
Author
All times are GMT. The time now is 08:55. Post New Thread    Post A Reply
GooberMan
Scripting Nut


Posts: 1170
Registered: 02-01


So. Another tech demo WAD from me. Has it really been that long since STARBOX.WAD?

Earlier this morning, I got an idea on how I could implement moving 3D floors. Except they wouldn't be 3D floors as such. They'd be a use of polyobjects with walkable mid textures. A bit of experimenting (and finding a Doomworld thread from last year) soon showed me the futility of my idea - that being that impassable polyobjects will push you out of the way. However, since I'd also planned on implemting height variation effectively, I'd also been playing around with sector heights in my polygon control sector. This gave me an interesting discovery - if I set my texture offsets to lower than the control sector's floor height, I didn't need walkable mid textures. The polygon would spawn with that sector's height. Or, in other words, it was entirely possible to replicate oldschool 3D floors purely with polyobjects.

So, the only line flags I set on my polyobject lines were doublesided, lower unpegged, and clip middle texture. This made my polyobject completely unblocking while moving. Combined with the texture offset and a control sector floor height set higher than the target sector floor height, I had a polyobject that would push me out of the way if I got in front of it but not if I stood on top of it.

Now, some might call that mission success. But from the start, I was programming some scripts with friction in mind. Being on a moving floor that slides away from me isn't good enough. I have to move with the floor. And this is the tricky part. To know if you're on a floor, generally these days you'd use an "Actor Hits Floor" thing. But that doesn't work. So you need to refer to linedefs. The script expects all exterior linedefs of your polyobject to be facing out. The script that activates on crossing it then checks which side it was activated from before determining if the player is on or off. Next, you need to know if the player's Z value matches the floor's Z value. To do this, I check against a dummy thing inside the control sector. You could use GetSectorFloorZ in the same manner, but you still need a dummy thing inside that control sector for reference. If the Z height matches, the player is on the floor and thus friction should be applied.

Using SetActorPosition was bad. It removed all freedom of moving on a platform. To implement friction, I needed to alter the player's velocity. Finding the correct velocity value was trial and error. I'm sure there's some mathematically correct way to find out the correct velocity to apply based on referring to the Doom movement code and plugging it in to an equation, but as it stands dividing the difference of the floor's previous position to it's current position by 10.7 gets something very close to the correct friction on the platform.

All that remains is to set up your polyobject's move path. The path I've set up moves tri-directionally - it moves on X and Y as a polyobject does, and it moves along Z at the same time thanks to altering the control sector.

Oh, and because I don't like showing off anywhere near enough, it is also multiplayer compatible.

The example WAD can be found here.

LIMITATIONS
  • You can't walk under the floor.
  • Things get screwy if your polyobject goes below the normal floor.
  • Rotational friction is not currently supported. There is no GetPolyobjAngle to compare against.
  • I'm disabling view bob when setting the velocity. I quite simply haven't checked if leaving it enabled will bob your view as the platform moves.


THE WAY FORWARD FROM HERE
  • Removing the sector height modification and simply changing the texture offsets.
  • To account for the now-missing height, anchor some invisible bridge things to the poly object.
  • See if we can't get a flat rendering over that 3D floor. Transfer_Heights trickery? Non-solid 3D floor trickery?

Last edited by GooberMan on 01-22-13 at 13:16

Old Post 01-21-13 20:57 #
GooberMan is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Icytux
Junior Member


Posts: 126
Registered: 06-09


Impressive!

I've been messing around with Walkabletexture polyobjects too at the time when they were made possible in zdoom. I came to the point where i could stand on it etc, but wouldn't move along with its moving. The script you made seem to work pretty well, only problem i noticed was if you went too close to the edge, it would activate the "off the platform" script, and cause me to stop moving a long the platform. Moving back in didn't always reactivate the platform script either, you might want to place the script activation lines a bit farther away from the platform than the actual visible platform lines are. Not sure if that is possible the way you've set up the polyobject atm without changing the actual walkable radius of the platform. But if you manage to change it to bridgeactors that make up the polyobject it would be easy to do.

GJ

Old Post 01-21-13 21:25 #
Icytux is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
BlackFish
Forum Spammer


Posts: 4560
Registered: 06-02



GooberMan said:
Transfer_Heights trickery? Non-solid 3D floor trickery?


First of all, awesome job, because I was trying to figure this out. I did a polyobject trick last week that involved a 3d model representing a visible object. So this concept might help you.

http://forum.zdoom.org/viewtopic.php?f=3&t=35260

Old Post 01-21-13 22:41 #
BlackFish is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
GooberMan
Scripting Nut


Posts: 1170
Registered: 02-01


I made it better! Here's the reference WAD.

So I solved the walking under it problem. Not by using bridge things. No, that would remove the arbitrary nature of polyobjects. I got to thinking - if the polyobject I was using was just transferring sector heights, what would happen if I applied a 3D floor to the polyobject control sector? The answer was that SHIT WOULD JUST WORK!

You can now walk over and under the walking floors. I've cleaned the scripts up a tiny bit, and applied the texture offsetting I was talking about. The polyobject's control sector height no longer changes one bit, however the 3D floor applied to it does. Textures are offset to match that 3D floor.

However, the linedef method is now starting to show its horrible flaws. Namely, if a polyobject moves and an actor crosses above/below it while standing still it doesn't trigger the line crossed behaviour. Not that anyone's had to care about such things before.

This is almost "right". I want to solve the hop on/hop off stuff. To do that, I need to remove the linedef triggers. Which means I need to have the transferred heights trigger the "Actor hits floor" thing specials. Feel free to experiment and contribute, anyone who can map and knows ZDoom well.

Old Post 01-22-13 13:16 #
GooberMan is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
CorSair
Forum Regular


Posts: 792
Registered: 11-12


Dude, that's fucking boss. Kudos for that.

And now we need to wait horrible platforming sections in future wads. D:

Old Post 01-22-13 14:08 #
CorSair is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Mancubus II
Purple is not a breakfast color


Posts: 1940
Registered: 02-03


Doom rollercoaster!

Old Post 01-22-13 15:55 #
Mancubus II is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Scypek2
Member


Posts: 559
Registered: 01-12



CorSair said:
And now we need to wait horrible platforming sections in future wads. D:

not as horrible as platforming sections with platforms that don't actually carry you (Sonic Doom).

Old Post 01-22-13 17:18 #
Scypek2 is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
GooberMan
Scripting Nut


Posts: 1170
Registered: 02-01


I'd like to hope they're used in a similar fashion to how Quake did it. Rather than going nuts creating jump puzzles.

Old Post 01-22-13 17:31 #
GooberMan is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 08:55. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > WADs & Mods > Dear community, have BETTER tri-directional moving floors

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.