AIAI

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

Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI delta2 version

Post by Kogut »

Wardjp wrote:So is the delta2 the latest version or is the gamma4 the latest?
delta2

alfa - beta - gamma - delta
old -------------------- new
Wardjp wrote:As well, is there any way for someone (such as myself) with little to no programming experience to be able to get into these AI's and use them to learn and build onto, or is it a little too complicated to jump into, if so does anyone know any good websites or such that are good to learn at?
Squirrel is almost the same language as C, so you can follow basic C tutorial (if, else, for, functions etc), prepare some hello world programs. Later you can think about AI coding.
I suggest to (for start) improve WrightAI. It is very stupid, but with just one modification it may greatly improve. There is kind of NoAI API tutorial on openttd wiki but for start checking code of other AIs is also good way to learn about using NoAI API.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: AIAI delta2 version

Post by Zuu »

I would argue that Squirrel isn't very similar to C or C++. Yes it has curly brackets, but so do Java etc. I'd say that Squirrel is closer to Java or PHP than to C++. That said, pretty much any language will do to learn if-statements, loops, functions, classes etc. But I wouldn't agree that C and Squirrel are pretty close to each other. Squirrel has more in common with many other interpreted languages than C - at least if you look at the language features rather than at the brackets.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI delta2 version

Post by Kogut »

Zuu wrote:I would argue that Squirrel isn't very similar to C or C++. Yes it has curly brackets, but so do Java etc. I'd say that Squirrel is closer to Java or PHP than to C++. That said, pretty much any language will do to learn if-statements, loops, functions, classes etc. But I wouldn't agree that C and Squirrel are pretty close to each other. Squirrel has more in common with many other interpreted languages than C - at least if you look at the language features rather than at the brackets.
In other words - I coded in Squirell in the same way like in C. So far without problems (except that http://www.tt-forums.net/viewtopic.php?p=881759#p881759 ). Coding in Java is (for me) sth completely other than Squirell.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Steffl
Engineer
Engineer
Posts: 103
Joined: 23 Feb 2010 15:44

Re: AIAI delta2 version

Post by Steffl »

Hi Kogut, I found a little bug in your AI.
I was loading a game on a little 64x64 map and AIAI crashed after a short time.
Attachments
Crash after loading
Crash after loading
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI delta2 version

Post by Kogut »

It is fixed in development version (epsilon). Unfortunatelly uploading development version is very bad idea, so it may be needed to wait about week.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Wardjp
Engineer
Engineer
Posts: 2
Joined: 13 Jun 2010 05:15

Re: AIAI delta2 version

Post by Wardjp »

I see, thanks :) I'll have a look and start working with C++ etc.
Edit or with java and such, java seems to be A LOT more complicated and different than the normal programming language though :p
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI delta2 version

Post by Kogut »

AIAI constructed first train! (and crashed in next tick)
Special thanks for authors of AdmiralAI (depot construction) and Denver & Rio Grande (best engine/wagon finder, train construction).
Attachments
epsilon.png
epsilon.png (50.33 KiB) Viewed 5883 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Brumi
President
President
Posts: 920
Joined: 18 Jul 2009 17:54

Re: AIAI delta2 version

Post by Brumi »

I can't wait to see your AI using trains! Congratulations! :D
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: AIAI delta2 version

Post by Lord Aro »

woah!
its going to be completely unbeatable now!
and Rondje might be getting its crown taken away pretty soon... :bow:
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
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI delta2 version

Post by Kogut »

Rondje is already dead on large maps (airplanes, Rondje can active manage with no more than 500 RV)
Second bridge lover :P
Attachments
epsilon.png
epsilon.png (92.58 KiB) Viewed 5851 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI delta2 version

Post by Kogut »

delta3 uploaded to bananas

===========
Epsilon changelog
- Cargo trains! [really stupid cargo trains]
- Support for 2cc, NARS, default trains. Probably also other newgrf.
- Removes useless railways
- RV stations use both directions
- industry to industry plane routes (av8 or other cargo planes needed)
- Airport capacity bug fixed
- Bus buying bug fixed
- Passengers are no longer "processed cargo"
- capping truck stations with depots, if circle around station failed
- Fixed ignored "Trucks allowed" setting

TODO
- smarter trains
- ChooChoo's pathfinder
Attachments
AIAI-epsilonOMGtrain.tar
(202.5 KiB) Downloaded 196 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI delta2 version

Post by Kogut »

Changelog
- Faster pathfinder (from ChooChoo)
- train upgrader
- smarter rail connection
- suicide company will be closed below one year after starting (water destroying & tree planting)
- suicide controlled by option (but disabling it is unsupported feature and may result in multiple instances of AIAI building in the same place)
- support for ISR
Attachments
AIAI-epsilon18.tar
(249 KiB) Downloaded 177 times
Przechwytywanie.PNG
Przechwytywanie.PNG (124.04 KiB) Viewed 5765 times
AIAI is red colour.PNG
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI delta2 version

Post by Kogut »

Updated, bug fixed
Attachments
AIAI-epsilon-27.tar
(247.5 KiB) Downloaded 206 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Brumi
President
President
Posts: 920
Joined: 18 Jul 2009 17:54

Re: AIAI epsilon (26) version

Post by Brumi »

I'm trying to replicate Samu's latest game to discover why the AIs go bankrupt.
AIAI seems to have frozen, its last log entry is 5 years old:
Attachments
AIAI frozen.png
AIAI frozen.png (43.81 KiB) Viewed 1192 times
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI epsilon (26) version

Post by Kogut »

Thanks, fortunatelly it is fixed in development version.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Steffl
Engineer
Engineer
Posts: 103
Joined: 23 Feb 2010 15:44

Re: AIAI epsilon (26) version

Post by Steffl »

Hi Kogut, please test your AI with high building costs. In my tests it always tried to build a rail connection but can't afford it.Maybe it's better to start with road vehicles then.
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI epsilon (26) version

Post by Kogut »

Steffl wrote:Hi Kogut, please test your AI with high building costs. In my tests it always tried to build a rail connection but can't afford it.Maybe it's better to start with road vehicles then.
Next version is going to contain new menagement.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI epsilon (26) version

Post by Kogut »

Brumi wrote:I'm trying to replicate Samu's latest game to discover why the AIs go bankrupt.
AIAI seems to have frozen, its last log entry is 5 years old:
Thanks, unfortunatelly it is still unfixed. Please, send me information whet it will happen.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI epsilon (31) version

Post by Kogut »

Tested on 20027.
Changelog
Michiel wrote:But yeah, I think I see where some of the difficulty comes from. It's very crowded, and the trains are severely underpowered, crawling uphill at 9 km/h, which means they make little profit.
- Is is fixed!

- credit list updated (ChooChoo)
- single bus bug fix
- licence updated (fixed Copyright (C) <year> <name of author>)
- better loan management
- HasNext changed into IsEnd
- Other updates to 1.1 NoAI API
- train builders ignore small industries
- control of minimal train station size
- empty RV stations are removed
- grammar error corrected
- order bug fixed
- autorenew enabled only for games with breakdowns
- freeze bug fixed
Attachments
AIAI-epsilon-31.tar
(256 KiB) Downloaded 185 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
deamonhunter11
Engineer
Engineer
Posts: 56
Joined: 10 Mar 2010 08:23

Re: AIAI epsilon (31) version

Post by deamonhunter11 »

AIAI epsilon 31 does not seem to want to appear in 1.0.2 but appears in r20037
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 14 guests