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
User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Trans AI .:19.07.23 :.

Post by fanioz »

Trans.png
Trans.png (50.62 KiB) Viewed 16281 times
Hello all, here now an AI player for OpenTTD named Trans. Project started at Sunday, February 01, 2009 as Fan AI. After looking for this AI name for a few months, finally I've found TRANS, wich is Train_Road-vehicle_Aircraft_N_Ship :D . Ah.. not must be like that, in fact I really only need a name. :lol:
There are many AI's available, and this one is not good enough to beat them :-)

Description:
Trans is an AI for OpenTTD. It try to transporting cargoes from/to any towns and industries using Bus, Truck, Tram, Train, Aircraft and Ship. In the future it would try to use all available vehicles. Current strategy is try to use only one type of industry (if possible) as the destination of transporting cargo named "Cargo Concept", As described in openttd-coop

Short Name ID:
FTAI => Fanioz Trans AI :

Version numbering:
The version number is in YYMMDD format. A version of 100307, mean it was released at 7th of March 2010.

Usage:
-Download file (from Bananas-"In Game Content Download")
-Open AI configuration window and you have an options.
TransParameters.jpg
TransParameters.jpg (63.18 KiB) Viewed 13254 times

The following items are configurable inside game (you've to set the difficulty setting to "custom") ::
- Vehicle to use
- Build Sign
- Dump Log
- Build pathfinder sign


-type "start_ai trans" in your OpenTTD console

Note:
-You would need at least OpenTTD 1.3 to run
-Please, report the bug(s) or something absurd that build by this AI (attach the screen shoot too)
-Bug report/suggestion/feature request could be made on this thread or https://github.com/fanioz/AI-Trans/issues

TODO :
- Always fix coding style to follow 'OTTD/Doxygen standard'
- Always Bug fixing
- Be SMART :P
-----------------------------------------------------------
Trans is an effort to be a transporter.
Build first, improve later, No Final Version.

Trans AI repositories
https://github.com/fanioz/AI-Trans/

Change log

see changelog.txt

Road Map

see Roadmap

===============================
Manual Download
Trans-AI_190723.tar
(346 KiB) Downloaded 511 times

Libraries:
  1. AI Library - Common
  2. AI Library - List
  3. AI Library - String
Last edited by fanioz on 23 Jul 2019 00:00, edited 63 times in total.
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:

Download Section

Post by fanioz »

Download Area



Libraries is needed to download if you haven't. Simply click link below. (don't forget to extract the *.gz one)

Trans AI would need :
1. Fibonacci Heap 2
2. AI Library - Common
3. AI Library - List (improvement of AIList)

Put in your ....\content_download\ai\library folder.

Code host :
provided by noai Project site at http://noai.openttd.org/svn/ai-trans
If you want to see the latest code, make a branch or patch of it, check it out.
Last edited by Chrill on 11 Apr 2018 08:39, edited 64 times in total.
Reason: Removed file download on user's request
Correct me If I am wrong - PM me if my English was bad :D

**[OpenTTD AI]** Image
***[NewGRF] *** Image
Roel
Engineer
Engineer
Posts: 9
Joined: 28 Jan 2009 22:20

Re: New Comer: Fan AI

Post by Roel »

Great! I'm going to test it now!
Webhosting - http://www.ejac.nl
User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: New Comer: Fan AI

Post by fanioz »

Change Log :: 90312

fix ::Sleep value < 0
fix :: some typos
fix:: forget to remark un-finished generator code
change some operational parameter.
fix:: even handler on vehicle lost and unprofitable
:: problem :: Can't found AIOrder.SkipOrderCurrent(vehicle_ID) in API (to skip current order)
:: problem :: AIEventController.InsertEvent <- index not exist (some time, on runtime)
fix:: Road Station Heading & Building (Join Distance Station)

Note:
this is just a test case, result of 2nd year (1950-1951). Standard generated map with 256*256. Difficulty level = medium. No NewGRF at all. Run on OpenTTD beta2.
1950-1951
1950-1951
2nd_year.png (26.63 KiB) Viewed 55648 times
Right now, I can't update the content server, because it doesn't recognize well other .nut file.

Unknown file in pack: changelog.txt

Fixing mean, re-tar-ing the file, and force me to use *nix clone, wich is not available now. Maybe later :lol:
Attachments
and this 5th year (1950-1955)
and this 5th year (1950-1955)
5th_year.PNG (52.13 KiB) Viewed 55650 times
Correct me If I am wrong - PM me if my English was bad :D

**[OpenTTD AI]** Image
***[NewGRF] *** Image
defaultluser
Engineer
Engineer
Posts: 34
Joined: 01 Mar 2009 19:56

Re: New Comer: Fan AI

Post by defaultluser »

You sure it's doing that well? I just played a 512x512 Hard map (300k start loan), and Fan AI isn't doing so well. See here:

http://www.tt-forums.net/viewtopic.php? ... 86#p772286
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: New Comer: Fan AI

Post by Yexo »

