## Horizontally moving platforms

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.

### Horizontally moving platforms

I cannot do something like this, so if anyone out there is able to, it would be much welcome.
The thing is that 3D floors have made it possible to have 3D platforms which are able to move up and down (like in most modern games), but Doom is seriously lacking the same thing, but for horizontal movement. While it can actually be worked around by making bridges and stuff, actual moving platforms cannot be made whatsoever. An actor moved by camera interpolation points can somewhat emulate this, but it's not perfect and the player has to still "walk" on top of this actor to keep him/herself on top of it.

So here's the deal:
Making an actor similar to fake 3D bridges would be the key for this. Adding it special native properties to keep the player "attached" to it while it moves (like a moving sector), and give it arguments to set its path through path nodes or patrol points. That would make actual horizontal-moving platforms possible. Then, giving it an appearance would depend on the modder (be it sprites made for it or actual 3D models).

Adding something like this will really expand what can actually be done in a map.

hfc2x
DoomEU is not dead, just inevitably headed for a Mordeth nomination.

Joined: 17 Aug 2009
Location: Chule

### Re: Horizontally moving platforms

AFAIK, a moving sector-based object is impossible with Doom's BSP-based map structure. However, if you're talking about an actor, the problem is that there are no functions to handle friction between 2 objects. The bottom object can move, without the top moving. I guess you can simulate friction by giving any actor touching the bridge thing a net velocity that is equal to the bridge objects movement velocity; relative to the map, you will be moving 'on' the bridge object. I'm not sure if you can apply this to only objects that are on top of the bridge object.

Amuscaria
The Sentient Mushroom

Joined: 26 Jul 2004
Location: Growing from mycelium near you.

### Re: Horizontally moving platforms

Well, Rise of The Triad did it, so Doom can do it too. The problem is that there's possibly no one interested in implementing this.

hfc2x
DoomEU is not dead, just inevitably headed for a Mordeth nomination.

Joined: 17 Aug 2009
Location: Chule

### Re: Horizontally moving platforms

hfc2x wrote:Well, Rise of The Triad did it, so Doom can do it too.

This is not how it works. Different engines do different things, and this usually includes physics.

edward850
[netcode intensifies]

Joined: 19 Jul 2005
Location: New Zealand

### Re: Horizontally moving platforms

edward850 wrote:Different engines do different things

And that's why I said that, since ROTT uses an enhanced version of the Wolf engine, which is of course, far more limited than the Doom engine. So, even if it's not an easy thing to do, it's likely that this can actually be implemented in ZDoom.

hfc2x
DoomEU is not dead, just inevitably headed for a Mordeth nomination.

Joined: 17 Aug 2009
Location: Chule

### Re: Horizontally moving platforms

While just about anything *can* be done, it might fit very poorly with existing code. If it does not double the size of the source, memory used or processing power required, if much existing zdoom code can be reused, then it is feasible. Otherwise, it can be done.

Tetris is a very simple game. It is fully possible to have tetris in zdoom, but you'd have to write tetris from scratch and integrate that with the existing engine (which means it is more work than just writing tetris from scratch). It may actually be possible with acs + voxels or hudmessages (a matter of style). With hudmessages you could even obscure most of the doom features and get a near faithful 2d experience.

I'm not saying that your idea is bad. I'm saying that saying something can be done is saying very little indeed.

Perhaps Doomscript can give us the means to handle this on our own. Maybe - just maybe - ACS bumpspecial can do it. Not sure; walking onto/bumping into, and staying on board, might be tricky. (Event handler for actors bumping into platform-actor, check if actor radiuses overlap, if they do, check if bumping actor is higher up, if it is, modify its speed based on platform movement.)

Based on the apparently possible scripting implementation, it seems that a built-in feature ought to be near-feasible, rather than tetris-unfeasible; but perhaps it is not required.

FDARI
Melbourne is actually pronounced Mel-Byn, as though it were a wizard.

Joined: 03 Nov 2009

### Re: Horizontally moving platforms

hfc2x wrote:
edward850 wrote:Different engines do different things

And that's why I said that, since ROTT uses an enhanced version of the Wolf engine, which is of course, far more limited than the Doom engine.

There's a fundamental difference here, though. The DIP would have been able to dump and rewrite Wolf 3D code without worrying about compatibility with Wolf 3D. ZDoom, for reasons that should be obvious, can't.

TheDarkArchon
OUT!

Joined: 07 Aug 2004
Location: Some cold place

### Re: Horizontally moving platforms

It might not currently be feasible, but, I would really be amazed if Moving sectors could be done Ala. Build. (Trains anyone?) From what I recall, Build uses a BSP-Structure for it's maps, but, I'm unsure what it does differently in order to make moving sectors possible. There was a limit though, moving sectors couldn't go outside their parent sector, otherwise there would be major Slime-trailing or HOM involved.

