SynTrans - A Synaptic Network AI

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

11Runner
Engineer
Engineer
Posts: 92
Joined: 01 Sep 2011 19:23
Location: Oregon, USA

SynTrans - A Synaptic Network AI

Post by 11Runner »

I am proud to presend my NoAI AI, SynTrans!

SynTrans stands for Synaptic Transportation. It can build massive road and aircraft networks. Will probably never implement train support... but oh well :) The AI is very good with Road and Air.

The AI features many improvements from its origionation, RoadAI:

1. Added Aircraft Support
2. Added Save/Load support (may be a buggy feature)
3. Better vehicle management
4. Better station placement (thanks GeekToo)
5. Various Bug fixes
6. And many other small improvements

--The Goals (in order of priority)--
1. To make a stable AI that works as intended in any situation
2. To make an AI that builds more realistically and is fun to play with
3. To make the AI extremely fast
4. To make the AI a good competitor

Keep in mind this AI depends on SuperLib v13.

If you find any bugs in the AI, please send them in. Feature requests are also appreciated :wink:

My code is free and Opensource, use may use any portion or change it to your hearts content!
Attachments
SynTrans-1.tar
(51 KiB) Downloaded 1078 times
Last edited by 11Runner on 15 Apr 2014 02:58, edited 1 time in total.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: SynTrans - A Synaptic Network AI

Post by Zuu »

Hello, you got two spelling errors in on your info.nut:

Code: Select all

The maximum number of seprate tranport networks for the roads SynTrans may build
seprate => separate
tranport => transport

Tip: Many text editors suitable for editing code also have a spell checker for comments and literal strings.


The AI itself, I don't have had time to test yet. But I'm sure will do as I really like that you have taken the network approach instead of just doing point to point connections.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
11Runner
Engineer
Engineer
Posts: 92
Joined: 01 Sep 2011 19:23
Location: Oregon, USA

Re: SynTrans - A Synaptic Network AI

Post by 11Runner »

It is obvious I am rushing way to much in my coding. Good call :lol:
Image

SynTrans - A Synaptic Networking AI for OpenTTD
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: SynTrans - A Synaptic Network AI

Post by Kogut »

small problem
Attachments
Przechwytywanie.PNG
(147.12 KiB) Downloaded 5 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
11Runner
Engineer
Engineer
Posts: 92
Joined: 01 Sep 2011 19:23
Location: Oregon, USA

Re: SynTrans - A Synaptic Network AI

Post by 11Runner »

Fixed the above listed problems (as well as a couple of bugs I found :D ).

You may also notice I am starting the train support if you look at the source code
Attachments
SynTrans-2.tar
(59 KiB) Downloaded 467 times
Image

SynTrans - A Synaptic Networking AI for OpenTTD
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: SynTrans - A Synaptic Network AI

Post by Zuu »

Your rail stub is about five times longer than the rail stub in CluelessPlus (as I only got one rail file) ;-)

On a more serious note, I think you should add SynTrans to bananas.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
11Runner
Engineer
Engineer
Posts: 92
Joined: 01 Sep 2011 19:23
Location: Oregon, USA

Re: SynTrans - A Synaptic Network AI

Post by 11Runner »

Zuu wrote:On a more serious note, I think you should add SynTrans to bananas.
I will do this as soon as I can. I just wasnt sure it was time just yet :D
Image

SynTrans - A Synaptic Networking AI for OpenTTD
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: SynTrans - A Synaptic Network AI

Post by Kogut »

eGRVTS in 1710 result in problems as all vehicles are articulated.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
11Runner
Engineer
Engineer
Posts: 92
Joined: 01 Sep 2011 19:23
Location: Oregon, USA

Re: SynTrans - A Synaptic Network AI

Post by 11Runner »

Hello,

Attatched is version 3. Sorry it took so long (I am very busy :wink: )

Here is an incomplete list of the improvements (and yes, the list will always be incomplete because I don't bother to keep track of the changes)

1.
Kogut wrote:eGRVTS in 1710 result in problems as all vehicles are articulated.
The AI now builds those vehicles and the appropriate stations
2. Fixed a few minor bugs
3. Slightly better connection building

Also, my rail stub is so long because I plan on adding somewhat extensive train support to my AI (It will be using ro-ro stations and junctions mentioned on the OTTD wiki manual, all in a network. I just wanted to start with road vehciles to alvoid confusion as I learn NoAI :D )
Attachments
SynTrans-3.tar
(79.5 KiB) Downloaded 440 times
Image

SynTrans - A Synaptic Networking AI for OpenTTD
11Runner
Engineer
Engineer
Posts: 92
Joined: 01 Sep 2011 19:23
Location: Oregon, USA

Re: SynTrans - A Synaptic Network AI

Post by 11Runner »

Here is SynTrans v4.

All I did was:

1. Update to SuperLib v15 (and did my things with the stuff I wanted to do with it)
2. Further developed train stub (not complete)
Attachments
SynTrans-4.tar
(80 KiB) Downloaded 323 times
Image

SynTrans - A Synaptic Networking AI for OpenTTD
Brumi
President
President
Posts: 920
Joined: 18 Jul 2009 17:54

Re: SynTrans - A Synaptic Network AI

Post by Brumi »

Good to see that development is going on, I'm eagerly waiting for train support :)

Anyway, in my tests, your AI doesn't build aircraft. I start the game in 1950, and the plane limit is 20, might that be the case?

Unfinished roads are quite a common sight when using your AI:
syntrans.png
syntrans.png (29.85 KiB) Viewed 22420 times
The AI log is full of messages like "Could not find a road vehicle to use!", although there are buses running on the roads, and I cheated to give your AI 'some' money, so money shouldn't be an issue now. I have the Generic Tram Set enabled, but anyway it's the default road vehicle set.
ai_log.png
ai_log.png (24.67 KiB) Viewed 22420 times
I don't know if it makes a difference...
11Runner
Engineer
Engineer
Posts: 92
Joined: 01 Sep 2011 19:23
Location: Oregon, USA

Re: SynTrans - A Synaptic Network AI

Post by 11Runner »

Sorry, I dont get much time to test my AI myself, I am so busy these days :)

