fish breeder does not work

Bug #1182010 reported by Borim
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Medium
cghislai

Bug Description

When testing the partial training feature with the atlanteans (lp:~kxq/widelands/feature-978-partial-training)
I realized that one of my fish breeder does not work. Although sea fields with fish resource 1 of 4 are in range.
The striking breeder can be found in the center of the view when loading the savegame.

A reference to a similar bug can be found at https://bugs.launchpad.net/widelands/+bug/1094711/comments/3
"fisher does not work when immoveables are on the shoreline", but I can not find the bug in launchpad, too.

Also the fisher bug seems fixed, as my fisher next to the none working breeder, depleted already some of the sea fields.

Related branches

Revision history for this message
Borim (borim) wrote :
Revision history for this message
cghislai (charlyghislain) wrote :

I can confirm, program returns "no space found" with no obvious reason.

Changed in widelands:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Jens Beyer (qcumber-some) wrote :

Some additional observations:

- stop/start of the fish breeder hut does not help
- disbanding the worker does not help
- dismantling the fish breeder hut and rebuilding at the same place does not help

Revision history for this message
Jens Beyer (qcumber-some) wrote :

- Extending the player's ownership to include the complete landmass (read: build a military building) does not help

Revision history for this message
Jens Beyer (qcumber-some) wrote :

There is another fish breeder just on the opposite shore (scroll down a little). This one is also on strike.

There are no other fish breeders in the game...

Revision history for this message
Jens Beyer (qcumber-some) wrote :

There is no additional fish breeder in the HQ. Building a new fish breeder house creates a new fish breeder. This fish breeder also directly goes into strike...

Revision history for this message
Jens Beyer (qcumber-some) wrote :

Hmm... loaded the save game, built 2 additional fishermen on each of the shores, speed up. At about 3:50 hours, the upper fish breeder starts working...

Revision history for this message
Jens Beyer (qcumber-some) wrote :

I guess I found the problem.

Fishermen (in general, not only those in those savegame, also for new games; for all tribes!) mostly "create" fish items, but they don't "mine". If you use the debug windows, you can see that most of the time, the fisher returns with a fish but the resources at the spot where he worked doesn't change.

This problem does not arise with mines.

Revision history for this message
Jens Beyer (qcumber-some) wrote :

Ok... this is not easy to understand nor to write down ;-)

Problem here is the way the fisher and fish breeders are working.

1) Search for a "random" fishable/breedable place in maximum walking distance 7 (just as an example)
2) Walk there
3) "Mine"/"Breed" at a "random" position in maximum distance 1

If you look at the save game and check the shores (last land places where flags could be), you see that all of them contain maximum resources (e.g. 7/7), while the "deeper sea" places have 1/4, 2/4 and so on.

Now the fish breeder program only looks for breedable place in maximum walking distance... and there are none!
That's the problem here.

Somehow the fishers seem to prefer the deeper sea when fishing. You can also check that by creating a new game and observing this. I don't know why this is, as from the Code I would say it should be random... But the result you can see in the save game.

Revision history for this message
cghislai (charlyghislain) wrote :

Thanks for your investigation!

So where dies the issue lie? Should breeders breed further offshore? Or fishers fish closer? Or just ensure there is some randomness in the pathfinding? Or - there was another bug report about that - allow fishes to move?

Revision history for this message
Jens Beyer (qcumber-some) wrote :

The problem is that the fish breeder does not find a space in the first program line.
There the fix should start. Extend the find_space program with resources by a second distance parameter...

(or alternatively, find out why the fisher prefer deep sea instead of shores...)

Revision history for this message
cghislai (charlyghislain) wrote :

yes, your suggestion is the better one. Alternatlively, the quick fix could be to modify the fishers and breeders conf files so that they fish and breed in a radius of 0 - that will always be the shore line.

Revision history for this message
cghislai (charlyghislain) wrote :

I went the other way around - accept a breed node if a neighbor has breedable resource; It works great

Changed in widelands:
assignee: nobody → cghislai (charlyghislain)
milestone: none → build18-rc1
Changed in widelands:
status: Confirmed → In Progress
Changed in widelands:
status: In Progress → Fix Committed
Revision history for this message
SirVer (sirver) wrote :

Released in build-18 rc1.

Changed in widelands:
status: Fix Committed → Fix Released
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.