Trans AI .:19.07.23 :.

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

Post Reply
Brumi
President
President
Posts: 905
Joined: 18 Jul 2009 17:54

Re: Trans AI :: 09-08-24 ::

Post by Brumi »

I just experimented with this, and then tested it for 2 minutes, and it worked. :mrgreen: I don't know if it can have an impact on other areas of the AI, you know your code better.

User avatar
Doorslammer
Tycoon
Tycoon
Posts: 1037
Joined: 16 Oct 2007 11:08
Location: Perth, Western Australia
Contact:

Re: Trans AI :: 09-08-24 ::

Post by Doorslammer »

Oops, a cockup has occured.
Attachments
Error1.PNG
(189.78 KiB) Downloaded 52 times
Image

Yexo
Tycoon
Tycoon
Posts: 3660
Joined: 20 Dec 2007 12:49

Re: Trans AI :: 09-08-24 ::

Post by Yexo »

Monaro Doorslammer wrote:Oops, a cockup has occured.
A bit more info on that error:

The subsidy system has been changed in a few commits +-r17110. Subsidies are no longer station->station, but are town->town, industry->industry or industry->town now. A new set of AI api functions has been introduced to deal with this. The old functions have been changed to work like the old functions as much as possible, but it isn't possible to return a StationID for an awarded subsidy anymore, since multiple stations can be valid.

User avatar
Doorslammer
Tycoon
Tycoon
Posts: 1037
Joined: 16 Oct 2007 11:08
Location: Perth, Western Australia
Contact:

Re: Trans AI :: 09-08-24 ::

Post by Doorslammer »

Oops, now in iMAX mode error reporting. :oops:
Attachments
Error1.PNG
(32.28 KiB) Downloaded 44 times
Image

User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4554
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Trans AI :: 09-08-24 ::

Post by Zuu »

Judging by the debug output that seams to be the same error as you have already reported, and you are still using the same version of the AI.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)

Yexo
Tycoon
Tycoon
Posts: 3660
Joined: 20 Dec 2007 12:49

Re: Trans AI :: 09-08-24 ::

Post by Yexo »

Zuu wrote:Judging by the debug output that seams to be the same error as you have already reported, and you are still using the same version of the AI.
Yes, but this time the complete stack trace is readable.

User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: Trans AI :: 09-08-24 ::

Post by fanioz »

Yexo wrote:
Monaro Doorslammer wrote:Oops, a cockup has occured.
A bit more info on that error:

The subsidy system has been changed in a few commits +-r17110. Subsidies are no longer station->station, but are town->town, industry->industry or industry->town now. A new set of AI api functions has been introduced to deal with this. The old functions have been changed to work like the old functions as much as possible, but it isn't possible to return a StationID for an awarded subsidy anymore, since multiple stations can be valid.
Its look like that AI crash on calling function. Thats mean the returned "INVALID_STATION" is not known?
What if the returned value of GetSource() and and GetDestination just an InvalidID of Town/Industry or common invalid value (eg. -1) instead of "INVALID_STATION"?
Correct me If I am wrong - PM me if my English was bad :D

**[OpenTTD AI]** Image
***[NewGRF] *** Image

Yexo
Tycoon
Tycoon
Posts: 3660
Joined: 20 Dec 2007 12:49

Re: Trans AI :: 09-08-24 ::

Post by Yexo »

fanioz wrote:Its look like that AI crash on calling function. Thats mean the returned "INVALID_STATION" is not known?
Ah, sorry. It's my fault, and a bug in OpenTTD (in compat_0.7.nut to be exact). Will fix this later tonight.

Edit: fixed in r17289.

User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: Trans AI :: 09-08-24 ::

Post by fanioz »

Yexo wrote:
fanioz wrote:Its look like that AI crash on calling function. Thats mean the returned "INVALID_STATION" is not known?
Ah, sorry. It's my fault, and a bug in OpenTTD (in compat_0.7.nut to be exact). Will fix this later tonight.

Edit: fixed in r17289.

Well, thanks :D
I don't need to change anything from my side.
(Just remember the number 17289) :D
Correct me If I am wrong - PM me if my English was bad :D

**[OpenTTD AI]** Image
***[NewGRF] *** Image

Wold
Transport Coordinator
Transport Coordinator
Posts: 318
Joined: 03 Aug 2006 19:32
Skype: woldy_bg
Location: Bulgaria

Re: Trans AI :: 09-08-24 ::

Post by Wold »

Well it's not exactly fixed:
Attachments
TransAI #1.png
(54.18 KiB) Downloaded 52 times
Image

bokkie
Transport Coordinator
Transport Coordinator
Posts: 326
Joined: 19 Jan 2007 19:26

Re: Trans AI :: 09-08-24 ::

Post by bokkie »

Don't know how I managed to make it instantly crash on startup? Maybe because I'm using multiple versions with the same grfs/AI's? I have used the most current nightly to download updates and then used an old build (9th of july, don't know revision) to play with it.
Attachments
Ridderdoorn Transport, 1950-01-25.png
(308.29 KiB) Downloaded 62 times

Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: Trans AI :: 09-08-24 ::

Post by Roujin »

bokkie: That screenshot is almost certainly of no use to the AI author. Please enlarge the window in both height and width so that the full error message is shown next time :)
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage

