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

Steffl
Engineer
Engineer
Posts: 103
Joined: 23 Feb 2010 15:44

Re: AIAI

Post by Steffl » 30 Nov 2012 17:54

Hi,
I'm here to report another bug. AIAI version iota 14, Ottd 1.2.2
I think also it doesn't earn money so fast as previous versions but I don't watch it enough to tell you why I think so.

Looks like it is only a little bug. Have fun to fix it. :-)

Bigrederror.png
(188.23 KiB) Downloaded 17 times

s_kitty
Engineer
Engineer
Posts: 3
Joined: 09 Dec 2012 00:48

Re: AIAI

Post by s_kitty » 09 Dec 2012 01:00

Suggestion:

If you already have a station very close by, do not build another one and just make the road slightly longer instead.
Saving the money by not building another station will outweigh saving a few tiles of distance.

In the attached picture, stations numbered 8, 9 and 14 all service the same thing and are all within 8 tiles of each other. IMO It should have connected everything to station 8. The drive time would not be too much different and the construction cost would be quite a bit less since road is A LOT cheaper than stations.
Attachments
redundent.png
(297.41 KiB) Downloaded 16 times

Brumi
President
President
Posts: 904
Joined: 18 Jul 2009 17:54

Re: AIAI

Post by Brumi » 09 Dec 2012 12:53

One should be careful when merging stations: station 14 is used to pick up food, the other two are unloading stations. If you merge all three, a deadlock may occur: the station is filled with food trucks waiting because there is no food at the station, and the other trucks cannot unload because the station is full.

s_kitty
Engineer
Engineer
Posts: 3
Joined: 09 Dec 2012 00:48

Re: AIAI

Post by s_kitty » 09 Dec 2012 18:28

That is true. But those stations certainly do not look very crowded.

Also if the stations are used for unloading only, the time taken is much shorter so merging should be ok.

Steffl
Engineer
Engineer
Posts: 103
Joined: 23 Feb 2010 15:44

Re: AIAI

Post by Steffl » 21 Dec 2012 11:28

Hi Kogut,
here is another error. Your AI found something to complain about...
I hope screenshot is enough, autosave was already overwritten.

aiai.png
(26.92 KiB) Downloaded 12 times

User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5388
Joined: 13 Sep 2004 13:21
Location: The Moon
Contact:

Re: AIAI

Post by PikkaBird » 04 Feb 2013 09:42

Steffl wrote:Hi Kogut,
here is another error. Your AI found something to complain about...
I hope screenshot is enough, autosave was already overwritten.
There was a post about this on reddit too. It appears to be caused by the AI being told by the GRF that it can't start the aircraft; in this case, because the destination airport is out of range, in the case on reddit because the AI decided to build a seaplane.

The range is hopefully something you can test for, the seaplanes on the other hand you might have to make a special case (grfID 44440a01, aircraft IDs 0x56 and 0x57). OpenTTD devs: this is a good example of where the buylist control callbacks which have been suggested (to deny certain players building certain vehicles) would be useful! :)

Oscar9999
Engineer
Engineer
Posts: 8
Joined: 05 Feb 2013 11:40

About AIAI AI (The AI is named AIAI)

Post by Oscar9999 » 06 Feb 2013 17:21

This AI keeps crashing on me, I do not really know why, except it says that the next station is too far away.

If anyone wants to/can help, I'd appreciate it, The savegame and a screenshot is included.
Attachments
Ballan's Transport Inc., 9th Nov 1964.sav
The savegame.
(1.95 MiB) Downloaded 104 times
Ballan's Transport Inc., 9th Nov 1964#6.png
And the screenshot.
(151.68 KiB) Downloaded 9 times

Arie-
Director
Director
Posts: 593
Joined: 20 Jan 2009 16:07

Re: AIAI

Post by Arie- » 07 Feb 2013 10:37

Perhaps an issue with the range properties of the aircraft? Maybe the two airports are too far apart, a while ago a feature was introduced that allowed to set range limits on aircraft.

Oscar9999
Engineer
Engineer
Posts: 8
Joined: 05 Feb 2013 11:40

Re: AIAI

Post by Oscar9999 » 07 Feb 2013 20:22

Arie- wrote:Perhaps an issue with the range properties of the aircraft? Maybe the two airports are too far apart, a while ago a feature was introduced that allowed to set range limits on aircraft.

I looked around a bit, I can't find any range property to modify.

Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4738
Joined: 09 Sep 2007 05:03
Location: home

Re: AIAI

Post by Alberth » 07 Feb 2013 20:33

Oscar9999 wrote:I looked around a bit, I can't find any range property to modify.
It is not your range to modify.

Aircraft NewGRFs got the option to set a maximum range they can fly until the next airport (before it was always "unlimited"). Some NewGRF author took that opportunity to add such a limit to their aircraft.
Obviously, this new limit also holds for AIs.

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

Re: AIAI

Post by Kogut » 12 Mar 2013 09:13

I am back!

