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 »

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 »

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
redundent.png (297.41 KiB) Viewed 3632 times
Brumi
President
President
Posts: 920
Joined: 18 Jul 2009 17:54

Re: AIAI

Post by Brumi »

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 »

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 »

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

aiai.png
aiai.png (26.92 KiB) Viewed 3628 times
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5601
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: AIAI

Post by PikkaBird »

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 »

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 232 times
And the screenshot.
And the screenshot.
Ballan's Transport Inc., 9th Nov 1964#6.png (151.68 KiB) Viewed 3625 times
Arie-
Director
Director
Posts: 593
Joined: 20 Jan 2009 16:07

Re: AIAI

Post by Arie- »

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 »

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: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: AIAI

Post by Alberth »

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 »

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: 5601
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: AIAI

Post by PikkaBird »

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 »

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 »

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 206 times
screenshot#3.png
(49.04 KiB) Downloaded 5 times
Gankenstein
Engineer
Engineer
Posts: 41
Joined: 28 Mar 2013 13:30

Re: AIAI

Post by Gankenstein »

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 204 times
aiai v87 crash 20130413.PNG
aiai v87 crash 20130413.PNG (32.43 KiB) Viewed 12106 times
jogi
Engineer
Engineer
Posts: 10
Joined: 27 Apr 2013 20:47

Re: AIAI

Post by jogi »

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 190 times
crash.log.txt
(2.54 KiB) Downloaded 257 times
Brumi
President
President
Posts: 920
Joined: 18 Jul 2009 17:54

Re: AIAI

Post by Brumi »

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 »

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: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: AIAI

Post by planetmaker »

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 201 times
ogfx-landscape.tar
NewGRF needed for loading savegame
(2.25 MiB) Downloaded 200 times
Phrossi_TTD
Engineer
Engineer
Posts: 79
Joined: 12 Feb 2013 17:29

Re: AIAI

Post by Phrossi_TTD »

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: Google [Bot] and 5 guests