News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

AI's Stop Fail to Connect Properly to Industry

Started by knightly, April 16, 2009, 07:40:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

knightly

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.

prissi

DId you rotate the map? THis may confuse AI, since it check rotation status directly from factory.

Dwachs

@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.
Parsley, sage, rosemary, and maggikraut.

z9999

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.

knightly

Quote from: 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.

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.

prissi

THe code was lacking the rotation check at all.