As result of long inactivity, multiple system reinstalations and messy backuping I lost my work in progress - so I will probably restart work from current BaNaNaS version.

To avoid this problem in future and feel more professional I upgraded my source control from "lets post .tars to forum" to git - with repository at https://github.com/Bulwersator/AIAI

Bug reports may be now reported directly to bugtracker on github, in this topic or via mail.

Steffl wrote:Hi,
I'm here to report another bug. AIAI version iota 14, Ottd 1.2.2
I think also it doesn't earn money so fast as previous versions but I don't watch it enough to tell you why I think so.

Looks like it is only a little bug. Have fun to fix it. :-)

Bigrederror.png
Thanks for report - copied to https://github.com/Bulwersator/AIAI/issues/3
s_kitty wrote:Suggestion:

If you already have a station very close by, do not build another one and just make the road slightly longer instead.
Saving the money by not building another station will outweigh saving a few tiles of distance.

In the attached picture, stations numbered 8, 9 and 14 all service the same thing and are all within 8 tiles of each other. IMO It should have connected everything to station 8. The drive time would not be too much different and the construction cost would be quite a bit less since road is A LOT cheaper than stations.

AIAI services one cargo per station to keep things sane and I doubt that it will be changed in this century.
Steffl wrote:Hi Kogut,
here is another error. Your AI found something to complain about...
I hope screenshot is enough, autosave was already overwritten.

aiai.png
Thanks for report - copied to https://github.com/Bulwersator/AIAI/issues/4
Oscar9999 wrote:This AI keeps crashing on me, I do not really know why, except it says that the next station is too far away.

If anyone wants to/can help, I'd appreciate it, The savegame and a screenshot is included.
Thanks for report - copied to https://github.com/Bulwersator/AIAI/issues/5
PikkaBird wrote:
Steffl wrote:Hi Kogut,
here is another error. Your AI found something to complain about...
I hope screenshot is enough, autosave was already overwritten.
There was a post about this on reddit too. It appears to be caused by the AI being told by the GRF that it can't start the aircraft; in this case, because the destination airport is out of range, in the case on reddit because the AI decided to build a seaplane.

The range is hopefully something you can test for, the seaplanes on the other hand you might have to make a special case (grfID 44440a01, aircraft IDs 0x56 and 0x57). OpenTTD devs: this is a good example of where the buylist control callbacks which have been suggested (to deny certain players building certain vehicles) would be useful! :)
Weird, I am unable to find this reddit post. Well, I will try to enable seaplane newgrf and see what happens. Tracked as https://github.com/Bulwersator/AIAI/issues/6
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD

User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5388
Joined: 13 Sep 2004 13:21
Location: The Moon
Contact:

Re: AIAI

Post by PikkaBird » 12 Mar 2013 09:25

Kogut wrote:Weird, I am unable to find this reddit post. Well, I will try to enable seaplane newgrf and see what happens. Tracked as https://github.com/Bulwersator/AIAI/issues/6
FWIW, the latest version of Av8 removes the seaplanes from the buylist altogether if the parameter to use them is not selected, rather than allowing them to be built but not started. You will still have the problem with out-of-range orders.

Samu
Traffic Manager
Traffic Manager
Posts: 236
Joined: 17 Apr 2007 14:28

Re: AIAI

Post by Samu » 04 Apr 2013 20:05

Hey all. I'm back to this game again. Got bored of all other games. Decided to go AI versus AI.

First report in a long time goes to AIAI.

the index 'Count' does not exist
Attachments
Unnamed, 2016-12-23.png
(34.91 KiB) Downloaded 7 times

Samu
Traffic Manager
Traffic Manager
Posts: 236
Joined: 17 Apr 2007 14:28

Re: AIAI

Post by Samu » 12 Apr 2013 20:44

another crash found

division by zero

Using AIAI v87. Not sure what it was trying to do.
Attachments
aiai v87 crash.sav
(3.95 MiB) Downloaded 77 times
screenshot#3.png
(49.04 KiB) Downloaded 5 times

Gankenstein
Engineer
Engineer
Posts: 38
Joined: 28 Mar 2013 13:30

Re: AIAI

Post by Gankenstein » 13 Apr 2013 17:56

AIAI crash: AIRCRAFT_DEST_TOO_FAR followed by division by zero. It appears to be AIAI's first airplane.
AIAI (v87).
Attachments
Helemaal te gek BV.sav
(1.75 MiB) Downloaded 77 times
aiai v87 crash 20130413.PNG
aiai v87 crash 20130413.PNG (32.43 KiB) Viewed 3705 times

jogi
Engineer
Engineer
Posts: 10
Joined: 27 Apr 2013 20:47

Re: AIAI

Post by jogi » 27 Apr 2013 21:12

Hi there

I just started playing this game, and during my first tries playing with AI opponents, I encountered a bug,hich segfaults the programm. I have put a savefile in the attachment, after a few seconds in high speed mode, it will crash. I don't know why exactly, but it oobviously causes a Segfault.

