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

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

Re: AIAI

Post by Zuu » 06 Jul 2012 11:05

Unless you have added a new setting or renamed the existing setting, existing savegames with airports enabled will still have airports enabled.

So if you have 1.2.1 and an existing savegame created with an older version of AIAI, you need to manually ensure that airports/airplanes are turned off for AIAI.
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

Post by Kogut » 07 Jul 2012 00:09

Zuu wrote:Unless you have added a new setting or renamed the existing setting, existing savegames with airports enabled will still have airports enabled.

So if you have 1.2.1 and an existing savegame created with an older version of AIAI, you need to manually ensure that airports/airplanes are turned off for AIAI.
Uh-oh. Thanks for the info.
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

Post by Kogut » 07 Jul 2012 07:18

Kogut wrote:
Zuu wrote:Unless you have added a new setting or renamed the existing setting, existing savegames with airports enabled will still have airports enabled.

So if you have 1.2.1 and an existing savegame created with an older version of AIAI, you need to manually ensure that airports/airplanes are turned off for AIAI.
Uh-oh. Thanks for the info.
Fixed, thanks, new version available on bananas.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD

bokkie
Transport Coordinator
Transport Coordinator
Posts: 326
Joined: 19 Jan 2007 19:26

Re: AIAI

Post by bokkie » 27 Jul 2012 12:15

Error! Can I do more to help you next to posting the screenshot?
Attachments
My First Transport Company, 18 Aug 1956.png
My First Transport Company, 18 Aug 1956.png (46.13 KiB) Viewed 4043 times

Shadowism
Engineer
Engineer
Posts: 1
Joined: 30 Jul 2012 03:50

Re: AIAI

Post by Shadowism » 30 Jul 2012 03:55

As asked, here it is, a print from a bug.

Thank you for your AI!
Good luck solving it's problem. :D
Attachments
Sem título.png
(235.02 KiB) Downloaded 8 times

MAG101
Engineer
Engineer
Posts: 28
Joined: 14 Dec 2011 00:55

Re: AIAI

Post by MAG101 » 03 Aug 2012 12:49

AI Crash I got a crash right after loaded a game, Theres a savegame where AI crash


Seoundy any wip feature planned or inproved
Attachments
Rarnpool-Tarningworth Railway, 15th Dec 1993.png
(344.31 KiB) Downloaded 7 times
Rarnpool-Tarningworth Railway, 31st Oct 1993.sav
(57.28 KiB) Downloaded 121 times

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

Re: AIAI

Post by Kogut » 01 Oct 2012 20:15

Fixed, thanks for reports!

NOTE: Thanks to inability to include Pathfinder.Road v3 as required file on BaNaNaS fixing BaNaNaS version is delayed till I discover what happened in v4.
Attachments
AIAI-iota10.tar
(293.5 KiB) Downloaded 130 times
Last edited by Kogut on 01 Oct 2012 20:30, edited 1 time in total.
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

Post by Zuu » 01 Oct 2012 20:23

Did you buy TrueBrain some cookies to set SuperLib 24 as dependency at bananas? If not, I would suggest using the same library version in your AI as you use as dependency on BaNaNaS. This also holds for the road path finder where you use version 3 while the last version on bananas is version 4.

When updating to RPF 4 you might want to refer to this thread:
RPF (Road path finder) Updates - Version 4
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

Post by Kogut » 01 Oct 2012 20:31

Superlib is not a problem, nothing is supposed to be broken but RoadPathfinder change is rather fun as I am not sure what happened.
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

Post by Zuu » 01 Oct 2012 20:39

Did you read my post in that RPF thread? If so, please write there what you didn't understand. I made my best to explain the changes, but if its still unclear, please give me a hint on what needs more clarification.
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

Post by Kogut » 01 Oct 2012 20:44

OK, this version seems to work. I really hope that only code using that uses _Cost function needs to be changed.

Upgraded to Superlib v26 (nothing changed)
Upgraded to RoadPathFinder v4 (I hope that only this fix was required)

Uploaded to BaNaNaS as it fixes serious bug and it is now possible to enable planes.

EDIT: It seems that it also includes a bit more - according to my notes:

[feature] better autoreplacing
[fix] handle rare problem (engine expired during route construction) rather than crash AI
[fix] road vehicles were not added to station despite huge amounts of waiting cargo
[change] better description of options, better debug options
[feature] smarter (I hope) rail depot construction
Attachments
AIAI-iota10.tar
(300 KiB) Downloaded 111 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

Post by Kogut » 06 Oct 2012 14:42

