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

User avatar
davidx123
Traffic Manager
Traffic Manager
Posts: 146
Joined: 21 Feb 2008 19:05
Location: boring city in the middle of nowhere,Israel.
Contact:

Re: Trans AI :: 09-06-19 ::

Post by davidx123 »

so it seems that I don't have much time to test you AI.
just got gta iv to my xbox 360 :mrgreen:
ill test it now.
Your Faithful Student, Twilight Sparkle.
____
Visit my screenshot thread
Image


thanks to Supercheese for help with the GIF.cheers.
User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: Trans AI :: 09-06-19 ::

Post by fanioz »

Here what I 've got my self with my AI. It happened when Trans is trying to build rail station over an existing station, because AITile.IsBuildable() will return true if tile owner is him self. I hope I can fix this in the next release.
Attachments
Build rail station multiple times
Build rail station multiple times
build_on_edge.PNG (161.02 KiB) Viewed 5157 times
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-06-19 ::

Post by Wold »

Dundingworth Falls Transport, 3rd May 1967.png
Dundingworth Falls Transport, 3rd May 1967.png (68.47 KiB) Viewed 857 times
Why would the AI start so great with the trains and continue using road vehicles for a fraction of the income ?
Dundingworth Falls Transport, 29th Apr 1968.png
Dundingworth Falls Transport, 29th Apr 1968.png (85.51 KiB) Viewed 857 times
That idea was rubbish. The AI even sold a train from the original line, which was at least 2 times longer than the "new one".
Image
User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: Trans AI :: 09-06-19 ::

Post by fanioz »

Wold wrote: Why would the AI start so great with the trains and continue using road vehicles for a fraction of the income ?
Well, its because Trans can't build a rail service at that time, so it would fall back to road vehicle service.
In the next version you can push Trans to only build rail (and vice-versa) :D
Wold wrote: That idea was rubbish. The AI even sold a train from the original line, which was at least 2 times longer than the "new one".
That was a bug, I never though, thanks to report. :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-06-19 ::

Post by Wold »

Minwood Transport, 30th Apr 1965.png
Minwood Transport, 30th Apr 1965.png (43.57 KiB) Viewed 830 times
Minwood Transport, 28th Apr 1965.png
Minwood Transport, 28th Apr 1965.png (49.2 KiB) Viewed 825 times
These trains have no way to go back :?:
Cathill Transport, 3rd Aug 1965.png
Cathill Transport, 3rd Aug 1965.png (97.56 KiB) Viewed 828 times
It competes with another AI. The AI has built the line after the other company, still it made 3 trains which made a great income. It left them operating for a couple of years, when it decided to sell 2/3 and left the 3rd train in depot doing nothing.
Image
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Re: Trans AI :: 09-06-19 ::

Post by Zutty »

Hi fanioz,

Just a quick note. Your AI is really cool and extremely fast, but I notice using a NewGRF engine set that it builds rather poor engines. I tried it with Pikkabird's UK Renewal set + the addons set, and it keeps building low power, low reliability tram engines or shunters of <1,000HP to haul coal trains.
transai-tramengine.png
transai-tramengine.png (90.58 KiB) Viewed 4874 times
As you can see, there are much better engines it could have used, and it does this every time. Maybe this is because the engines in UKRS cost more than the standard ones.
PathZilla - A networking AI - Now with tram support.
Wold
Transport Coordinator
Transport Coordinator
Posts: 318
Joined: 03 Aug 2006 19:32
Skype: woldy_bg
Location: Bulgaria

Re: Trans AI :: 09-06-19 ::

Post by Wold »

Some things for you too :D
FanAI #1.png
FanAI #1.png (99.75 KiB) Viewed 849 times
Well it speaks for itself :)
FanAI #2.png
FanAI #2.png (54.89 KiB) Viewed 849 times
A rather unsuccessful route with no exception thrown
FanAI #3.png
FanAI #3.png (56.95 KiB) Viewed 854 times
As seen on the left - originally 3 trains serving the gold station, it has build a 4th one and later sold the 2nd
Image
User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: Trans AI :: 09-06-19 ::

