Daily Archives: December 1, 2016

Performance bug

I’ve just found a significant performance bug in code that handles pickables (i.e. items lying on the ground).

The reason for the problem is that the game tries to find a suitable inventory slot for every pickable in the world every frame, even if the pickable is far away from the player. This is a performance killer in creative mode, because player has around 1500 inventory slots (including creative items slots). So for every pickable, 1500 slots are scanned every frame. This takes some time.

As a result, if you have hundreds, or even just dozens of pickables floating around, it will kill the framerate.

I’ve just seen it in the profiler and almost fell off the chair. It must have been in the game since time immemorial! How could I have missed it all these years?

The good news is that it’s trivial to fix. If your game slows down to a crawl when there’s plenty of stuff lying around, just wait for the next version.

I am now putting finishing touches to a new exciting feature that has been requested more than once and was long long overdue. Can’t post any pictures, because it would be a dead giveaway this time :-)

The next version must be released before Christmas.