← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands/frisian_balancing_with_ai_hints into lp:widelands

 

Ok here is a probable reason for the aqua farmbehaviour. The building observer "inputs" vector is filled later than the check for the fishers house. So I assume the aqua farm is identified as a fisher as well. Therefore I'd like to propose to check for the AI hint "needs water = true" to distinguish the fisher from the aqua farm instead of checking for empty inputs.

have commented this inline as well

Diff comments:

> 
> === modified file 'src/ai/defaultai.cc'
> --- src/ai/defaultai.cc	2018-04-29 09:20:29 +0000
> +++ src/ai/defaultai.cc	2018-05-31 19:41:27 +0000
> @@ -625,12 +625,26 @@
>  		if (bld.needs_seafaring()) {
>  			bo.set_is(BuildingAttribute::kNeedsSeafaring);
>  		}
> -		if (bh.is_logproducer()) {
> +		// some important buildings are identified first the woodcutter/lumberjack
> +		if (bh.collects_ware_from_map() == "log") {
>  			bo.set_is(BuildingAttribute::kLumberjack);
>  		}
> -		if (bh.is_graniteproducer()) {
> +		// quarries
> +		if (bh.collects_ware_from_map() == "granite") {
>  			bo.set_is(BuildingAttribute::kNeedsRocks);
>  		}
> +		// wells
> +		if (bh.collects_ware_from_map() == "water") {
> +			bo.set_is(BuildingAttribute::kWell);
> +		}
> +		// here we identify hunters
> +		if (bh.collects_ware_from_map() == "meat") {
> +			bo.set_is(BuildingAttribute::kHunter);
> +		}
> +		// and fishers
> +		if (bh.collects_ware_from_map() == "fish" && bo.inputs.empty()) {

here we should check for

if (bh.collects_ware_from_map() == "fish" && bh.get_needs_water())

> +			bo.set_is(BuildingAttribute::kFisher);
> +		}
>  		if (create_basic_buildings_list &&
>  		    bh.basic_amount() > 0) {  // This is the very begining of the game
>  			assert(persistent_data->remaining_basic_buildings.count(bo.id) == 0);


-- 
https://code.launchpad.net/~widelands-dev/widelands/frisian_balancing_with_ai_hints/+merge/347166
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/frisian_balancing_with_ai_hints into lp:widelands.


References