MineColonies

MineColonies

53M Downloads

[GENERAL] Create a internal Colony request and Market system. [$10 awarded]

marchermans opened this issue ยท 3 comments

commented

Current Situation:

In the current Construct the individual Workers request Items that can either be delivered by the User or by the Delivery Man from the Warehouse, when neither are available this can cause Issues, with builders, miners and other Workers not getting their requested Items, but still thinking that they made the request.

Desired Situation:

A general handling of requests and deliveries by an external System that is not managed by a Building and or a Worker and that can be stored independently on the Colony.

Proposed Changes to the Colony:

  • Let the Colony handle the Requests its citizens make. This should allow for more then one Warehouse (maybe even filtered specific Warehouses) in a Colony as well as better and finer control when requests that were not full filled by the Warehouse are send to the User.
    • Make it possible for requests to be made, both from Buildings and from Workers directly.
    • Make it possible to withdraw requests made, again both from Buildings and Workers directly.
    • Make it possible for the Colony to see the contents of a Building. (Special class indicating the use of a Content, like used for crafting, delivery, tools, stock, etc)
    • Manage requests based on the contents of all buildings in a Colony.

Proposed Changes to the Warehouse

  • Handle requests delegated by the Colony (by sending Deliverymans)
    - Pull Stockpiles from Buildings and store them if possible.
    - Full fill requests by delivering Contents from the Warehouse.

Proposed Changes to Buildings in general (if applicable)

  • Make it possible for Buildings to supply Items on demand. (Expose what a Worker can make/craft)
    • A Miner should only be able to supply what he has in stock.
    • However a Smith should be able to supply everything he can make.

Advantages of the new system:

  • A centralized way of handling request.
  • A controlled environment that is used to manage interaction with the Player when missing items are needed, should reduce bugs that cause workers to get stuck when waiting for a specific Resource, and makes the Colony itself a that bit more self sustaining.
  • It should allow for Colony to Colony interaction with regards to the economy.

The $10 bounty on this issue has been claimed at Bountysource.

commented

Some more details before I start working on this:
https://gist.github.com/OrionDevelopment/1cf29da278f9fc0f306a6b1bc17299fe

commented

This is definitely a direction I approve!

We have to solve multiple cases and should be clear what happens in them:

  1. A worker requests an item and no warehouse exist
  2. A worker requests an item and a warehouse but no deliveryman exist
  3. A worker requests an item and no warehouse but a deliveryman exist and has the item
  4. A worker requests an item and no warehouse has it in store
  5. A worker requests an item and two warehouses have this item
  6. A worker requests an item and a second worker can craft it, but he himself needs resources for it
  7. A resource is requested and two citizen can craft it (with different recipes)
  8. Two requests for stone appear but there is only one stone
  9. The deliveryman who fulfills a request dies

I guess that is enough for now. There are some requirements to the system we have to guarantee in all these cases:

  • Liveness: There should always be progress, never gets a request lost
  • Fallback: If a request cannot be fulfilled, the player should be asked, even if the situation changes (items used/taken away)
  • Efficiency: Big colonies should not suffer under O(n2) operations

If we can have a design that fulfills all this then I am all for it.

commented

just wanted to add a note: if you have multiple delivery men they seem to service the same request at the same time resulting in a flooded inventory for the builder/miner etc.