Page 30 of 32

Re: AdmiralAI v25

Posted: 08 Jan 2011 16:11
by Markus_cz
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

Re: AdmiralAI v25

Posted: 18 Feb 2011 10:13
by kiome
Hi,

I have the following problem with AdmiralAI, it occurs just after the electric rails have been discovered.

Image

Uploaded with ImageShack.us

How can it be resolved ?

Many thanks.

kiome

Re: AdmiralAI v25

Posted: 17 Mar 2011 06:52
by planetmaker
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)

Re: AdmiralAI v25

Posted: 17 Mar 2011 18:56
by Kogut
It is not AIAI. AIAI is constructing first track and later it is trying to build second.

Re: AdmiralAI v25

Posted: 10 Apr 2011 17:38
by Zuu
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.

Re: AdmiralAI v25

Posted: 20 Apr 2011 20:14
by planetmaker
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.

Re: AdmiralAI v25

Posted: 21 Apr 2011 20:45
by Yisc
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.

Re: AdmiralAI v25

Posted: 27 Apr 2011 21:43
by planetmaker
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.

Re: AdmiralAI v25

Posted: 27 May 2011 15:58
by Brumi
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...

Admiral AI crash report

Posted: 15 Jun 2011 00:19
by WhirrledPeas
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.

Re: Admiral AI crash report

Posted: 15 Jun 2011 00:20
by WhirrledPeas
Here is the other promised screen shot.

Thanks for any guidance you may offer.

Re: AdmiralAI v25

Posted: 15 Jun 2011 00:27
by planetmaker
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 ;-)

Re: AdmiralAI v25

Posted: 23 Jun 2011 20:38
by HUgo8745
AdmiralAI crashed when electric rails was introduced.

Re: AdmiralAI v25

Posted: 24 Jun 2011 11:54
by Brumi
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 :) )
stationmanager.diff
(1.29 KiB) Downloaded 253 times
trainmanager.diff
(839 Bytes) Downloaded 242 times
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

Posted: 24 Jun 2011 15:05
by Lord Aro
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

Re: AdmiralAI v25

Posted: 24 Jun 2011 16:09
by Brumi
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:

Re: AdmiralAI v25

Posted: 28 Jul 2011 10:43
by Hephi
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.

Re: AdmiralAI v25

Posted: 25 Oct 2011 21:43
by Kogut
Small suggestion, in function TownManager::ImproveTownRating

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;
may be replaced with

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;
		}
or even entire loop may be modified

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;
		}
	}

Re: AdmiralAI v25

Posted: 29 Jan 2012 21:51
by Moriarty
I had it crash out of the blue:

Re: AdmiralAI v25

Posted: 30 Jan 2012 10:21
by Brumi
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.