AdmiralAI v25
Moderator: OpenTTD Developers
Re: AdmiralAI v25
I'm playing with eGRVTS and AdmiralAI consistently makes bad choices of vehicles. eGRVTS inlcudes some vehicles that are almost never profitable, mainly the early steam cars, but AdmiralAI seems to like them for some reason. It will inevitably bankrupt.
See the included image
See the included image
- Attachments
-
- Brünschalinen, 19th Nov 1874.png
- (213.14 KiB) Downloaded 1 time
Re: AdmiralAI v25
Hi,
I have the following problem with AdmiralAI, it occurs just after the electric rails have been discovered.
Uploaded with ImageShack.us
How can it be resolved ?
Many thanks.
kiome
I have the following problem with AdmiralAI, it occurs just after the electric rails have been discovered.
Uploaded with ImageShack.us
How can it be resolved ?
Many thanks.
kiome
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: AdmiralAI v25
In some tests I had AdmiralAI start. It did start well with a train route and air service. Looking at the train routes I wondered though whether it might not want to pick slightly longer, more profitable routes (AdmiralAI: yellow. The blue company came 2nd).
Also I noticed that the track building algorithm by AIAI and AdmiralAI vary a lot. To me it seems that AdmiralAI always builds one direction first and only then builds the other direction of tracks between stations, with quite some thought time passing between that (and also between building stations and building track). It might be an idea to jointly path find both tracks or only build the path is found. AIAI builds both directions at the same time and it looks like an interesting concept (upper unfinished tracks which are being build that very moment)
Also I noticed that the track building algorithm by AIAI and AdmiralAI vary a lot. To me it seems that AdmiralAI always builds one direction first and only then builds the other direction of tracks between stations, with quite some thought time passing between that (and also between building stations and building track). It might be an idea to jointly path find both tracks or only build the path is found. AIAI builds both directions at the same time and it looks like an interesting concept (upper unfinished tracks which are being build that very moment)
- Attachments
-
- Unnamed, 2021-01-05.png (79.35 KiB) Viewed 10722 times
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: AdmiralAI v25
It is not AIAI. AIAI is constructing first track and later it is trying to build second.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: AdmiralAI v25
I had AdmiralAI crash with the same error as kiome. As his screenshot is on a slow external server I've attached a screenshot of my error even if it is a duplicate.
Edit: I'm using r22302 + the OpenGFX+ sets. I've also attached the savegame if it is of any help. I believe the crash happened quite some time ago as I didn't notice it until I was to save the game.
Edit: I'm using r22302 + the OpenGFX+ sets. I've also attached the savegame if it is of any help. I believe the crash happened quite some time ago as I didn't notice it until I was to save the game.
- Attachments
-
- Hinwood Transport, 10th Jul 1970.png (22.07 KiB) Viewed 10722 times
-
- Me and AI.sav
- (518.09 KiB) Downloaded 241 times
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: AdmiralAI v25
I did it again, let the AIs have fun with my NewGRF testgame while I was at work. This time AdmiralAI crashed on me (savegame and custom newgrfs attached):
Code: Select all
dbg: [ai] [1] [S] Your script made an error: assertion failed
dbg: [ai] [1] [S]
dbg: [ai] [1] [S] *FUNCTION [BuildPath()] AdmiralAI-25.tar/admiralai-25/rail/railroutebuilder.nut line [571]
dbg: [ai] [1] [S] *FUNCTION [TestBuildPath()] AdmiralAI-25.tar/admiralai-25/rail/railroutebuilder.nut line [541]
dbg: [ai] [1] [S] *FUNCTION [ConnectRailStations()] AdmiralAI-25.tar/admiralai-25/rail/railroutebuilder.nut line [307]
dbg: [ai] [1] [S] *FUNCTION [BuildNewRoute()] AdmiralAI-25.tar/admiralai-25/rail/trainmanager.nut line [354]
dbg: [ai] [1] [S] *FUNCTION [Start()] AdmiralAI-25.tar/admiralai-25/main.nut line [701]
dbg: [ai] [1] [S]
dbg: [ai] [1] [S] [orig_path] INSTANCE
dbg: [ai] [1] [S] [prevprev] 85990
dbg: [ai] [1] [S] [prev] 85989
dbg: [ai] [1] [S] [path] INSTANCE
dbg: [ai] [1] [S] [this] INSTANCE
dbg: [ai] [1] [S] [test] INSTANCE
dbg: [ai] [1] [S] [path] INSTANCE
dbg: [ai] [1] [S] [this] INSTANCE
dbg: [ai] [1] [S] [building_ok] false
dbg: [ai] [1] [S] [num_retries] 0
dbg: [ai] [1] [S] [first_path] INSTANCE
dbg: [ai] [1] [S] [path] INSTANCE
dbg: [ai] [1] [S] [path2] false
dbg: [ai] [1] [S] [pf2] INSTANCE
dbg: [ai] [1] [S] [track_near_station_b_already_build] false
dbg: [ai] [1] [S] [track_near_station_a_already_build] false
dbg: [ai] [1] [S] [platform_length] 4
dbg: [ai] [1] [S] [tile] 87016
dbg: [ai] [1] [S] [goals] ARRAY
dbg: [ai] [1] [S] [sources] ARRAY
dbg: [ai] [1] [S] [pf] INSTANCE
dbg: [ai] [1] [S] [ignored] INSTANCE
dbg: [ai] [1] [S] [station_b] 372
dbg: [ai] [1] [S] [station_a] 371
dbg: [ai] [1] [S] [this] INSTANCE
dbg: [ai] [1] [S] [station_to] INSTANCE
dbg: [ai] [1] [S] [station_from] INSTANCE
dbg: [ai] [1] [S] [@ITERATOR@] 266
dbg: [ai] [1] [S] [dummy] 95
dbg: [ai] [1] [S] [ind_to] 266
dbg: [ai] [1] [S] [ind_acc_list] INSTANCE
dbg: [ai] [1] [S] [@ITERATOR@] 144
dbg: [ai] [1] [S] [dummy] 91
dbg: [ai] [1] [S] [ind_from] 144
dbg: [ai] [1] [S] [val_list] INSTANCE
dbg: [ai] [1] [S] [@ITERATOR@] 6
dbg: [ai] [1] [S] [dummy] 724
dbg: [ai] [1] [S] [cargo] 6
dbg: [ai] [1] [S] [cargo_list] INSTANCE
dbg: [ai] [1] [S] [rail_type_list] INSTANCE
dbg: [ai] [1] [S] [this] INSTANCE
dbg: [ai] [1] [S] [veh_list] INSTANCE
dbg: [ai] [1] [S] [build_route] false
dbg: [ai] [1] [S] [last_type] 1
dbg: [ai] [1] [S] [build_road_route] 3
dbg: [ai] [1] [S] [build_busses] false
dbg: [ai] [1] [S] [start_tick] 2
dbg: [ai] [1] [S] [group_list] INSTANCE
dbg: [ai] [1] [S] [this] INSTANCE
dbg: [ai] The AI died unexpectedly.
dbg: [ai] The AI died unexpectedly.
- Attachments
-
- random_AI_test2.sav
- savegame
- (662.86 KiB) Downloaded 245 times
-
- ogfx-industries.zip
- required industries newgrf
- (16.11 KiB) Downloaded 237 times
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: AdmiralAI v25
Is there any developement going on for this AI?
I really liked to play a game against it, but the crashes prevents it.
Hopefully an update for this AI will be released soon.
I really liked to play a game against it, but the crashes prevents it.
Hopefully an update for this AI will be released soon.
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: AdmiralAI v25
Same bug as Zuu describes, after 36 game years. But it was stressed hard, but did better for years than most AI, when I activated mid-game the cargo destinations in my YACD game (before it was ranked 2nd or 3rd):
Code: Select all
dbg: [ai] [1] [S] Your script made an error: parameter 2 has an invalid type 'null' ; expected: 'integer'
dbg: [ai] [1] [S]
dbg: [ai] [1] [S] *FUNCTION [ConvertRailType()] AdmiralAI-25.tar/admiralai-25/stationmanager.nut line [333]
dbg: [ai] [1] [S] *FUNCTION [_UpdateRailType()] AdmiralAI-25.tar/admiralai-25/rail/trainline.nut line [371]
dbg: [ai] [1] [S] *FUNCTION [CheckVehicles()] AdmiralAI-25.tar/admiralai-25/rail/trainline.nut line [413]
dbg: [ai] [1] [S] *FUNCTION [CheckRoutes()] AdmiralAI-25.tar/admiralai-25/rail/trainmanager.nut line [236]
dbg: [ai] [1] [S] *FUNCTION [DoMaintenance()] AdmiralAI-25.tar/admiralai-25/main.nut line [545]
dbg: [ai] [1] [S] *FUNCTION [Start()] AdmiralAI-25.tar/admiralai-25/main.nut line [680]
dbg: [ai] [1] [S]
dbg: [ai] [1] [S] [tile] 184512
dbg: [ai] [1] [S] [tiles] INSTANCE
dbg: [ai] [1] [S] [rail_type] 1
dbg: [ai] [1] [S] [this] INSTANCE
dbg: [ai] [1] [S] [new_type] 1
dbg: [ai] [1] [S] [rail_type_list] INSTANCE
dbg: [ai] [1] [S] [this] INSTANCE
dbg: [ai] [1] [S] [this] INSTANCE
dbg: [ai] [1] [S] [@ITERATOR@] 1
dbg: [ai] [1] [S] [route] INSTANCE
dbg: [ai] [1] [S] [@INDEX@] 0
dbg: [ai] [1] [S] [need_money] false
dbg: [ai] [1] [S] [this] INSTANCE
dbg: [ai] [1] [S] [ret2] false
dbg: [ai] [1] [S] [ret1] false
dbg: [ai] [1] [S] [this] INSTANCE
dbg: [ai] [1] [S] [last_type] 1
dbg: [ai] [1] [S] [build_road_route] 3
dbg: [ai] [1] [S] [build_busses] false
dbg: [ai] [1] [S] [start_tick] 5
dbg: [ai] [1] [S] [group_list] INSTANCE
dbg: [ai] [1] [S] [this] INSTANCE
dbg: [ai] The AI died unexpectedly.
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: AdmiralAI v25
I got a similar crash to Zuu's and planetmaker's crash, only the line number in stationmanager.nut is different.
I'm playing OpenTTD without patches, with the Generic Tram Set and the Temperate Oil Wells Only Decrease Neutraliser as the only NewGRFs. I have a savegame before the crash as well, but quite a long time has passed since then...
I'm playing OpenTTD without patches, with the Generic Tram Set and the Temperate Oil Wells Only Decrease Neutraliser as the only NewGRFs. I have a savegame before the crash as well, but quite a long time has passed since then...
- Attachments
-
- AdmiralAI crash.png (25.05 KiB) Viewed 18833 times
-
- AI testing.sav
- (647.86 KiB) Downloaded 244 times
-
- Engineer
- Posts: 2
- Joined: 27 Feb 2009 16:57
Admiral AI crash report
Admiral AI consistently crashes in the current game.
I am attempting to attach screen shots of two error messages but I'm not very tech savvy so please excuse any error.
I am attempting to attach screen shots of two error messages but I'm not very tech savvy so please excuse any error.
- Attachments
-
- AICrashCapture.JPG (80.3 KiB) Viewed 10722 times
-
- AdmiralAI.JPG (72.96 KiB) Viewed 18733 times
-
- Engineer
- Posts: 2
- Joined: 27 Feb 2009 16:57
Re: Admiral AI crash report
Here is the other promised screen shot.
Thanks for any guidance you may offer.
Thanks for any guidance you may offer.
- Attachments
-
- Alternate screen shot of error report
- AdmiralAI.JPG (72.96 KiB) Viewed 18732 times
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: AdmiralAI v25
The savegame itself might be sometimes interesting, though the screenshots you provided often go a loong way
Please attach bug reports with a specific AI to its respective thread, e.g.. this one in the case of Admiral AI
Please attach bug reports with a specific AI to its respective thread, e.g.. this one in the case of Admiral AI
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: AdmiralAI v25
AdmiralAI crashed when electric rails was introduced.
- Attachments
-
- Nardingstone Bay Transport, 8th May 1966.png
- (308.33 KiB) Downloaded 1 time
Re: AdmiralAI v25
I took the liberty and tried to fix the bug in ConvertRailType. The problem is that after loading from a savegame, the _platform_length field of the StationManager instances remain uninitialised. So I inserted an AfterLoadSetPlatformLength function into the StationManager class, which is a slightly modified version of SimpleAI's GetRailStationPlatformLength. It took me quite a while to realise that you don't even use the Save() and Load() functions of StationManager
Here are the diffs: (these are my first diff files ever made, so they may be wrong ) Is the fix OK?
By the way, your SVN repository at http://noai.openttd.org/svn/ai-admiralai/ doesn't seem to work, it's giving me error 502 (Bad gateway).
Here are the diffs: (these are my first diff files ever made, so they may be wrong ) Is the fix OK?
By the way, your SVN repository at http://noai.openttd.org/svn/ai-admiralai/ doesn't seem to work, it's giving me error 502 (Bad gateway).
Re: AdmiralAI v25
The NoAI SVN has been down for ages. Most AI in active development have moved to openttdcoop
Also i think (not sure) Yexo may have already fixed the bug, just never bothered to release a fixed version
Also i think (not sure) Yexo may have already fixed the bug, just never bothered to release a fixed version
AroAI - A really feeble attempt at an AI
It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
Re: AdmiralAI v25
Hmm... I realised that there is a new version just one page back after I posted my diffs
It seems to me that this particular bug has been fixed, but there is a typo in the code where it loads pre-v26 savegames. Loading this savegame fails:
It seems to me that this particular bug has been fixed, but there is a typo in the code where it loads pre-v26 savegames. Loading this savegame fails:
- Attachments
-
- crash this.sav
- (373.38 KiB) Downloaded 229 times
Re: AdmiralAI v25
It seems to have problems finding the second rail outgoing of this station and so it gave up and started building a new route (the station at the bottom of the screenshot).
Immediately after it had the same problem although if pathfinder would have looked a bit harder it might have found a possible route.
Immediately after it had the same problem although if pathfinder would have looked a bit harder it might have found a possible route.
- Attachments
-
- unfinished route
- admiral.png (235.9 KiB) Viewed 10722 times
-
- immediately after
- admiral2.png (887.57 KiB) Viewed 10722 times
--------------------------------------------------
MailAI, a casual postal service for openTTD.
--------------------------------------------------
MailAI, a casual postal service for openTTD.
--------------------------------------------------
Re: AdmiralAI v25
Small suggestion, in function TownManager::ImproveTownRating
may be replaced with
or even entire loop may be modified
Code: Select all
foreach (tile, dummy in list) {
AITile.PlantTree(tile);
}
/* Check whether the current rating is good enough. */
if (AITown.GetRating(town_id, AICompany.COMPANY_SELF) >= min_rating) return true;
Code: Select all
foreach (tile, dummy in list) {
AITile.PlantTree(tile);
/* Check whether the current rating is good enough. */
if (AITown.GetRating(town_id, AICompany.COMPANY_SELF) >= min_rating) return true;
}
Code: Select all
for (local size = 3; size <= 1000; size++) {
local list = AITileList();
SafeAddRectangle(list, location, size);
list.Valuate(AITile.IsBuildable);
list.KeepValue(1);
/* Don't build trees on tiles that already have trees, as this doesn't
* give any town rating improvement. */
list.Valuate(AITile.HasTreeOnTile);
list.KeepValue(0);
foreach (tile, dummy in list) {
if(AITile.GetClosestTown(tile) != town_id)return false;
AITile.PlantTree(tile);
/* Check whether the current rating is good enough. */
if (AITown.GetRating(town_id, AICompany.COMPANY_SELF) >= min_rating) return true;
}
}
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
-
- Tycoon
- Posts: 1395
- Joined: 12 Jun 2004 00:37
- Location: United Kingdom of Great Britain and Northern Ireland
- Contact:
Re: AdmiralAI v25
I had it crash out of the blue:
- Attachments
-
- Clipboard01.jpg (68.53 KiB) Viewed 17868 times
Re: AdmiralAI v25
There is a newer version posted on the previous page (link), which AFAIK doesn't have this bug. Loading the savegame may be a problem, but it's only a typo in the code, so you should be able to fix it.
Who is online
Users browsing this forum: No registered users and 15 guests