The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: knightly on April 16, 2009, 07:40:51 am

Title: AI's Stop Fail to Connect Properly to Industry
Post by: knightly on April 16, 2009, 07:40:51 am
Please see attached image. Goods AI intended to collect waste from garbage dump, but the stop wasn't built close enough to cover the garbage dump. In the end, no waste was delivered, and later Goods AI remove all roads, stops and vehicles.

This is detected in R2422 (Win/SDL) with Pak128 v.554.

Thanks for your attention.
Title: Re: AI's Stop Fail to Connect Properly to Industry
Post by: prissi on April 16, 2009, 02:08:36 pm
DId you rotate the map? THis may confuse AI, since it check rotation status directly from factory.
Title: Re: AI's Stop Fail to Connect Properly to Industry
Post by: Dwachs on April 16, 2009, 02:38:59 pm
@prissi: I did not do any test, but I think in lines 883 and 889 of ai_goods.cc the third parameter of suche_platz1_platz2 should be length-1 and 0 (instead of length and 0). See the routine
bool ai_t::suche_platz(koord pos, koord &size, koord *dirs) const in ai.cc line 168.
Title: Re: AI's Stop Fail to Connect Properly to Industry
Post by: z9999 on April 16, 2009, 03:13:50 pm
I only know old ai code.
Every time "if(  current_dist<dist  &&  suche_platz(platz,size,dir)  )" is called, size is overwritten. So, two rotations test never success.

In old ai code, there was a bug and two rotations test didn't happen.
Title: Re: AI's Stop Fail to Connect Properly to Industry
Post by: knightly on April 16, 2009, 03:55:29 pm
DId you rotate the map? THis may confuse AI, since it check rotation status directly from factory.

I didn't do any rotation. Simply started a new game and activated one Goods AI, and then this happened. The reason why this problem went unnoticed is probably because the Goods AI will remove everything once it finds the line unprofitable.
Title: Re: AI's Stop Fail to Connect Properly to Industry
Post by: prissi on April 17, 2009, 07:35:56 am
THe code was lacking the rotation check at all.