Page 3 of 6

Re: DictatorAI

Posted: 16 Apr 2012 19:29
by Zuu
Krinn, for information the "AI_" prefix has been dropped in the 1.2 API. (if that is why the problem occurs) This happened short after NoGo was merged.

Re: DictatorAI

Posted: 17 Apr 2012 09:56
by krinn
Zuu: Thank you zuu, will watch that as soon as 1.2 hit the streets

MAG101: You are seeing that because your current open NOAI API doesn't handle that event.
This mean you are playing an openttd version that is older than 1.1.0.

This is actually a bug, thank you for reporting it, i will try to put an update soon, but the fix is just to setup correctly the API version need to handle the AI

If you wish test it more (or avoid this bug), i'm afraid you will need to update openttd to 1.1.0 or better.

Re: DictatorAI

Posted: 17 Apr 2012 19:33
by Zuu
Krinn, take a look again at his screenshot. He definitely uses 1.2 or at least a version at least from December 2011 when Nogo was merged with trunk. Otherwise, why would he have a Game Scripts button in the AI debug window?

Now taking a look at your AI, I'm a bit puzzeled. I though the cause of this was that you used API version 1.2 which doesn't provide the compatibility layer. However you use 1.0 API. But perhaps the issue is that you have used this constant that is not part of 1.0, but still visible in newer OpenTTD versions. However as it was not part of 1.0, the compat.nut for 1.0 doesn't provide an AI_.. compatibility constant for the renamed constant.
155b wrote:

Code: Select all

   function GetAPIVersion()    { return "1.0"; }

Re: DictatorAI

Posted: 17 Apr 2012 21:15
by krinn
That's the issue yep, miss to change the API version, if only all bugs could be as easy !

Here's my current work that should fix it, i'm not quiet sure how the AI state is, full of debug/tweaks i'm trying, but here's the latest version i have (on page 1)

edit: lol just saw 1.2 is out, i should build that one to try it, but it should works still with 1.1 set :)

Re: DictatorAI

Posted: 10 Jun 2012 19:03
by ReisRyos
version: 156a
no newGRF

Re: DictatorAI

Posted: 11 Jun 2012 09:56
by krinn
Thank you for the report ReisRyos i will correct it and post a "b" release when i'm back from work tonight.
I'm not working on it currently because of a heavy workload. And even i couldn't make it evolve like i wish, i could still correct bugs in it.
So except the bug correction, sadly don't expect more from that "b" release.

Re: DictatorAI

Posted: 17 Jun 2012 10:49
by MAG101
krinn wrote:Zuu: Thank you zuu, will watch that as soon as 1.2 hit the streets

MAG101: You are seeing that because your current open NOAI API doesn't handle that event.
This mean you are playing an openttd version that is older than 1.1.0.

This is actually a bug, thank you for reporting it, i will try to put an update soon, but the fix is just to setup correctly the API version need to handle the AI

If you wish test it more (or avoid this bug), i'm afraid you will need to update openttd to 1.1.0 or better.
I was running 1.2 Openttd. 104 never crashes, 154 crashes lot .
wip and any inprovement planned?

Re: DictatorAI

Posted: 02 Sep 2012 12:09
by Zuu
I guess it is a typo, but your manual says that one need OpenTTD 1.5 to run DictatorAI.
You need openttd 1.5 to run this AI.

Re: DictatorAI

Posted: 03 Sep 2012 11:41
by krinn
yep of course, it was 1.1.5 by that time i think :)

i will fix it and fix the 1.2 API bug soon, my spare time is going back to a less stressful normality. I'm just using the few i have right now to fix other things i couldn't do while spring work (lol mostly getting out for a beer with my friends)

Re: DictatorAI

Posted: 16 Sep 2012 16:47
by Zuu
Your AI crashed with last nightly of OpenTTD (r24526). This error probably exist since december 2012 when NoGo was merged and the constants that start with 'AI_' or 'AI' had the 'AI_' part removed.

The EVENT flag that you use was introduced in API version 1.1, and for that compatibility layer there exist code do handle backward compatibility with the AI_ET_TOWN_FOUNDED constant. However your info.nut set API version to 1.0 for your AI, and since the constant didn't exist in the 1.0 API, no compatibility for that constant exist in compat_1.0.nut.

