Minecolonies & A Bunch of Fixes

in #utopian-io6 years ago

Hi everyone, I was traveling the last week so I was unable to post anything here. Nonetheless, before I went traveling I merged a bunch of pull requests which I'll be able to write about over the next days.

First of all, I had fixed a bunch of small problems before heading to the holidays.

First batch:

The first fix I did was related to a series of index out of range exceptions which filled up the log. I now made sure that null is returned when out of range so the workers can do the appropriate actions to recover from this situation.

Then, I had profiled our server to find out what is influencing the performance and I found out that we were wasting 10% of the performance on the building task manager. So I made sure it doesn't get called every tick but every second on average.

After that, I did some renaming to have variable names which make sense

and fixed the tinkers mod compatibility by calculating the weapon strength when the weapon is searched so the worker actually uses it.

Following that, I found out that the deliveryman was calculating chests with enough space wrong since it checked for the max stack size of 64 for each stack although some items cannot be stacked up to 64.

Second Batch:

In the second batch, I fixed the claim command to take the dimension into account which is getting claimed by the player while also allowing to unclaim area which does not belong to any valid colony anymore. For that I made the colony id input an integer and added an integer for the dimension.

Then I obtain the id and dimension and claim the chunks based on that.

After that, I got contacted that the sandstone barracks offset is wrong. When I checked the code I noticed that the barracks need an offset into the other direction for sandstone.

Then, after the pvp-event I had noticed that having guards on follow is a pain because they don't walk very fast, as a fix I added that after a certain distance to the player they will teleport to the player.

Then, I fixed a crash with citizens trying to access their bed wrong and improved the performance of the call.

Third Batch:

In the third batch, I first fixed an issue where the world crashed because of the huge pathfinding range of certain workers. I quickly found out that this was related to some workers trying to path to the origin block in certain moments since their actual target was not correctly set yet. To avoid this I added a check to the base method.

After that, I figured out why the builder was running to empty chests since he was picking up air.

And finally, I fixed some issues with the miner related to chunk un/reloading. By reloading the structure the miner is working on if he doesn't have any.

Almost forgot, I also added support for other chests over a certain size for the workers to access by filtering them based on the minimum size to avoid detecting furnaces and similar.

Repository:

https://github.com/ldtteam/minecolonies

https://github.com/ldtteam/minecolonies/pull/2917
https://github.com/ldtteam/minecolonies/pull/2920
https://github.com/ldtteam/minecolonies/pull/2913
https://github.com/ldtteam/minecolonies/pull/2911
https://github.com/ldtteam/minecolonies/pull/2870
https://github.com/ldtteam/minecolonies/pull/2874

Sort:  

Thanks for the contribution, @raycoms! Great to see you fixing all these bugs - stuff like this always feels very rewarding to me personally. Especially the one where you found out that you were wasting 10% of the performance on the building task manager must have been a satisfying fix, haha.


Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]


Yeah, we had a huge bottleneck which was kinda obfuscating these kinds of performance killers.
I will make a post about that one soon. After I cleaned it up it was easier to find out where performance is lost.

Thank you for your review, @amosbastian!

So far this week you've reviewed 11 contributions. Keep up the good work!

Hi, @raycoms!

You just got a 100% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.

Hi @raycoms!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Hey, @raycoms!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63179.13
ETH 2573.33
USDT 1.00
SBD 2.72