Commit Graph

395 Commits (da57fe63f348a1f4628b9f17df171f4c54f0d2e7)

Author SHA1 Message Date
glx ab3fc1d437 (svn r15535) -Fix (r15460, pre noai merge): use '.' as 'any' for squirrel calls typechecking as stated in squirrel docs 16 years ago
yexo 07a37af14c (svn r15530) -Fix (r15519): The AIWaypoint classes were not exported to squirrel. 16 years ago
yexo a54061f840 (svn r15527) -Fix (r15526): A ')' too much. 16 years ago
yexo b3fe664d90 (svn r15526) -Add [NoAI]: Support for conditional orders. 16 years ago
yexo 3491b0fab9 (svn r15524) -Add [NoAI]: AIEngine::GetPower, AIEngine::GetWeight and AIEngine::GetMaxTractiveEffort. 16 years ago
yexo 459a855e60 (svn r15520) -Cleanup [NoAI]: Fix some typos, unify the comment style and update some documentation since a few enums have been renamed. 16 years ago
yexo c0e7ddeb9e (svn r15519) -Add [NoAI]: support for waypoints by adding AIRail::Build/Remove RailWaypoint, AIWaypoint and AIWaypointList. 16 years ago
yexo a0b57c849e (svn r15494) -Change [API CHANGE]: Split AIRoad::BuildRoadStation in BuildRoadStation and BuildDriveThroughRoadStation. 16 years ago
yexo 2b221f5afc (svn r15492) -Change [API CHANGE]: Split AIVehicle::MoveWagon in MoveWagon and MoveWagonChain (frosch). 16 years ago
yexo 336abd66a2 (svn r15491) -Change [API CHANGE]: AIMarine::BuildWaterDepot now accepts a front tile instead of a bool is_vertical (frosch). 16 years ago
yexo 7d88077add (svn r15490) -Change [API CHANGE]: Remove AIBridge::GetYearAvailable. AIBridge::IsValidBridge now only returns true for available bridges. 16 years ago
yexo 16954ba378 (svn r15489) -Change [API CHANGE]: Remove AIAirport::AirportAvailable. AIAirport::IsValidAirportType now only returns true for available AirportTypes. 16 years ago
yexo bce1bcb0f2 (svn r15488) -Change [API CHANGE]: Add support for distant-join stations. 16 years ago
yexo 5a5bc8ab52 (svn r15487) -Change [API CHANGE]: Remove the never implemented function AIEventVehicleCrashed::CloneCrashedVehicle. 16 years ago
yexo 8ceb92e699 (svn r15486) -Change [API CHANGE]: Remove AITown::GetMaxTownID. 16 years ago
yexo cea470e687 (svn r15485) -Change [API CHANGE]: Split AIIndustry::HasHeliportAndDock and GetHeliportAndDockLocation in HasHeliport/HasDock and GetHeliportLocation/GetDockLocation. 16 years ago
yexo 58359b8d6e (svn r15484) -Change [API CHANGE]: Remove AICompany::GetCompanyName and SetCompanyName. They've been replaced with GetName and SetName. 16 years ago
yexo 7fdde2fec0 (svn r15483) -Change [API CHANGE]: Remove AIIndustry::GetProduction, use AIIndustry::GetLastMonthProduction instead. 16 years ago
yexo 92fc2e692c (svn r15482) -Fix [NoAI]: Typos in api docs. 16 years ago
yexo 37819fc8c5 (svn r15481) -Fix [NoAI]: Make sure AIs can't call functions they shouldn't call. 16 years ago
frosch b123756c9f (svn r15479) -Fix: Documentation of AIIndustryType::CanBuildIndustry(). 16 years ago
yexo e84f25a2bd (svn r15470) -Fix [NoAI]: Check the types of the parameters passed to AddSetting, AddLabels and RegisterAI. 16 years ago
yexo 8e14d77d05 (svn r15467) -Fix [NoAI]: AIs with an error in their info.nut are no longer available in-game. 16 years ago
yexo 15b9366f06 (svn r15466) -Fix (r15330): The squirrel instance object was freed twice if an info.nut failed to compile. 16 years ago
smatz d3f018a7e3 (svn r15465) -Codechange: constify most of AIInfo/AIFileInfo methods, move definition of very simple getters to header file 16 years ago
yexo 9292c90360 (svn r15464) -Codechange [NoAI]: Call all info.nut functions exactly once and only during initialization. 16 years ago
yexo b9c66aa750 (svn r15463) -Change [API CHANGE]: Replace AIInfo::CanLoadFromVersion(version) with AIInfo::MinVersionToLoad() which should return a single integer, the minimum version the AI is able to load data from. 16 years ago
yexo 4c7106dad7 (svn r15462) -Change [NoAI]: Make AIController::GetTick() and AIController::GetSetting() static functions.
-Fix (r15460): ai_controller.hpp.sq was forgotten.
16 years ago
rubidium dea3490b2f (svn r15460) -Fix [NoAI]: don't require an instance to exist in the scope for static functions and limit exposure of the internal function GetClassName. 16 years ago
yexo 8d25202067 (svn r15441) -Cleanup: Use a return value instead of passing a pointer to where the result should be stored. 16 years ago
yexo 1eeb0f6748 (svn r15440) -Fix: Backup AIObject::GetAllowDoCommand and restore the old value so AIs can't work around it. 16 years ago
peter1138 ad30a3c4ca (svn r15436) -Codechange: Return index of station spec within station class as a return parameter of GetCustomStationSpecByGrf(), as the index is already known. Saves on an extra loop and an extern... 16 years ago
rubidium c0a8d09ca7 (svn r15428) -Codechange: consistently use colour instead of having both color and colour. 16 years ago
rubidium 8dae160d0f (svn r15425) -Codechange: some color->colour changes and type safety. 16 years ago
rubidium 377ce6c5bf (svn r15410) -Cleanup: get rid of most of the references to the 'patches' except where it's used for backward compatability. 16 years ago
Yexo 5bcdcdd1d1 (svn r15408) -Fix (r15027): AIs could call AIController::Sleep() at times they're not allowed to sleep. 16 years ago
rubidium e1b1fd18b5 (svn r15406) -Fix: make Valuate actually cost a few opcodes to not make it a single opcode method of doing lots of the same thing. This should resolve most of the hiccups caused by AIs. 16 years ago
smatz 9c59b711b7 (svn r15401) -Fix [FS#2619](r15027): AI::Stop changed _current_company, but didn't restore its original value 16 years ago
frosch 4e8707b93f (svn r15400) -Fix: Typos in comments. 16 years ago
rubidium 6252c74584 (svn r15368) -Fix: some typos in comments 16 years ago
Yexo cb3784d8b1 (svn r15366) -Add [NoAI]: Add AddLabels() where you can define labels for the values of the settings in info.nut 16 years ago
frosch 324e92f879 (svn r15360) -Fix: Flooding vehicles did not trigger an AI event. 16 years ago
frosch cb049e4e58 (svn r15359) -Add [NoAI]: AIEventVehicleCrashed::CRASH_RV_UFO, AIEventDisasterZeppelinerCrashed and AIEventDisasterZeppelinerCleared as aliens accepted NoAIs as competing life-form. 16 years ago
frosch 7f198507f7 (svn r15358) -Add [NoAI]: AIEventVehicleCrashed::GetCrashReason() 16 years ago
rubidium 8fb4962407 (svn r15355) -Codechange: simplify some stuff now ->FirstShared returns non-NULL again. 16 years ago
Yexo f2907d816f (svn r15346) -Add [NoAI]: Add AIAirport::GetNearestTown() so AIs can known in which town the noise level will increase. 16 years ago
Yexo 62a11eb5a9 (svn r15345) -Add [NoAI]: Add AIVehicle::HasSharedOrders() and AIVehicleList_SharedOrders. 16 years ago
Yexo b321130d9a (svn r15343) -Add [NoAI]: Add AITown::GetRoadLayout so AIs can get the road layout per town. 16 years ago
rubidium 1c30c8c801 (svn r15330) -Fix [FS#2597]: leaking of Squirrel when using circular references (by enabling the GC). 16 years ago
Yexo 101f55e65c (svn r15328) -Fix (r15327): Load(data, version) was called instead of Load(version, data). 16 years ago
Yexo 1892c34ac6 (svn r15327) -Fix (r15027): AIs could access the map and other data in their constructor and Load() function while the savegame was not completely loaded. 16 years ago
smatz 5ad1cd32b2 (svn r15324) -Codechange: unify the class used for comparing of strings for std::map 16 years ago
Yexo a5807f4a77 (svn r15322) -Fix (r15175): The AI list window didn't display information about the selected AI if it wasn't visible. 16 years ago
frosch de9a6fc90b (svn r15308) -Codechange: Deduplicate km-ish/h -> mph conversions. 16 years ago
frosch 317220c2e4 (svn r15307) -Fix: AIVehicle::GetCurrentSpeed() should also use km-ish/h instead of mph. (Documentation by Rubidium) 16 years ago
frosch c28c4c1986 (svn r15306) -Codechange: Deduplicate code by adding Engine::GetDisplayMaxSpeed(), GetPower() and GetDisplayWeight(). (and using them) 16 years ago
smatz 0d3f5e6e74 (svn r15299) -Cleanup: remove many redundant includes 16 years ago
Yexo ea01534e6d (svn r15284) -Fix [FS#2582] (r15045): Parameters were popped from the squirrel stack twice. 16 years ago
smatz 659989af45 (svn r15278) -Fix [FS#2332]: test noise limit of nearest town instead of st->town 16 years ago
Yexo 7f9c91901e (svn r15277) -Fix (r15027): Building bridges in AITestMode always returned false. 16 years ago
glx 062f32a186 (svn r15270) -Change [API CHANGE]: remove AIEventTest 16 years ago
glx c1cf3934fa (svn r15263) -Codechange: added Engine::GetCost() to remove some code duplication. 16 years ago
frosch 80ee3d3440 (svn r15262) -Fix: AIEvents were not freed, when they were not queued for any AI. 16 years ago
glx e8b5f49861 (svn r15261) -Add: added Engine::GetRunningCost() to remove some code duplication. Also stops AIs decrementing vehicle counter of first company 16 years ago
frosch 47cdbe4a20 (svn r15255) -Fix (r15027): AIVehicle::GetLength() returned only the length of the first part of articulated road vehicles. 16 years ago
frosch 7e6049ba02 (svn r15252) -Fix (r15027): AIMarine::AreWaterTilesConnected() reported aqueducts being connected with all surrounding tiles. Also add some type safety. 16 years ago
frosch d05ab5a531 (svn r15244) -Fix (r15027): The station tile of an oilrig-like industry is not neccessarily the first industry tile. 16 years ago
frosch a1d4b792e8 (svn r15241) -Fix (r15027): NoAI API was not aware of certain newindustries 'features'. 16 years ago
glx 4fe58bc303 (svn r15228) -Fix [FS#2571]: possible crash when an AI/Library doesn't have a required function 16 years ago
glx ceb60b426e (svn r15226) -Fix (r15214): broken AI content download 16 years ago
rubidium 83e1288c6a (svn r15215) -Fix: various MSVC x64 compiler warnings 16 years ago
glx 92f5c6b1da (svn r15214) -Fix [NoAI]: ignore case for ai/library main script path on windows 16 years ago
glx b44390bf39 (svn r15191) -Fix (r15188): -1 is not a bool (MSVC warning) 16 years ago
Yexo db3ee34b44 (svn r15190) -Feature: Allow terraforming of the tiles at the edges of the map. 16 years ago
Yexo ddcaf2f4cc (svn r15188) -Feature: You can now change the number of AIs from the AI config window. 16 years ago
Yexo 2307adf8d2 (svn r15187) -Fix: assert when an AI called AIRoad::GetNeighbourRoadCount on a tile at the north edge (bug found by SmatZ). 16 years ago
Yexo e395533632 (svn r15186) -Fix: Select the currently selected AI instead of the second on in the list.
-Feature: Double clicking on a slot in the AI config window results in opening the list of AIs.
16 years ago
Yexo c3b7917da1 (svn r15185) -Fix (r15175): It was impossible to select AIs that had a different instance name then their name. 16 years ago
glx a4d3c76093 (svn r15184) -Cleanup: remove extra spaces 16 years ago
Yexo 3c757724e9 (svn r15182) -Fix: After updating an AI select the latest version for the next game. 16 years ago
Yexo 3d35b3c2cc (svn r15175) -Feature: Add the option to select the AIs to start in a new game and configure them via the gui. 16 years ago
Yexo 61ee8ca42a (svn r15171) -Fix (r15027): Buffer underflow in case there are no settings to save for an AI. 16 years ago
peter1138 481c2164d0 (svn r15149) -Codechange: GetMaskOfTownActions() is used by a Cmd handler, therefore it does not belong in _gui. 16 years ago
rubidium 67ac7124b1 (svn r15139) -Fix [NoAI]: a wrong tile got returned for hangar tiles when the station sign isn't over st->airport_tile. 16 years ago
peter1138 dba9d60d3a (svn r15133) -Fix: Crash if no NoAIs are present. 16 years ago
rubidium 3a13b75e37 (svn r15126) -Feature: downloading content from a central server (content.openttd.org) where authors can upload they NewGRFS/AI etc. This should make joining servers that use only NewGRFs that are distributed via this system easier as the players can download the NewGRFs from in the game. It should also make it easier to see whether there are updates for NewGRFs and make the necessary updates. 16 years ago
truebrain 4bc7afae41 (svn r15124) -Fix: last memory leak related to NoAI 16 years ago
truebrain 3abb8abd07 (svn r15123) -Fix [NoAI]: 'const char *' implies that the return value should not be free'd, which is should .. so make them 'char *' 16 years ago
truebrain 7e8d9a3e66 (svn r15122) -Codechange: add a security assert, to make sure something never happens 16 years ago
truebrain 27717e1b6d (svn r15121) -Fix: more mem-leak fixes (this should make SmatZ so happy ;) :p) 16 years ago
truebrain fe90077681 (svn r15120) -Fix: more mem-leak fixes 16 years ago
truebrain 7eae652302 (svn r15118) -Fix: fix a minor mem-leak 16 years ago
truebrain 8510afe233 (svn r15109) -Add [NoAI]: add AITile::LevelTiles (Yexo) 16 years ago
truebrain 7f851eaeb9 (svn r15107) -Fix [NoAI]: don't use so much explicit string copies if it is not required 16 years ago
rubidium 95fa33157f (svn r15106) -Fix [NoAI]: printf-ing of garbage. 16 years ago
truebrain b8d2049bc4 (svn r15102) -Fix (r15101): somehow makedepend fucked up (patch by Yexo) 16 years ago
truebrain 94dd36d1ec (svn r15101) -Change [API CHANGE]: more consistant naming for consts:
INVALID_TOWN_RATING        -> TOWN_RATING_INVALID
   INVALID_TRANSPORT          -> TRANSPORT_INVALID
   INVALID_ORDER              -> ORDER_INVALID
   INVALID_GROUP              -> GROUP_INVALID
   GROUP_ALL/DEFAULT          -> ALL/DEFAULT_GROUP
   VEHICLE_RAIL/ROAD/..       -> VT_RAIL/ROAD/..
   MY_COMPANY                 -> COMPANY_SELF
   FIRST/LAST/INVALID_COMPANY -> COMPANY_FIRST/LAST/INVALID
16 years ago
truebrain 5119132dda (svn r15100) -Add [NoAI]: introduce TILE_INVALID as const 16 years ago
truebrain e9437c2b2b (svn r15099) -Fix (r15078): GetTileIndex(0, -1) is perfectly fine 16 years ago
truebrain 6cfb9a24e0 (svn r15096) -Fix [NoAI]: free memory when no longer needed
-Fix [NoAI]: when there are multiple versions of one AI, never randonly pick an older one, but always the latest
16 years ago
truebrain ef62688522 (svn r15095) -Add [NoAI]: allow AI Libraries to be in .tar files (subdir required, as with AIs
-Add [NoAI]: allow multiple versions of the same AI co-exist
-Change [NoAI]: updated the whole method of AI (Library) finding and loading; it is now much more clear and transparent
-Change [NoAI]: the name of the AI is now the name used by CreateInstance()
-Change [NoAI]: make the AI finder a bit more clever, mostly related to version finding
16 years ago
truebrain 3e7c2bbacc (svn r15093) -Fix [NoAI]: check if a tile is valid before using IsTileType (bug found by Zuu, patch by Yexo) 16 years ago
truebrain 103cd2a5ed (svn r15091) -Add [NoAI] [API CHANGE]: introduce GetCategory() as a requirement for every library.nut, to indicate in which category it belongs. Currently the directory indicates the category, but this doesn't allow planned future additions 16 years ago
truebrain d62a85f2ce (svn r15090) -Add [NoAI] [API CHANGE]: info.nut/library.nut now requires a function GetShortName(), which should return a 4 (four) character string, unique throughout the world. This id is simular to a GRFid. 16 years ago
truebrain ae29148565 (svn r15086) -Fix: start AIs after 6 months on hard, 12 months on medium, and 24 months on easy. The current values were a bit .. too long waiting period ;) 16 years ago
truebrain 3cd6bf0ead (svn r15084) -Fix [NoAI] (r15027): by removing the threads for NoAIs, it is no longer possible to use DoCommand (even indirect) in AIAbstractList::Valuator(). 16 years ago
rubidium ea5457d831 (svn r15082) -Codechange: make the AI library path also a searchdir instead of manually manufacturing it into a searchdir. 16 years ago
truebrain 6fe54a2d1a (svn r15078) -Fix [NoAI]: AIMap didn't filter its input (Yexo) 16 years ago
smatz e00cf92f47 (svn r15077) -Codechange: enumify DAYS_IN_YEAR and DAYS_IN_LEAP_YEAR
-Change: when computing daily running cost, divide by 365 (instead of 364). Since r12134, the rounding errors don't need this correction anymore
16 years ago
truebrain cb221d9996 (svn r15076) -Fix: a start_date of 0 would never start an AI .. so don't allow it (Yexo) 16 years ago
truebrain 2d3fc8141d (svn r15074) -Fix: make Rubidium happy 16 years ago
peter1138 792d1bd883 (svn r15073) -Fix (r15067) [FS#2532]: Default copy constructors don't necessarily do what you want. Instead of creating one, we now pass a pointer around as that avoids additional allocations. 16 years ago
truebrain 2e30efb530 (svn r15068) -Add [NoAI]: introducing 'step_size' for AIConfig, for future AIGUI (Yexo) 16 years ago
peter1138 02bda12599 (svn r15067) -Fix [FS#2531]: Possible compiler bug, alleviated by using SmallVector instead of using std::set. SmallVector does everything needed anyway. 16 years ago
truebrain e1f64922c5 (svn r15066) -Change: start_date is now in days, instead of in months (Yexo) 16 years ago
truebrain 890074a03e (svn r15063) -Fix [NoAI]: starting companies now listen correctly to 'start_date' set to the AI slot (Yexo)
-Add [NoAI]: add a 'deviation' value for all settings, giving a slight deviation of the value of a setting (Yexo)
16 years ago
smatz 0a357c0ac1 (svn r15062) -Fix: further forgotten svn properties and headers 16 years ago
smatz 7cea618fcc (svn r15061) -Fix (r15027): three files were missing the Id header 16 years ago
truebrain c3249d599f (svn r15059) -Add [NoAI]: use 'start_date' from the AI configure to see when an AI should start next 16 years ago
truebrain 07f2afa635 (svn r15057) -Fix [NoAI]: clamp the values of a setting between the ones allowed by info.nut 16 years ago
truebrain 1bd2867715 (svn r15056) -Add [NoAI]: when starting a game, give a random value to the setting marked with AICONFIG_RANDOM (Yexo) 16 years ago
truebrain e6543c2776 (svn r15055) -Add [NoAI]: add the AICONFIG_RANDOM and AICONFIG_BOOLEAN consts (Yexo) 16 years ago
glx 37500a13f6 (svn r15049) -Fix (r15045): MSVC performance warning 16 years ago
truebrain 0adcb5bc2f (svn r15048) -Fix (r15047): the one time you don't compile a patch of someone, it contains a warning .. ;) 16 years ago
truebrain c9d20bfd47 (svn r15047) -Fix [NoAI]: AICONFIG_BOOLEAN (in AddSetting) doesn't require (or even allow) a min/max setting .. it is always 0/1 (Yexo) 16 years ago
truebrain e06e372529 (svn r15046) -Fix (r15045): in case CanLoadFromRevision does not exist, only allow savedata from the same version as we are now 16 years ago
truebrain bcbbf2c366 (svn r15045) -Add [NoAI API CHANGE]: in info.nut you can now have (optional) a CanLoadFromVersion(version), which should return true/false, to indicate if you can load a savegame made with your AI of version 'version'
-Add [NoAI API CHANGE]: in main.nut the Load() function now should be Load(version, data), where 'version' is the version of your AI which made the savegame
-Codechange [NoAI]: various of function renames to make things more sane
-Add [NoAI]: push the 'version' of the AI through various of layers
-Codechange [NoAI]: various of code cleanups
-Add [NoAI]: store the version of the AI in the savegame too
16 years ago
truebrain e6883c5cc7 (svn r15044) -Add [NoAI]: AIConfig::GetVersion(), to get the version of the current AI 16 years ago
truebrain 695765fde7 (svn r15042) -Fix (r15027): don't leak memory in AIInfo (Yexo) 16 years ago
truebrain c666cf5a49 (svn r15036) -Fix: use the same value for 'random' through-out the code for PlantTree 16 years ago
truebrain b7b29d96de (svn r15033) -Fix (r15027): silent a warning when compiling without network 16 years ago
truebrain a3dd7506d3 (svn r15027) -Merge: tomatos and bananas left to be, here is NoAI for all to see.
NoAI is an API (a framework) to build your own AIs in. See:
   http://wiki.openttd.org/wiki/index.php/AI:Main_Page
 With many thanks to:
  - glx and Rubidium for their syncing, feedback and hard work
  - Yexo for his feedback, patches, and AIs which tested the system very deep
  - Morloth for his feedback and patches
  - TJIP for hosting a challenge which kept NoAI on track
  - All AI authors for testing our AI API, and all other people who helped in one way or another
-Remove: all old AIs and their cheats/hacks
16 years ago
frosch e8796a148f (svn r14991) -Fix: Command-flags is an uint32. 16 years ago
rubidium 11da45ee55 (svn r14949) -Cleanup: pointer coding style 16 years ago
rubidium cda853872a (svn r14944) -Cleanup: add spaces around some operators 16 years ago
rubidium c8c61e36bd (svn r14919) -Feature: distant joining of stations (Frostregen and PhilSophus) 16 years ago
glx c7959ce2a9 (svn r14840) -Cleanup: remove duplicate includes 16 years ago
smatz 7368c740a6 (svn r14828) -Codechange: move most of save/load-specific code to separate files 16 years ago
smatz afef22e3e7 (svn r14812) -Codechange: use INVALID_TILE instead of 0 to mark company without HQ 16 years ago
rubidium 87e5a8b52b (svn r14754) -Codechange: get rid of _cmd_text and just pass it as (optional) parameter. 16 years ago
smatz 419f6e099f (svn r14743) -Codechange: use INVALID_TILE to indicate station doesn't have queried facility (or station/roadstop is invalid) instead of 0 (Yexo) 16 years ago
smatz 5b26afbd6b (svn r14734) -Codechange: type of bankrupt_asked is CompanyMask, not byte 16 years ago
frosch ebf51ffb6b (svn r14707) -Cleanup: Replace an 'int' by 'Trackdir'. 16 years ago
smatz a7f82bd11a (svn r14693) -Codechange: replace one check in old AI (probably typo, but the effect was the same) (Yexo) 16 years ago
michi_cc 02c99bdf66 (svn r14504) -Cleanup: Use the right variable type for tile offsets. 16 years ago
rubidium 272b2ef0e9 (svn r14464) -Codechange: replace (uint)-1 with UINT_MAX (PhilSophus) 16 years ago
smatz 1906aa2bbb (svn r14448) -Codechange [FS#2328]: rename a few variables (based on a patch by planetmaker) 16 years ago
rubidium b650a86e58 (svn r14422) -Codechange: also reflect the changes of r14421 in the filenames. 16 years ago
rubidium 3b798599b6 (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with. 16 years ago
frosch bffc5717bc (svn r14335) -Codechange: Remove some magic numbers. 16 years ago