Re: DictatorAI

Posted: 17 Sep 2012 10:55
by krinn
I have fix it zuu it's in bananas, it was fixed in the testing version but i have forget the released one.
Funny but if none tell me this is thing i cannot see as i only own the testing version in my openttd :P

Re: DictatorAI

Posted: 06 Nov 2012 23:41
by krinn
A new stable release 1.60 should be available thru bananas.

- Many bugfixes
- Add handling of subsidy
- Add support for SCP
- Add handing of NoCargoal . See source here to if you want add it to your AI easy, or as sample on howto implement it.
- No trains yet (sorry, a real lot of more work to do to add that).
- Now blacklisting aircraft with limited range, in my tests it show only av8 newGRF set use it, but sadly all the aircrafts in it use that, so the AI won't play with aircrafts from that newGRF at all.

This AI is made for openttd API 1.2, but you will need a newer API to play with it and nocargoal as nocargoal need a newer API (see its thread for requierements).

I will upload here another test version with trains when i get one ready, so, even lacking trains, this version is the newest.

Re: DictatorAI

Posted: 02 Jan 2013 15:51
by Hyronymus
Your dictator was extradicted in my current game, see attached image.

Re: DictatorAI

Posted: 02 Jan 2013 17:39
by krinn
It wasn't a good period for dictators.

I will fix that tonight, i've work hard to fix a lot of stuff for the road and air parts, and forget totally the train part, as this is not finished. This bug is from the train part, something i will work on soon as my todo list is now smaller.

Thank you for your report.
For your information, the latest version is 1.68, and this bug is in it too. Look for 1.69 for the fixed version.

Re: DictatorAI

Posted: 02 Jan 2013 20:28
by Hyronymus
krinn wrote:It wasn't a good period for dictators.

I will fix that tonight, i've work hard to fix a lot of stuff for the road and air parts, and forget totally the train part, as this is not finished. This bug is from the train part, something i will work on soon as my todo list is now smaller.

Thank you for your report.
For your information, the latest version is 1.68, and this bug is in it too. Look for 1.69 for the fixed version.
Your welcome and I'll have a look for 1.69 :).

Re: DictatorAI

Posted: 02 Jan 2013 22:15
by krinn
Ok bugfixes, look for 1.69 in bananas.

Do you have a savegame to provide, as the bug came out when AI fail to select a train engine, and as your screenshot prove, some trains exists in that game, It's not the bug by itself : that was a real one in the code ; and not even a real bug, as for many reasons the AI may not select an engine, not because none exists to work with, but none matching its selection critera exists (per example, a too huge cost train engine...).
So i'm curious to see why it couldn't pickup one.

Re: DictatorAI

Posted: 03 Jan 2013 10:11
by Hyronymus
krinn wrote:Ok bugfixes, look for 1.69 in bananas.

Do you have a savegame to provide, as the bug came out when AI fail to select a train engine, and as your screenshot prove, some trains exists in that game, It's not the bug by itself : that was a real one in the code ; and not even a real bug, as for many reasons the AI may not select an engine, not because none exists to work with, but none matching its selection critera exists (per example, a too huge cost train engine...).
So i'm curious to see why it couldn't pickup one.
Sure, but it's not from the exact date as my report see http://tinyurl.com/b6d4wtk.

Re: DictatorAI

Posted: 13 Apr 2013 20:46
by Samu
Hi. Reporting a crash

the index 'GetRoadStationEntry' does not exist.

Re: DictatorAI

Posted: 15 Apr 2013 10:15
by krinn
Thank you for your report Samu. I will work on it.

Re: DictatorAI

Posted: 31 Jul 2013 14:31
by krinn
I have put my current work on dictatorai with trains as i have convert it to use cEngineLib, it will gave a good playground for anyone.

The ai nearly handle trains, i have still plenty stuff to do to finish that. But it works more or less ;)
This include bugfixes and changes for other aspect of the AI too.

It should works for everyone if you disable trains ("should") because many debug and testing are in it, that may impact it even without using trains.
But as some love to test things, and as this could provide me feedback, you can download it from the first post.

The big change : AI savegame for older versions has been drop (except 168 & 169), a new savegame is use (that save nearly nothing).
So if you want load old savegame to play with it, better load it with dictatorai 168 or 169 and resave them.