← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands/bug-1810062-territorial-calculations into lp:widelands


okay did some further investigations. 
The C++ function to calculate the nodecaps can be executed with or without taking immovable into account (you need to provide the bool "consider_Mobs" which defaults to true) 

As far as I could see the only instance where Mobs are ignored is for calculating if a portspace is allowed on a field.

the lua Hook has_caps is using the default calculation with mobs considered. 

>From my perspective we need to adjust the lua Hook to use this bool "consider_mobs" parameter to get the max caps of a field instead of the current caps. As for the valuable fields calculation we should consider the possible building options after removing stones and trees.

I might try to implement this but I am not very skilled in C++.

with this information we could use Toni's algorithm to get very close to the optimum.

Only problem is I am short of time
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1810062-territorial-calculations into lp:widelands.