Amount of fish depends on the terrain next to it

Bug #1350259 reported by wl-zocker
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Won't Fix
Low
Unassigned

Bug Description

To reproduce (tested in r7157):
- In the editor, create a lake a set different terrain types (beach, mountian, swamp etc.) at its coast. Do not set any fish.
- Start a game on that map with a debug build. Check the amount of fish resources.

Expected result: Every field in contact with the lake should contain the same amount of fish, or near the coast, there should be less fish.

Actual result: The amount of fish depends on the number and type of the neighboring triangles:
- In the middle of the sea, there are four fish (some kind of default value).
- At the coast, the amount of fish seems to depend on the default resource amount for that terrain type:
  * Snow or mountains do not contain any resources, therefore there are less fish next to them.
  * Grassland contains some water, therefore there are more fish next to it.
  * Swamp contains a lot of water, therefore there are many more fish next to it.
- Since the amount of fish also depends on the number of triangles of that type next to it, make sure to always have the same number when comparing the values.

Revision history for this message
wl-zocker (wl-zocker) wrote :

In https://bugs.launchpad.net/widelands/+bug/1349137/comments/7, SirVer wrote:
ounds like a bug to me. I have an idea where this comes from though. Resources used to be defined on the fields, but one dev changed it one day to put them on the triangles and added some logic to convert from the first to the second implementation. Maybe that does no averaging?

description: updated
Revision history for this message
SirVer (sirver) wrote :

I believe this issue is that this "refactoring" has only been done partly: resources are a property of the field right now, but are bound to terrain (i.e. mountain can contain gold, iron, coal, granite while meadow can only contain water). Somebody tried to even this out a bit by averaging over the surrounding triangles in a weird fashion (and probably made a mistake that leads to the described behavior).

Short term should be to fix this averaging bug. Long term, the editor/engine should be changed to actually set resources on the triangles, not on the fields. I think this change is a bit involved, but not actually too difficult.

Changed in widelands:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for widelands because there has been no activity for 60 days.]

Changed in widelands:
status: Incomplete → Expired
SirVer (sirver)
Changed in widelands:
status: Expired → Confirmed
importance: Undecided → Low
Revision history for this message
TiborB (tiborb95) wrote :

Hey, there is another aspect - I was told that fishers catch fishes only on first field next to coast. If it is indeed true the editor should allow placing fish only on these fields (=achievable by fishers). It would help AI, because it counts fishes in radius around fisher huts.

Revision history for this message
SirVer (sirver) wrote :

I disagree with #4. Right now you can also place coal in places that are never reachable through expansion. It is the AIs task to figure out if it cares for some fish or not.

Revision history for this message
TiborB (tiborb95) wrote :

If I understand whole discussion is about default/initial values. You can afterwards manually set as much fish as possible - up to 20/20.

So would not it be better to set default fish to zero and let map creator to put fish where he wishes?

Or ignore the entire problem at all?

Revision history for this message
wl-zocker (wl-zocker) wrote :

Inside the editor, the default is 0. The map maker can set as much fish as he wants (up to 20).
If he does not set any fish, there is a default value calculated when the game is started. This default value cannot be changed in any way (see also bug 969873).

Revision history for this message
GunChleoc (gunchleoc) wrote :
Changed in widelands:
status: Confirmed → Won't Fix
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.