Traincraft

Traincraft

1M Downloads

FPS Problems with Switches

xNccPlay opened this issue ยท 5 comments

commented

Hello guys, I don't know, if anybody already posted something like that, but I didn't found anything.
We noticed, that when we are placing a few switches on our server, the FPS is massivly dropping. My PC get around 200 FPS in our City and when i'm moving towards our central station, they're dropping down to 40-60 FPS. After that, I created a flat world, placed some tracks and compared the FPS. Yeah I know, the more FPS I have, the more they are dropping, but this is huge. Does it give any way to use other textures or do anything else to reduce the lags? We already replaced all straight TC tracks with Railcraft tracks. Now its a bit better, but not good enough for permanent usage. If you need any other informations, just ask :)

Greetings xNccPlay

2018-07-26_12 58 12
2018-07-26_12 58 39
2018-07-26_12 59 47
2018-07-26_13 00 28
2018-07-26_13 00 53
2018-07-26_13 19 06

commented

Yeah, the FPS drop with a lot of tracks is quite annoying, especially when you have a big node like that
The worst thing is that it's not a small drop, in some cases this drop with the connection of the place where some factory is with machines from different mods, which then with the connection with Traincraft tracks cause an unplayable place :D

Looking into the sky
2022-07-30_20 21 22

Looking into places where we can see the tracks but also the ones we can't see thanks to the blocks
2022-07-30_20 21 18

commented

Lag is a problem with the current track that isn't really fixable, one of the many reasons that we are doing a rewrite. As of right now your options are to deal with the lag, or to not use them. When the rewrite comes around, it will be fixed, and there will be less FPS drop.

commented

Borscolotos is correct.
The main reason behind the lag currently is the model format, obj has a lot of overhead as compared to programmatically generated models, like the trains for example, because it's a parsed format, it has to read the file, store it, then render what's stored, And weaker computers have less storage for this stuff so it becomes more common they have to repeat the entire process.
Programmatically generated modes on the other hand don't need parsing or storage, because the values are all statically defined in a class, ready to access at any given moment.

With the rewrite not only will the models be redesigned in a similar method to the train, but they will have procedural generation to let us make new rail shapes faster and easier, this will also allow for animations and dynamic track for very little overhead.

Also, don't feel bad about the superflat world thing, that's actually the best possible way to check the performance hit of different items.

commented

You said that it probably will be possible to make content pack using obj files. So it will still drop fps or not?

commented

Oh yeah, even in the rewrite obj (and .json for that matter) will make a noticeable fps hit.
That's why, even though you will have the option to do it in content packs, we still won't accept it for TC.