farmers at home (out of fields)

Bug #1669741 reported by toptopple
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Won't Fix
Low
Unassigned

Bug Description

Wonder if this is another regression. In the save-game you can see some completely or partly inactive farmers although their area overview shows several free spots which could be farmed and they appear to be walkable too. Obviously something is blocking recognition of these spots. (You can find these farmers in the center land where all parties meet for a battle. There are 3 to 4 such defected farmers, one of them completely inactive, one works only one field, etc.) When there is no activity at all then "out of fields" is reported on the building.

Suspicion is that Immovable objects could play a role in this, but the observation is inconsistent. Terrain shouldn't be the problem, but road congestion might be.

Tags: economy
Revision history for this message
toptopple (7010622-q-deactivatedaccount) wrote :
GunChleoc (gunchleoc)
tags: added: economy
Changed in widelands:
importance: Undecided → High
milestone: none → build20-rc1
Revision history for this message
kaputtnik (franku) wrote :

Looking at the save game it seems to me that the mentioned farmers couldn't reach the available fields.

The one working on only one field (pos 101,93)seeds the field and coudn't go then to the other field which might be available because the seeded field blocks him to go there.

The one who is never working (pos 95,90) couldn't go to the available fields (pos 93,90 and 93,89), because on the left is a well which blocks him and on the right is Terrain 'lava rocks' which blocks him. Burning down the well the farmer works.

It looks also that the well blocks the farmer on pos. 91,90 couldn't reach the field 93,90. Burning down the well (93,91) let both farmers reaching the field(s).

But it seems that the standing stones have influence on the farmers fields.

I don't think this is a regression. The only curious thing in the save game is that standing stones have some influence. But i couldn't say how this was in build 18.

Revision history for this message
GunChleoc (gunchleoc) wrote :

The standing stones have no size, but they are still an immovable, so I guess that this makes the search algorithm fail. If you build something that will destroy the standing stone, the space should be cleared for fields afterwards.

Changed in widelands:
status: New → Incomplete
Revision history for this message
kaputtnik (franku) wrote :

> The standing stones have no size.

That's not true. The used stones are of type "Standing_stones3" which have size 'big': http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/data/world/immovables/standing_stones/standing_stone3_wasteland/init.lua

As far as i can see the size had not changed between build18 and build19

Revision history for this message
GunChleoc (gunchleoc) wrote :

I mixed them up with some other eye candy then. If they have size, they will block movement anyway, so no bug there.

Revision history for this message
toptopple (7010622-q-deactivatedaccount) wrote :

Explanations offered are not extensively satisfying. First, farmers can walk through corn fields, so they shouldn't block a path.

Second, some fields appear available but not used. In the case of the single-field farmer they are i) NE of the flag (radius 1 field which can be used - proof by observation ), ii) NE of the single used field. So there are 2 hexfields which should be used by the farmer and effectively are not. I'm not aware how buildings block space of hexfields. Therefore I have for testing removed the Guardhall but the effect was that only the field next to the Guardhall was used but not the field NE of the flag. So something is still unexplained here.

I also found out that a single map address can bear more than one terrain types. E.g. if you click around (96, 89) in the map you will receive both "Igneous Rocks" and "Lava Rocks 2". The former is walkable, the latter not. So there is something unclear here about these socalled "fields" which indeed don't appear to be fields but nodes. People tend to talk about fields instead of nodes. Can we cast more light into this? Is there a documentation about fields as opposed to nodes?

Perhaps the logic says: if there is something blocking in a node then don't regard it walkable. It could be modified so that the selection is more fine-grain. As for terrain, the node should be regarded walkable if only one aspect of it is walkable. That would solve a lot of problematic walk-cases, I guess.

Revision history for this message
GunChleoc (gunchleoc) wrote :

Documentation:

https://wl.widelands.org/wiki/HelpTerrains/

Each node has 6 terrains assigned to it. The movement/buildable properties of a node are calculated according to these 6 terrains. So, Lava Rocks blocks its 3 surrounding nodes as intended - it is unreachable terrain: Nothing can be built here, and nothing can walk on it, and nothing will grow.

Revision history for this message
toptopple (7010622-q-deactivatedaccount) wrote :

@GunChleoc
You are seeing this from the perspective of a triangle. Viewing the NODE instead, which seems more relevant to economy algorithms, things look less obvious. We have to note there sadly that because of a single out of six fields of a node being not walkable, the entire node is unpassable.

I am interested in the following question:

a) is the WALKABILITY of a node a static feature or calculated at each investigation?

b) what is the influence of the various building sizes (assume: small, medium, large) on the Walkability and the Usability (farming) of the surrounding nodes?

Revision history for this message
GunChleoc (gunchleoc) wrote :

I dug up the function - it is implemented in Map::calc_nodecaps_pass1()

// 2a) If any of the neigbouring triangles is walkable this node is
 // walkable.

// 2c) [OVERRIDE] If any of the neighbouring triangles is really "bad" (such
 // as lava), we can neither walk nor swim to this node.

Then it checks whether an immovable is sitting on the node.

a) it is of course recalculated every time, because players do build things etc! The function is Worker::checkstep

b)

// 4) Flags
 // We can build flags on anything that's walkable and buildable, with some
 // restrictions
// 4b) Flags must be at least 2 edges apart

Which buildings can be built is calculated in Map::calc_nodecaps_pass2

The code is quite complicated, so I'll leave it at that.There is a reason that I haven't implemented shallow water yet - tried messing with this once and failed ;)

Revision history for this message
GunChleoc (gunchleoc) wrote :

We should be able to solve this by adding an attribute "walkable" to certain immovables, like fields.

Changed in widelands:
status: Incomplete → In Progress
assignee: nobody → GunChleoc (gunchleoc)
Revision history for this message
GunChleoc (gunchleoc) wrote :

I have attached a branch that will allow the farmers to walk through standing stones. The problem that I see with it though is that they visually walk through them as well, so I am not happy with it.

Farmers can already walk through fields, so that is not an issue.

I don't want to touch the terrain properties at this moment, that's a bit tricky.

Changed in widelands:
status: In Progress → Confirmed
importance: High → Low
milestone: build20-rc1 → none
Revision history for this message
toptopple (7010622-q-deactivatedaccount) wrote :

The problem has been identified and it isn't walkability of stones; I wouldn't like it as well.

The behaviour has been found according to rules so this isn't really a bug and I believe nobody would object scrapping it. What may be argued here is qualifying a certain terrain (falsely) as "really bad" which obviously has been used rather for decoration and unaware of its "bad" quality by the map designer. If these terrain properties can be assigned on a set level (Wasteland terrains, e.g.) then such a correction seems possible, otherwise not.

Revision history for this message
GunChleoc (gunchleoc) wrote :

Maybe we should have a look at the Ancient Sun of Fire map then and redesign the terrain a bit?

GunChleoc (gunchleoc)
Changed in widelands:
assignee: GunChleoc (gunchleoc) → nobody
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.