An introduction to the OpenTTD NoAI framework

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
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

An introduction to the OpenTTD NoAI framework

Post by Yexo »

First of all, what is the NoAI framework?
The NoAI framework provides an API to write your own AI. AIs can be written using squirrel.

What does it offer for me?
The old AI was still the same AI as in TTD which hasn't been updated for years. With this new framework several users are writing their own AIs which perform much better then the original AI, proving a better challenge to play against.

Where can I download the latest version?
NoAI is included in latest nightly.

Where can I get a new AI to play with?
You can download AIs in-game via the "Download content" button.

I want to write my own AI, where do I start?
The best starting place is the wiki. Also see AI:Introduction. The API docs are located here.

Tournament server
TrueBrain has created a tournament server and is regularly running competitions between AIs. It is currently offline. Check back in a few weeks for updates.
Last edited by planetmaker on 16 Jul 2013 15:50, edited 2 times in total.
Reason: no tournatment server... :-(
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: An introduction to the OpenTTD NoAI framework

Post by Kogut »

Yexo wrote:Tournament server
TrueBrain has created a tournament server and is regularly running competitions between AIs. It is currently offline. Check back in a few weeks for updates.
It may be a good idea to remove it, unfortunately it seems to be thoroughly dead.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: An introduction to the OpenTTD NoAI framework

Post by planetmaker »

Kogut wrote:
Yexo wrote:Tournament server
TrueBrain has created a tournament server and is regularly running competitions between AIs. It is currently offline. Check back in a few weeks for updates.
It may be a good idea to remove it, unfortunately it seems to be thoroughly dead.
Of course there could be volunteers who run or hold such contests regularily...
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: An introduction to the OpenTTD NoAI framework

Post by Kogut »

planetmaker wrote:
Kogut wrote:
Yexo wrote:Tournament server
TrueBrain has created a tournament server and is regularly running competitions between AIs. It is currently offline. Check back in a few weeks for updates.
It may be a good idea to remove it, unfortunately it seems to be thoroughly dead.
Of course there could be volunteers who run or hold such contests regularily...
I should be able to make one, but I will do it after fixing all cases of random crashes in my AI 8)
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: An introduction to the OpenTTD NoAI framework

Post by Lord Aro »

About a year ago, i did update Truebrain's patch for his tournament, however i haven't looked at it since and it wasn't complete anyway
AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1354
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: An introduction to the OpenTTD NoAI framework

Post by MagicBuzz »

Hello,

Do you know if there is some editor for Squirrel ? (on Windows)

I found there were a Visual Studio integration with VS2010, but it's quite old. I'm trying to compile it for VS2019 but I have serious doubts.
I fould also a SquirrelEditor on SourceForce, but the program is discontinued, bugged, and was oriented for a specific game (autocompletion was proposing only functions that not exists in OTTD).
embeddedt
Engineer
Engineer
Posts: 7
Joined: 15 Jun 2020 18:21

Re: An introduction to the OpenTTD NoAI framework

Post by embeddedt »

MagicBuzz wrote: 15 Jul 2020 12:59 Do you know if there is some editor for Squirrel ? (on Windows)
There are two Visual Studio Code extensions that claim to have Squirrel syntax highlighting. I doubt you'll get autocompletion though.

https://marketplace.visualstudio.com/it ... e-squirrel
https://marketplace.visualstudio.com/it ... irrel-lang
thegreatpl
Engineer
Engineer
Posts: 28
Joined: 29 Dec 2008 22:28
Location: my own mind

Re: An introduction to the OpenTTD NoAI framework

Post by thegreatpl »

MagicBuzz wrote: 15 Jul 2020 12:59 Hello,

Do you know if there is some editor for Squirrel ? (on Windows)

I found there were a Visual Studio integration with VS2010, but it's quite old. I'm trying to compile it for VS2019 but I have serious doubts.
I fould also a SquirrelEditor on SourceForce, but the program is discontinued, bugged, and was oriented for a specific game (autocompletion was proposing only functions that not exists in OTTD).
Late response, but there is/was a Notepad++ extension specifically for Openttd AI, which comes with autocomplete.

Found here:viewtopic.php?t=69671

It is, however, out of date, and the current API includes a number of functions and types which are not covered by this. A few have also changed.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 7 guests