Difference between revisions of "TrainCarts/Lag"
Bergerkiller (talk | contribs) |
Bergerkiller (talk | contribs) (Marked this version for translation) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | [[TrainCarts|« Go back]] | + | <languages/> |
+ | <translate> | ||
+ | <!--T:1--> | ||
+ | [[Special:MyLanguage/TrainCarts|« Go back]] | ||
+ | <!--T:2--> | ||
Using the plugin in some way may cause server or client lag. This page details causes of lag, and how to deal with them. | Using the plugin in some way may cause server or client lag. This page details causes of lag, and how to deal with them. | ||
− | == Complex 3D models == | + | == Complex 3D models == <!--T:3--> |
+ | |||
+ | <!--T:4--> | ||
Minecraft is not very good at rendering complicated voxel models. If you use a custom resource pack on the server that has far too complicated models, it can cause the FPS of the client to drop. Always review models before you use them on a live server. The model JSON filesize is a strong indicator. | Minecraft is not very good at rendering complicated voxel models. If you use a custom resource pack on the server that has far too complicated models, it can cause the FPS of the client to drop. Always review models before you use them on a live server. The model JSON filesize is a strong indicator. | ||
− | == Large carts == | + | == Large carts == <!--T:5--> |
− | When configuring the [[TrainCarts/Attachments/Physical|physical]] attributes of a cart in the [[TrainCarts/Attachments|attachment editor]], the cart size can be set very large. This changes the bounding box of the entity itself, which may result in worsened TPS on the server. The main cause is the block collision calculations the server does. To prevent this problem, disable block collisions entirely | + | |
+ | <!--T:6--> | ||
+ | When configuring the [[Special:MyLanguage/TrainCarts/Attachments/Physical|physical]] attributes of a cart in the [[Special:MyLanguage/TrainCarts/Attachments|attachment editor]], the cart size can be set very large. This changes the bounding box of the entity itself, which may result in worsened TPS on the server. The main cause is the block collision calculations the server does. To prevent this problem, disable block collisions entirely | ||
+ | </translate> | ||
{{Command|train collision block cancel|Turns off block collisions, trains will fall through the ground|train.property.collision}} | {{Command|train collision block cancel|Turns off block collisions, trains will fall through the ground|train.property.collision}} | ||
+ | <translate> | ||
+ | == Large wait distance == <!--T:7--> | ||
− | + | <!--T:8--> | |
− | The [[TrainCarts/Signs/Property#Wait_Property|wait distance property]] can be set for a train, so that it will keep distance to trains up ahead. This does require tracking all the rails the full distance in front of the train. Setting this distance too high can therefore result in worsened TPS on the server. | + | The [[Special:MyLanguage/TrainCarts/Signs/Property#Wait_Property|wait distance property]] can be set for a train, so that it will keep distance to trains up ahead. This does require tracking all the rails the full distance in front of the train. Setting this distance too high can therefore result in worsened TPS on the server. |
− | == Keep chunks loaded == | + | == Keep chunks loaded == <!--T:9--> |
+ | |||
+ | <!--T:10--> | ||
Trains can keep chunks loaded, but too many loaded chunks may also hurt server performance. They consume RAM, which might cause an out-of-memory situation. They may also contain entities or redstone contraptions that all contribute to a worsened TPS. As trains move, they load and unload chunks continuously, which might also cause problems. | Trains can keep chunks loaded, but too many loaded chunks may also hurt server performance. They consume RAM, which might cause an out-of-memory situation. They may also contain entities or redstone contraptions that all contribute to a worsened TPS. As trains move, they load and unload chunks continuously, which might also cause problems. | ||
+ | <!--T:11--> | ||
Generally a single train keeping chunks loaded is not a big deal, it's no different from a player moving from one location to another. But having hundreds of them on far reaches of the server could cause problems. | Generally a single train keeping chunks loaded is not a big deal, it's no different from a player moving from one location to another. But having hundreds of them on far reaches of the server could cause problems. | ||
+ | |||
+ | == Limit the number of trains == <!--T:12--> | ||
+ | |||
+ | <!--T:13--> | ||
+ | You can edit <code>plugins/Train_Carts/config.yml</code> to limit how many individual TrainCarts Minecart entities can exist per world. This prevents an out of control spawner sign or player abuse lagging the server to a halt. | ||
+ | <pre> | ||
+ | # Limits of the amount of carts on the server | ||
+ | cartLimits: | ||
+ | # Maximum number of TrainCarts minecarts allowed per world | ||
+ | # If there are more than this number, no more minecarts can be placed/spawned | ||
+ | # A value of -1 disables this limit (default) | ||
+ | maxCartsPerWorld: -1 | ||
+ | |||
+ | <!--T:14--> | ||
+ | # Whether to include unloaded trains/carts in the maxCartsPerWorld limit | ||
+ | countUnloaded: false | ||
+ | |||
+ | <!--T:15--> | ||
+ | # Maximum number of carts that can be joined together in a train | ||
+ | # Linking does not happen when it would exceed this limit, | ||
+ | # and trains longer than this cannot be spawned | ||
+ | # A value of -1 disables this limit, allowing any length (default) | ||
+ | maxCartsPerTrain: -1 | ||
+ | </pre> | ||
+ | |||
+ | == Saved Train Spawn Limits == <!--T:16--> | ||
+ | |||
+ | <!--T:17--> | ||
+ | Besides a global limit, it is possible to configure a spawn limit per saved train. After having saved a train with <code>/train save name</code>, you can configure a spawn limit with <code>/savedtrain name spawnlimit <limit></code>. | ||
+ | |||
+ | <!--T:18--> | ||
+ | Spawn signs and train chests configured with the train name will stop spawning trains when this limit is reached. This is particularly useful with [[Special:MyLanguage/TrainCarts/Signs/Spawner|auto-spawning spawn signs]] that populate a train network, combined with setting <code>destroyAllOnShutdown</code> to true in '''config.yml'''. | ||
+ | </translate> |
Latest revision as of 12:31, 3 September 2024
Using the plugin in some way may cause server or client lag. This page details causes of lag, and how to deal with them.
Complex 3D models
Minecraft is not very good at rendering complicated voxel models. If you use a custom resource pack on the server that has far too complicated models, it can cause the FPS of the client to drop. Always review models before you use them on a live server. The model JSON filesize is a strong indicator.
Large carts
When configuring the physical attributes of a cart in the attachment editor, the cart size can be set very large. This changes the bounding box of the entity itself, which may result in worsened TPS on the server. The main cause is the block collision calculations the server does. To prevent this problem, disable block collisions entirely
Command: | /train collision block cancel |
---|---|
Permission: | train.property.collision |
Large wait distance
The wait distance property can be set for a train, so that it will keep distance to trains up ahead. This does require tracking all the rails the full distance in front of the train. Setting this distance too high can therefore result in worsened TPS on the server.
Keep chunks loaded
Trains can keep chunks loaded, but too many loaded chunks may also hurt server performance. They consume RAM, which might cause an out-of-memory situation. They may also contain entities or redstone contraptions that all contribute to a worsened TPS. As trains move, they load and unload chunks continuously, which might also cause problems.
Generally a single train keeping chunks loaded is not a big deal, it's no different from a player moving from one location to another. But having hundreds of them on far reaches of the server could cause problems.
Limit the number of trains
You can edit plugins/Train_Carts/config.yml
to limit how many individual TrainCarts Minecart entities can exist per world. This prevents an out of control spawner sign or player abuse lagging the server to a halt.
# Limits of the amount of carts on the server cartLimits: # Maximum number of TrainCarts minecarts allowed per world # If there are more than this number, no more minecarts can be placed/spawned # A value of -1 disables this limit (default) maxCartsPerWorld: -1 # Whether to include unloaded trains/carts in the maxCartsPerWorld limit countUnloaded: false # Maximum number of carts that can be joined together in a train # Linking does not happen when it would exceed this limit, # and trains longer than this cannot be spawned # A value of -1 disables this limit, allowing any length (default) maxCartsPerTrain: -1
Saved Train Spawn Limits
Besides a global limit, it is possible to configure a spawn limit per saved train. After having saved a train with /train save name
, you can configure a spawn limit with /savedtrain name spawnlimit <limit>
.
Spawn signs and train chests configured with the train name will stop spawning trains when this limit is reached. This is particularly useful with auto-spawning spawn signs that populate a train network, combined with setting destroyAllOnShutdown
to true in config.yml.