Anyway, here is the next release.
Anyway, in my tests, your AI doesn't build aircraft. I start the game in 1950, and the plane limit is 20, might that be the case?
Sorry about that. I broke my AI's ability to build aircraft with a new function I failed to test. It has been fixed in this release.
The AI log is full of messages like "Could not find a road vehicle to use!", although there are buses running on the roads, and I cheated to give your AI 'some' money, so money shouldn't be an issue now. I have the Generic Tram Set enabled, but anyway it's the default road vehicle set.
Part of the same aircraft bug it appears, but if you continue seeing those messages, let me know :wink: .
Unfinished roads are quite a common sight when using your AI
This is a known bug. I have taken various steps to preventing it from happening. It seems to never happen to me, I plan on fixing it (again) in the next release (the aircraft bug was more important and I didn't have enough time)
Attachments
SynTrans-5.tar
(90 KiB) Downloaded 337 times
Image

SynTrans - A Synaptic Networking AI for OpenTTD
11Runner
Engineer
Engineer
Posts: 92
Joined: 01 Sep 2011 19:23
Location: Oregon, USA

Re: SynTrans - A Synaptic Network AI

Post by 11Runner »

Merry Christmas Everyone :D

Here is SynTrans v6. This release features the most improvements thus far:

* Speed improvements

* Bigger networks faster

* Smarter Aircraft Support

* Builds HQ (for supporting CityDomination :wink: )

* Many other small bugfixes

Bug reports and feature requests welcome!

Side Note: Does anyone know how to load an older version of a AI using the start_ai command? I would like to show you graphs of improvements in this release.
Attachments
SynTrans-6.tar
(100 KiB) Downloaded 356 times
Image

SynTrans - A Synaptic Networking AI for OpenTTD
Brumi
President
President
Posts: 920
Joined: 18 Jul 2009 17:54

Re: SynTrans - A Synaptic Network AI

Post by Brumi »

You can use this for example:

Code: Select all

start_ai syntrans.5
bman
Engineer
Engineer
Posts: 8
Joined: 29 Dec 2011 22:08

Re: SynTrans - A Synaptic Network AI

Post by bman »

I get this error when it loads the AI:
"Your script made an error: couldn't find library 'util.superlib'"

I couldn't find any util.superlib file on the forums. Is there something I'm missing here?
11Runner
Engineer
Engineer
Posts: 92
Joined: 01 Sep 2011 19:23
Location: Oregon, USA

Re: SynTrans - A Synaptic Network AI

Post by 11Runner »

I was having the same issue too, but I assumed it was just my own misconfiguration. I suppose Zuu could have renamed the library or something. I will fix the problem as soon as possible. Thank you for the notice :D
Image

SynTrans - A Synaptic Networking AI for OpenTTD
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: SynTrans - A Synaptic Network AI

Post by Zuu »

11Runner wrote:I suppose Zuu could have renamed the library or something.
Not as far as I'm concerned ;-)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
11Runner
Engineer
Engineer
Posts: 92
Joined: 01 Sep 2011 19:23
Location: Oregon, USA

Re: SynTrans - A Synaptic Network AI

Post by 11Runner »

bman wrote: I get this error when it loads the AI:
"Your script made an error: couldn't find library 'util.superlib'"

I couldn't find any util.superlib file on the forums. Is there something I'm missing here?
Turns out my AI was trying to load SuperLib v15 :) Thank you for the report, it has now been fixed. You can find SynTrans v7 on bananas or the download link below
Attachments
SynTrans-7.tar
(97 KiB) Downloaded 461 times
Image

SynTrans - A Synaptic Networking AI for OpenTTD
Glaukon777
Engineer
Engineer
Posts: 1
Joined: 02 Mar 2012 23:28

Re: SynTrans - A Synaptic Network AI

Post by Glaukon777 »

Hi! First of all, I'd like to say that this is the best AI I've tried so far! So kudos for you on that. Now, this is the first crash I've run into:

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

Re: SynTrans - A Synaptic Network AI

Post by Zuu »

Fix:

Change line 236 from

Code: Select all

							raildir = Tile.TurnDirClockwise90Deg(Tile.GetDirectionToAdjacentTile(site, bridge), 1);
to

Code: Select all

							raildir = Direction.TurnDirClockwise90Deg(Direction.GetDirectionToAdjacentTile(site, bridge), 1);
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 8 guests