Stopped production sites should produce something from their consumed wares befor they stop

Bug #1442869 reported by GunChleoc
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Low
TiborB

Bug Description

It seems that production sites lose already consumed wares when they are stopped. They should finish the current production cycle first, so that no wares are lost.

Originally reported on the forum: https://wl.widelands.org/forum/topic/1706/

Related branches

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

I agree the building should continue doing whatever is in progress, but not start the next cycle if they are stopped. It should definitely not consume wares without giving anything in return. (Most likely the reason for stopping buildings is to conserve a particular ware and losing it without getting something it produces would be working against the intention.)

I've had some suspicions this might be happening, but never really sat down to investigate what happened to the buildings. If someone look into this, could they please check whether this is a regression from build18 (or earlier).

tags: added: economy gameplay
Changed in widelands:
milestone: none → build19-rc1
Revision history for this message
SirVer (sirver) wrote :

Definitively not a regression from build18 - this logic has not been touched, I am pretty confident about that.

Revision history for this message
TiborB (tiborb95) wrote :

I would say the trick is quite simple and no C++ coding is needed, just edit of conf files like below should be enough:

now:
[work]
sleep=43000
return=skipped unless economy needs blackwood
consume=log:2
animate=working 24000
produce=blackwood

changed:
[work]
sleep=43000
return=skipped unless economy needs blackwood
animate=working 24000
consume=log:2
produce=blackwood

What do you think? And as no serious coding is needed, anybody could do this.

Revision history for this message
GunChleoc (gunchleoc) wrote :

This way, we would get working animations for buildings that aren't actually working due to lack of resources. So, it's not that simple.

Revision history for this message
TiborB (tiborb95) wrote :

good point. What about adding another step named f.e. check so the cycle would look like:

sleep=43000
return=skipped unless economy needs blackwood
check=log:2
animate=working 24000
consume=log:2
produce=blackwood

Revision history for this message
GunChleoc (gunchleoc) wrote :

Worth considering... we would have to write a "check" program in C++ then. Also, we would have to make sure that all production programs have a check program in them, which is error prone. It might be easier to change the code in C++ to finish producing - we will have to look at the code though.

Revision history for this message
TiborB (tiborb95) wrote :

C code works the way that "work" can be interrupted after every step. So we would get two types of steps: ones that could allow interruption afterwards (perhaps the only one - sleep) and other ones that does not allow it.

Revision history for this message
TiborB (tiborb95) wrote :

I can prepare a fix (absolutely primitive) where stop would be effective only before first step in production cycle, otherwise the cycle will go on till the end even the building will me shown in state "stopped". What do you think?

Revision history for this message
GunChleoc (gunchleoc) wrote :

Sounds good to me :)

TiborB (tiborb95)
Changed in widelands:
status: New → In Progress
importance: Undecided → Low
assignee: nobody → TiborB (tiborb95)
GunChleoc (gunchleoc)
Changed in widelands:
status: In Progress → Fix Committed
GunChleoc (gunchleoc)
Changed in widelands:
status: Fix Committed → Fix Released
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build19-rc1.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.