New trick: a moving bus

I've made another "new trick" - or at least I've yet to see this in a doom wad. It's a moving bus this time. It works on the same principle as the cogwheel. We have a whole bunch of sectors and we raise/lower them continuosly.

It didn't turn out as good as I hoped but it's still a cool visual in my opinion. To make this effect believable, one would need some cool textures. I'm no graphic artist so I just ripped and butchered something from Shadow Warrior (which also has a moving van in it).

If we only use it as an ambient thing (that is, the player is blocked from going near), it could be a really cool addition to a city type level. The player looks out the window, and voila, there are vehicles running around.

To use this effect in a way that the player can go near it, there are a few problems. The start and the end of the vehicle's line has to be hidden from the player (it looks crappy no matter what we do). I took care of that in this example wad by putting a tunnel on one end (of course the player should be blocked from going into the tunnel). However, the bus doesn't hit the player, it just raises him/her. This idea needs to be improved to implement that. I was thinking all the "long" lines of the bus could trigger an ACS script with the line number in the parameter. If we make the current position of the bus a global variable (it's called "s" now in script 2), we could check against that to determine if the bus is hitting the player. Or something like that.

Have fun with it, I hope someone gets inspired by this (or gets a new idea). Build time was about 3 hours, all in XWE and Photoshop.

http://doomworld.com/xwe/movingbus.shtml

Share this post


Link to post

That looks fantastic! OK the bus is a little flat and cuboid, but that's not the point.

It really works: the demo really shows off the idea and what can be done with it. It really gives the impression that something is going on that is simply impossible in the doom engine. Conveyor crates would be really simple using this technique. Nice one.

Share this post


Link to post

Didn't Deep/Random Lag have moving crates on a conveyor in one of his wads? Hmm, maybe it was another object, but it was unusual.

Share this post


Link to post

How do you keep the textures on both sides of this bus in the right spot?

Share this post


Link to post

If you download and open the WAD it will be obvious. There's a patch (128*64) which is the side of the bus. I created 16 textures out of this (CAR01, CAR02, etc.) which are all 16*64, and have this patch offseted by 16 units (look at this in TEXTURE1). The "short" sides of the "track" are tagged, each with a unique number (1-128). Then the script sets up the sides like this:

SetLineTexture ( s + 12, SIDE_FRONT, TEXTURE_BOTTOM, "CAR01" );
SetLineTexture ( s + 11, SIDE_FRONT, TEXTURE_BOTTOM, "CAR02" );
SetLineTexture ( s + 10, SIDE_FRONT, TEXTURE_BOTTOM, "CAR03" );

etc., where "s" is the current position of the bus. The bus has 128 steps right now, so the "other" side's line are marked between 129-256. So for the other side:

SetLineTexture ( s + 128 + 12, SIDE_FRONT, TEXTURE_BOTTOM, "CAR12" );
SetLineTexture ( s + 128 + 11, SIDE_FRONT, TEXTURE_BOTTOM, "CAR11" );
SetLineTexture ( s + 128 + 10, SIDE_FRONT, TEXTURE_BOTTOM, "CAR10" );

Notice that the textures are backwards.

Share this post


Link to post

I'll bet that it would be possible to script a collision effect if the player allowed the bus to "hit" him. First, the damage...
As each sector at the front of the bus is raised, set its damage very high so that the player is killed immediately if he contacts the front sector. You may leave the damage on for several sector steps I suppose, then turn it off before the bus progresses past that sector.

Now, maybe an impact effect too....
As the front sector rises, you might also script a setlinespecial for each front line in turn, making the special a thrust_thing to toss the player (player's body) forward. ThrustThingZ could add some vertical motion..haha that would look cool.

The problem with this might be in getting the player to cleanly cross the front line and trigger the thrust scripts...the player could just stand and let the bus hit him, and it would not work. So...
How about those zdoom things which do something when a player enters a sector, or when a player contacts the floor of a sector? Probably by script such things can be activated and deactivated. So, the front sector rises, player in sector thing is activated, player is in the sector, script is executed which uses damage_thing and also thrust_thing. You would not need to set sector damage, just script the player death with damage_thing. Heh.

Share this post


Link to post
Enjay said:

[...] It really gives the impression that something is going on that is simply impossible in the doom engine. [...]


Naturally... it IS impossible (but I know what you mean.)

Share this post


Link to post

hey, thats damn cool. now adding the damage, throwing effect like biff said would make it even cooler. the bus does kinda looks more like a hummer though, which could apply if you're making a miltary base or something.

Share this post


Link to post

Cool shit Csabo! That's a lot of sectors, too bad you couldn't just do this with a poly-object. As it is it looks damn realistic, very smooth!

Share this post


Link to post
999cop said:

What port does this trick apply to?

Why, zdoom of course, sir!

Share this post


Link to post
Biffy said:

Why, zdoom of course, sir!

bah never mind, thought it could be done for oldschool

Share this post


Link to post

Hahaha, just turn off your mlook, jump, crosshair and crank the resolution all the way down. Instant oldschool with a bus!

Share this post


Link to post
Rellik said:

Cool shit Csabo! That's a lot of sectors, too bad you couldn't just do this with a poly-object. As it is it looks damn realistic, very smooth!


Can you do this with polyobj's?

Share this post


Link to post
ravage said:

Can you do this with polyobj's?


Nope. A polyobject is solid.

Share this post


Link to post
Shaviro said:

Nope. A polyobject is solid.

Wait a min. The bus is solid anyway, so I don't understand your point. I used to think that polyobjects had to extend from floor to ceiling, but I'm pretty sure that someone discovered a way to make them of lower height, like a crate or whatever. Am I mistaken?

Share this post


Link to post

OK, I tweaked Csabo's bus to make it kill a player it hits. The effect is not exactly what I had in mind, but close. It's pretty good the way it will knock you forward, kill you unless you have armor, and then bump your body down the road. :) I'll try to email it to Csabo or whoever wants it.

Share this post


Link to post
Biffy said:

Wait a min. The bus is solid anyway, so I don't understand your point. I used to think that polyobjects had to extend from floor to ceiling, but I'm pretty sure that someone discovered a way to make them of lower height, like a crate or whatever. Am I mistaken?


No. I mean a polyobject is solid. There's no floor or ceiling.

Share this post


Link to post

Thanks Biffy, I got your email. Excellent job! The bus really hits you. I found that sometimes if you stand in front of the "corner" (instead of facing the bus straight on) it will only throw you, but won't hurt you still, it's really cool this way.

In the wad you sent me something was wrong. The BEHAVIOR entry was only 740 bytes. After re-compiling the script it once again jumped up to ~2100 bytes or so. I'm not sure what went wrong there.

Anyway, here's Biffy's addition:

// after Change Floor
Sector_SetDamage (s, 0, 0);
Sector_SetCurrent (s, 0, 0, 0);

// after Change Floor
Sector_SetDamage (f, 64, 0);
Sector_SetCurrent (f, 64, 0, 0);

With these four lines added after each Change Floor call, the bus really hits the player.

Share this post


Link to post

That's odd. It's a good thing you looked into the problem...I don't know what happened, it worked fine before I zipped it.
You might want to alter the current speed or damage amount to get a different effect, you can splatter the player harder with greater damage, throw him farther with more current (I know csabo knows this already).

Share this post


Link to post

thats cool that you worked out how to make the bus damage the player. I just downloaded xwe and looked at the original scripting (still is very confusing), and was wondering where to put the additions to check out the effect. if it works how I think it does, it would go good in my work in progress.

Share this post


Link to post

Here's Csabo's script, with the roadkill effect I added. I'll put arrows where I added stuff:


#include "zcommon.acs"

script 1 open
{
print ( s: "hello there!\nmoving bus demo\nyou are roadkill" ); <---------- added roadkill joke
//
// raise the initial sectors
int i;
for ( i = 1; i <= 12; i++ )
{
Floor_RaiseByValue ( i, 512, 64 );
}
Delay ( 1 );
//
// start running the loop
ACS_Execute ( 2, 0, 0, 0, 0 );
}

script 2 (void)
{
Int s,f;
//
// step one ahead in every cycle
s += 1;
if ( s > 128 ) { s -= 128; }
//
// move the end of the bus down, change floor back
Floor_LowerByValue ( s, 512, 64 );
ChangeFloor ( s, "FLAT19" );
Sector_SetDamage (s, 0, 0); <------- damage off
Sector_SetCurrent (s, 0, 0, 0); <------ "move player" off
//
// set both sides
SetLineTexture ( s + 12, SIDE_FRONT, TEXTURE_BOTTOM, "CAR01" );
SetLineTexture ( s + 11, SIDE_FRONT, TEXTURE_BOTTOM, "CAR02" );
SetLineTexture ( s + 10, SIDE_FRONT, TEXTURE_BOTTOM, "CAR03" );
SetLineTexture ( s + 09, SIDE_FRONT, TEXTURE_BOTTOM, "CAR04" );
SetLineTexture ( s + 08, SIDE_FRONT, TEXTURE_BOTTOM, "CAR05" );
SetLineTexture ( s + 07, SIDE_FRONT, TEXTURE_BOTTOM, "CAR06" );
SetLineTexture ( s + 06, SIDE_FRONT, TEXTURE_BOTTOM, "CAR07" );
SetLineTexture ( s + 05, SIDE_FRONT, TEXTURE_BOTTOM, "CAR08" );
SetLineTexture ( s + 04, SIDE_FRONT, TEXTURE_BOTTOM, "CAR09" );
SetLineTexture ( s + 03, SIDE_FRONT, TEXTURE_BOTTOM, "CAR10" );
SetLineTexture ( s + 02, SIDE_FRONT, TEXTURE_BOTTOM, "CAR11" );
SetLineTexture ( s + 01, SIDE_FRONT, TEXTURE_BOTTOM, "CAR12" );

SetLineTexture ( s + 128 + 12, SIDE_FRONT, TEXTURE_BOTTOM, "CAR12" );
SetLineTexture ( s + 128 + 11, SIDE_FRONT, TEXTURE_BOTTOM, "CAR11" );
SetLineTexture ( s + 128 + 10, SIDE_FRONT, TEXTURE_BOTTOM, "CAR10" );
SetLineTexture ( s + 128 + 09, SIDE_FRONT, TEXTURE_BOTTOM, "CAR09" );
SetLineTexture ( s + 128 + 08, SIDE_FRONT, TEXTURE_BOTTOM, "CAR08" );
SetLineTexture ( s + 128 + 07, SIDE_FRONT, TEXTURE_BOTTOM, "CAR07" );
SetLineTexture ( s + 128 + 06, SIDE_FRONT, TEXTURE_BOTTOM, "CAR06" );
SetLineTexture ( s + 128 + 05, SIDE_FRONT, TEXTURE_BOTTOM, "CAR05" );
SetLineTexture ( s + 128 + 04, SIDE_FRONT, TEXTURE_BOTTOM, "CAR04" );
SetLineTexture ( s + 128 + 03, SIDE_FRONT, TEXTURE_BOTTOM, "CAR03" );
SetLineTexture ( s + 128 + 02, SIDE_FRONT, TEXTURE_BOTTOM, "CAR02" );
SetLineTexture ( s + 128 + 01, SIDE_FRONT, TEXTURE_BOTTOM, "CAR01" );
//
// length = 12
f = s + 12;
//
// uncomment the line below to pause between runs
// if ( f == 128 ) { Delay ( Random ( 128, 255 ) ); }
//
// make front of bus come up
if ( f > 128 ) { f -= 128; }
Floor_RaiseByValue ( f, 512, 64 );
ChangeFloor ( f, "CARTOP" );
Sector_SetDamage (f, 64, 0); <------- damage on
Sector_SetCurrent (f, 64, 0, 0); <------ "move player" on
//
// wait a bit, then do it again
Delay ( 1 );
Restart;
}



So, you see that it's actually the top of the bus which damages the player and shoves the player, and the damage and current effects are just enough to make it fairly realistic, yet probably let the player escape with his life if he has armor. If you want a completely unavoidable death, set the damage as high as 255. More current will throw you harder, but this value felt about right.

Edit: There is one more thing which must be done to movingbus.wad to make the Sector_SetCurrent command work - the bus sectors all the way down the street have to be flagged as "Wind/Current enabled" in WadAuthor. With DeePsea, you have to click the sector type button, go to zdoom sector flags and check the BOOM Wind box. If you don't do this, the bus will kill you but just pass under you instead of tossing your body forward.

Share this post


Link to post

I've seen kurt. make rotating fans and stuff, with 2s polys. How about appkying the same principle to the bus? it'll of course not have a roof, but it'll be polyobjected. ;)

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now