atlantean mines failing to extract all resources

Bug #1525395 reported by king of nowhere
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Undecided
TiborB

Bug Description

I have noticed while playing 7515 that atlantean mines will not use all available resources, even if they should. I know the version is several months old, but to my knowledge the bug hasn't been detected or fixed in the meantime.

In the screenshot you can see that there is a little bit of coal, and it is in the range of the mine. Yet the mine say it's exhausted.

Related branches

Revision history for this message
king of nowhere (lainluigi86) wrote :
Revision history for this message
king of nowhere (lainluigi86) wrote :
Revision history for this message
king of nowhere (lainluigi86) wrote :
Revision history for this message
king of nowhere (lainluigi86) wrote :

an update: i made another mine, this one directly on top of the coal, and that mine worked. so either the atlantean mine fails to work to its full radius, or it fails to work fully on its more periferic tiles. it could even be intended, but in that case it should be specified.

GunChleoc (gunchleoc)
Changed in widelands:
status: New → Confirmed
Revision history for this message
wl-zocker (wl-zocker) wrote :

The responsible code is here: http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/src/logic/production_program.cc#L1239

A penalty for empty or nearly-empty fields is added, so I guess the chance of extracting the very last bit of resources is very low. I do not know if this has to do something with the peripheric position (I don't think so), it might have been luck that the second mine digged out the resource immediately.

Revision history for this message
king of nowhere (lainluigi86) wrote :

ah, that's why i also noticed that nnearly depleted mines sometimes fail to operate. I was going to report a bug for it too, but now I learn it's supposed to be that way.

So, two fixes should be made:

1) in the help text, it should specify that when a mine is almost empty, it will sometimes fail to work.

2) It should not give an empty messsage until there is really nothing left.

Revision history for this message
Albert Einstein (w-aaaaa) wrote :

I think that the second way is better.

Also there should be a change of text over the mine while not mining the resource. "Produce no coal, because it is ALMOST depleted". Empty mine text should not contain "almost".

Revision history for this message
TiborB (tiborb95) wrote :

I prepared the fix - but only for the main problem - not mining all resources.

The problem is mathematical. There was a corner case when digged_percentage=100 and at the same time there were few unmined resources left. The fix is to change the rounding, so that if there are some resources left, the digged_percentage will never be 100.

But I am not able to do the other suggestions about text over, I dont understand fully how that stuff works in code.

Revision history for this message
TiborB (tiborb95) wrote :

Should be fixed in rev. 7703 - at least in the scope of bug description

Changed in widelands:
assignee: nobody → TiborB (tiborb95)
status: Confirmed → Fix Committed
SirVer (sirver)
Changed in widelands:
milestone: none → build19-rc1
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.