Transport Tycoon Forums
https://www.tt-forums.net/

DictatorAI
https://www.tt-forums.net/viewtopic.php?f=65&t=52982
Page 3 of 5

Author:  Zuu [ Mon Apr 16, 2012 7:29 pm ]
Post subject:  Re: DictatorAI

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.

Author:  krinn [ Tue Apr 17, 2012 9:56 am ]
Post subject:  Re: DictatorAI

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.

Author:  Zuu [ Tue Apr 17, 2012 7:33 pm ]
Post subject:  Re: DictatorAI

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:
   function GetAPIVersion()    { return "1.0"; }

Author:  krinn [ Tue Apr 17, 2012 9:15 pm ]
Post subject:  Re: DictatorAI

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 :)

Author:  ReisRyos [ Sun Jun 10, 2012 7:03 pm ]
Post subject:  Re: DictatorAI

version: 156a
no newGRF

Attachments:
bug.png
bug.png [ 19.65 KiB | Viewed 4855 times ]

Author:  krinn [ Mon Jun 11, 2012 9:56 am ]
Post subject:  Re: DictatorAI

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.

Author:  MAG101 [ Sun Jun 17, 2012 10:49 am ]
Post subject:  Re: DictatorAI

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?

Author:  Zuu [ Sun Sep 02, 2012 12:09 pm ]
Post subject:  Re: DictatorAI

I guess it is a typo, but your manual says that one need OpenTTD 1.5 to run DictatorAI.

Quote:
You need openttd 1.5 to run this AI.

Author:  krinn [ Mon Sep 03, 2012 11:41 am ]
Post subject:  Re: DictatorAI

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)

Author:  Zuu [ Sun Sep 16, 2012 4:47 pm ]
Post subject:  Re: DictatorAI

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.

Attachments:
TynspÄng Transport, 14th Mar 1982.png [14.25 KiB]
Downloaded 7 times

Author:  krinn [ Mon Sep 17, 2012 10:55 am ]
Post subject:  Re: DictatorAI

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

Author:  krinn [ Tue Nov 06, 2012 11:41 pm ]
Post subject:  Re: DictatorAI

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.

Author:  Hyronymus [ Wed Jan 02, 2013 3:51 pm ]
Post subject:  Re: DictatorAI

Your dictator was extradicted in my current game, see attached image.

Attachments:
End of a dictator.png [590.69 KiB]
Downloaded 9 times

Author:  krinn [ Wed Jan 02, 2013 5:39 pm ]
Post subject:  Re: DictatorAI

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.

Author:  Hyronymus [ Wed Jan 02, 2013 8:28 pm ]
Post subject:  Re: DictatorAI

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 :).

Author:  krinn [ Wed Jan 02, 2013 10:15 pm ]
Post subject:  Re: DictatorAI

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.

Author:  Hyronymus [ Thu Jan 03, 2013 10:11 am ]
Post subject:  Re: DictatorAI

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.

Author:  Samu [ Sat Apr 13, 2013 8:46 pm ]
Post subject:  Re: DictatorAI

Hi. Reporting a crash

the index 'GetRoadStationEntry' does not exist.

Attachments:
Unnamed, 2016-11-07.sav [4.36 MiB]
Downloaded 81 times
screenshot#4.png [50.72 KiB]
Downloaded 4 times

Author:  krinn [ Mon Apr 15, 2013 10:15 am ]
Post subject:  Re: DictatorAI

Thank you for your report Samu. I will work on it.

Author:  krinn [ Wed Jul 31, 2013 2:31 pm ]
Post subject:  Re: DictatorAI

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.

Page 3 of 5 All times are UTC
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.