rehlds / ReHLDS

Enhanced version of the HLDS engine with bug fixes, security patches, and optimizations for stable servers.
https://rehlds.dev/docs/rehlds
GNU General Public License v3.0
681 stars 170 forks source link

Movable objects long distance bug #875

Closed justgo97 closed 1 year ago

justgo97 commented 3 years ago

I m testing a map with an elevator ( a func_train with 2 path_corner ) and there is a big distance the elevator should travel and the problem is at some point the elevator starts moving without its model, it keeps moving but invisible leaving the visual object behind.

Video showing the bug : https://youtu.be/gucC87Pwg9U

You will see 1:07 how the platform will keep going invisible without the texture.

The map

Steps to reproduce : 1 - get on the elevator and start it with the button 2 - Wait for it till it gets at a high place 3 - now you will notice that the texture will be left behind but the train is still moving

NukemD commented 3 years ago

This is a known Half-Life engine bug that's been around since the original WON release of the game, it has nothing to do with rehlds. All brush entities have a maximum distance their world model can travel from their origin, it's not limited to func_train.

This bug isn't fixable without a client patch because the networked entity code is shared between the client and the server.

You'll have to get creative and split the elevators up so they only travel below the maximum distance before they break. freefall4 and freefall5 on TFC did this waaaay back in the early 2000s.

justgo97 commented 3 years ago

This is a known Half-Life engine bug that's been around since the original WON release of the game, it has nothing to do with rehlds. All brush entities have a maximum distance their world model can travel from their origin, it's not limited to func_train.

This bug isn't fixable without a client patch because the networked entity code is shared between the client and the server.

You'll have to get creative and split the elevators up so they only travel below the maximum distance before they break. freefall4 and freefall5 on TFC did this waaaay back in the early 2000s.

Thanks for elaborating about this, I already fixed this by creating two elevators, one is invisible and non-solid and I spawn it in the middle of the map, once the first elevator touches the invisible one they swap states, the first elevator gets invisible and stops and the second becomes visible and solid then starts moving, so far it works but it's a tricky solution and I needed to use an amxx plugin to manage this.

NukemD commented 3 years ago

You shouldn't need an amxx plugin to do that. Just have a path_corner midway and another identical func_train nearby but outside the map in like a small skybox area. Have the "teleport" flag set on the path_corner and the lower func_train trigger it on passing. The upper func_train should teleport in and you can have the lower func_train teleport back to the bottom or out of sight.

You may have to do more trickery if you want the train to be able to go in both directions.

justgo97 commented 3 years ago

You shouldn't need an amxx plugin to do that. Just have a path_corner midway and another identical func_train nearby but outside the map in like a small skybox area. Have the "teleport" flag set on the path_corner and the lower func_train trigger it on passing. The upper func_train should teleport in and you can have the lower func_train teleport back to the bottom or out of sight.

You may have to do more trickery if you want the train to be able to go in both directions.

That seems like a nice solution though I never tested that, for now, the plugin method seems to work fine and it's easy to test and maintain, I don't need it to go both directions but I guess that would be so easy to do in the plugin as I won't have to deal with many entities, just the two elevators swapping states. I wonder if Steam would fix this bug and someone already reported it? or if something can be done from the server side to somehow make this work like respawning the entity or relinking/resetting it...

NukemD commented 3 years ago

I don't think Valve has any interest or anyone qualified still to fix old GoldSRC engine bugs. You can report bugs on Valve's HL github repo

https://github.com/ValveSoftware/halflife/issues

But I don't think they get fixed, just discussed.