Moving train, lights + sound...


(Flippy) #1

Hi,

I had the idea to put a (fast) moving train in my map, since I am building a small railway station with a few (thus far) empty rails. One of the rails starts and ends in the mountains nearby and is just straight and looks kind of boring. I was hoping I would be able to make a train rage over the rails at a random interval.

I have two reasons for this:

  1. If it works how I want it to it will look awesome :stuck_out_tongue:
  2. The attacking team can camp behind other trains (non-moving) on the station, but this means that they will sit on the train tracks. It would be cool if a train moves across those tracks once every while so they can’t stay there indefinitely (place an MG there for example).

Of course, I don’t want just a silent train suddenly CRASH into 6 players at a time, I want a nice loud warning: sound and more importantly lights. Since the train comes out of a tunnel I want the sound in three stages:

  1. Train inside tunnel: very load and echo-ing
  2. Train infront of player(s)
  3. Train behind players, shift in frequency due to doppler effect.

From 1 to 2 won’t be a problem as it’s just timing of the sound effect, but 2 to 3 is (pretty sure) impossible to do this for each player individually, so I guess I have to find kind of a center point where the sound suddenly shifts frequency. I know it won’t look perfect for everyone but if I get it right it might be convincing


Also, when the train is inside the tunnel the lights should suddenly light up the whole tunnel (it is completely dark right now) which should be a very strong visual clue to get the hell off the tracks :stuck_out_tongue:

If the train is going to look a little realistic the sound and the lights should obviously move with the train, so this limits me to dlights (correct?) which are supposed to be a real FPS hit? Is this really bad? Would 2 dlights as the train headlights moving across half the map very fast cause an FPS drop suddenly?

Furthermore, is it even possible to link dlights to a moving source? I know about the sound because that is used in nearly all vehicles in ET so that won’t be a problem, but I can’t remember ever seeing dlights moving


Just need your opinions and if it’s possible :slight_smile:
Thanks

EDIT
Something like this, but with more light effects (my map is night time) and a much shorter ‘sound warning’ before the train pops out (and possibly much faster :stuck_out_tongue: )


(FireFly) #2

Well, I don’t know if you are familiar with the tramfight map I created several years ago. But the map contains a tram, similar to the railgun map


When I first started the project I wanted it to be a night map, the tram had a (yellow) front light and a (red) backlight
 I experimented with different light emitters :

-Using a “light casting” shader for the head - or back lights obviously doesn’t work, as the light is burned into the lightmap during compile.

-Dlights do work, I created a front and back -tag to my tram model and attached the dlight to it, Unfortunately Dlights - as you already mentioned - eat up a lot of fps, I don’t remember how much they reduced my fps, but it was enough for me to cancel the dlight altogether, however tramfight was built around an entire town divided into 3 separate areas to reduce r_speeds, , If you have your train running “underground” I don’t think a dlight would be a problem
 else I would not recommend it :slight_smile:

  • corona entity, Now, these do work very well, - again I attached them to my front tram_tag
they don’t affect fps that much and the best thing is that you can have your own custom flare image: I used a custom one , created in photoshop that was really bright and this worked really well, downside is that it takes several units for players to notice the corona: I’m not aware at what distance the corona shows up - this is probably hardcoded - but I if your train moves really fast the corona only shows up seconds before players get crashed


Tramfight turned out to be a daylight map instead of a nightmap because of these issues


My suggestion would be to use sound if you want to warn a player, instead of visual warnings - like lights -

I remember a long time ago - God I must sound like some old fart - when there was this scandinavian guy called loffy reworked the eagles map.: whenever the flag was captured in the map there was a short ‘bleep’ sound, it was very short and very faint, but players knew after only one game what that sount ment.

In other words: I would go for the sound and not for the visual stuff :slight_smile:


(Tyrlop) #3

the idea sounds very good, i know you can download a very nice train prefab that the_pirate made here


(Diego) #4

I think I played a custom map for Team Fortress 2 with this kind of behavior. A lot of fighting in the center of the map and every now and then a train would come through and mow everyone down. Lot’s of fun.