Post by fanioz »

hey.. I just comeback from my annual holiday and it seems much changes in this forum.
Wold wrote:Some things for you too :D
FanAI #1.png
Well it speaks for itself :)
FanAI #2.png
A rather unsuccessful route with no exception thrown
FanAI #3.png
As seen on the left - originally 3 trains serving the gold station, it has build a 4th one and later sold the 2nd
thanks, It would be fixed in the next version.
Zutty wrote:Hi fanioz,

Just a quick note. Your AI is really cool and extremely fast, but I notice using a NewGRF engine set that it builds rather poor engines. I tried it with Pikkabird's UK Renewal set + the addons set, and it keeps building low power, low reliability tram engines or shunters of <1,000HP to haul coal trains.
transai-tramengine.png
As you can see, there are much better engines it could have used, and it does this every time. Maybe this is because the engines in UKRS cost more than the standard ones.
hi zutty, I would like to try better engine selection then. thanks
Correct me If I am wrong - PM me if my English was bad :D

**[OpenTTD AI]** Image
***[NewGRF] *** Image
User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: Trans AI :: 09-07-13 ::

Post by fanioz »

Many people said that 13 is related to something ......bad luck, but here is TransAI 0907.....13
I don't expect to be unlucky today, but if you still find a crash... well I got my unlucky today.

Whats New ? Whats changed? Why 13?
I just press Ctrl-Alt-Del on my brain, and...
-I've got a small 1x3 rail station flying in front of my eyes. With this small station I can build much more station in the Drop Off target. Later if I've finished my RailPF modification to re-use existing track, I promise to build the better-realistic Drop off station. (oh my God, I don't want to promise thing :cry: )
-Try to use PBS signal and build them after building track immediatelly.
-Fixing the reported bugs related to vehicle.
-Configurable Trans AI behaviour (instead of hardcoded in 090619). And thanks to ....
--Build Sign (zuu)
--Allow build Bus (Admiral)
--Allow build Truck (Admiral)
--Allow build Train (Admiral)
--Percent of last month Transported cargo. (SirKoz) <--- if A town/industry last month transported cargo percent is above this value, Trans would skip it.
--Processing speed (it seems Pathzilla have this too., )


Codechange:
I've decide to fall back to libraries which is provided by bananas. (Ask me if you need a reason :lol: )
-FibbonaciHeap 2
-AyStar.6
-RailPF 1
-RoadPF 3
Add More Documentation.
Cleanup code, I can reduce Trans AI code from 300kb (3rd biggest after Admiral-380kb and NoCAB-330kb) to 240kb (below pathzilla-276kb)

As usual, download via Bananas or 2nd page.

And... Go!
Correct me If I am wrong - PM me if my English was bad :D

**[OpenTTD AI]** Image
***[NewGRF] *** Image
Dezmond_snz
Engineer
Engineer
Posts: 58
Joined: 19 Apr 2009 11:50

Re: Trans AI :: 09-07-13 ::

Post by Dezmond_snz »

Thanx, Fanioz, for update.
It's very nice to see that your AI become more familiar with trains.
Tested it a bit and found two issues.
1. Articulated vehicles again (see SH).
2. 2cc trainset: it builds monorail line between towns but ain't build trains, at deport i found only 2 wagons. (2cc don't provide mail wagons for monorails - is that reason?)

Also you can see at screenshot train station built at not ideal position - its better to check if we can build rails out of stations before build station. :)
Attachments
Fanioz Trans Corp., 1950-05-24.png
(161.27 KiB) Downloaded 74 times
Russia
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: Trans AI :: 09-07-13 ::

Post by SirkoZ »

Thank you Fanioz for this update - I'll gladly try it out. :D
By the way - one suggestion right away - based on above screenshot - perhaps build bridges over any existing line - be it rail or road so you can dramatically lower the number of folks that travel by road, being casual and wearing ties. :mrgreen:

