Topic: wishlist: preferrably split selcted ware among warehouses
king_of_nowhere![]() Topic Opener |
Posted at:
2015-11-19, 05:31 UTC+1.0
Right now, if a ware is produced and not needed immediately, it is sent to the nearest warehouse among those that are not set to not contain that ware. Alternatively, you can set some warehouses to preferrably store the seleted ware, in which case the ware will go to the closer warehouse with that setting. But always, it is one warehouse, the closer one. That have some problems. In a large map, you want to expand in all directions. but you generally only produce wood in one place, because foresters take space and can plant trees in annoying locations so you want to bunch them up. so your wood is all concentrated in the middle of your empire, far away from where it is needed. When you make a new building, you have to wait ten minutes for wood to arrive at it. Or, you may tell the game to preferrably store the wood in one single location, which means that in that location they will have wood available, but on the other side of the empire they will have to wait 20 minutes instead of "just" 10. Right now, there is no way to fix that, unless one constantly microomanage with the warehouse settings to make sure that wood is split and sent both ways. So comes my idea of a new setting "preferrably split ware among those warehouses". basically, it works that way: of all the warehouses with that setting, send the ware to the one containing the lower amount of wares. So, basically, it would split the ware evenly to all the warehouses with that setting. that way, you could give that setting to all the warehouses on the borders of your empire, and you'd be sure each of those had some logs and planks. all your buildings would start immediately, everywhere. You could do the same with builders, so there woud be some in each warehouse and you won't have to wait for one to arrive from the other side of the map. You could also use that setting to improve your economy. Say you made a concentration of bakeries in one place, and in the middle of them a warehouse set to preferrably store flour. that's efficient, cause all your bakeries will have a source of flour nearby. but then you run out of space, and you had to make new bakeries in another place. very far away, cause there was no other place.you also make a warehouse there, and set it to preferrably store flour. but it doesn't work well with current setting. mills will send flour to the closer warehouse with such preference, and depending on how many mills and bakeries are closer to one specific warehouse, it means one of your warehouses will be full of flour, while the other will be empty and the bakeries close to it will be missing wares. With my option, you could simply set to split the flour among the two warehoues, and both of them would always have flour. all bakeries would have a source of flour close nearby, vastly reducing transport times. True, what you gain with having flour close to the bakeries you probably lost in transporting the flour to the more distant warehouse, but the important thing is that as long as you have a flour surplus all your bakeries are working at 100%. basically, you transported the ware a longer distance when it was not needed, so you can have it close when you need it. It should be extremely simple to code: after deciding which warehouses are eligible candidates to receive the ware (all those not set to not store there, or all those set to preferrably store there) instead of sending to the closer one, you send to the one with less of the ware. Only if they have the same amount you send to the closer one. As far as I understand programming (which, as I admitted many other times, is very little) it should take only a handful of lines. It will also have the added advantage of reducing cpu usage. I've seen discussed in this bugreport (https://bugs.launchpad.net/widelands/+bug/1515762) that calculating distance is very cpu intensive, and with that setting you don't have to calculate distance anymore, you merely have to compare two integer numbes. The AI could also be thaught to use that setting. For every building that use a ware, calculate the distance to the nearest warehouse. Then set that warehouse as one of those among whom the ware is split. configure economy to increase the target amount of that ware by, say, 1 or 20% (whichever is the bigger) for every new warehouse among whom the ware is split. Do you think it would be worth opening a bugreport for it?
Edited:
2015-11-19, 05:33 UTC+1.0
![]() ![]() |
kaputtnik![]() |
Posted at:
2015-11-19, 08:46 UTC+1.0
This a good idea If understand it right you want to make this setting for all wares in a warehouses? Or did you meant to have an additional button for stock policy (like "preferably store selected wares here") which do the setting for wares? ![]() ![]() |
king_of_nowhere![]() Topic Opener |
Posted at:
2015-11-19, 12:16 UTC+1.0
I was thinking to either make an additional button, or change the behavior of the current "preferrably store here". But now that you mention, having it as a default (of course, while still respecting the don't store here/normal policy/preferrably store here policies) could work too. To keep wiith the bakery example, if you have built them all in the same place, then you will want to set the closer warehouse as preferential for flour. and if you have them all aroud, then it will be good that flour will also be spread. Still, I don't like the idea of making it impossible to go back to the current storing mechanism. There are a few cases where it can be the best option if one does not manually deal with warehouses. I can think for example if one made all the mills and the bakeries together, and did not set the preferential option for warehouse; in which case with normal option all the flour will be sent to the closer warehouse, which is also close to the bakeries, while with the new mechanism, the flour will be scattered to the four corners of the world. Not all players micromanage. So, let's say to just make it an extra option. But one that the AI could set as its default. ![]() ![]() |
wl-zocker |
Posted at:
2015-11-19, 12:26 UTC+1.0
In another thread, a minimum storage for warehouses has been discussed. If you set the minimum storage for flour to 50, all warehouses with this setting (i.e. the ones near the bakeries) hold at least 50 units of flours. This would also serve the purpose of increasing the productivity, and it would avoid transporting too much wares (if you produce too much flour, it is not evenly distributed, but delivered to the closest warehouse, which reduces the risk of congestions). This options could be an addition to the existing system, and overwrite the preferences while wares are missing. "Only few people know how much one has to know in order to know how little one knows." - Werner Heisenberg ![]() ![]() |
staustelladam |
Posted at:
2015-11-19, 13:06 UTC+1.0
Alternatively you could have different warehouse types, and define what is stored in them in the individual building config files. Eg, you could have a granary type warehouse, which would store only those foodstuffs types that you define, and an armory type warehouse which you would place near your training centres and store only weapons and armour. And of course you would still have a normal warehouse for everything else ... ![]() ![]() |
GunChleoc![]() |
Posted at:
2015-11-19, 15:47 UTC+1.0
How about the following:
Edited:
2015-11-19, 15:48 UTC+1.0
Busy indexing nil values ![]() ![]() |
wl-zocker |
Posted at:
2015-11-19, 17:25 UTC+1.0
So the only change would be for wares that are preferred by more than one warehouse. I think this is a good solution. "Only few people know how much one has to know in order to know how little one knows." - Werner Heisenberg ![]() ![]() |
king_of_nowhere![]() Topic Opener |
Posted at:
2015-11-19, 17:40 UTC+1.0
that's a completely unrelated kind of proposal. that's a proposal to change the functionalities of some buildings (which i personally dislike, but i suppose it's a matter of tastes) but it does not affect the distribution of a specific type of ware among different buildings set to contain it. if you make granaries, and you have two granary warehouses, then mills will send flour to the closer warehouse with the highest priority. it won't cause the wares to be evenly distributed among the warehouses like my algorithm would.
that would be exactly changing the functioning of the option "preferrably store selected ware here" to match with my proposal.
but what would happen if you don't have 50 units of flour for every warehouse? how about you have 20 flour in one and 0 in another? if your code is simply "give high priority if less than 50 wares, normal priority otherwise" then it wouldn't work until you have the target amount of resources. it also seem more complicated to code, you have to take into account possible conflicts with the configure economy options and define a new level of priority for warehouses that have met their target amount - it is lower than higher priority, but higher than normal, otherwise once all the specified warehouses have 50 flour, they have no longer priority, and suddenly the flour ay be sent elsewhere, unless you manually set a no storage policy on all the other warehouses. the good thing is that is should actually make for more efficient transport one you have met your target. with my proposal, if you have two areas with mills and bakeries, then whenever one warehouse get one more flour than the other, all the mills will send there, from both areas A and B. while with your mechanism, if A produces more flour and B consumes more, then the warehouse in A will always be over the target amount and will never receive fflour from B; all the flour produced in B would be used in B, with just enough sent from A to keep a comfortable stock in warehouse B. So... take both proposal and combine? how about using the minimum target, and splitting the wares evenly among the warehouses that have not met their target? Should still be fairly easy to code: if wares less than X, then high priority; among all the warehouses with high priority, send to the one with less wares. If wares more than X, normal priority; if normal priority, send to the closer one. EDIT: on the other hand, that discussion is one year old and nothing was done about it, so I'm now less optimistic about the feasibility...
Edited:
2015-11-19, 17:44 UTC+1.0
![]() ![]() |
GunChleoc![]() |
Posted at:
2015-11-19, 23:16 UTC+1.0
Although I am not familiar with the routing code, I don't thing that the problem isn't feasibility. The problem is too many things to code and not enough developers. So, please do keep the ideas coming We could also implement this in two stages - the minimum value and the target splitting should be pretty separate in the code. Busy indexing nil values ![]() ![]() |
einstein13![]() |
Posted at:
2015-11-20, 10:43 UTC+1.0
Target splitting is solving most of economy problems in Widelands. I like the idea very much! But for me default settings should be as it is now (move resources to the closest warehouse). Otherwise (with no micromanagement) most of resources will come across the whole country without purpose. And now I can't decide if replacing high priority button is still needed. Yes, it will help sometimes, but no- it will be too complicated GUI for most of players. einstein13 ![]() ![]() |