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 gamma2 version

Post by Kogut »

Thanks for good news!
Here is new fix for gamma version:
- never service the same industry using truck and plane
- credits for reused code
- fixed company name bug
Attachments
aiai_gamma2.tar
(125 KiB) Downloaded 211 times
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 gamma2 version

Post by Zuu »

Thanks for the credits. I took a look, and I wonder why do you have a copy of ItemValuator in your KRAI_level_crossing_menagement_from_clueless_plus.nut? Why not use the one in SuperLib.Helper? I see you have already imported SuperLib.Helper, .Direction and .Tile even if I can't see that you have used any of those functions in your own code.
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 gamma2 version

Post by Kogut »

I will fix it next version, probably I copied valuator and later also included library. Library is (so far) for level crossing menagement only.
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 gamma2 version

Post by Kogut »

Fixed, together with spam of debug signs.
Attachments
aiai_gamma3.tar
(125 KiB) Downloaded 208 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 gamma3 version

Post by Kogut »

AIAI uploaded to BaNaNaS!
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
donchatryit
Transport Coordinator
Transport Coordinator
Posts: 259
Joined: 16 Mar 2009 21:00

Re: AIAI gamma3 version

Post by donchatryit »

A quick bug report for you. Not sure what caused this crash. Playing in OpenTTD 1.0.0 with two other AIs (NoCAB and StreetCars). Medium difficulty, temperate mat 256x512. Windows Vista 32 bit.
Crash!
Crash!
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI gamma3 version

Post by Kogut »

Fixed, your game will be OK after save & load. (But it can break other AIs).

EDIT: Bananas updated, why download counter is now 0?
EDIT: Problem caused by AIVehicle.sth instead of AIError.sth.
EDIT: Thanks for bug report.
Attachments
AIAI-gamma4.tar
(126 KiB) Downloaded 191 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
donchatryit
Transport Coordinator
Transport Coordinator
Posts: 259
Joined: 16 Mar 2009 21:00

Re: AIAI gamma4 version

Post by donchatryit »

Thanks Kogut. Will the update be on BaNaNAS?
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI gamma4 version

Post by Kogut »

Already updated
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
donchatryit
Transport Coordinator
Transport Coordinator
Posts: 259
Joined: 16 Mar 2009 21:00

Re: AIAI gamma4 version

Post by donchatryit »

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

Re: AIAI gamma3 version

Post by Zuu »

Kogut wrote:EDIT: Bananas updated, why download counter is now 0?
Because it shows the number of downloads of the last version. In the manage page you can see the number of downloads of each version of your AI(s).
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 delta version

Post by Kogut »

Delta version
- busses (with dynamic full load menagement)
- better airports (use more airpots types, more than one airport in cities etc)
- recoded vital part of truck part
Attachments
AIAI-delta.tar
(142 KiB) Downloaded 195 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: AIAI delta version

Post by Morloth »

Hey Kogut,

Your AI is really shaping up well! Just found a bug you want to look at while testing it:
Attachments
Crash :'(
Crash :'(
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI delta version

Post by Kogut »

I see no reason why AIIndustryType.GetProducedCargo(AIIndustry.GetIndustryType(ID)) returned null, but I fixed it.
Attachments
AIAI-delta2.tar
(142 KiB) Downloaded 199 times
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 »

Hmm,

I actually don't know if there is a policy in the API to always return empty lists over returning null, but I would certainly check this issue with Yexo. If it is intended behaviour, perhaps that's something that should be added to the documentation:
http://noai.openttd.org/docs/1.0.0/clas ... 19f1a10bda
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:Hmm,

I actually don't know if there is a policy in the API to always return empty lists over returning null, but I would certainly check this issue with Yexo. If it is intended behaviour, perhaps that's something that should be added to the documentation:
http://noai.openttd.org/docs/1.0.0/clas ... 19f1a10bda
I discovered that it happened when function is stuffed with incorect ID. (Stupid industry closed itself at wrong time)
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 »

Haha, your AIAI thinks it is General Motors. :-)

It's fun to watch your AI fighting against getting bankrupt. Nice work Kogut :-)
Attachments
Hamilton & Co., 6. Nov 1963.png
Hamilton & Co., 6. Nov 1963.png (4.7 KiB) Viewed 5883 times
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI delta2 version

Post by Kogut »

Maybe in future that text will be rather useless. I see that it is high speed train era, rather but time for truck only AI.
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 »

So is the delta2 the latest version or is the gamma4 the latest? 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?
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 »

At http://wiki.openttd.org/AI:Main_Page you can get information about AI writing for OpenTTD. This is recommended if you feel like getting into how AIs are programmed.

From your question it seemed that you are also new to programming? If that's the case I'd suggest to learn programming by for example starting out with python, C++ or any other language. Opt for a commonly used language to start with, as there are more tutorials and easier to find books for that language. You should probably at least write a few not too simple applications before getting into AIs.

The problem with the OpenTTD AIs for programmer newbies is that the language used (Squirrel) only has a reference document, no tutorial that holds your hand and teach you how to program. Most of the documentation for Squirrel and NoAI is oriented towards people who already know how to program, and only need to learn the details regarding Squirrel and the NoAI API.
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 13 guests