By the way - second iteration - number 13? It's all good, although I really like Linux way of describing stable builds with even numbers and those other with odd. :wink:
Brumi
President
President
Posts: 920
Joined: 18 Jul 2009 17:54

Re: Trans AI :: 09-07-13 ::

Post by Brumi »

Hi all,
As this is my first post to the forums, I'd like to congratulate to the OTTD developers, you made a great game even greater! :bow:
And for the AI developers, you also made a great work! I really like the whole NoAI thing.
I've been playing around with the different AIs for quite a long time, and I have a few minor suggestions. (sorry if they have been discussed earlier)
Here are my suggestions for Trans:
1) The new feature with the adjustable competition level (last_transport) is really great, but I think you swapped the easy_value and the hard_value. The description says that the AI won't compete above the given value. So let's say that I transport 50% of the cargo from a given industry. In easy mode last_transport = 60, so it will compete. Hard_value is 0, so it won't compete with me in hard mode. But this is just theory, I didn't test this thoroughly, so I may be wrong...
2) If I start a game in 1950 without NewGRF trainsets, Trans always chooses the Kirby Paul Tank engine. This may be OK with the realistic acceleration turned on, but without realsitic acceleration it is obviously a bad choice. The two differents acceleration models confuse AdmiralAI as well, because IMHO without NewGRFs and without realistic acceleration the best choice is always the fastest and/or strongest (of course if we can afford it).
3) You should include some sort of maximum distance check when building train lines, especially on maps bigger than 256x256. On larger maps, Trans wastes a lot of time on pathfinding (for example, across the diagonal on a 512x512 map), and those Kirby Paul Tanks just struggle with that distance.
And I think Trans is not as bad compared to other AIs as you say Fanioz, it can keep up with the others on the short term (I always test AIs on short term, so no information for me about long term performance).
Keep up the good work, Fanioz! :D
Best wishes,
Brumi
derchesten
Engineer
Engineer
Posts: 2
Joined: 18 Jul 2009 19:49

Re: Trans AI :: 09-07-13 ::

Post by derchesten »

Yo men!

hey, that A.I. is kind'a stupid, i've been playing with it, and the way it makes the railways is very ineffective, that circular way is dummy.

and if you can fix the save function, every time i load a game, the A.I. shows an error (in the console) that the type is string, and it have to be integer, u must fix it, 'cause it get lag the game...

well that's my problem

if u fix it, i'll kiss your feet
User avatar
davidx123
Traffic Manager
Traffic Manager
Posts: 146
Joined: 21 Feb 2008 19:05
Location: boring city in the middle of nowhere,Israel.
Contact:

Re: Trans AI :: 09-07-13 ::

Post by davidx123 »

never herd about being nice?
also,take notice to the fact that trans is just an effort for being a transporter,and it just a AI that is fun to play against.i won't play this with this AI if he gonna make the best,the ultimate railways.
this ai good because he just plain simple!
Your Faithful Student, Twilight Sparkle.
____
Visit my screenshot thread
Image


thanks to Supercheese for help with the GIF.cheers.
User avatar
Dustin
Transport Coordinator
Transport Coordinator
Posts: 272
Joined: 07 Dec 2005 19:22

Re: Trans AI :: 09-07-13 ::

Post by Dustin »

derchesten wrote:Yo men!

hey, that A.I. is kind'a stupid, i've been playing with it, and the way it makes the railways is very ineffective, that circular way is dummy.

and if you can fix the save function, every time i load a game, the A.I. shows an error (in the console) that the type is string, and it have to be integer, u must fix it, 'cause it get lag the game...

well that's my problem

if u fix it, i'll kiss your feet
Trans AI is GNU GENERAL PUBLIC LICENSE, Version 2, June 1991. Therefore, you don't like it, fork of your own version and fix it. Have you checked out the other AIs? Is there one you like? If not, you better design your own. :)