Yexo
Tycoon
Tycoon
Posts: 3660
Joined: 20 Dec 2007 12:49

Re: Trans AI :: 09-08-24 ::

Post by Yexo »

I'm 99% sure it's because the version of OpenTTD is you use is too old for that version of Trans AI.

User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: Trans AI :: 09-08-24 ::

Post by fanioz »

Wold wrote:Well it's not exactly fixed:
I'm sory. I couldn,t see any wrong there. Perhaps you could describe it a bit.

bokkie:
Yexo is right. And, yes there are 1 percent of my bad code design.
Correct me If I am wrong - PM me if my English was bad :D

**[OpenTTD AI]** Image
***[NewGRF] *** Image

User avatar
cmoiromain
Chief Executive
Chief Executive
Posts: 655
Joined: 15 Jan 2007 21:45
Location: FRANCE
Contact:

Re: Trans AI :: 09-08-24 ::

Post by cmoiromain »

One thing I have noticed about this AI is that it loves long bridges. I think that's the problem on he above screenshot. I also came across many situations where instead of simply building some straight track, the AI built a bridge.

Also, it seems reluctant to reusing its tracks, and sometimes builds three times the same path for three different industries.
I am little, ugly, and nasty. How do you do?

Wold
Transport Coordinator
Transport Coordinator
Posts: 318
Joined: 03 Aug 2006 19:32
Skype: woldy_bg
Location: Bulgaria

Re: Trans AI :: 09-08-24 ::

Post by Wold »

With the previous screenshot I meant that the bridge problem is not fixed.

With the following screenshot I want to show that your AI makes a route ( blocking the supply ). I think it will be a good idea when you transport secondary stuff to add a simple route ( either train or truck ) in order to feed the industry ensuring constant supply.
Attachments
trans1.png
(99.98 KiB) Downloaded 43 times
Image

Brumi
President
President
Posts: 905
Joined: 18 Jul 2009 17:54

Re: Trans AI :: 09-08-24 ::

Post by Brumi »

I ran into this while I was playing:
Trans AI bug.png
Trans AI bug.png (96.82 KiB) Viewed 3141 times
The pair of that road station simply didn't exist.

Wold
Transport Coordinator
Transport Coordinator
Posts: 318
Joined: 03 Aug 2006 19:32
Skype: woldy_bg
Location: Bulgaria

Re: Trans AI :: 09-08-24 ::

Post by Wold »

Brumi wrote:I ran into this while I was playing:
Trans AI bug.png
The pair of that road station simply didn't exist.
That's because it couldn't find a path. That's normal when it fails to build a route.
Image

Brumi
President
President
Posts: 905
Joined: 18 Jul 2009 17:54

Re: Trans AI :: 09-08-24 ::

Post by Brumi »

Wold wrote:That's because it couldn't find a path. That's normal when it fails to build a route.
I'm not sure about that. The coal mine was quite nearby and there was no obstruction. Even if the pathfinder fails, it should delete the station.

User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: Trans AI :: 09-08-29 ::

Post by fanioz »

Updated, as usual. 2nd post and Bananas... :mrgreen:
bokkie wrote:Don't know how I managed to make it instantly crash on startup? Maybe because I'm using multiple versions with the same grfs/AI's? I have used the most current nightly to download updates and then used an old build (9th of july, don't know revision) to play with it.
Yexo wrote:I'm 99% sure it's because the version of OpenTTD is you use is too old for that version of Trans AI.
Then, this version should fix the 1% left. :D Just make sure you would need at least 0.7.2 (I don't remember if I've ever added newer API function)
Wold wrote:With the previous screenshot I meant that the bridge problem is not fixed.
cmoiromain wrote:One thing I have noticed about this AI is that it loves long bridges. I think that's the problem on he above screenshot. I also came across many situations where instead of simply building some straight track, the AI built a bridge.
I've tell him in this version to try build normal track instead, but still let him build bridge if necessary. :D
Long bridge is a feature, but Bridge-Happy is a bug. Agree ?
cmoiromain wrote: Also, it seems reluctant to reusing its tracks, and sometimes builds three times the same path for three different industries.
re-using track : I've done some experiment in my other thread, and I've a not-published-yet version of Trans that re-use rail track. There is still a problem to avoid crossing on existing track. Of course I'll release it when ready. :D

Wold wrote: With the following screenshot I want to show that your AI makes a route ( blocking the supply ). I think it will be a good idea when you transport secondary stuff to add a simple route ( either train or truck ) in order to feed the industry ensuring constant supply.
I left this one, couldn't implement it right now, probably in the trunk version. However the idea is good. Thanks :D

edit:
Forget to answer this:
Brumi wrote:
Wold wrote:That's because it couldn't find a path. That's normal when it fails to build a route.
I'm not sure about that. The coal mine was quite nearby and there was no obstruction. Even if the pathfinder fails, it should delete the station.
TestMode said, AI can build route, ExecMode not. The pathfinder failed, it wouldn't delete the road station, because it was a drop off. It will re-used later. But in the next days, AI decide to build rail and success. The road station would only be used again, if AI couldn't build rail service.
Correct me If I am wrong - PM me if my English was bad :D

**[OpenTTD AI]** Image
***[NewGRF] *** Image

Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 2 guests