Request for change to be reverted

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

Post Reply
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Request for change to be reverted

Post by Zutty »

Hi all,

Unless I'm mistaken, the function AITile.GetCargoAcceptance/Production seems to have been changed since 0.7.0.

http://noai.openttd.org/docs/classAITil ... 773f396c8e

I think a precondition has been added that the radius must be greater than 0. This limits functionality, as before we could do

Code: Select all

AITile.GetCargoProduction(tile, cargo, 1, 1, 0)
To see what types of cargo are produced on a certain tile. This is VERY handy for handling NewGRF house sets. With this you can tell which towns accept and produce which cargo, e.g. tourists or petrol.

Using a radius of 1 doesn't break this behaviour completely, but it does invalidate the assumptions behind the theory. It means we can no longer pin-point things like petrol stations, and in the case where two towns are directly adjacent to each other this may mean that a town is incorrectly flagged as accepting tourists.

It seems odd to me that someone would intentionally remove this functionality. I imagine that the functions were being cleaned up and whoever did it didn't realise that a radius of zero was acceptable.

The functionality could be very simply restored by just changing the precondition to be >=0. Could this be fixed perhaps in time for 0.7.2?

Thanks very much.

Edit: This also breaks a long standing feature of my AI to detect the proportion of cargo accepting tiles (i.e. houses) in a town that are serviced by stations.
PathZilla - A networking AI - Now with tram support.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Request for change to be reverted

Post by Yexo »

Fixed in r16767.

<Rubidium> though why do they come with such remarks after 3 months?
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Re: Request for change to be reverted

Post by Zutty »

Oh brilliant, thanks very much.

And, sorry Rubidium! I've been busy with my dissertation for the past 3 months!
PathZilla - A networking AI - Now with tram support.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 18 guests