Minecolonies & The fixathon

in #utopian-io6 years ago

Hey everyone, continuing the quest of solving as many of minor and medium-sized issues which are quite often gamebreaking I solved a bunch of other issues during this week.

Female Deliveryman:

First of all, the female deliveryman's arms were quite far from her body and too far behind, so I adjusted the values of that and cleaned up the model code a bit while I was at it.

The result looks much better:

Structure Rotation:

Previously when we wanted to mirror decorations when placing them they would be placed with an offset.

As in the above picture, they should've been build on the same spot, but due to the mirror function, it was placed with an offset.

After some tinkering, I found out that this happens because the central position we calculate does not change when we place the structure.

To fix this, we recalculate the point when mirroring (Mirror would be making positive x to negative x and positive z to negative z) and then applying the rotation to the point.

Works perfectly now.

Ladder issues:

Besides that citizens regularly got stuck on ladders when trying to path down.
Since the Pathfinder is not able to exactly time the position as a player would.

That's why I had the pathfinder to search a position randomly close to his target which will let the worker by 80% on the first try to go down, and then he will continue pathing different distances until he is able to do it.

Worker dumping:

Then, I finally fixed that workers are able to dump their items into all chests within their building.

The fix for that was super easy since our buildings are CapabilityProviders which do provide a container (And this container is a list of all containers of the building) I had to adapt that we dump into the building and not into the building chest.

Dman Gathering:

Since we allow the worker to put things in the chest we gotta allow the dman to retrieve from there as well:

So, again I replaced building tileEntity with building only.

Uploading file..._agfpaksns

Dman random gathering:

We also fixed the random Dman gathering to be truly random by priority and not pseudo-random.

By shuffling the array of the building.

Citizen style changes:

Citizens previously changed their style depending on their level, but since they only level in jobs we adapted this to them leveling depending on the housing.

So, you'll see some especially, fancy citizens over your colony.

For that, I extracted some model code to prime it on the building level into a specific method.

Which gets called on assign and unassign to and from a building and on building an upgrade for all citizens of a particular building.

Limit Cook:

Since we fixed the cook he requested infinite amounts of food which we limited to his building level:

Where we had a reachedMaxToKeep() which we check before we request any material in our superclass.

    @Override
    protected boolean reachedMaxToKeep()
    {
        return InventoryUtils.getItemCountInProvider(getOwnBuilding(), ItemStackUtils.ISFOOD) > Math.max(1, getOwnBuilding().getBuildingLevel() * getOwnBuilding().getBuildingLevel() / 2) * SLOT_PER_LINE;
    }

StackOverflow Hotfix:

Then we had this week our server run into a restart loop since someone built a cycle into the crafting requests.
So I had to hotfix a loop delimiter.

Doing the classic, adding the same method with a counter.

And then checking for it, while increasing it with each recursive call.

Guards pathing weirdly:

Then, we also fixed the guard getting stuck while pathing to weird places,
so I made the stuck handler available for the guard.
And then, we decide on a new control target if we are there or if we are stuck going to the current one.

Lumberjack range fixes:

We also had a bunch of players complain for a while about the lumberjack wandering off too far.
Which we fixed by letting him wander only a certain range off and then starting to search close to his hut again.

By adjusting his start position when he is too far from the hut:

Small adaptations:

And finally but not less important some small fixes:

  • Hotfixing some NPEs by adding null checks.
  • Reducing the despawn time for barbarians.
  • Hotfixing some code smells.
  • Make smeltable request independent of the requested amount.

List of Pull Requests:

https://github.com/ldtteam/minecolonies/pull/2662
https://github.com/ldtteam/minecolonies/pull/2660
https://github.com/ldtteam/minecolonies/pull/2649
https://github.com/ldtteam/minecolonies/pull/2633
https://github.com/ldtteam/minecolonies/pull/2646
https://github.com/ldtteam/minecolonies/pull/2642
https://github.com/ldtteam/minecolonies/pull/2641
https://github.com/ldtteam/minecolonies/pull/2640
https://github.com/ldtteam/minecolonies/pull/2635

Sort:  

Thank you for your contribution. A large number of bugs have been fixed, nice work.

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]

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

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

Vote for Utopian Witness!

Wow, the transformation is fascinating look at @raycoms
Your codes don't seem easy to learn but let me stay put and wait for your next posts otherwise thank you for sharing

Coin Marketplace

STEEM 0.20
TRX 0.15
JST 0.030
BTC 65269.02
ETH 2653.11
USDT 1.00
SBD 2.84