(Flippy) #5

I’m trying to construct part of the map so that the objective has to be carried over the tracks for a short way (going against the oncoming trains) and possibly even into the tunnel where the train can crash out of any second, should be much fun :stuck_out_tongue:
Of course, it mustn’t be tooo hard to capture the objective but it probably won’t be, since if one teammate covers the other from off the tracks, he can jump in and get the obj when the other gets run over and he’ll be pretty sure that he won’t see another train soon



(Flippy) #6

I drew out the start of the map so I could get it into my head better, decided to share it here for the interested


(Read my explanation otherwise you won’t understand xD )

Basically this is the outside part of the map. The building at C is a train station (for supplies not people) which is kind of the center point of the outside part.
Green is flat ground, brown is mountains. Gray is buildings.

Allies first spawn somewhere off the picture near A and probably get more ways to the station then just the one ‘via the ground’. Their first objective is the train controls © in the station (somewhere in a point where you can view over the entire outside map (it’s not extremely large)).
The train at B (just a cargo train) is moved to point 2 via the tracks, and then back to point 3 where it crashes into a gate (D) which opens the gate. The train moves automatically as long as Allies control the train controls (axis can destroy them with satchel, but that will probably be hard to do).

What happens inside is not yet decided but it will be some kind of storage facility where an Enigma encoding machine (actual machine, used in WW2) is located somewhere. Allies probably get some more ways into the facility (via the station?) by dynamite or whatever. At this point allies probably spawn inside the station or near it so axis can’t block off the entrance at D too strongly.

Allies have to steal the Enigma machine and bring it back to the cargo train (still at the gate D). They can go via two ways: 1 is via inside but will bring them past the axis spawn. 2 is via the tunnel (4 to 1) and back outside. The tunnel path is also dangerous because of the train that rages past at random intervals over the very left track. The train will also randomly choose either the up path or the right (1 to 4) path. If the objective carrier happens to find himself in the tunnel (4 to 1) when a train choses the same tunnel (1 to 4) he will have to take cover in little ‘escape doors’ in the wall if he wants to survive
 But he’s probably screwed :slight_smile:

When the objective is back at the cargo train (now damaged, no longer controllable by train controls) the allies have to escort it to the tunnel at E.

At this point I might build another small part of the map, depends on how long this takes and how balanced it is right now. This will contain:
The allies have to transmite a secret message (now decoded by the Enigma machine) via a transmitter they have to build. Axis however can destroy the transmitter by satchels which will stop the transmitting progress (which will take a short time, like a minute or two).

Few

So basically, the first stage for allies is using the train controls to crash a train into a gate to gain access to a base. In the base they have to steal an Enigma encoding machine which they bring back onto the train. They escort the train to a transmitter where they decode a secret message and try to send it.
All the while, a train rages over the left track in random intervals possibly killing players if they’re unlucky.


(isbowhten) #7

nice :slight_smile:
well i would suggest to use dlights, it also depends on your brushes in your map how much fps is eaten.
e.g. a simple room with a few moving dlights dont eat any FPS at my PC.

the rest is timing and scripting.

maybe you think this is funny:
you can make trains starting to drive towards a player if he is near :stuck_out_tongue:


(Flippy) #8

[QUOTE=isbowhten;186662]nice :slight_smile:
well i would suggest to use dlights, it also depends on your brushes in your map how much fps is eaten.
e.g. a simple room with a few moving dlights dont eat any FPS at my PC.

the rest is timing and scripting.

maybe you think this is funny:
you can make trains starting to drive towards a player if he is near :P[/QUOTE]

Problem is, it’s right in the middle of the outside area, which consists mainly of terrain so will contain lots of brushes. Probably the worst part to put a dlight, let alone 2 :slight_smile:

And I’d like to keep my map as realistic as possible, target-seeking trains are not part of that lol :stuck_out_tongue:


(isbowhten) #9

what a pity


(aaa3) #10

i laughed a great on Flippy’s last sentence ^^