[change] beter money menagement (train before passing lanes)
[change] wait for money during construction of passing lanes rather than immediately abandon project
[fix] request money before cloning RV
[change] handle economy.infrastructure_maintenance - by disabling aircrafts if this is set to true, as currently AI is unable to make sure that airplanes will get profitable
[fix] creating impossible aircraft connections (with limited range aircrafts)
[savegame combatibility] MinVersionToLoad bumped

Known bug: vehicles suddenly getting invalid (happens around once in 900 in-game years). Nothing new, I am trying to find how this happens for years.
Attachments
AIAI-iota11.tar
(299.5 KiB) Downloaded 109 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

Post by Kogut » 06 Oct 2012 15:47

[fix] fix attempting to clone first vehicle from the empty list
[fix] copy-paste failure

Known bugs:

vehicles suddenly getting invalid (happens around once in 900 in-game years). Nothing new, I am trying to find how this happens for years.
creating impossible aircraft connections (with limited range aircrafts) (found yet another case of this)
Attachments
AIAI-iota12.tar
(299.5 KiB) Downloaded 110 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

Post by Kogut » 08 Oct 2012 10:47

[fix] fix attempting to clone first vehicle from the empty list
[fix] copy-paste failure
[fix] train refuses to be sold, goes mad

Known bug: vehicle suddenly getting invalid in the middle of function (happens around once in 1000 in-game years). Nothing new, I am trying to find how this happens for years.
Known bug: creating impossible routes for aircrafts with a maximum range

Won't fix bug: With enabled infrastructure maintenance costs even mature company may go bankrupt. Due to missing functions in NoAI API there is no sane way to prevent this (see http://www.tt-forums.net/viewtopic.php? ... 3#p1049303)
Attachments
AIAI-iota13.tar
(300 KiB) Downloaded 112 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

Post by Kogut » 12 Oct 2012 17:10

[fixed] With enabled infrastructure maintenance costs even mature company may go bankrupt.
[fixed] Self crossing, deadlocking train routes
[fixed] Pointless train replacing due to loading and newgrf enforced restrictions
[fixed] Creating impossible routes for aircrafts with a maximum range
[update] Code copied from AdmiralAI (RailBuilder::BuildDepot) copied again, updated to modern API
[disabled] Cargo planes are disabled
[change] Gmund Mog mania is finally ended, speed is no longer the only factor in selecting faster vehicles
[change] Smarter choosing of train length (with passengers/mail and other nonfreight)
[change] Supposedly smarter selecting of destinations

Known bug: vehicle suddenly getting invalid in the middle of function (happens around once in 1000 in-game years).

Known problem: Aircrafts are disabled with enabled economy.infrastructure_maintenance

This is a release candidate.

EDIT: Uploaded to BaNaNaS
Attachments
AIAI-iota14.tar
(290.5 KiB) Downloaded 183 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD

krinn
Transport Coordinator
Transport Coordinator
Posts: 336
Joined: 29 Dec 2010 19:36

Re: AIAI

Post by krinn » 30 Oct 2012 19:11

here's a log, aiaiv18 crash openttd (something with aircraft planning route)
Attachments
ttdlog.txt
(17.55 KiB) Downloaded 136 times

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

Re: AIAI

Post by Kogut » 01 Nov 2012 11:41

1) It is a full OpenTTD crash what AI should not be able to do (so it is problem in OpenTTD, not my AI)
2) In this game Newgrf were changed during game, so crashes and other problems should not be reported (see big red warning - http://wiki.openttd.org/images/a/a6/Newgrf_warning.png )
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD

User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2365
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: AIAI

Post by Lord Aro » 01 Nov 2012 13:54

Kogut wrote:2) In this game Newgrf were changed during game, so crashes and other problems should not be reported (see big red warning - http://wiki.openttd.org/images/a/a6/Newgrf_warning.png )
Actually, i don't think they were
The GRFs you see in the log are the ones added at startup, not added/changed during game...
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

Post by Kogut » 01 Nov 2012 19:26

:oops:

BTW, you play on 1.2.1 OpenTTD - at least one bug where AI was able to crash openTTD was fixed in 1.2.2, so I recommend to update your game.

If problem persists in recent version - please report crash on http://bugs.openttd.org/
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD

Ric_
Engineer
Engineer
Posts: 1
Joined: 21 Nov 2012 13:59

Re: AIAI

Post by Ric_ » 21 Nov 2012 14:04

Posting savegame and screenshot after AIAI crash.

Great achievement nonetheless!

Ric
Attachments
NewCo, 22-12-1958.png
(143.95 KiB) Downloaded 2 times
NewCo AI crash, 09-05-1966.sav
(569.45 KiB) Downloaded 94 times

Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 1 guest