I admired all the other AI's. They are all cool in some way. So I was inspired to try my own. You should try it.
User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: Trans AI :: 09-07-13 ::

Post by fanioz »

Brumi wrote:Hi all,
As this is my first post to the forums, I'd like to congratulate to the OTTD developers, you made a great game even greater! :bow:
And for the AI developers, you also made a great work! I really like the whole NoAI thing.
I've been playing around with the different AIs for quite a long time, and I have a few minor suggestions. (sorry if they have been discussed earlier)
Here are my suggestions for Trans:
1) The new feature with the adjustable competition level (last_transport) is really great, but I think you swapped the easy_value and the hard_value. The description says that the AI won't compete above the given value. So let's say that I transport 50% of the cargo from a given industry. In easy mode last_transport = 60, so it will compete. Hard_value is 0, so it won't compete with me in hard mode. But this is just theory, I didn't test this thoroughly, so I may be wrong...
Well, I got confused with the term I've been used for my self :oops: . What I want to do is not same with the description I've wrote. So you maybe right.
Brumi wrote: 2) If I start a game in 1950 without NewGRF trainsets, Trans always chooses the Kirby Paul Tank engine. This may be OK with the realistic acceleration turned on, but without realsitic acceleration it is obviously a bad choice. The two differents acceleration models confuse AdmiralAI as well, because IMHO without NewGRFs and without realistic acceleration the best choice is always the fastest and/or strongest (of course if we can afford it).
The version 90713 should detect realistic acceleration, both in rail pathfinder and vehicle selection. But it seems that it doesn't work for vehicle, I have to check it.
Brumi wrote: 3) You should include some sort of maximum distance check when building train lines, especially on maps bigger than 256x256. On larger maps, Trans wastes a lot of time on pathfinding (for example, across the diagonal on a 512x512 map), and those Kirby Paul Tanks just struggle with that distance.
Yes, I (hope) have done it. Trans would not have maximum distance, in the hope that it still can build later if he have enough money. However current sort algorithm need to improve.
Brumi wrote: And I think Trans is not as bad compared to other AIs as you say Fanioz, it can keep up with the others on the short term (I always test AIs on short term, so no information for me about long term performance).
Keep up the good work, Fanioz! :D
Best wishes,
Brumi
In long term, it still have problem with Autorenewal and upgrading railtypes.

Thanks, thank you very much for the suggestions. These would be added in my "TODO-list". :D
Correct me If I am wrong - PM me if my English was bad :D

**[OpenTTD AI]** Image
***[NewGRF] *** Image
User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: Trans AI :: 09-07-13 ::

Post by fanioz »

Dezmond_snz wrote:Thanx, Fanioz, for update.
It's very nice to see that your AI become more familiar with trains.
Tested it a bit and found two issues.
1. Articulated vehicles again (see SH).
2. 2cc trainset: it builds monorail line between towns but ain't build trains, at deport i found only 2 wagons. (2cc don't provide mail wagons for monorails - is that reason?)

Also you can see at screenshot train station built at not ideal position - its better to check if we can build rails out of stations before build station. :)
Thanks for testing, its something I did'nt expected. (I think I've checked it before build) :D
SirkoZ wrote:Thank you Fanioz for this update - I'll gladly try it out. :D
By the way ..... so you can dramatically lower the number of folks that travel by road, being casual and wearing ties. :mrgreen:
Agree SirkoZ :P thanks..
Correct me If I am wrong - PM me if my English was bad :D

**[OpenTTD AI]** Image
***[NewGRF] *** Image
User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: Trans AI :: 09-07-13 ::

Post by fanioz »

derchesten wrote:Yo men!

hey, that A.I. is kind'a stupid, i've been playing with it, and the way it makes the railways is very ineffective, that circular way is dummy.

and if you can fix the save function, every time i load a game, the A.I. shows an error (in the console) that the type is string, and it have to be integer, u must fix it, 'cause it get lag the game...

well that's my problem

