1 /* 2 * This file is part of OpenTTD. 3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. 4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>. 6 */ 7 8 /** 9 * @file ai_changelog.hpp Lists all changes / additions to the API. 10 * 11 * Only new / renamed / deleted api functions will be listed here. A list of 12 * bug fixes can be found in the normal changelog. Note that removed API 13 * functions may still be available if you return an older API version 14 * in GetAPIVersion() in info.nut. 15 * 16 * \b 12.0 17 * 18 * API additions: 19 * \li AINewGRF 20 * \li AINewGRFList 21 * \li AIGroup::GetNumVehicles 22 * \li AIMarine::BT_LOCK 23 * \li AIMarine::BT_CANAL 24 * \li AITile::IsSeaTile 25 * \li AITile::IsRiverTile 26 * \li AITile::BT_CLEAR_WATER 27 * \li AIObjectTypeList 28 * \li AIObjectType 29 * 30 * \b 1.11.0 31 * 32 * API additions: 33 * \li AICargo::GetName 34 * \li AIPriorityQueue 35 * 36 * Other changes: 37 * \li AIVehicle::CloneVehicle now correctly returns estimate when short on cash 38 * 39 * \b 1.10.0 40 * 41 * API additions: 42 * \li AIGroup::SetPrimaryColour 43 * \li AIGroup::SetSecondaryColour 44 * \li AIGroup::GetPrimaryColour 45 * \li AIGroup::GetSecondaryColour 46 * \li AIVehicle::BuildVehicleWithRefit 47 * \li AIVehicle::GetBuildWithRefitCapacity 48 * \li AIRoad::GetName 49 * \li AIRoad::RoadVehCanRunOnRoad 50 * \li AIRoad::RoadVehHasPowerOnRoad 51 * \li AIRoad::ConvertRoadType 52 * \li AIRoad::GetMaxSpeed 53 * \li AIEngine::CanRunOnRoad 54 * \li AIEngine::HasPowerOnRoad 55 * \li AIRoadTypeList::RoadTypeList 56 * \li AIEventVehicleAutoReplaced 57 * 58 * Other changes: 59 * \li AITile::DemolishTile works without a selected company 60 * 61 * \b 1.9.0 62 * 63 * API additions: 64 * \li AIAirport::GetMonthlyMaintenanceCost 65 * \li AIGroup::SetParent 66 * \li AIGroup::GetParent 67 * \li AICompany::SetPrimaryLiveryColour 68 * \li AICompany::SetSecondaryLiveryColour 69 * \li AICompany::GetPrimaryLiveryColour 70 * \li AICompany::GetSecondaryLiveryColour 71 * 72 * Other changes: 73 * \li AIBridge::GetName takes one extra parameter to refer the vehicle type 74 * \li AIGroup::CreateGroup gains parent_group_id parameter 75 * 76 * \b 1.8.0 77 * 78 * No changes 79 * 80 * API additions: 81 * \li AIRoad::ERR_ROADTYPE_DISALLOWS_CROSSING 82 * 83 * \b 1.7.0 - 1.7.2 84 * 85 * No changes 86 * 87 * \b 1.6.1 - 1.6.0 88 * 89 * No changes 90 * 91 * \b 1.5.3 - 1.5.1 92 * 93 * No changes 94 * 95 * \b 1.5.0 96 * 97 * API additions: 98 * \li AIList::SwapList 99 * \li AIStation::GetCargoPlanned 100 * \li AIStation::GetCargoPlannedFrom 101 * \li AIStation::GetCargoPlannedFromVia 102 * \li AIStation::GetCargoPlannedVia 103 * \li AIStation::GetCargoWaitingFromVia 104 * \li AIStationList_CargoPlannedByFrom 105 * \li AIStationList_CargoPlannedByVia 106 * \li AIStationList_CargoPlannedFromByVia 107 * \li AIStationList_CargoPlannedViaByFrom 108 * \li AIStationList_CargoWaitingByFrom 109 * \li AIStationList_CargoWaitingByVia 110 * \li AIStationList_CargoWaitingFromByVia 111 * \li AIStationList_CargoWaitingViaByFrom 112 * 113 * \b 1.4.4 - 1.4.1 114 * No changes 115 * 116 * \b 1.4.0 117 * 118 * API additions: 119 * \li AICargo::GetDistributionType 120 * \li AIDate::DATE_INVALID 121 * \li AIDate::IsValidDate 122 * \li AIStation::HasCargoRating 123 * \li AIStation::GetCargoWaitingFrom 124 * \li AIStation::GetCargoWaitingVia 125 * \li AITile::GetTerrainType 126 * \li AITown::FoundTown 127 * \li AITown::GetFundBuildingsDuration 128 * \li AITown::TOWN_GROWTH_NONE 129 * 130 * Other changes: 131 * \li AIStation::GetCargoRating does return -1 for cargo-station combinations that 132 * do not have a rating yet instead of returning 69. 133 * 134 * \b 1.3.3 - 1.3.2 135 * 136 * No changes 137 * 138 * \b 1.3.1 139 * 140 * API additions: 141 * \li AITile::GetTerrainType 142 * 143 * \b 1.3.0 144 * 145 * API additions: 146 * \li AIEventExclusiveTransportRights 147 * \li AIEventRoadReconstruction 148 * \li AIIndustryType::IsProcessingIndustry 149 * \li AIStation::IsAirportClosed 150 * \li AIStation::OpenCloseAirport 151 * \li AIController::Break 152 * 153 * \b 1.2.3 - 1.2.1 154 * 155 * No changes 156 * 157 * \b 1.2.0 158 * 159 * API additions: 160 * 161 * \li AIAirport::GetMaintenanceCostFactor 162 * \li AICargo::CT_AUTO_REFIT 163 * \li AICargo::CT_NO_REFIT 164 * \li AICargo::IsValidTownEffect 165 * \li AICargoList_StationAccepting 166 * \li AICompany::GetQuarterlyIncome 167 * \li AICompany::GetQuarterlyExpenses 168 * \li AICompany::GetQuarterlyCargoDelivered 169 * \li AICompany::GetQuarterlyPerformanceRating 170 * \li AICompany::GetQuarterlyCompanyValue 171 * \li AIController::GetOpsTillSuspend 172 * \li AIEngine::GetMaximumOrderDistance 173 * \li AIEventAircraftDestTooFar 174 * \li AIInfo::CONFIG_DEVELOPER 175 * \li AIInfrastructure 176 * \li AIOrder::ERR_ORDER_AIRCRAFT_NOT_ENOUGH_RANGE 177 * \li AIOrder::GetOrderDistance 178 * \li AIOrder::GetOrderRefit 179 * \li AIOrder::IsRefitOrder 180 * \li AIOrder::SetOrderRefit 181 * \li AIRail::GetMaintenanceCostFactor 182 * \li AIRoad::GetMaintenanceCostFactor 183 * \li AITile::GetTownAuthority 184 * \li AITown::GetCargoGoal 185 * \li AITown::GetGrowthRate 186 * \li AITown::GetLastMonthReceived 187 * \li AITownEffectList (to walk over all available town effects) 188 * \li AIVehicle::ERR_VEHICLE_TOO_LONG in case vehicle length limit is reached 189 * \li AIVehicle::GetMaximumOrderDistance 190 * 191 * API renames: 192 * \li AITown::GetLastMonthTransported to AITown::GetLastMonthSupplied to better 193 * reflect what it does. 194 * \li AIInfo has all its configure settings renamed from AICONFIG to just CONFIG 195 * like CONFIG_RANDOM. 196 * \li AIEvent has all its types renamed from AI_ET_ prefix to just ET_ prefix, 197 * like ET_SUBSIDY_OFFER. 198 * \li AIOrder has all its types renamed from AIOF_ prefix to just OF_ prefix. 199 * 200 * API removals: 201 * \li AICompany::GetCompanyValue, use AICompany::GetQuarterlyCompanyValue instead. 202 * 203 * Other changes: 204 * \li AITown::GetLastMonthProduction no longer has prerequisites based on town 205 * effects. 206 * \li AITown::GetLastMonthTransported resp. AITown::GetLastMonthSupplied no longer has prerequisites based on 207 * town effects. 208 * \li AITown::GetLastMonthTransportedPercentage no longer has prerequisites 209 * based on town effects. 210 * 211 * \b 1.1.5 212 * 213 * No changes 214 * 215 * \b 1.1.4 216 * 217 * API additions: 218 * \li AIVehicle::ERR_VEHICLE_TOO_LONG in case vehicle length limit is reached. 219 * 220 * \b 1.1.3 - 1.1.1 221 * 222 * No changes 223 * 224 * \b 1.1.0 225 * 226 * API additions: 227 * \li IsEnd for all lists. 228 * \li AIEventTownFounded 229 * \li AIIndustry::GetIndustryID 230 * \li AIIndustryType::INDUSTRYTYPE_TOWN 231 * \li AIIndustryType::INDUSTRYTYPE_UNKNOWN 232 * \li AIOrder::IsVoidOrder 233 * \li AIRail::GetName 234 * \li AITown::IsCity 235 * 236 * API removals: 237 * \li HasNext for all lists. 238 * \li AIAbstractList, use AIList instead. 239 * \li AIList::ChangeItem, use AIList::SetValue instead. 240 * \li AIRail::ERR_NONUNIFORM_STATIONS_DISABLED, that error is never returned anymore. 241 * 242 * Other changes: 243 * \li AIEngine::GetMaxTractiveEffort can be used for road vehicles. 244 * \li AIEngine::GetPower can be used for road vehicles. 245 * \li AIEngine::GetWeight can be used for road vehicles. 246 * \li AIIndustry::IsCargoAccepted now returns CargoAcceptState instead of a boolean. 247 * \li AIOrder::GetOrderFlags returns AIOrder::AIOF_INVALID for void orders as well. 248 * \li AIRoad::BuildDriveThroughRoadStation now allows overbuilding. 249 * \li AIRoad::BuildRoadStation now allows overbuilding. 250 * 251 * \b 1.0.5 - 1.0.4 252 * 253 * No changes 254 * 255 * \b 1.0.3 256 * 257 * API additions: 258 * \li AIRail::ERR_RAILTYPE_DISALLOWS_CROSSING 259 * 260 * \b 1.0.2 261 * 262 * Other changes: 263 * \li AIBridge::GetPrice now returns the price of the bridge without the cost for the rail or road. 264 * 265 * \b 1.0.1 266 * 267 * API additions: 268 * \li AIRail::GetMaxSpeed 269 * 270 * \b 1.0.0 271 * 272 * API additions: 273 * \li AIBaseStation 274 * \li AIEngine::IsBuildable 275 * \li AIEventCompanyAskMerger 276 * \li AIIndustry::GetLastMonthTransportedPercentage 277 * \li AIInfo::AICONFIG_INGAME 278 * \li AIMarine::GetBuildCost 279 * \li AIOrder::AIOF_GOTO_NEAREST_DEPOT 280 * \li AIOrder::GetStopLocation 281 * \li AIOrder::SetStopLocation 282 * \li AIRail::RemoveRailStationTileRectangle 283 * \li AIRail::RemoveRailWaypointTileRectangle 284 * \li AIRail::GetBuildCost 285 * \li AIRoad::GetBuildCost 286 * \li AISubsidy::SubsidyParticipantType 287 * \li AISubsidy::GetSourceType 288 * \li AISubsidy::GetSourceIndex 289 * \li AISubsidy::GetDestinationType 290 * \li AISubsidy::GetDestinationIndex 291 * \li AITile::GetBuildCost 292 * \li AITown::GetLastMonthTransportedPercentage 293 * \li AIVehicleList_Depot 294 * \li AIWaypoint::WaypointType 295 * \li AIWaypoint::HasWaypointType 296 * \li Some error messages to AIWaypoint 297 * 298 * API removals: 299 * \li AIOrder::ChangeOrder, use AIOrder::SetOrderFlags instead 300 * \li AIRail::RemoveRailStationTileRect, use AIRail::RemoveRailStationTileRectangle instead 301 * \li AIRail::RemoveRailWaypoint, use AIRail::RemoveRailWaypointTileRectangle instead 302 * \li AISign::GetMaxSignID, use AISignList instead 303 * \li AIStation::ERR_STATION_TOO_LARGE, use AIError::ERR_STATION_TOO_SPREAD_OUT instead 304 * \li AISubsidy::SourceIsTown, use AISubsidy::GetSourceType instead 305 * \li AISubsidy::GetSource, use AISubsidy::GetSourceIndex instead 306 * \li AISubsidy::DestinationIsTown, use AISubsidy::GetDestinationType instead 307 * \li AISubsidy::GetDestination, use AISubsidy::GetDestinationIndex instead 308 * \li AITile::GetHeight, use AITile::GetMinHeight/GetMaxHeight/GetCornerHeight instead 309 * \li AITown::GetMaxProduction, use AITown::GetLastMonthProduction instead 310 * \li AIVehicle::SkipToVehicleOrder, use AIOrder::SkipToOrder instead 311 * \li AIWaypoint::WAYPOINT_INVALID, use AIBaseStation::STATION_INVALID instead 312 * 313 * Other changes: 314 * \li The GetName / SetName / GetLocation functions were moved from AIStation 315 * and AIWaypoint to AIBaseStation, but you can still use AIStation.GetName 316 * as before 317 * \li The GetConstructionDate function was moved from AIStation to 318 * AIBaseStation, but can still be used as AIStation.GetConstructionDate 319 * \li WaypointID was replaced by StationID. All WaypointIDs from previous 320 * savegames are invalid. Use STATION_INVALID instead of WAYPOINT_INVALID 321 * \li AIWaypointList constructor now needs a WaypointType similar to AIStationList, 322 * it can also handle buoys. 323 * \li AIVehicleList_Station now also works for waypoints 324 * \li Stations can be build over rail without signals that is in the right 325 * direction for the to-be built station. It will also convert the rail if 326 * the station's rail type supports the old type. 327 * \li GetAPIVersion() was added as function to info.nut. If it does not exist 328 * API version 0.7 is assumed. This function should return the major and 329 * minor number of the stable version of the API the AI is written against. 330 * For 0.7.2 that would be 0.7, for 1.1.3 it would be 1.1, etc. 331 * \li The subsidy logic has changed. Subsidy is now awarded when cargo 332 * originating from subsidy source is delivered to station that has subsidy 333 * destination it its catchment area. One industry tile or one town house 334 * is enough as long as station accepts the cargo. Awarded subsidies are no 335 * longer bound to stations used for first delivery, any station can be 336 * used for loading and unloading as long as cargo is transferred from 337 * source to destination. 338 * \li Make AIEngine:CanRefitCargo() not report refittability to mail by 339 * default for aircraft. It is not necessarily true. This means that even 340 * if the aircraft can carry mail (as secondary cargo) it does not return 341 * true if the aircraft cannot carry it as its only cargo. 342 * \li Improve behaviour of AIEngine::GetCargoType(), AIEventEnginePreview::GetCargoType() 343 * and AIEngine::CanRefitCargo() for articulated vehicles. For 344 * CanRefitCargo true is returned if at least one part can be refitted. 345 * For GetCargoType the first most used cargo type is returned. 346 * \li AIIndustryType::GetConstructionCost() now returns -1 if the industry is 347 * neither buildable nor prospectable. 348 * \li AIEngine::IsValidEngine will now return true if you have at least one 349 * vehicle of that type in your company, regardless if it's still buildable 350 * or not. AIEngine::IsBuildable returns only true when you can actually 351 * build an engine. 352 * \li AITile::GetCargoProduction will now return the number of producers, 353 * including houses instead the number of producing tiles. This means that 354 * also industries that do not have a tile within the radius, but where 355 * the search bounding box and the industry's bounding box intersect, are 356 * counted. Previously these industries (and their cargoes), although they 357 * produced cargo for a station at the given location, were not returned. 358 * \li AIRail::BuildRail will now fail completely if there is an obstacle 359 * between the begin and end, instead of building up to the obstacle and 360 * returning that everything went okay. 361 * \li Orders for buoys are now waypoint orders, i.e. instead of using the 362 * station orders for buoys one has to use waypoint orders. 363 * \li Autoreplaces can now also be set for the default group via AIGroup. 364 * 365 * \b 0.7.5 - 0.7.4 366 * 367 * No changes 368 * 369 * \b 0.7.3 370 * 371 * API additions: 372 * \li AIAbstractList::SORT_ASCENDING 373 * \li AIAbstractList::SORT_DESCENDING 374 * \li AIAirport::IsAirportInformationAvailable 375 * \li AICompany::GetPresidentGender 376 * \li AICompany::SetPresidentGender 377 * \li AIEngine::GetDesignDate 378 * \li AIStation::GetConstructionDate 379 * 380 * Other changes: 381 * \li AIs are now killed when they execute a DoCommand or Sleep at a time 382 * they are not allowed to do so. 383 * \li When the API requests a string as parameter you can give every squirrel 384 * type and it will be converted to a string 385 * \li AIs can create subclasses of API classes and use API constants as part 386 * of their own constants 387 * 388 * \b 0.7.2 389 * 390 * API additions: 391 * \li AIVehicle::GetReliability 392 * 393 * Other changes: 394 * \li DoCommands and sleeps in call, acall, pcall and valuators are disallowed 395 * 396 * \b 0.7.1 397 * 398 * API additions: 399 * \li AIAirport::GetPrice 400 * \li AIController::GetVersion 401 * \li AIOrder::AIOF_DEPOT_FLAGS 402 * \li AIOrder::AIOF_STOP_IN_DEPOT 403 * \li AIOrder::IsCurrentOrderPartOfOrderList 404 * \li AIOrder::IsGotoDepotOrder 405 * \li AIOrder::IsGotoStationOrder 406 * \li AIOrder::IsGotoWaypointOrder 407 * \li AISignList 408 * \li AITile::CORNER_[WSEN] 409 * \li AITile::ERR_AREA_ALREADY_FLAT 410 * \li AITile::ERR_EXCAVATION_WOULD_DAMAGE 411 * \li AITile::GetCornerHeight 412 * \li AITile::GetMaxHeight 413 * \li AITile::GetMinHeight 414 * \li AIVehicle::SendVehicleToDepotForServicing 415 * 416 * Other changes: 417 * \li GetURL() was added as optional function to info.nut 418 * \li UseAsRandomAI() was added as optional function to info.nut 419 * \li A limit was introduced on the time the AI spends in the constructor and Load function 420 * 421 * \b 0.7.0 422 * \li First stable release with the NoAI framework. 423 */ 424