[1.7.10][Cauldron][1.8] Tick Dynamic - Keep your server running at 20 TPS

wildex999

New Member
Jul 29, 2019
46
0
0
Tick Dynamic

tickdynamic_1.png

Tick Dynamic is a Minecraft Forge CoreMod, which will attempt to maintain a server Ticks Per Second at 20. It does this by individually controlling how many Entities and TileEntities update each tick. As the server TPS goes down, the number of Entities and TileEntities that update each tick also goes down, to maintain a high server TPS.
Note: This is server side, so players/clients do not need to have it installed!
Detailed description:
On a Minecraft server the world will update 20 times a second. This means that the server has 50 milliseconds to go through every active world and update the Entities, TileEntities and other tings like lighting and terrain generation.
Once your server has a lot of players, and large active bases, the server might start having problems updating everything within the given time.
This is especially true on modded server with Chunk loaders, large bases with a lot of TileEntities, and many new Monsters and other Entities.

With Tick Dynamic on your server, you will be able to define how much time each world is allowed to use, and within each world, how much time Entities and TileEntities are allowed to use.
Whenever these limits are hit, Tick Dynamic will limit the number of Entities and/or TileEntities that updates each tick for the given groups.
You essentially have a separate TPS for Entities and TileEntities in each world.

So what do you gain by maintaining a server TPS of 20, by allowing Entities and TileEntitie to update slower?
- Little to no Block lag
- Interact with TileEntities(Chests, Machines etc.) without delays
- Chunk loading and teleporting without long pauses
- No player lag when moving around
- No disconnects due to long ticks
- Generally lower ping and a more responsive server


Note however, that Tick Dynamic will not help for every case, certain events will still cause the TPS to drop, or cause noticeable lag.
Some examples for this is:
- World Generation taking a significant amount of time of a tick.
- Rapid change in time usage for a world
- One mod, or a combination of mobs, using a large amount of time on a single operation during a tick.
- World backup
However, Tick Dynamic should be able to smooth out the spikes by quite a bit.

Tick Dynamic allows a lot of control in how it will maintain that 20 TPS.
If you would have Entities run at a full 20 TPS, but you don't care about TileEntities, you can provide a larger slice of time for Entities.
If you want to give Overworld more time, you can also give it a larger slice of time than the other worlds.
Check out the Help section for full overview of the configuration options, commands and installation instructions.

Example use cases:
Default config
Just dropping Tick Dynamic into a server that is struggling with TPS due to a large amount of Entities and/or TileEntities, will in most cases help the server TPS get up to a constant 20TPS.
By default Tick Dynamic will allocate the time evenly. So if you have Overworld, The End and Nether, each world will be given ~16,66 ms.
Then within each world, Entities and TileEntities will be given ~8,33 ms to run their updates.
If either Entities or TileEntities use more than their given time, it will limit the number of updates to fit within the given time automatically.

Please note however, that if any group is not using all the time provided to it, that time will be available for other groups.
So if a world is heavy on Entities, but have few TileEntities, then more time will automatically be given to Entities.
Same for worlds, If a world uses a lot of time, and two others do not, then the active world will be given more time.

Mining/Spawner World
On many modded servers you have assigned worlds/dimensions for running machines like Quarries, as they make the world look "ugly" with a lot of holes around.
Using Tick Dynamic you have an additional reason to use specific worlds for things.
For a mining world, you can specify that the world is to be given a lower slice of time, thus at peak times when a lot of players are on, the Machines and Entities in this world will start running at a lower tickrate, before worlds like the Overworld.
Likewise, you can assign a world for Mob Spawners and Mob Farms, and give Entities a lower slice of time, without affecting the mobs in the Overworld or The End.

Planned further development:
- Per Chunk timing and limit
Instead of slowing down TileEntities or Entities globally in world, locally slow down the Entities and/or TileEntities that are using a lot of time in a chunk.

- Per user timing and limit
You know that user that seems to just live on your server, and builds large, complex and CPU intensive builds.
With this feature you will be able to set a limit on just that players Entities and TileEntities.
This feature is a bit into the future tho, as some changes are required for it to work.

The mod is currently a Minecraft Forge CoreMod, and is built for Minecraft 1.7.10, 1.7.10 Cauldron and Minecraft 1.8
Download & Documentation: Tick Dynamic Project Page

If you have any questions or problems, you can post them here, or on our GitHub Repository, and I will try to answer them =)
 
Last edited:

Zaflis

New Member
Jul 29, 2019
184
0
0
Are you able to report what entities or tile-entities would lag most? Opis isn't reliable on 1.7.10 and we lack the tools to debug. If we knew, we could get to the bottom of the core issues and report lag problems to mod authors.
 

wildex999