fanioz wrote: :: problem :: Can't found AIOrder.SkipOrderCurrent(vehicle_ID) in API (to skip current order)
:: problem :: AIEventController.InsertEvent <- index not exist (some time, on runtime).
I've introduced IOrder::SkipToOrder() in r15684.
You shouldn't ever call AIEventController.InsertEvent from your AI (I've made that more clear now in the docs).
User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: New Comer: Fan AI

Post by fanioz »

defaultluser wrote:You sure it's doing that well? I just played a 512x512 Hard map (300k start loan), and Fan AI isn't doing so well. See here:

http://www.tt-forums.net/viewtopic.php? ... 86#p772286
You're right, the current performance is still need to improve. thank you :D
Yexo wrote: I've introduced IOrder::SkipToOrder() in r15684.
You shouldn't ever call AIEventController.InsertEvent from your AI (I've made that more clear now in the docs).
Thank you yexo, I 'll try it :bow:
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: New Comer: Fan AI

Post by fanioz »

Change Log ::
:Adjust: some operating parameters
:fix: road station building, now use AITileList_IndustryProducing/Accepting
:fix: Vehicle group name have leading zero if it is below 10 (some one PM-me about this issue) :D
:fix:Better handling on vehicle unprofitable (after AIOrdr.SkipToOrder is available)

New (experimental) : Use conditional order to prevent congestion

min. requirement : OpenTTD 0.7.0 RC-1 (or latest trunk)

And still getting hard for this "FAirly_Naive_AI" (FANAI) to beat prior AI :roll: :lol:
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 :: Reborn (a.k.a Fan AI)

Post by fanioz »

:Made announcement for new Project.
:Updated the first post.
=========================
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 :: Reborn (a.k.a Fan AI)

Post by fanioz »

Development milestone to Trans AI 090417

=========================================
Remove :: Conditional order on loading

Fix :: Loading save game will not try to rename President Name anymore
Fix :: Try to replace vehicle after 2 year
Fix :: More event handling
Fix :: recode the service generator
Fix :: Un-grouped vehicle now moved to its group
Fix :: Add vehicle to station by cargo waiting
Fix :: Train can't detect whether the second line has been built or not
Fix :: Typos in rail pathfinder

New :: Add depot near destination
New :: Conditional Order for servicing on destination depot if required.
New :: Try to rename Drop Off Station (1, 2, ...)
New :: Try to handle Industry -> Town cargo (water, good, food)
New :: Try to support save / load (known problem : not work in the middle of building station/depot)
New :: Try to use train for servicing, if failed fall back to road vehicle
New :: Detect a number of vehicle in front off station and inside rail depot
New :: Add a little bit randomization to allow run with same instance
New :: Try to implement "be nice" (to SirkoZ) :-)
New :: Simple Flattening land to build rail station
New :: Support New GRF for Rail Stations

Internal :: Restructure folders and files
Internal :: Try to debug nicely
Internal :: Aystar.5 and BinaryHeap.1 not included anymore
Internal :: Try to (re)write more documentation
Internal :: Used pathfinder :
- Road Path Finder as discussed here
- Rail Path Finder as discussed here

However you may still found "old school" AI here :lol:
old_school.png
old_school.png (130.22 KiB) Viewed 54086 times
Download link in the 2nd post
Correct me If I am wrong - PM me if my English was bad :D

**[OpenTTD AI]** Image
***[NewGRF] *** Image
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: Trans AI :: Reborn (a.k.a Fan AI)

Post by Morloth »

Nice work fanioz,

Couple of comments about your pathfinder, it seems to very very bridge happy. Often building bridges where it has no advantage (see the screenshot in your latest post) and I also get some pretty 'interesting' track sometimes (couldn't reproduce at time of writing :/). I had similar problems when I set the cost of building bridges to low, in which case the pathfinder will find building bridges cheaper than building normal tracks.

Besides that I get an error message which is in the included screenshot. Otherwise well done and congrats on including train support :).
Attachments
Error message
Error message
Unnamed, 1st Mar 1951.png (25.6 KiB) Viewed 5381 times
User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: Trans AI :: Reborn (a.k.a Fan AI)

Post by fanioz »

:oops: that is just a typos, and not enough testing time. Thanks Morloth, However the update would be available at least tomorrow,due to version numbering.
About the bridge, I think thats because the neighbour function in path finder doesn't mark that tile as rail buildable, thus the path builder interpreting it as a request to build bridge over an ignored tile.
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 :: Reborn (a.k.a Fan AI)

Post by cmoiromain »

indeed the pathfinder seems to go quite wrong. Attached is a piece of track your AI just build... I goes all over the place ^^

EDIT: damn, the thing crashed here as well...
Here is the error message.
Attachments
bug.png
(438.33 KiB) Downloaded 178 times
crash.png
crash.png (24.7 KiB) Viewed 5341 times
I am little, ugly, and nasty. How do you do?
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Trans AI :: Reborn (a.k.a Fan AI)

Post by Bilbo »

So, construction style of "good old AI" returns? :)

