RFTools

RFTools

74M Downloads

Endergenic's ticking behaviour

Aquahatsche opened this issue ยท 4 comments

commented

I tinkered a lot with the endergenic generator and how to set them up properly. For wiring I tried several mods (SCM, EnderIO and RFTools). I recompiled your code (v 1.10-5.6.2) with logging enabled. I figured out that there are some inconsistencies in the ticking behaviour. I know that it often relates to vanilla.

Here is the first example logging (the beginning):

=== Time 13202500 ===
125,70,157: Server Tick: pulse -> start charging
=== Time 13202504 ===
119,70,157: Server Tick: pulse -> start charging
=== Time 13202507 ===
125,70,151: Fire Pearl from injector: pearl is launched to 125,70,157
125,70,151: Pearls: age=0, ticks left=3
=== Time 13202508 ===
125,70,151: Pearls: age=0, ticks left=2
119,70,151: Server Tick: pulse -> start charging
=== Time 13202509 ===
125,70,151: Pearls: age=0, ticks left=1
125,70,157: Receive Pearl: pearl arrives at tick 9, age=0, RF=24000
125,70,157: Server Tick: holding pearl, consume 333 RF

Second example logging:

=== Time 13210071 ===
119,70,157: Server Tick: pulse -> start charging
=== Time 13210075 ===
119,70,151: Server Tick: pulse -> start charging
=== Time 13210078 ===
125,70,157: Fire Pearl from injector: pearl is launched to 119,70,157
125,70,157: Pearls: age=0, ticks left=3
=== Time 13210079 ===
125,70,151: Server Tick: pulse -> start charging
125,70,157: Pearls: age=0, ticks left=2
=== Time 13210080 ===
125,70,157: Pearls: age=0, ticks left=1
119,70,157: Receive Pearl: pearl arrives at tick 10, age=0, RF=38400

In both tests the first endergenic generator starts charging at tick 1 (Time 13202500, Time 13210071)
At tick 10 (Time 13202509, Time 13210080) they behave differently. one says it receives at tick 9 the other one says at tick 10.

Both tests had the same setup. Four endergenic generators with a tick distance of 3 each. The whole setup is in one chunk in a void dimension. The coordinates are different because I wanted to test if the relative block position inside the setup makes any diffferences.

commented

That's vanilla. Tile Entities in a chunk don't always tick in the same order. It depends on what other blocks are there and so on. So this cannot be made deterministic easily

commented

It can (probably). Atm I'm working on a solution. To fix that particular issue mentioned above add this to the method handleTick(...) in EndergenicPearl.java:
if (ticksLeft <= 0 && ticksStarted != world.getTotalWorldTime()) {

long ticksStarted ist passed to the constructor and stored in a class variable. The value comes from the EndergenicTileEntity's worldObj.getTotalWorldTime()
That value is final, so we line up the code to the next tick. It works pretty well.

commented

Sorry, haven't had a chance to look at this. But it is not ignored though :-)

commented

Closed in preference for this one #854