StrikerMan780
Struggling but getting by. For now.

Joined: 29 Nov 2005
Discord: StrikerTheHedgefox#6299
Github ID: StrikerMan780
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

### Re: Horizontally moving platforms

StrikerMan780 wrote:From what I recall, Build uses a BSP-Structure for it's maps ...

Nope. It doesn't use Ray-casting either, but rather some weird brute-forced wall sorting. What you are also overlooking is ZDoom's physics engine, which only barely has the concept of one object standing on another.

edward850
[netcode intensifies]

Joined: 19 Jul 2005
Location: New Zealand

### Re: Horizontally moving platforms

Quick and dirty moving platform:

Code: Select all
`ACTOR Platform : SwitchableDecoration{   Height 8   Radius 32   Mass 10000   +FLOORCLIP   +SOLID   +ACTLIKEBRIDGE   +CANPASS   +BUMPSPECIAL   +NOGRAVITY   Activation THINGSPEC_ThingTargets | THINGSPEC_ThingActs | THINGSPEC_Switch   States   {   Spawn:      UNKN A 0   Spawn.Patrol:      "####" A 1 ThrustThing (angle * 256 / 360, 1, 0, 0)      "####" A 20      "####" A 0 A_JumpIf((velx != 0) || (vely != 0), "Spawn.Patrol")      "####" A 7      "####" A 1 A_UnSetSolid      "####" A 1 A_SetAngle(angle + 180)      "####" A 1 A_SetSolid      Loop   Inactive:   Active:      "####" A 1 ACS_NamedExecute("W_DoPlatform", 0, 64, 64)      Goto Spawn.Patrol   }}`

With this ACS script:
Code: Select all
`Script "W_DoPlatform" (int PlatWidth, int PlatHeight){   int NotMoving = True;   int OnPlatform = True;   int PlatTID = UniqueTID();   Thing_ChangeTID(0, PlatTID);   SetActivatorToTarget (PlatTID);   While (OnPlatform)   {      NotMoving = True;      int PlatX = GetActorX(PlatTID);      int PlatY = GetActorY(PlatTID);      int PlatZ = GetActorZ(PlatTID);      int PlayX = GetActorX(0);      int PlayY = GetActorY(0);      int PlayZ = GetActorZ(0);      int offsetX = PlayX - PlatX;      int offsetY = PlayY - PlatY;      int offsetZ = PlayZ - PlatZ;      While (NotMoving)      {         SetActorPosition(0, GetActorX(PlatTID) + offsetX, GetActorY(PlatTID) + offsetY, GetActorZ(PlatTID) + offsetZ, 0);         If (GetPlayerInput(-1, INPUT_BUTTONS) & (BT_FORWARD + BT_BACK + BT_MOVELEFT + BT_MOVERIGHT + BT_JUMP))            NotMoving = False;         delay(1);      }      If (((offsetX * 2) > PlatWidth) || ((offsetY * 2) > PlatHeight)) OnPlatform = False;      delay(1);   }}`

This makes a moving thing that travels back and forth between two points that you can stand on. Basically it moves the player with the platform object as long as they're standing still on the platform. If you do this in GZDoom, you could probably set up a model for the item to make it look like a real platform.

Obviously this could be expanded upon, but this was a rough proof of concept.

AFADoomer

Joined: 15 Jul 2003

### Re: Horizontally moving platforms

AFADoomer wrote:If you do this in GZDoom, you could probably set up a model for the item to make it look like a real platform.

Voxels!
Gez

Joined: 06 Jul 2007

### Re: Horizontally moving platforms

Proof of concept, with voxel platform (that may look familiar...):
http://www.afadoomer.com/files/platform.pk3

Summon 'Platform' for a moving platform, or 'StaticPlatform' for a non-moving platform.

I also changed the code to use SetActorPosition and calculate movement based on the thing's defined speed, instead of using ThrustThing (movement was jerky and speed was hardcoded with ThrustThing).

AFADoomer

Joined: 15 Jul 2003

### Re: Horizontally moving platforms

Hang on, hang on. Don't you know that what you just did can't be done?

Seriously, that works really well and is very smooth.

Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain

Joined: 15 Jul 2003
Location: Scotland

### Re: Horizontally moving platforms

It works nicely, but only for the player of course. Engine-side support, if it were implemented somehow, would allow to put imps on these platforms.
Gez

Joined: 06 Jul 2007

### Re: Horizontally moving platforms

Gez wrote:It works nicely, but only for the player of course. Engine-side support, if it were implemented somehow, would allow to put imps on these platforms.

I'm working on that... It vaguely works when you add THINGSPEC_MonsterTrigger to the Activation property of the platform, but the code to keep them on the platform is glitchy.

AFADoomer

Joined: 15 Jul 2003

Next

Return to Editing (Archive)

### Who is online

Users browsing this forum: No registered users and 2 guests