Page 1 of 1

0.11.13 fps/ups decrease when placing rails really fast

Posted: Fri Jan 23, 2015 3:15 pm
by Choumiko
A minor one (if a bug at all) and not noticable in unmodded Factorio:

When using my mod to place rails, it starts to really lag when driving diagonally.
The funny/interesting/thing is: when placing signals via the mod too, it is not slowing down (at least not noticeably) even though from the mods point of view it's more work to be done

Numbers from debug screen (show_time_used_percent):

ImageImage
Left one with signals being placed every 15 straight rails, right one without signals (the number keeps going up, decreasing fps and ups), turning on signal placement makes everything go back to normal

With signals being placed, i can go to train speed 1.2 without reduced fps, which indicates to me that my ontick function isn't to heavy (testing showed that it's doing "heavy" work only every 3-5 ticks anyway).
I guess rail segments/blocks get recalculated for every placed piece of track, when it should be only necessary when a signal is placed or a rail track intersects another one. Testing this showed that the number for block/segments increased after every placed rail, though technically it still would be the same block.

Win7 64, amd cpu, nvidia gfx (not that it matters i think)

Re: 0.11.13 fps/ups decrease when placing rails really fast

Posted: Thu Jan 29, 2015 10:29 am
by kovarex
Yes, one of the many places, where we just had to do it somehow and we didn't really have the time for optimisations.

We might do the performance fix for this later, but not for 0.11.

Re: 0.11.13 fps/ups decrease when placing rails really fast

Posted: Sat Jan 31, 2015 9:06 am
by Choumiko
Absolutely fine for me, means i don't have to worry about the performance of my mod until you have time to optimize :D