NoAI API requests
Posted: 09 Apr 2014 20:45
After writing my first AI there are several functions which would be very helpful. Do I add them myself and hope they are accepted as a patch? Is there a procedure to make acceptance more likely? Do any experts have any insight into how difficult they would be to add? Any current developers willing to take some on?
AICargoList_StationProducing
This is the missing counterpart to the already existing AICargoList_StationAccepting function. Currently superlib implements this function by iterating through tiles around the station. However the process is very time consuming and ideally my AI should respond between the point where a vehicle enters and leaves a station.
AIMap.TravelDistance(tile, tile, AITile::TransportType)
Returns the travel distance between two tiles using only the specified road type. Returns -1 (or other appropriate failure value) if journey is not possible.
AIVehicle.EstimatedTravelTime(vehicle, tile)
Returns the number of ticks a vehicle will require to reach the specified tile. May not be needed if Travel distance is known. I was thinking of the case of needing to take elevation change into account for travel time along a path.
AIStation.PredictedStockpile(cargo_type, ticks_in_future)
I am having a hard time predicting how much cargo will be at a station at some point in the future. If there is a way to translate LastMonthsProduction into ticks that may be something I can do myself.
AIIndustry.ProductionPerTick(cargo_type)
It may be possible to translate last months production into ticks, but going to a uniform time constant seems reasonable.
AIIndustryList_AtStation
Returns the list of industries within a station's area.
Any insight is appreciated, Thanks
AICargoList_StationProducing
This is the missing counterpart to the already existing AICargoList_StationAccepting function. Currently superlib implements this function by iterating through tiles around the station. However the process is very time consuming and ideally my AI should respond between the point where a vehicle enters and leaves a station.
AIMap.TravelDistance(tile, tile, AITile::TransportType)
Returns the travel distance between two tiles using only the specified road type. Returns -1 (or other appropriate failure value) if journey is not possible.
AIVehicle.EstimatedTravelTime(vehicle, tile)
Returns the number of ticks a vehicle will require to reach the specified tile. May not be needed if Travel distance is known. I was thinking of the case of needing to take elevation change into account for travel time along a path.
AIStation.PredictedStockpile(cargo_type, ticks_in_future)
I am having a hard time predicting how much cargo will be at a station at some point in the future. If there is a way to translate LastMonthsProduction into ticks that may be something I can do myself.
AIIndustry.ProductionPerTick(cargo_type)
It may be possible to translate last months production into ticks, but going to a uniform time constant seems reasonable.
AIIndustryList_AtStation
Returns the list of industries within a station's area.
Any insight is appreciated, Thanks