Currently Online

Latest Posts

Topic: Warehouse controls

Lobsterninja

Topic Opener
Joined: 2010-03-09, 08:00
Posts: 13
Ranking
Pry about Widelands
Posted at: 2010-03-09, 22:18

Would be nice to allow the user to specify the desired stock level for each type of item in a warehouse. The warehouse would request shipment when the stock level is not met. The priority of a warehouse stock request would be lower than a standard consumer request.


Top Quote
Nasenbaer
Avatar
Joined: 2009-02-21, 18:17
Posts: 826
Ranking
One Elder of Players
Location: Germany
Posted at: 2010-03-10, 07:58

There is a similiar feature for the whole economy - click on a flag in your economy and than click on "ware target quantiy settings" (or similiar - don't have a widelands build in front of me atm face-wink.png )

However there are plans to improve ware handling in warehouses as well - so with "stop storing this ware here" and "move all wares of this type to another warehouse" buttons. But ... just future music at the moment :).


Top Quote
ixprefect

Joined: 2009-02-27, 14:28
Posts: 367
Ranking
Tribe Member
Posted at: 2010-03-10, 16:43

What's the opinion on trying to balance warehouse contents automatically? If we have a request somewhere, let that request first check for supplies in the closest warehouse (or idle supplies that are not significantly further away). If this warehouse cannot fulfill the request, flag this somewhere in the warehouse. If a lot of supplies of the missing ware are available elsewhere, have part of them moved to that warehouse.

This would cause building materials to migrate towards the borders where buildings are being built, even if the materials are produced close to the HQ.

The whole idea appeals to me mostly because it's an interesting task to design useful heuristics. I'm not so sure whether it's actually a good idea from a game design perspective.


Top Quote
Lobsterninja

Topic Opener
Joined: 2010-03-09, 08:00
Posts: 13
Ranking
Pry about Widelands
Posted at: 2010-03-12, 11:00

I like both of those ideas.

For warehouses, I would love to see a control for the desired stock level. The UI would replace the single number with a pair of numbers (current / desired), with + and - buttons to adjust the desired quantity. The rule would be that the desire for a commodity gets a bonus if the actual stock level is less than the desired stock level. It would still be possible for the stock to increase beyond the desired level if a commodity doesn't have anywhere better to go, but items will want to move from overstocked warehouses to understocked warehouses.


Top Quote
timowi

Joined: 2009-11-01, 23:08
Posts: 146
Ranking
At home in WL-forums
Location: Germany
Posted at: 2010-03-12, 15:02

I began to implement the "stop storage" and "move out" some time ago. I target to push a branch when build15 is ready. I had some problems with the request system and I think a will change a lot there. I thought of getting the warehouses out of the request system. This would make it a lot easier and allows to implement different "storage strategies". I still have to search for some bugs in the economy code before I can do something useful there.

I try to write something about my plans and push a first branch as soon as possible. It makes not much sense to work on similar features "out of sync". But I want to do a bit for build15 before that.

I think a heuristic for where to store a ware will make it more complicated and harder to understand. Possible it makes it even worse. On big maps it's often almost unpredictable where I will build the next building. Possible it even makes it worse by transporting a long way to a wrong direction and cause more traffic.

I thought of adding a storage strategy like distributing over all warehouses if above a certain value stored and there is road capacity.


Top Quote
Lobsterninja

Topic Opener
Joined: 2010-03-09, 08:00
Posts: 13
Ranking
Pry about Widelands
Posted at: 2010-03-14, 05:00

Here's how I would design it...

Keep in mind that this proposal is a complete system, so each item should not be considered individually without considering the whole (e.g. undoing a bad solution to a real problem and replacing it with a good solution is not the same as just removing the solution). Also, this implements a single basic idea that solves a large set of problems that either have no current solution or have a current inferior solution. With that in mind...

Observations:

  • Economic flow and military flow suffer from similar problems. Currently there is an ad hoc mixture of solutions. If these problems can be solved in a simple universal manner, the game will be more appealing.
  • The feature to specify maximum capacity on military housing and training buildings is intended to meet the need for the players to express some degree of control of the flow of military units. Other than for that purpose, really there is no direct reason to set the max capacity of a building (you would nearly always prefer all buildings to be full, all other things being equal). The user really wants to say "send strong units to the front lines" or "I'd like to put more emphasis on training". These thoughts are quite badly translated into "I want to limit the capacity on this building".
  • This is an economic game, not a military game. Therefore the military aspect must be improved such that the user spends less time micromanaging the military. Ideally, military decisions should have an economic flavor, i.e. that the player is generally interested in controlling production, allocation, and conversion of resources. It would be badly flawed logic to suggest that we should avoid improving the military aspect of the game just because the emphasis is on economy.
  • There are several assorted features that control movement of wares and raw materials. Many of these features are suboptimal and could be replaced with a different way to solve the same problems.