How do you manage to construct this style of tracks?
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Trans AI :: Reborn (a.k.a Fan AI)

Post by Zuu »

Sounds like a big step forward.

However, in last nightly I couldn't find FanAI in the content download window. So I tried in 0.7.0 and found it there, tested it but it did not build any trains. Then an hour later I realized that it might be under another name, but there was no Trans AI in last nightly, but in 0.7.0 there is.

So I guess you have told BaNaNaS that minimum version is 0.7.0. Unfortunately that don't make (later) nightlies able to download it. I use some kind of custom number for PAXLink that I got explained is the same as the OpenTTD version number that GRFs reads. Using this custom number both 0.7.0 and last nightly finds PAXLink. (Unless you really wanted to make it only available for 0.7.0)


Nice to see your AI building rails. :)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Trans AI :: Reborn (a.k.a Fan AI)

Post by Yexo »

Zuu wrote:Sounds like a big step forward.

However, in last nightly I couldn't find FanAI in the content download window. So I tried in 0.7.0 and found it there, tested it but it did not build any trains. Then an hour later I realized that it might be under another name, but there was no Trans AI in last nightly, but in 0.7.0 there is.

So I guess you have told BaNaNaS that minimum version is 0.7.0. Unfortunately that don't make (later) nightlies able to download it. I use some kind of custom number for PAXLink that I got explained is the same as the OpenTTD version number that GRFs reads. Using this custom number both 0.7.0 and last nightly finds PAXLink. (Unless you really wanted to make it only available for 0.7.0)


Nice to see your AI building rails. :)
Using 0.7.0 as minimum version works ok, as long as you set the maximum version to "(None)". If it does not show up in a nightly when you do that, please report it as a bug.
User avatar
cmoiromain
Chief Executive
Chief Executive
Posts: 655
Joined: 15 Jan 2007 21:45
Location: FRANCE
Contact:

Re: Trans AI :: Reborn (a.k.a Fan AI)

Post by cmoiromain »

yet another request:

your AI seems to like coal (so do I ^^), and it would be pretty neat to have it re-use previous tracks instead of desperately trying to find another way of reaching the same goal.
better rails.png
(691.12 KiB) Downloaded 115 times
Another thing, I don't understand why it builds two way exit signals at stations, there is no rational reason for that is there?

also something else (less important, maybe it's just a coincidence), the two trans AIs running build their HQ at the same place, maybe you could randomise this a little.

I really love to play with train building AIs, I do hope this one will become even better! Keep up the good work!
I am little, ugly, and nasty. How do you do?
User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: Trans AI :: Reborn (a.k.a Fan AI)

Post by fanioz »

TRANS AI 090418
Revision 59
Fix :: Typos in vehicle detection
Fix :: Now, used combo type signal on rail station instead of exit type to make the train waiting inside of depot.
Fix :: wrong calculation of signal positioning has been corrected
Fix :: Build signal on existing signal will cycle signal type, so must do detect it before build.
Revision 60
Fix :: Issue with send vehicle to depot. (hope it fine now)
Fix :: adjustment little bit at rail path finder
Revision 61
Fix :: Combo signal has a 'feature', fall back to exit signal, and add entry signal too.
Fix :: un grouped vehicle after replacement now bounded to it group again

I hope no more red box crash there, Happy playing :D

And now, time to answer/respond your suggestion/feedback ..
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 :: Reborn (a.k.a Fan AI)

Post by fanioz »

Morloth wrote:Nice work fanioz,

Couple of comments about your pathfinder, it seems to very very bridge happy. Often building bridges where it has no advantage (see the screenshot in your latest post) and I also get some pretty 'interesting' track sometimes (couldn't reproduce at time of writing :/). I had similar problems when I set the cost of building bridges to low, in which case the pathfinder will find building bridges cheaper than building normal tracks.

Besides that I get an error message which is in the included screenshot. Otherwise well done and congrats on including train support :).
I've adjusted a cost little bit, still found unnecessary bridge there but not as much as yesterday version. Thanks Morloth.
cmoiromain wrote:indeed the pathfinder seems to go quite wrong. Attached is a piece of track your AI just build... I goes all over the place ^^

EDIT: damn, the thing crashed here as well...
Here is the error message.
I could not understand whats wrong with that, as long as the rail is connected, for me it is not wrong, it just a (what to say exactly?) abnormal/ un - natural rail building :lol: thanks for testing.
However the crash you're reported has been fixed today.
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 :: Reborn (a.k.a Fan AI)

Post by fanioz »

Bilbo wrote:So, construction style of "good old AI" returns? :)

How do you manage to construct this style of tracks?
mmm.. I didn't mean to be the "good old AI". :mrgreen: (can't stop laughing right now)
I don't know exactly the reason, but it seem because I gave 2 input for both source and goals. The goals has an estimated_tile routine but not the sources, So the pathfinder is "splitted" before going to the right direction of source. Right now, for me, it is the safest way to connect both side of a station on limited buildable space. Maybe later will change again. Thanks :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 3 guests