Minecolonies & The Cook

in #utopian-io6 years ago

Hey everyone, exciting news, a new worker, the Cook is finally hitting our alphas.

With the cook we rework several parts of the mod where players had problems previously.

Previously the deliveryman was responsible for delivering food to all citizen huts when citizen felt hungry the night before.
This got us into some problems since it took away a good part of the deliveryman worker force.

Additionally, workers did not try to get food from their worker chests before.
We now finally changed this.

Every AI got a new State which takes care of being hungry.

As you can see in the figure above, we check if the citizen has a not perfect saturation and also look if he already looked for food today. If not he will search food in his chest.
Nevertheless, if his saturation reaches 0 he will automatically search a restaurant to get saturatred, where the cook will bring him food.


The cook himself is responsible for taking care that he always has enough food in his hut, for this reason he has a lot of storage in there.
He requests food and fuel to the request system of the colony and then cooks it on arrival in up to 5 furnaces depending on his building level.

Our AI are usually state driven, that means we have certain predefined states in each worker and depending on the disponibility of certain resources he will switch to a certain state.

In the cook there are the follwing states:

Let's simulate an example execution:

Like every worker the cook starts out in the START_WORKING State and will search for food in his hut.

In the next step he will find raw food and will, therefore, switch to the COOK_COOK_FOOD step.

Arriving in this state he will notice he doesn't have any fuel for the furnace and will switch to COOK_GET_FIREWOOD

If there is firewood in his hut he will take it, else he will request it to the Deliveryman and he will switch back to START_WORKING until then so see if there is anything else to do which doesn't require any fuel.

For example he might switch to COOK_SERVE to serve any hungry worker.

As soon as the delivery arrives he will then switch back to COOK_COOK_FOOD and finish it.

Then he will wait until the conditions are met to retrieve the food from the furnace and voilá.

I hope you'll be having a lot of fun with our cook.

See you the next time.

PS: Will be working on finding the last bugs and merging it to 1.12 and 1.11 today.



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Hey @raycoms I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • You are generating more rewards than average for this category. Super!;)
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Congratulations @raycoms, this post is the second most rewarded post (based on pending payouts) in the last 12 hours written by a User account holder (accounts that hold between 0.1 and 1.0 Mega Vests). The total number of posts by User account holders during this period was 3080 and the total pending payments to posts in this category was $2721.86. To see the full list of highest paid posts across all accounts categories, click here.

If you do not wish to receive these messages in future, please reply stop to this comment.

There is a modern game I recommend everyone download it is very cool

Coin Marketplace

STEEM 0.29
TRX 0.12
JST 0.033
BTC 63732.43
ETH 3135.73
USDT 1.00
SBD 3.83