The basic idea is to solve all of the resource distribution problems by allowing the user to specify desired stock levels. This mechanism will also solve the problem of military training (i.e. that there is no decent mechanism for exchanging trained and untrained soldiers). These goals are to be met in a way that avoids micromanaging, and give the player control over something that is fun to control. Although I go into some detail here, the concept is quite simple when you take a moment to think about it.

The desired stock level is not a hard limit. Items can become overstocked or understocked. The desired stock level determines where resources flow (details below...).

Feature to be replaced:

  • Remove the stop button controlling production (it will be redundant with these other changes).
  • Remove the Capacity control on military buildings (redundant, since desired stock level solves the same problem in a better way).

Features to be added (globally implement the concept of desired stock levels)

  • Warehouses: each item has A/B display where A is actual stock and B is desired stock, and a pair of + - buttons to control desired stock level\
  • Military housing buildings (e.g. Fortress, Castle, Barracks, etc.) get a control for the desired occupancy (instead of Capacity).
  • Industrial buildings get a single pair of + - buttons, and visual indicator underneath each stock display representing desired stock level (default = max). The desired stock level is increased for all raw materials proportional to the manufacturing requirements (

In industrial buildings, overstocked items are available to be moved to where they are needed (note that this feature trumps the idea of manually expelling items, which is micromanaging).

To stop production in an industrial facility, the player sets the desired stock levels to zero. Production will continue anyway until the stock is used up or sent elsewhere.

Precedence for wares and raw materials:

1 Understocked industrial building (places production orders)
2 Understocked warehouse (places production orders)
3 Fully stocked warehouse
4 Overstocked industrial building (but only if under maximum capacity).
5 Overstocked warehouse
6 Flag (items without current destination)

Note that "fully stocked industrial building" neither sends nor receives.

Whenever there is a difference in precedence of a good between any two buildings that can be resolved by a transfer, a transfer order is placed. Of course, a transfer from overstocked to fully stocked, or a transfer from fully stocked to understocked would not occur, since these cases would cause the same condition that they try to resolve (possibly resulting in a loop). When determining the relative importance of competing transfers, the transfer with the largest differences between desired stock and actual stock has precedence.

Precedence for military units:

1 Understocked housing (e.g. barracks, castle, tower)
2 Understocked training
3 Fully stocked housing
4 Fully stocked training
5 Overstocked housing
6 Overstocked training
7 Warehouses (implicit desired stock level of 0, so always overstocked if occupied at all)
8 Any training facility containing a fully trained unit

The following restrictions apply:

  • Units move from training to housing only if the strongest unit is better that the weakest unit at the target facility (with respect to a skill available at the facility).
  • A training facility will never accept and always expel a fully trained unit.

In military buildings, "overstocked" soldiers are available to move where they are needed (i.e. soldier most needing training moves to a training facility, and most well trained soldier moves to a housing facility).

Possible variation: perhaps soldiers should not live in warehouses, and perhaps there should be a capacity limit on number of units at headquarters (i.e. headquarter = combined military housing and warehouse). Please note that this suggestion would be really lame in the current system because it would be incompatible with the system of manually adjusting max capacity. In this proposed system, the maximum capacity of buildings does not change.

Strategy Guide using proposed system (how the player uses these features to get things done):

Defend the front lines: Maximize desired stock level on front line military buildings, and reduce other housing buildings and training buildings.
Keep units training until maxed out: Set desired stock level at training facility to maximum.
Release units after incomplete training: Set desired stock level at training facility to a lower value. When the training facility becomes overstocked, the best trained unit will leave (if there is somewhere to go).
Build up inventory in preparation for future use: Increase desired stock level at a nearby warehouse.
Prefer some mines over others when food is scarce: Reduce desired stock level at the less important mines; increase stock level at the more important mines,

Top Quote
Lobsterninja

Topic Opener
Joined: 2010-03-09, 08:00
Posts: 13
Ranking
Pry about Widelands
Posted at: 2010-03-15, 02:10

I converted this to a blueprint:

https://blueprints.launchpad.net/widelands/+spec/stocklevels


Top Quote
SirVer

Joined: 2009-02-19, 15:18
Posts: 1440
Ranking
One Elder of Players
Location: Germany - Munich
Posted at: 2010-03-15, 13:08

Hi,

I had a throughout look at your proposition and I think the blueprint needs more work. I like the general style and it could become an example of future Blueprints. I have the following complaints:

  • You're definition of micro management vs macro management is not clear to me. I think reducing desired stock level in a specific productionsite is as much micro management as is currently setting the number of soldiers in a trainingsite.
  • The personal opinion section is too long.
  • Some of the suggestion already have a bug report, they should be found and linked to the blueprint on launchpad (For example desired stock for productionsite is related to bug 536570).
  • I would destil the following suggestions:
    • Add desired stock to warehouses and productionsites.
    • Add a button to militarysites that let users decide if strong or weak soldiers should live inside this site. The sites should automatically replace soldiers (for example level 2 should be replaced by level 10 soldier without having to manually drop the soldier). Remove the drop soldier button. Keep the number of stationed soldier control.
    • Add a button to trainingsites defining if rather heros should be trained or if all soldiers should advance approximately equally.

I understand that you see the features as related, but I think each of them would be useful in their own regard and should actually not be considered as one feature.

Cheers, !SirVer

Edited: 2010-03-15, 13:09

Top Quote
timowi

Joined: 2009-11-01, 23:08
Posts: 146
Ranking
At home in WL-forums
Location: Germany
Posted at: 2010-03-15, 13:59

Hi Lobsterninja,

thanks for your detailed proposal

fist of all i want to differentiate between changes/fixing to the underlying system and how to control the economy:

The economy system:

I have worked mainly on this part yet. It's hard to change the control functions if the underlying system does not work completely and correct. There are some bugs which must be fixed. (One of these is not considering the output queue of a warehouse when assign a transfer to a request). The economy should avoid traffic jams which are not necessary. I think of separating the storage of wares from the request system of economy. This would avoid some problems, should give some speed improvements and allows different strategies for storage of wares.

The main problem with the economy I see:

  • the bugs/inefficiency

    This must be fixed and I will work on it after build15

  • understanding what is going on

    To do the fixes and advance the system it is necessary to observe the economy. I have worked on this but it is not good enough yet.

  • it's not possible to pull out wares (or workers) of a building

    This is basically the fix to the worker and military problem. If this is implemented for example a master miner and a miner would change positions or a master miner would be "pulled out" of a normal mine if one is needed for an upgraded one. The same is true for the "military problem". A trainingsite could pull a weak soldier out of a military building and a military building would pull a trained soldier out of a trainingsite. This will be done.

  • it's not possible to deactivate requests

    It is possible to set a request idle. This function could be changed if it is no more used by warehouses. So an idle request could allow taking away ware. This depends on the above point.

  • There are some issues with transfers.

    • There is no prioritisation of transfers
    • I want to do more rerouting (and reuse) of wares. But that is a very complex thing.

Control the economy:

micro- vs. macromanaging

I think micromanagement should be possible in widelands but it must never be necessary. I consider even your stock levels as micromanaging.

general

Economic flow and military flow suffer from similar problems. Currently there is an ad hoc mixture of solutions. If these problems can be solved in a simple universal manner, the game will be more appealing.

I think these will go away if the economy system is fixed (and advanced). That are workarounds for a incomplete economy/request... system.

Military

The feature to specify maximum capacity on military housing and training buildings is intended to meet the need for the players to express some degree of control of the flow of military units. Other than for that purpose, really there is no direct reason to set the max capacity of a building (you would nearly always prefer all buildings to be full, all other things being equal). The user really wants to say "send strong units to the front lines" or "I'd like to put more emphasis on training". These thoughts are quite badly translated into "I want to limit the capacity on this building".

I'm not with you in this point. The capacity setting makes sense in my opinion. Your right if you have enough soldier to fully occupy all military buildings. But most of the time you will not have enough soldiers. Whether this should be done by the player or by an AI is a different thing.

Wareflow

There are several assorted features that control movement of wares and raw materials. Many of these features are suboptimal and could be replaced with a different way to solve the same problems.

There are? I think not. At the moment the only thing to control wareflow is ripping up roads. Stopping productionsites goes a bit in the direction bud does not really work.

The basic idea is to solve all of the resource distribution problems by allowing the user to specify desired stock levels. This mechanism will also solve the problem of military training (i.e. that there is no decent mechanism for exchanging trained and untrained soldiers). These goals are to be met in a way that avoids micromanaging, and give the player control over something that is fun to control. Although I go into some detail here, the concept is quite simple when you take a moment to think about it. The desired stock level is not a hard limit. Items can become overstocked or understocked. The desired stock level determines where resources flow (details below...). Feature to be replaced:

Remove the stop button controlling production (it will be redundant with these other changes). I thinks it's not. I would even add more of this buttons. You could a settings to each ware input. But thats more micromanagement. Even if there is a control of every input I would use the stop button to set all to zero or reset them on continue. I want the same for warehouses so I can stop storage with one click.

Remove the Capacity control on military buildings (redundant, since desired stock level solves the same problem in a better way). As obove. I think it's not redundant.

Warehouses: each item has A/B display where A is actual stock and B is desired stock, and a pair of + - buttons to control desired stock level\

Military housing buildings (e.g. Fortress, Castle, Barracks, etc.) get a control for the desired occupancy (instead of Capacity).

Industrial buildings get a single pair of + - buttons, and visual indicator underneath each stock display representing desired stock level (default = max). The desired stock level is increased for all raw materials proportional to the manufacturing requirements (

I think your approach is far to much micromanaging. I want to do most of the settings economy wide. Setting this for every production site is far to much overkill.

In industrial buildings, overstocked items are available to be moved to where they are needed (note that this feature trumps the idea of manually expelling items, which is micromanaging). To stop production in an industrial facility, the player sets the desired stock levels to zero. Production will continue anyway until the stock is used up or sent elsewhere. Precedence for wares and raw materials:

1 Understocked industrial building (places production orders) 2 Understocked warehouse (places production orders) 3 Fully stocked warehouse 4 Overstocked industrial building (but only if under maximum capacity). 5 Overstocked warehouse 6 Flag (items without current destination)

Note that "fully stocked industrial building" neither sends nor receives. Whenever there is a difference in precedence of a good between any two buildings that can be resolved by a transfer, a transfer order is placed. Of course, a transfer from overstocked to fully stocked, or a transfer from fully stocked to understocked would not occur, since these cases would cause the same condition that they try to resolve (possibly resulting in a loop). When determining the relative importance of competing transfers, the transfer with the largest differences between desired stock and actual stock has precedence.

Precedence for military units:

1 Understocked housing (e.g. barracks, castle, tower) 2 Understocked training 3 Fully stocked housing 4 Fully stocked training 5 Overstocked housing 6 Overstocked training 7 Warehouses (implicit desired stock level of 0, so always overstocked if occupied at all) 8 Any training facility containing a fully trained unit

The following restrictions apply:

Units move from training to housing only if the strongest unit is better that the weakest unit at the target facility (with respect to a skill available at the facility). A training facility will never accept and always expel a fully trained unit.

In military buildings, "overstocked" soldiers are available to move where they are needed (i.e. soldier most needing training moves to a training facility, and most well trained soldier moves to a housing facility). Possible variation: perhaps soldiers should not live in warehouses, and perhaps there should be a capacity limit on number of units at headquarters (i.e. headquarter = combined military housing and warehouse). Please note that this suggestion would be really lame in the current system because it would be incompatible with the system of manually adjusting max capacity. In this proposed system, the maximum capacity of buildings does not change. Strategy Guide using proposed system (how the player uses these features to get things done):

Defend the front lines: Maximize desired stock level on front line military buildings, and reduce other housing buildings and training buildings. Keep units training until maxed out: Set desired stock level at training facility to maximum. Release units after incomplete training: Set desired stock level at training facility to a lower value. When the training facility becomes overstocked, the best trained unit will leave (if there is somewhere to go). Build up inventory in preparation for future use: Increase desired stock level at a nearby warehouse. Prefer some mines over others when food is scarce: Reduce desired stock level at the less important mines; increase stock level at the more important mines,

This works fine if you have enough ware. But what is about the common situation the every building is understocked? It would not give much control over it.

Conclusion

The current economy configuration is much like what you proposed. My planed addition are the mentioned fixing and advancing of the economy/request/transfer code and a little bit more control.

My control addition would be:

  • allow overwriting the economy setting for a warehouse:

    • per ware: stop storage of this ware, move this ware out and store x of this ware is this warehouse
    • do the stop and move out for all wares in a warehouse
  • allow setting of economy wide strategies

    • distribute ware even over all warehouse
    • store wares in the nearest warehouse
    • train sodier to maximum
    • train all soldier even

Please try to separate the mentioned economy code improvements out of your proposal. I will write a blueprint and push some code a soon I have sorted this a bit.

Cheers Timo


Top Quote
Nasenbaer
Avatar
Joined: 2009-02-21, 18:17
Posts: 826
Ranking
One Elder of Players
Location: Germany
Posted at: 2010-03-15, 17:10

timowi wrote: Conclusion The current economy configuration is much like what you proposed. My planed addition are the mentioned fixing and advancing of the economy/request/transfer code and a little bit more control. My control addition would be:

allow overwriting the economy setting for a warehouse:

  • per ware: stop storage of this ware, move this ware out and store x of this ware is this warehouse
  • do the stop and move out for all wares in a warehouse

allow setting of economy wide strategies

  • distribute ware even over all warehouse
  • store wares in the nearest warehouse
  • train soldier to maximum
  • train all soldier even

Of course my personal opinion, but:

I agree with Timowi here - there is no need for a complete economy/military design change - however there are many nice features that would improve the current system.

Cheers

Peter

Edited: 2010-03-15, 17:13

Top Quote