New Member
Jul 29, 2019
46
0
0
That is what I plan to have my next mod be.
It will be able to sample to get the time used by Chunks, Entity/TIleEntity types etc.
It will not be able to tell you exactly how much time each single Entity/TileEntity is using, but it will be able to tell you how much time is used by for example "EntityCow" in the world, and within a chunk.
So you can list chunks in a world by the time they use, then list the time used by Entity/TileEntity types within that chunk to get to what is using the time.
That is how my mod worked when I wrote it for my own server back in the 1.5 days xD
 
  • Like
Reactions: Geometry

GreenZombie

New Member
Jul 29, 2019
2,402
-1
0
Crikey.
For a deep-in-alpha mod this has "sorted" out my servers performance problems.
By "sorted" I mean, of course, something, somewhere, is not getting ticks.

Question: How "fair" is it - if tick processing is cut off, on the next tick it will restart processing where it left off ?
 

wildex999

New Member
Jul 29, 2019
46
0
0
Glad it's working out for you =D

As for how fair... it depends.
Whenever it cut's off, it stores the current index into the list of Entities/TileEntities, and on the next tick it will continue at that index.
However, Entities and TileEntities can be removed from the list between updates, which means the index may have shifted. This means that on the next tick it might start further back, or further forward in the list depending on how it changed, thus ticking certain entities twice, and maybe skipping others.
But, over time it should average out to a "fair" distribution =)

EDIT: Correction: The index should never go backwards, as items can be remove from before the index(Thus pushing the index forward in the list), but all new items are added at the end of the list(Not affecting the index)
So, an Entity/TileEntity can be skipped for a tick, but will never be "double ticked".
 
Last edited:
  • Like
Reactions: Geometry

wildex999

New Member
Jul 29, 2019
46
0
0
A quick update for you guys:
- Updated to version 0.1.3, which does some bugfixes, makes it more compatible with the patching.
It will also now take into account time spent between ticks. So if you are running multiple Minecraft servers, and the other one starts hogging the CPU, Tick Dynamic will now notice it and lower the Entity/TE TPS to maintain a 20 TPS Server =)

Also for those who have not yet been able to use this, because they are using a Cauldron server, or are running Minecraft 1.8:
- Released a Cauldron compatible version
- Released a MC 1.8 version
 
  • Like
Reactions: Geometry

kallope

New Member
Jul 29, 2019
224
0
1
I really like the idea of this mod.

I have tried it on my dw20 server, however it seems to break big reactors :(
 

wildex999

New Member
Jul 29, 2019
46
0
0
Seems it's not getting water pumped in =/
If the world is getting slowed, both the reactor and any water pipes should be running at the same tickrate.

EDIT: I'll try setting up a reactor on my own server, and try it out. What are you using to cool it(Water source, pipes etc?)?
 

kallope

New Member
Jul 29, 2019
224
0
1
Was using extra utilities liquid transfer pipes into an ender tank and then tried both exporting the ender tank directly, by a liquid conduit and by putting it into a tesseracts and inputting it that way but didn't give me any success.


Sent from my iPhone using Tapatalk
 

wildex999

New Member
Jul 29, 2019
46
0
0
Ok, I have confirmed that this happens.
It seems that "Big Reactors" does the energy calculations based on the server TPS, rather than how often the reactor Tile Entities actually updates.
So, as the reactor is ticking less often(Low Tile Entities TPS) it actually uses more water per tick, until eventually it's using more than you can provide to it.

In the next version I will provide a method of avoiding this problem, by allowing you set TileEntities that are not slowed down. So you can set the Big Reactors and Water supply to not be slowed down, and thus allowing it to work normally.
 

kallope

New Member
Jul 29, 2019
224
0
1
That would be great. Thanks for looking into this.


Sent from my iPhone using Tapatalk
 

fusty

New Member
Jul 29, 2019
4
0
0
Have you considered limiting things by chunk? This would be a neat way of not having to keep track of players, but rather throttling offending chunks. This could have some annoying chunk-boundary effects but overall things might run more smoothly than now.
 

keybounce

New Member
Jul 29, 2019
1,925
0
0
Let me see if I understand the mod/goal here:

If it takes a long time to tick everything, then you might get 5 tps, and each entity/tile entity gets ticked 5 times, once per server tick.

With this installed, you will get (best case) 20 tps. During each tick, 1/4th of the entities in the loaded chunks get ticked. Each still gets 5 ticks per second, but only gets updated once every 4 server ticks.

That about sum it up?

So I assume this means that the sun/moon will move properly, at 20 real minutes per cycle, even when the server is loaded, and I won't see the client's idea of "Game time" jump around.

Will things like furnaces ... actually, will a smelt take 10 seconds like it does now, or will it take time based on how many ticks it sees?
 

keybounce

New Member
Jul 29, 2019
1,925
0
0
Ohh ... speaking of reactors, how will this work with rotarycraft/reactorcraft machines/engines/reactors?