How can you make such detailed reports like in the post above? I'm a bit interested in what's going on behind the scenes and I'm not afraid of looking at the code, so do you have any pointers for me?

jogi
Attachments
crashsave.sav
Just let it Run, it will crash
(115.09 KiB) Downloaded 81 times
crash.log.txt
(2.54 KiB) Downloaded 133 times

Brumi
President
President
Posts: 904
Joined: 18 Jul 2009 17:54

Re: AIAI

Post by Brumi » 28 Apr 2013 10:21

It does not crash for me even after 10 years if I load your savegame.
In your case it was OpenTTD itself which crashed, not AIAI, OpenTTD crashes can be reported at bugs.openttd.org (make sure to include your crash.dmp file in the report).
If the AI crashes and not OpenTTD, you will get a similar window as Gankenstein. In that case simply take a screenshot of that window (Ctrl+S).

jogi
Engineer
Engineer
Posts: 10
Joined: 27 Apr 2013 20:47

Re: AIAI

Post by jogi » 28 Apr 2013 16:35

Thanks for the clarification. I know, it had clearly to do something with the AI, because whenever I played from this point in the game, a few seceonds later on high speed, it crashed, but when I stopped the AI, it didn't.

However, I have now upgraded to Ubuntu 13.04 and now the crash has disappeared. I guess, there was a new Version in the repositories.

jogi

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9288
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: AIAI

Post by planetmaker » 09 May 2013 17:00

Likely this has been reported before... AIAI was doing quite well and then sadly died:

Code: Select all

dbg: [script] [2] [S] Your script made an error: the index 'Count' does not exist
dbg: [script] [2] [S] 
dbg: [script] [2] [S] *FUNCTION [ValuateConsumer()] aiai-iota14/Builder.nut line [31]
dbg: [script] [2] [S] *FUNCTION [FindPairDeepWrapped()] aiai-iota14/findpair.nut line [65]
dbg: [script] [2] [S] *FUNCTION [Go()] aiai-iota14/ROAD/TruckRoadBuilder.nut line [45]
dbg: [script] [2] [S] *FUNCTION [TryEverything()] aiai-iota14/main.nut line [124]
dbg: [script] [2] [S] *FUNCTION [Start()] aiai-iota14/main.nut line [59]
dbg: [script] [2] [S] 
dbg: [script] [2] [S] [score] 0
dbg: [script] [2] [S] [cargo] 9
dbg: [script] [2] [S] [ID] 69
dbg: [script] [2] [S] [this] INSTANCE
dbg: [script] [2] [S] [base] 0
dbg: [script] [2] [S] [industry_list_accepting_current_cargo] INSTANCE
dbg: [script] [2] [S] [cargo_list] INSTANCE
dbg: [script] [2] [S] [new] 0
dbg: [script] [2] [S] [best] 2419200
dbg: [script] [2] [S] [choise] INSTANCE
dbg: [script] [2] [S] [industry_list] INSTANCE
dbg: [script] [2] [S] [FindEngine] CLOSURE
dbg: [script] [2] [S] [ToCityStationAllocator] CLOSURE
dbg: [script] [2] [S] [GetNiceTownForMe] CLOSURE
dbg: [script] [2] [S] [DualIndustryStationAllocator] CLOSURE
dbg: [script] [2] [S] [distanceBetweenIndustriesValuator] CLOSURE
dbg: [script] [2] [S] [ValuateConsumer] CLOSURE
dbg: [script] [2] [S] [IsConsumerOK] CLOSURE
dbg: [script] [2] [S] [ValuateProducer] CLOSURE
dbg: [script] [2] [S] [IsConnectedIndustry] CLOSURE
dbg: [script] [2] [S] [IsProducerOK] CLOSURE
dbg: [script] [2] [S] [GetIndustryList] CLOSURE
dbg: [script] [2] [S] [traska] INSTANCE
dbg: [script] [2] [S] [this] INSTANCE
dbg: [script] [2] [S] [i] 0
dbg: [script] [2] [S] [this] INSTANCE
dbg: [script] [2] [S] [i] 3
dbg: [script] [2] [S] [builders] ARRAY
dbg: [script] [2] [S] [this] INSTANCE
dbg: [script] [2] [S] [builders] ARRAY
dbg: [script] [2] [S] [this] INSTANCE
dbg: [script] The script died unexpectedly.
Attachments
autosave15.sav
savegame from before the crash
(322.67 KiB) Downloaded 82 times
ogfx-landscape.tar
NewGRF needed for loading savegame
(2.25 MiB) Downloaded 73 times

Phrossi_TTD
Engineer
Engineer
Posts: 79
Joined: 12 Feb 2013 17:29

Re: AIAI

Post by Phrossi_TTD » 02 Jun 2013 14:54

i had both bugs happen.
but the division by zero bug happened when the ai was building an RV.
screen below.
Attachments
bug2.png
(192.54 KiB) Downloaded 1 time
Activity-absent for now.
PLEASE DO NOT REPLY TO MY MESSAGES ANYMORE!

Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 2 guests