Creating Optimized Escalators

In my map TTT_Nuclear_Power I have fully functioning escalators:

They work extremely well but I believe they are a contributing factor for some servers experiencing lag in that area of the map. Right now, every step spawned is a func_tracktrain, which to my understanding is a networked entity (or edict). I’d like to replace the escalator system with something more optimized that doesn’t cause any load on a server. Does anyone have any ideas?

Would it work to model all of the escalator steps in Blender and create a looping animation for the steps moving one step length? And then I could make them non-solid and use an invisible func_conveyor to actually move the player?

Is there a better way to approach this?

This is in fact the best way to do it. However, I don’t know if func_conveyor can replicate the movement in an acceptable way.

[editline]11th September 2017[/editline]

Holy cow, Im surprised this doesn’t crash on load. I can definitely see how this causes performance problems

func_conveyor can actually move players in an acceptable way. Right now I have them on the escalator “belt railings” so if a player stands on the railings they will move at the same rate as the steps. However func_conveyors don’t move anything other than players. I’ve had some luck with trigger_vphysics_motion as the other half of it to move physics objects though, so I think I could get it done that way.

And yeah, the load on the server actually wasn’t an issue at all in the B2 version of the map. I think it’s when I added a lot more other content in V3 that it finally started to run into some performance issues. Time to optimize!

Animated model + func_conveyor + trigger_vphysics_motion?

Yeah, I think that’s the route I’m going to have to take. The other alternatives would be changing it to a simple conveyor belt scrolling texture or just making the steps stationary, but I don’t want to do either of those things.

I don’t have too much experience with modeling in Blender but it should be a fun challenge and I’m sure I could figure it out.

Is it in any way possible for the animated model to be solid and have a collision that carries the player up? Or as I suspect, is that outside the realm of the Source Engine’s capabilities?

I don’t think so, atleast that would explain why all of L4D2s Rescue Vehicles are non-solid

Yes this is very much possible although frustrating… It worked out perfectly some time but didn’t some other time for no apparent reason. You can add me on steam if you want. Searching for “KingPommes” should do

Bit off-topic but you do remember there is a button below your name that leads directly to your profile right?

This isn’t actually how animated models with collisions are supposed to be used. It can lead to numerous instances of people getting stuck etc. For example, in the lab scene in HL2 with Lamar, the npc doesn’t actually knock the cans and monitors over, those are faked with phys_explosion entities.

I’m going the route of making a custom model and using a func_conveyor + trigger_vphysics_motion. I don’t think any other way would work properly, like you guys have said.

This is my first creation in Blender, but through a lot of trial and error, I managed to get a fully animated escalator model working with the same texture and dimensions as in the map, so it should look more or less the exact same:

Now I just need to figure out how to export it to the Source Engine. :stuck_out_tongue:

As for physics collision, you can attach a collision object to an animated bone, and I don’t have problems with the player colliding with them.

I think that wouldn’t solve his problem regarding performance and edict count, but yeah, thats a good way to do it.

I think you can do one collision mesh per bone, so that’s up to 32 of them per model. Granted, the escalator has more steps than 32, but 2-3 models with animations is better than 64-94 full on tracktrains I’d think.

That’s pretty interesting. The way my model is set up though, I’m not sure how well it would work doing it that way? My model only consists of two bones - one that moves the lower and top flat sections straight forward and one that moves the whole angled section up. The animation is only a few frames since it moves one step length and loops the animation over and over, which seems to be the most optimized way to do it.

In that case an animated collision model isn’t really suitable. I highly recommend against it anyways as it’s a huge pain to setup (a detailed guide on how to get it to work consistently would be amazing)

I’ve thought about this topic for some time and think there’s a third way that could work, but it would be difficult to tweak to work right because the trains in Source sometimes don’t quite move exactly where they should or have little breaks at their path nodes.

If you had managed to get it working with brush entities for a bunch of steps, you could animate the bottom and the top in detail, and for the middle use a bigger brush entity encompassing many steps and either

  • have it move by a step and then teleport back
  • or have two of those and let one drop “into” the escalator while the other one pops out in the right moment, making it a seamless illusion too

One pitfall would be to get the lighting right, but that could probably be arranged with a different light origin and very homogeneous illumination there.

You’d basically animate all the bones at the same time. You’d probably want to break the top and bottom landings off into their own model with its own unique animation.

I don’t see a reason why it’s not possible. It’s more complicated than just having a for-show model with a conveyor+vphysmotion, but it might be an idea to explore.

Is a slope escalator instead of a step escalator an acceptable alternative?

Might look odd for human use. Usually a slope escalator is used for moving luggage or items.