Currently Online

Latest Posts

Topic: Release the ware

nsh

Topic Opener
Joined: 2010-11-08, 19:30
Posts: 27
Ranking
Pry about Widelands
Posted at: 2010-11-21, 09:13

In buildings it is possible to increase/decrease consumed resources delivery priority. It would be nice, if resources would be also releasable back.

In this case the item, which is not consumed, would move back from building to the flag. Then it may be rerouted by economics engine to somewhere else. E.g. if you urgently need the trunk, you could release it from wood hardener. Or, you can release wares from buildings before upgrade (e.g. ration from mines, coal and ore from axefactory, wheat from brewery etc). To avoid races, only one item may be released back at a time. Only after that it was actually dropped at the flag, another may be released. I guess, it simplifies the implementation. Building should just emit, out of the order, that it had built the ware, that it usually consumes.

The implementation maybe in the same way as it is made for military buildings right now - just click on the ware icon in the building, and it will be dropped back to the flag, its status would be changed to idle and economics engine can decide what to do with it. Alternatively, the priority selection may include the fourth choice - release back. That would cyclically remove all unconsumed wares back. Even better if both methods work.

Edited: 2010-11-21, 09:52

Top Quote
Gannaf

Joined: 2010-06-21, 23:10
Posts: 47
Ranking
Pry about Widelands
Location: Germany, Bird Mountain
Posted at: 2010-11-21, 13:13

I made a quite equal request some time ago, though not as detailed as you described it ;) http://wl.widelands.org/forum/topic/526/


Top Quote
nsh

Topic Opener
Joined: 2010-11-08, 19:30
Posts: 27
Ranking
Pry about Widelands
Posted at: 2010-11-21, 13:30

Ah, sorry, that's why I had a dejavu feeling face-smile.png


Top Quote
Venatrix
Avatar
Joined: 2010-10-05, 19:31
Posts: 449
Ranking
Tribe Member
Location: Germany
Posted at: 2010-11-21, 21:02

I like this idea, too. I often wished to drag some wares from one building and drop it to another face-wink.png


Two is the oddest prime.

Top Quote
ixprefect

Joined: 2009-02-27, 13:28
Posts: 367
Ranking
Tribe Member
Posted at: 2010-11-22, 15:47

Well, it's on purpose that this is not possible. You build the roads, perhaps set some priorities, and then the built-in game logic does its thing. Your job as a player is to design an optimal road network and production chain under the constraints given by the built-in game rules.

We should definitely consider releasing wares from buildings that are about to be enhanced, though (e.g. barbarian mines etc.), that just seems like an awful waste.


Top Quote
nsh

Topic Opener
Joined: 2010-11-08, 19:30
Posts: 27
Ranking
Pry about Widelands
Posted at: 2010-11-23, 17:23

Ok, let stick to the case of releasing wares prior to upgrade.

This gives two possible implementations - worker, before going back to warehouse, should "clean" the building from remaining wares, or, the builder, before starting a reconstruction, should do it. Both would be quite logical. To make it fair, I suggest to impose some time penalty. In this case user gets back some wares in expense of some proportional time delay to reconstruct building. Time penalty should be not very high, but quite noticeable. In this case, the implementation with worker releasing back unconsumed wares, looks easier. In fact, it is almost the same logic as for producing the ware, but now he produces back the ware and drops it at the flag as usual.


Top Quote
ixprefect

Joined: 2009-02-27, 13:28
Posts: 367
Ranking
Tribe Member
Posted at: 2010-11-24, 22:15

I agree. Instead of enhancing the building immediately, the building could first go into a kind of "prepare for enhancement" mode, during which it stops regular production (perhaps completing the currently running production program first) and then gets rid of the wares using the usual get_building_work routine. Once all wares are cleared, the actual enhancement takes place.

Though perhaps this kind of slow enhancement should be made optional. For example, barbarians definitely need to update Micro Breweries to Breweries quickly, and most people could probably live with wasting some wheat in the process if it means the enhancement completes more quickly.


Top Quote
nsh

Topic Opener
Joined: 2010-11-08, 19:30
Posts: 27
Ranking
Pry about Widelands
Posted at: 2010-11-29, 19:40

I have thought about it a little bit more and found probably the most logical approach.

I suggest, that for every building, going to be upgraded, resources, which could be consumed by upgraded building, should simply remain in it. It means that after building have been upgraded it will have the amount of wares which was in it before upgrade. Only in case, if resources are not valid for upgraded building, they should be returned back.

It means, that upgrade of brewery and tavern will start instantly and after upgrade they will continue with all wares they had before. Mines will definitely return back their rations. The most interesting case is metal workshop - it should store the iron and release trunks face-smile.png

In this from it should be less influential on transportation and cause much less traffic jams.

Worker should move not consumable wares as fast as possible from building to the flag. If time penalty is actually desired (still not sure?) we can just add it to the upgrade time.

Actually, this approach simplifies the implementation. It is possible to implement it in two separate steps:

1) Implement consumables, that can survive upgrade. Very small change is needed here, just save amount available before upgrade and later initialize resource counter back to it. At this stage, not consumable resource is still lost. Temporary counter should be stored and loaded with game, now I know it face-smile.png

2) Implement the actual return procedure. It is more difficult, but may be done anytime later.

So, if main developers would agree on this feature, I may look into it further.


Top Quote
ixprefect

Joined: 2009-02-27, 13:28
Posts: 367
Ranking
Tribe Member
Posted at: 2010-11-29, 20:47

That sounds like a pretty good plan to me. I would vote that the surplus wares are removed before the upgrading starts. Somehow that makes more sense to me, but that's just an opinion.


Top Quote
SirVer

Joined: 2009-02-19, 14:18
Posts: 1445
Ranking
One Elder of Players
Location: Germany - Munich
Posted at: 2010-11-29, 20:59

I like this idea. It feels like the logical thing to do: pickle the wares you'll need later in the storeroom, go on vacation and let the builder do their work. Continue when you return.

It could be undesirable when you want to enhance e.g. a brewery and you'll want the corn to be used in some place else while the brewery is building, but I agree that your solution is better in a all around way. Note that the implementation is not trivial without relying on hacks, as the buildings is replaced by a constructionsite and then later on by a new building again. You need to cache the wares state through the enhancement process.


Top Quote