Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Mon Dec 10, 2018 9:56 am

All times are UTC




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
 Post subject: NoAI Documentation
PostPosted: Tue Aug 07, 2018 9:35 am 
Offline
Engineer
Engineer

Joined: Sun Jul 22, 2018 8:30 pm
Posts: 20
Sometimes, I find a function in the NoAI Documentation that I want to use, but then it seems that it behaves different from what I expected.

In the following functions, could the behaviour be adjusted, or the documentation updated? I might add more things to the list by editing this post.
  1. AIVehicleList_Station(StationID station_id) - This function only works for the "own" company, but that is not stated. My AI would like to see if any vehicle has orders to a station of another company. Human players can do this by clicking a station of another company.
  2. AIRail.BuildSignal (TileIndex tile, TileIndex front, SignalType signal) - If there is already a signal, its direction will be turned, similar to building signals for human player.
  3. AIMarine.AreWaterTilesConnected (TileIndex tile_from, TileIndex tile_to) - Fails when two locks are built, blocking eachother. This function will return true between the lock tiles, despite the documentation says "whether a ship vehicle can travel from the center of the first tile to the center of the second tile."
  4. AIStation.GetLocation(StationID station_id), AIStation.GetName(StationID station_id) - Doesn't work for stations of another company
  5. AIStation.HasCargoRating(StationID station_id, CargoID cargo_id), AIStation.GetCargoRating(StationID station_id, CargoID cargo_id) - Doesn't work for stations of other companies either


Top
   
 Post subject: Re: NoAI Documentation
PostPosted: Wed Nov 14, 2018 9:57 pm 
Offline
Engineer
Engineer

Joined: Sun Jul 22, 2018 8:30 pm
Posts: 20
Another one:
- AIRail.RemoveRail - this function returns true, even if a train was on a part of the railway track that was requested to be removed. Then, all track parts that were not occupied by a train are removed, leaving the track parts with a train on it. The same behaviour happens when a human player tries to remove rail tracks that are partially occupied by a train.


Top
   
 Post subject: Re: NoAI Documentation
PostPosted: Thu Nov 15, 2018 10:34 pm 
Offline
Engineer
Engineer

Joined: Sun Jul 22, 2018 8:30 pm
Posts: 20
..and:
  • AITile.IsWaterTile - returns false when a buoy was placed on the tile.


Top
   
 Post subject: Re: NoAI Documentation
PostPosted: Fri Nov 16, 2018 9:56 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9062
Location: Sol d
Thank you for pointing out the non-obvious limitations :) Can you create amendments to the documentation and open a pull request on Github, please?

(it can certainly be discussed to change some behaviour - but that's a backward incompatible change, so needs consideration or new names for new functions)

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
 Post subject: Re: NoAI Documentation
PostPosted: Sat Nov 17, 2018 11:02 pm 
Offline
Engineer
Engineer

Joined: Sun Jul 22, 2018 8:30 pm
Posts: 20
There is sometimes a difference between non-obvious things (like, expenses are negative) and the unexpected things (like, a buoy is no water according to the API).

Maybe there will be one day I'm going to start updating the NoAI documentation for you (not yet this week) :D


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.