This won't be done for a (long) while by me, and for this reason: currently we have FindBestXXXEngine, which finds the best engine for a given vehicle-type. It checks if it can refit the vehicle to the requested cargo, so it for sure can carry the cargo. As it is very similar to your request, I rather continue expending the API with ships, trains, tunnels, ... then to add such functions, which are code-wise rather hard (and used not that much by most of the AIs)griffin71 wrote:TrueLight, I have a request for a function in the AIVehicle class:It should return an engine ID, or null.Code: Select all
EngineID AIVehicle::GetEngineId(CargoID cargo, uint SequenceNum)
SequenceNum will be an integer number, starting with zero. If only 1 engine is available for the cargoID, then that EngineID should be returned if Sequencenum == 0; if more are available, they should be returned when SequenceNum ==1, 2, ...; just as many as there are engines available.
In addition, a function that returns the Engine specs should be present, so that the AI can make a choice for the engine. (I just want to keep in mind that in the future, our great artists will almost surely design their own vehicle sets, and more than 1 good engine may become available for a certain type of cargo.)
Are there any plans for implementing this?
(I'm trying to derive some kind of empirical relation between engine type and how much hills slow them down. This is a preparation to the extension of my pathfinder to work in hills.)
Thanks!
Of course you are free to create it yourself and send in your patch!