if u fix it, i'll kiss your feet
Dustin wrote: Trans AI is GNU GENERAL PUBLIC LICENSE, Version 2, June 1991. Therefore, you don't like it, fork of your own version and fix it. Have you checked out the other AIs? Is there one you like? If not, you better design your own. :)

I admired all the other AI's. They are all cool in some way. So I was inspired to try my own. You should try it.
derchesten, Dustin is just right. You can make it better, or make your own AI.

FYI, I'm not a programmer nor developer. I only OpenTTD fans that would like to try to make something. I started my AI from zero knowledge, and made a step by step progress. I do all I can to fix the bug reported or something weird that was build by this AI. It's not a big problem for me if I got blamed. Although I would feel ashamed. :oops:
Correct me If I am wrong - PM me if my English was bad :D

**[OpenTTD AI]** Image
***[NewGRF] *** Image
User avatar
Dustin
Transport Coordinator
Transport Coordinator
Posts: 272
Joined: 07 Dec 2005 19:22

Re: Trans AI :: 09-07-13 ::

Post by Dustin »

fanioz wrote:
derchesten wrote:Yo men!

hey, that A.I. is kind'a stupid, i've been playing with it, and the way it makes the railways is very ineffective, that circular way is dummy.

and if you can fix the save function, every time i load a game, the A.I. shows an error (in the console) that the type is string, and it have to be integer, u must fix it, 'cause it get lag the game...

well that's my problem

if u fix it, i'll kiss your feet
Dustin wrote: Trans AI is GNU GENERAL PUBLIC LICENSE, Version 2, June 1991. Therefore, you don't like it, fork of your own version and fix it. Have you checked out the other AIs? Is there one you like? If not, you better design your own. :)

I admired all the other AI's. They are all cool in some way. So I was inspired to try my own. You should try it.
derchesten, Dustin is just right. You can make it better, or make your own AI.

FYI, I'm not a programmer nor developer. I only OpenTTD fans that would like to try to make something. I started my AI from zero knowledge, and made a step by step progress. I do all I can to fix the bug reported or something weird that was build by this AI. It's not a big problem for me if I got blamed. Although I would feel ashamed. :oops:

Fanioz,

I am trying your AI out against mine. In 3 of 4 trials your AI got off to a slow start and went bankrupt (at which time I stopped). However, when yours got a good start, mine can't keep up. My passing lane builder is just too slow. (I have some ideas to fix that.) Your system (however it works) works nicely and you build routes much faster than my AI. Well done sir!

I like your network. Your stations with the depot and PBS signal works really well.

I would suggest you should limit your starting route distance. If your first route is short (50-200 tiles) then your AI gets a good start and runs well. Otherwise it's very nice. I really like your debug output. Very friendly. -> Good Job :-D

I would like to see derchesten try to do better. Yours is a nice AI and I am impressed by it. Moreso that you aren't a programmer. Squirrel isn't the easiest scripting language! (But I like it well for this.)
User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: Trans AI :: 09-07-13 ::

Post by fanioz »

Dustin wrote: Fanioz,

I am trying your AI out against mine. In 3 of 4 trials your AI got off to a slow start and went bankrupt (at which time I stopped). However, when yours got a good start, mine can't keep up. My passing lane builder is just too slow. (I have some ideas to fix that.) Your system (however it works) works nicely and you build routes much faster than my AI. Well done sir!

I like your network. Your stations with the depot and PBS signal works really well.

I would suggest you should limit your starting route distance. If your first route is short (50-200 tiles) then your AI gets a good start and runs well. Otherwise it's very nice. I really like your debug output. Very friendly. -> Good Job :-D

I would like to see derchesten try to do better. Yours is a nice AI and I am impressed by it. Moreso that you aren't a programmer. Squirrel isn't the easiest scripting language! (But I like it well for this.)
Thanks Dustin. :D. I would like to take an other approach to solve the pathfinding waste time.
Thanks for testing. :D
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 10 guests