Update documentation from openttd 1.6 branch
[openttd/fttd.git] / src / script / api / ai_changelog.hpp
blob23f4a0958f81dcb69cf729590f78deff2b873b88
1 /* $Id$ */
3 /*
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
8 */
10 /**
11 * @file ai_changelog.hpp Lists all changes / additions to the API.
13 * Only new / renamed / deleted api functions will be listed here. A list of
14 * bug fixes can be found in the normal changelog. Note that removed API
15 * functions may still be available if you return an older API version
16 * in GetAPIVersion() in info.nut.
18 * \b 1.7.0
20 * 1.7.0 is not yet released. The following changes are not set in stone yet.
22 * \b 1.6.1 - 1.6.0
24 * No changes
26 * \b 1.5.3 - 1.5.1
28 * No changes
30 * \b 1.5.0
32 * API additions:
33 * \li AIList::SwapList
34 * \li AIStation::GetCargoPlanned
35 * \li AIStation::GetCargoPlannedFrom
36 * \li AIStation::GetCargoPlannedFromVia
37 * \li AIStation::GetCargoPlannedVia
38 * \li AIStation::GetCargoWaitingFromVia
39 * \li AIStationList_CargoPlannedByFrom
40 * \li AIStationList_CargoPlannedByVia
41 * \li AIStationList_CargoPlannedFromByVia
42 * \li AIStationList_CargoPlannedViaByFrom
43 * \li AIStationList_CargoWaitingByFrom
44 * \li AIStationList_CargoWaitingByVia
45 * \li AIStationList_CargoWaitingFromByVia
46 * \li AIStationList_CargoWaitingViaByFrom
48 * \b 1.4.4 - 1.4.1
49 * No changes
51 * \b 1.4.0
53 * API additions:
54 * \li AICargo::GetDistributionType
55 * \li AIDate::DATE_INVALID
56 * \li AIDate::IsValidDate
57 * \li AIStation::HasCargoRating
58 * \li AIStation::GetCargoWaitingFrom
59 * \li AIStation::GetCargoWaitingVia
60 * \li AITile::GetTerrainType
61 * \li AITown::FoundTown
62 * \li AITown::GetFundBuildingsDuration
63 * \li AITown::TOWN_GROWTH_NONE
65 * Other changes:
66 * \li AIStation::GetCargoRating does return -1 for cargo-station combinations that
67 * do not have a rating yet instead of returning 69.
69 * \b 1.3.3 - 1.3.2
71 * No changes
73 * \b 1.3.1
75 * API additions:
76 * \li AITile::GetTerrainType
78 * \b 1.3.0
80 * API additions:
81 * \li AIEventExclusiveTransportRights
82 * \li AIEventRoadReconstruction
83 * \li AIIndustryType::IsProcessingIndustry
84 * \li AIStation::IsAirportClosed
85 * \li AIStation::OpenCloseAirport
86 * \li AIController::Break
88 * \b 1.2.3 - 1.2.1
90 * No changes
92 * \b 1.2.0
94 * API additions:
96 * \li AIAirport::GetMaintenanceCostFactor
97 * \li AICargo::CT_AUTO_REFIT
98 * \li AICargo::CT_NO_REFIT
99 * \li AICargo::IsValidTownEffect
100 * \li AICargoList_StationAccepting
101 * \li AICompany::GetQuarterlyIncome
102 * \li AICompany::GetQuarterlyExpenses
103 * \li AICompany::GetQuarterlyCargoDelivered
104 * \li AICompany::GetQuarterlyPerformanceRating
105 * \li AICompany::GetQuarterlyCompanyValue
106 * \li AIController::GetOpsTillSuspend
107 * \li AIEngine::GetMaximumOrderDistance
108 * \li AIEventAircraftDestTooFar
109 * \li AIInfo::CONFIG_DEVELOPER
110 * \li AIInfrastructure
111 * \li AIOrder::ERR_ORDER_AIRCRAFT_NOT_ENOUGH_RANGE
112 * \li AIOrder::GetOrderDistance
113 * \li AIOrder::GetOrderRefit
114 * \li AIOrder::IsRefitOrder
115 * \li AIOrder::SetOrderRefit
116 * \li AIRail::GetMaintenanceCostFactor
117 * \li AIRoad::GetMaintenanceCostFactor
118 * \li AITile::GetTownAuthority
119 * \li AITown::GetCargoGoal
120 * \li AITown::GetGrowthRate
121 * \li AITown::GetLastMonthReceived
122 * \li AITownEffectList (to walk over all available town effects)
123 * \li AIVehicle::ERR_VEHICLE_TOO_LONG in case vehicle length limit is reached
124 * \li AIVehicle::GetMaximumOrderDistance
126 * API renames:
127 * \li AITown::GetLastMonthTransported to AITown::GetLastMonthSupplied to better
128 * reflect what it does.
129 * \li AIInfo has all its configure settings renamed from AICONFIG to just CONFIG
130 * like CONFIG_RANDOM.
131 * \li AIEvent has all its types renamed from AI_ET_ prefix to just ET_ prefix,
132 * like ET_SUBSIDY_OFFER.
133 * \li AIOrder has all its types renamed from AIOF_ prefix to just OF_ prefix.
135 * API removals:
136 * \li AICompany::GetCompanyValue, use AICompany::GetQuarterlyCompanyValue instead.
138 * Other changes:
139 * \li AITown::GetLastMonthProduction no longer has prerequisites based on town
140 * effects.
141 * \li AITown::GetLastMonthTransported resp. AITown::GetLastMonthSupplied no longer has prerequisites based on
142 * town effects.
143 * \li AITown::GetLastMonthTransportedPercentage no longer has prerequisites
144 * based on town effects.
146 * \b 1.1.5
148 * No changes
150 * \b 1.1.4
152 * API additions:
153 * \li AIVehicle::ERR_VEHICLE_TOO_LONG in case vehicle length limit is reached.
155 * \b 1.1.3 - 1.1.1
157 * No changes
159 * \b 1.1.0
161 * API additions:
162 * \li IsEnd for all lists.
163 * \li AIEventTownFounded
164 * \li AIIndustry::GetIndustryID
165 * \li AIIndustryType::INDUSTRYTYPE_TOWN
166 * \li AIIndustryType::INDUSTRYTYPE_UNKNOWN
167 * \li AIOrder::IsVoidOrder
168 * \li AIRail::GetName
169 * \li AITown::IsCity
171 * API removals:
172 * \li HasNext for all lists.
173 * \li AIAbstractList, use AIList instead.
174 * \li AIList::ChangeItem, use AIList::SetValue instead.
175 * \li AIRail::ERR_NONUNIFORM_STATIONS_DISABLED, that error is never returned anymore.
177 * Other changes:
178 * \li AIEngine::GetMaxTractiveEffort can be used for road vehicles.
179 * \li AIEngine::GetPower can be used for road vehicles.
180 * \li AIEngine::GetWeight can be used for road vehicles.
181 * \li AIIndustry::IsCargoAccepted now returns CargoAcceptState instead of a boolean.
182 * \li AIOrder::GetOrderFlags returns AIOrder::AIOF_INVALID for void orders as well.
183 * \li AIRoad::BuildDriveThroughRoadStation now allows overbuilding.
184 * \li AIRoad::BuildRoadStation now allows overbuilding.
186 * \b 1.0.5 - 1.0.4
188 * No changes
190 * \b 1.0.3
192 * API additions:
193 * \li AIRail::ERR_RAILTYPE_DISALLOWS_CROSSING
195 * \b 1.0.2
197 * Other changes:
198 * \li AIBridge::GetPrice now returns the price of the bridge without the cost for the rail or road.
200 * \b 1.0.1
202 * API additions:
203 * \li AIRail::GetMaxSpeed
205 * \b 1.0.0
207 * API additions:
208 * \li AIBaseStation
209 * \li AIEngine::IsBuildable
210 * \li AIEventCompanyAskMerger
211 * \li AIIndustry::GetLastMonthTransportedPercentage
212 * \li AIInfo::AICONFIG_INGAME
213 * \li AIMarine::GetBuildCost
214 * \li AIOrder::AIOF_GOTO_NEAREST_DEPOT
215 * \li AIOrder::GetStopLocation
216 * \li AIOrder::SetStopLocation
217 * \li AIRail::RemoveRailStationTileRectangle
218 * \li AIRail::RemoveRailWaypointTileRectangle
219 * \li AIRail::GetBuildCost
220 * \li AIRoad::GetBuildCost
221 * \li AISubsidy::SubsidyParticipantType
222 * \li AISubsidy::GetSourceType
223 * \li AISubsidy::GetSourceIndex
224 * \li AISubsidy::GetDestinationType
225 * \li AISubsidy::GetDestinationIndex
226 * \li AITile::GetBuildCost
227 * \li AITown::GetLastMonthTransportedPercentage
228 * \li AIVehicleList_Depot
229 * \li AIWaypoint::WaypointType
230 * \li AIWaypoint::HasWaypointType
231 * \li Some error messages to AIWaypoint
233 * API removals:
234 * \li AIOrder::ChangeOrder, use AIOrder::SetOrderFlags instead
235 * \li AIRail::RemoveRailStationTileRect, use AIRail::RemoveRailStationTileRectangle instead
236 * \li AIRail::RemoveRailWaypoint, use AIRail::RemoveRailWaypointTileRectangle instead
237 * \li AISign::GetMaxSignID, use AISignList instead
238 * \li AIStation::ERR_STATION_TOO_LARGE, use AIError::ERR_STATION_TOO_SPREAD_OUT instead
239 * \li AISubsidy::SourceIsTown, use AISubsidy::GetSourceType instead
240 * \li AISubsidy::GetSource, use AISubsidy::GetSourceIndex instead
241 * \li AISubsidy::DestinationIsTown, use AISubsidy::GetDestinationType instead
242 * \li AISubsidy::GetDestination, use AISubsidy::GetDestinationIndex instead
243 * \li AITile::GetHeight, use AITile::GetMinHeight/GetMaxHeight/GetCornerHeight instead
244 * \li AITown::GetMaxProduction, use AITown::GetLastMonthProduction instead
245 * \li AIVehicle::SkipToVehicleOrder, use AIOrder::SkipToOrder instead
246 * \li AIWaypoint::WAYPOINT_INVALID, use AIBaseStation::STATION_INVALID instead
248 * Other changes:
249 * \li The GetName / SetName / GetLocation functions were moved from AIStation
250 * and AIWaypoint to AIBaseStation, but you can still use AIStation.GetName
251 * as before
252 * \li The GetConstructionDate function was moved from AIStation to
253 * AIBaseStation, but can still be used as AIStation.GetConstructionDate
254 * \li WaypointID was replaced by StationID. All WaypointIDs from previous
255 * savegames are invalid. Use STATION_INVALID instead of WAYPOINT_INVALID
256 * \li AIWaypointList constructor now needs a WaypointType similar to AIStationList,
257 * it can also handle buoys.
258 * \li AIVehicleList_Station now also works for waypoints
259 * \li Stations can be build over rail without signals that is in the right
260 * direction for the to-be built station. It will also convert the rail if
261 * the station's rail type supports the old type.
262 * \li GetAPIVersion() was added as function to info.nut. If it does not exist
263 * API version 0.7 is assumed. This function should return the major and
264 * minor number of the stable version of the API the AI is written against.
265 * For 0.7.2 that would be 0.7, for 1.1.3 it would be 1.1, etc.
266 * \li The subsidy logic has changed. Subsidy is now awarded when cargo
267 * originating from subsidy source is delivered to station that has subsidy
268 * destination it its catchment area. One industry tile or one town house
269 * is enough as long as station accepts the cargo. Awarded subsidies are no
270 * longer bound to stations used for first delivery, any station can be
271 * used for loading and unloading as long as cargo is transfered from
272 * source to destination.
273 * \li Make AIEngine:CanRefitCargo() not report refittability to mail by
274 * default for aircraft. It is not necessarily true. This means that even
275 * if the aircraft can carry mail (as secondary cargo) it does not return
276 * true if the aircraft cannot carry it as its only cargo.
277 * \li Improve behaviour of AIEngine::GetCargoType(), AIEventEnginePreview::GetCargoType()
278 * and AIEngine::CanRefitCargo() for articulated vehicles. For
279 * CanRefitCargo true is returned if at least one part can be refitted.
280 * For GetCargoType the first most used cargo type is returned.
281 * \li AIIndustryType::GetConstructionCost() now returns -1 if the industry is
282 * neither buildable nor prospectable.
283 * \li AIEngine::IsValidEngine will now return true if you have at least one
284 * vehicle of that type in your company, regardless if it's still buildable
285 * or not. AIEngine::IsBuildable returns only true when you can actually
286 * build an engine.
287 * \li AITile::GetCargoProduction will now return the number of producers,
288 * including houses instead the number of producing tiles. This means that
289 * also industries that do not have a tile within the radius, but where
290 * the search bounding box and the industry's bounding box intersect, are
291 * counted. Previously these industries (and their cargoes), although they
292 * produced cargo for a station at the given location, were not returned.
293 * \li AIRail::BuildRail will now fail completely if there is an obstacle
294 * between the begin and end, instead of building up to the obstacle and
295 * returning that everything went okay.
296 * \li Orders for buoys are now waypoint orders, i.e. instead of using the
297 * station orders for buoys one has to use waypoint orders.
298 * \li Autoreplaces can now also be set for the default group via AIGroup.
300 * \b 0.7.5 - 0.7.4
302 * No changes
304 * \b 0.7.3
306 * API additions:
307 * \li AIAbstractList::SORT_ASCENDING
308 * \li AIAbstractList::SORT_DESCENDING
309 * \li AIAirport::IsAirportInformationAvailable
310 * \li AICompany::GetPresidentGender
311 * \li AICompany::SetPresidentGender
312 * \li AIEngine::GetDesignDate
313 * \li AIStation::GetConstructionDate
315 * Other changes:
316 * \li AIs are now killed when they execute a DoCommand or Sleep at a time
317 * they are not allowed to do so.
318 * \li When the API requests a string as parameter you can give every squirrel
319 * type and it will be converted to a string
320 * \li AIs can create subclasses of API classes and use API constants as part
321 * of their own constants
323 * \b 0.7.2
325 * API additions:
326 * \li AIVehicle::GetReliability
328 * Other changes:
329 * \li DoCommands and sleeps in call, acall, pcall and valuators are disallowed
331 * \b 0.7.1
333 * API additions:
334 * \li AIAirport::GetPrice
335 * \li AIController::GetVersion
336 * \li AIOrder::AIOF_DEPOT_FLAGS
337 * \li AIOrder::AIOF_STOP_IN_DEPOT
338 * \li AIOrder::IsCurrentOrderPartOfOrderList
339 * \li AIOrder::IsGotoDepotOrder
340 * \li AIOrder::IsGotoStationOrder
341 * \li AIOrder::IsGotoWaypointOrder
342 * \li AISignList
343 * \li AITile::CORNER_[WSEN]
344 * \li AITile::ERR_AREA_ALREADY_FLAT
345 * \li AITile::ERR_EXCAVATION_WOULD_DAMAGE
346 * \li AITile::GetCornerHeight
347 * \li AITile::GetMaxHeight
348 * \li AITile::GetMinHeight
349 * \li AIVehicle::SendVehicleToDepotForServicing
351 * Other changes:
352 * \li GetURL() was added as optional function to info.nut
353 * \li UseAsRandomAI() was added as optional function to info.nut
354 * \li A limit was introduced on the time the AI spends in the constructor and Load function
356 * \b 0.7.0
357 * \li First stable release with the NoAI framework.