BorkAI

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

marco.r
Engineer
Engineer
Posts: 37
Joined: 16 Aug 2011 01:26

Re: BorkAI

Post by marco.r »

Phrossi_TTD wrote:
R-TEAM wrote:Hi,

The AI runs pretty good ...
But after an load of an savegame he crashes first time .... then after reload of AI it runs nice again ...
This happen every load of an save.
Actual HardGame version ... many NewGFX ...
Savegame + pictures included.

Regards
R-TEAM
same here, loaded 1913 save and crash!
see attachments below.
it needs last FISH and 2cc trainset nightly at devzone at http://bundles.openttdcoop.org/
The release you had (16) was still bugged. I've tried with the latest (rel 17) and seem lo load fine
(the AI doesn't do very well though... I'll have to start testing with nonstandard vehicles...).
Please let me know if you have issues with the latest too.
marqjc
Engineer
Engineer
Posts: 17
Joined: 12 Dec 2013 14:39
Location: Uruguay

Re: BorkAI

Post by marqjc »

After installing the BorkAI-17 found that it defends pretty well, making the game a very enjoyable game. No operational problems presented, beyond the occasional jam, you can spend a good time with Bork! :)


Image
marco.r
Engineer
Engineer
Posts: 37
Joined: 16 Aug 2011 01:26

Re: BorkAI

Post by marco.r »

Glad to know that you liked it :)
Do you have a savegame with the jam ?
I'll try to put a "jam cleanup" mechanism during the holidays
marqjc
Engineer
Engineer
Posts: 17
Joined: 12 Dec 2013 14:39
Location: Uruguay

Re: BorkAI

Post by marqjc »

marco.r wrote:Glad to know that you liked it :)
Do you have a savegame with the jam ?
I'll try to put a "jam cleanup" mechanism during the holidays
I attached a savegame where you can see the jam. Other than that ... if that Bork is gaining impresses, me is just a momentary thing. :D

Happy holidays!
Attachments
Juan Carlos Transport, 26º Mar 1970.sav
Savegame
(122.99 KiB) Downloaded 194 times
HGus
Engineer
Engineer
Posts: 121
Joined: 12 May 2013 22:28
Location: Argentina

Re: BorkAI

Post by HGus »

Hi, nice AI, it was in first place in one of my games for 35 years, even over older Clueless, but for some strange reason it forgot to renew their vehicles, going bankrupt. Maybe a bug, maybe bad luck. I was using FIRS/eGVRTS2 on a almost flat 1024x1024 map.
Attachments
screenshot, BorkAI going bankrupt, all vehicles aging
screenshot, BorkAI going bankrupt, all vehicles aging
HGus Transport, 1841-11-03.png (87.15 KiB) Viewed 946 times
HGus Transport, 1828-06-02.sav
savegame before the first vehicle start aging
(2.17 MiB) Downloaded 200 times
marco.r
Engineer
Engineer
Posts: 37
Joined: 16 Aug 2011 01:26

Re: BorkAI

Post by marco.r »

Hi, first of all sorry for the lack of updates.
Yes, it's a bug. As the time progresses the AI tries harder to find new routes, leaving less and less time of "maintenance actions".
This means that the AI will "forget" to do things like renew trucks (they will age, as HGus experienced) or sell them when they are too much (this was marqjc's problem). A quick workaround is to save the game and reload, the AI will start using little time for planning again, and in fact reloading marqjc's savegame seemed to solve the problem. (My AI gives an error in MGus' savegame, I'll try to understand what causes it)

I'll make a fix that should solve both problems, even if it may make the AI a bit less smart.
genericnpc927
Engineer
Engineer
Posts: 7
Joined: 20 Oct 2014 08:37

Re: BorkAI

Post by genericnpc927 »

i think i broke something

Image

i was just casually playing and this happened
Hafting
Engineer
Engineer
Posts: 106
Joined: 13 Feb 2014 11:22

Re: BorkAI

Post by Hafting »

I got the same crash. The bug report is identical down to the first [cargo]. After that, the words are still the same but the numbers vary. I guess I have a different map and possibly different newgrfs.

Code: Select all

dbg: [script] [4] [S] Your script made an error: You are not allowed to execute any DoCommand (even indirect) in your constructor, Save(), Load(), and any valuator.
dbg: [script] [4] [S] 
dbg: [script] [4] [S] *FUNCTION [GetEngineFor()] borkai-18/transport/trucks.nut line [201]
dbg: [script] [4] [S] *FUNCTION [NeededVehicles()] borkai-18/utils/route.nut line [150]
dbg: [script] [4] [S] *FUNCTION [CheckCurrentRoutes()] borkai-18/main.nut line [484]
dbg: [script] [4] [S] *FUNCTION [ManageTransports()] borkai-18/main.nut line [436]
dbg: [script] [4] [S] *FUNCTION [Start()] borkai-18/main.nut line [762]
dbg: [script] [4] [S] 
dbg: [script] [4] [S] [cmp] CLOSURE
dbg: [script] [4] [S] [isNotArticulated] CLOSURE
dbg: [script] [4] [S] [canTransport] CLOSURE
dbg: [script] [4] [S] [isTruck] CLOSURE
dbg: [script] [4] [S] [engineList] ARRAY
dbg: [script] [4] [S] [cargo] 13
dbg: [script] [4] [S] [this] INSTANCE
dbg: [script] [4] [S] [this] INSTANCE
dbg: [script] [4] [S] [@ITERATOR@] 23
dbg: [script] [4] [S] [route] INSTANCE
dbg: [script] [4] [S] [@INDEX@] 22
dbg: [script] [4] [S] [this] INSTANCE
dbg: [script] [4] [S] [this] INSTANCE
dbg: [script] [4] [S] [balance] 21255
dbg: [script] [4] [S] [me] INSTANCE
dbg: [script] [4] [S] [monthly] INSTANCE
dbg: [script] [4] [S] [this] INSTANCE
dbg: [script] The script died unexpectedly.
dbg: [script] [3] [S] Your script made an error: You are not allowed to execute any DoCommand (even indirect) in your constructor, Save(), Load(), and any valuator.
dbg: [script] [3] [S] 
dbg: [script] [3] [S] *FUNCTION [GetEngineFor()] borkai-18/transport/trucks.nut line [201]
dbg: [script] [3] [S] *FUNCTION [EstimateDays()] borkai-18/transport/all.nut line [68]
dbg: [script] [3] [S] *FUNCTION [EstimateGain()] borkai-18/transport/all.nut line [45]
dbg: [script] [3] [S] *FUNCTION [findIndustryRoutes()] borkai-18/main.nut line [250]
dbg: [script] [3] [S] *FUNCTION [FindPossibleRoute()] borkai-18/main.nut line [374]
dbg: [script] [3] [S] *FUNCTION [CreateNewRoutes()] borkai-18/main.nut line [529]
dbg: [script] [3] [S] *FUNCTION [ManageTransports()] borkai-18/main.nut line [438]
dbg: [script] [3] [S] *FUNCTION [Start()] borkai-18/main.nut line [762]
dbg: [script] [3] [S] 
dbg: [script] [3] [S] [cmp] CLOSURE
dbg: [script] [3] [S] [isNotArticulated] CLOSURE
dbg: [script] [3] [S] [canTransport] CLOSURE
dbg: [script] [3] [S] [isTruck] CLOSURE
dbg: [script] [3] [S] [engineList] ARRAY
dbg: [script] [3] [S] [cargo] 18
dbg: [script] [3] [S] [this] INSTANCE
dbg: [script] [3] [S] [distanceInKm] 9296
dbg: [script] [3] [S] [distance] 14
dbg: [script] [3] [S] [cargo] 18
dbg: [script] [3] [S] [to] 150315
dbg: [script] [3] [S] [from] 155439
dbg: [script] [3] [S] [this] INSTANCE
dbg: [script] [3] [S] [distance] 14
dbg: [script] [3] [S] [cargo] 18
dbg: [script] [3] [S] [to] INSTANCE
dbg: [script] [3] [S] [from] INSTANCE
dbg: [script] [3] [S] [this] INSTANCE
dbg: [script] [3] [S] [@ITERATOR@] 1
dbg: [script] [3] [S] [transport] INSTANCE
dbg: [script] [3] [S] [@INDEX@] 0
dbg: [script] [3] [S] [@ITERATOR@] 26
dbg: [script] [3] [S] [to] INSTANCE
dbg: [script] [3] [S] [@INDEX@] 25
dbg: [script] [3] [S] [@ITERATOR@] 2
dbg: [script] [3] [S] [from] INSTANCE
dbg: [script] [3] [S] [@INDEX@] 1
dbg: [script] [3] [S] [consumers] ARRAY
dbg: [script] [3] [S] [producers] ARRAY
dbg: [script] [3] [S] [cargo] 18
dbg: [script] [3] [S] [this] INSTANCE
dbg: [script] [3] [S] [@ITERATOR@] 0
dbg: [script] [3] [S] [cost] NULL
dbg: [script] [3] [S] [@INDEX@] 0
dbg: [script] [3] [S] [cargo] 18
dbg: [script] [3] [S] [this] INSTANCE
dbg: [script] [3] [S] [@ITERATOR@] 0
dbg: [script] [3] [S] [route] NULL
dbg: [script] [3] [S] [@INDEX@] 0
dbg: [script] [3] [S] [@ITERATOR@] 2
dbg: [script] [3] [S] [cargo] INSTANCE
dbg: [script] [3] [S] [@INDEX@] 1
dbg: [script] [3] [S] [routes] ARRAY
dbg: [script] [3] [S] [cargoList] ARRAY
dbg: [script] [3] [S] [this] INSTANCE
dbg: [script] [3] [S] [this] INSTANCE
dbg: [script] [3] [S] [balance] 102001
dbg: [script] [3] [S] [me] INSTANCE
dbg: [script] [3] [S] [monthly] INSTANCE
dbg: [script] [3] [S] [this] INSTANCE
dbg: [script] The script died unexpectedly.
Openttd 1.4.3
Newgrfs in use:
Random Norwegian Town Names
Squid Ate FISH squid-rc-3
Reduced Passenger Payment v1.0
Raise landscaping costs
FIRS Industry Replacement Set 2014-08-18 (5343:d77201428bc1)
av8 Aviators Aircraft Set
Industrial Stations Renewal 0.9.4
GRVTS v1.4 32bpp
L85 Roads
OpenGFX+ Trains 2014-01-07 (5120:5e0aa5e5e790)
32bpp extra zoom complete graphics
marco.r
Engineer
Engineer
Posts: 37
Joined: 16 Aug 2011 01:26

Re: BorkAI

Post by marco.r »

Thanks to both for the report. I have an updated version in the works that should fix this bug (and some others) and also add better support for aircrafts and trams.
At this point, I will try to release it as soon as possible.
marco.r
Engineer
Engineer
Posts: 37
Joined: 16 Aug 2011 01:26

Re: BorkAI

Post by marco.r »

I uploaded a new version.

This version fixes a few bugs, and enables by default use of aircrafts.
I added also support for trams. It is not enabled by default because there are a few blatant bugs that I have to iron out.
HGus
Engineer
Engineer
Posts: 121
Joined: 12 May 2013 22:28
Location: Argentina

Re: BorkAI

Post by HGus »

Thanks. :)
nobix
Engineer
Engineer
Posts: 3
Joined: 08 Feb 2015 16:12

Re: BorkAI

Post by nobix »

Image

I get this everytime i've closed the game and start it up and load a game with the AI in it.
marco.r
Engineer
Engineer
Posts: 37
Joined: 16 Aug 2011 01:26

Re: BorkAI

Post by marco.r »

nobix wrote:Image

I get this everytime i've closed the game and start it up and load a game with the AI in it.
I uploaded a new version with a fix. Please check if you can load the games correctly now.
User avatar
Core Xii
Traffic Manager
Traffic Manager
Posts: 228
Joined: 08 Apr 2008 09:47
Location: Finland

Re: BorkAI

Post by Core Xii »

This AI seems to perform very poorly compared to other AIs.
Unnamed, Apr 24th, 1964.png
Unnamed, Apr 24th, 1964.png (97.74 KiB) Viewed 941 times
marco.r
Engineer
Engineer
Posts: 37
Joined: 16 Aug 2011 01:26

Re: BorkAI

Post by marco.r »

Core Xii wrote:This AI seems to perform very poorly compared to other AIs.
Unnamed, Apr 24th, 1964.png
Unfortunately... yes :D, the performance depends greatly on the parameters, often it doesn't perform well :oops:
(mostly because search for new trade routes can be slow).

Do you have at hand the parameters you used for that game ? (Map size, sets etc...)
User avatar
Core Xii
Traffic Manager
Traffic Manager
Posts: 228
Joined: 08 Apr 2008 09:47
Location: Finland

Re: BorkAI

Post by Core Xii »

marco.r wrote:Do you have at hand the parameters you used for that game ? (Map size, sets etc...)
Sure. 512 x 512 map, TerraGenesis, Very Low towns, Flat terrain, Very High variety distribution, Very Low sea level, Improved trees, Random map edges, 30 maximum height, Very Low industries, Smooth and Medium rivers. Otherwise all vanilla.
HGus
Engineer
Engineer
Posts: 121
Joined: 12 May 2013 22:28
Location: Argentina

Re: BorkAI

Post by HGus »

Another error and my workaround:

Code: Select all

 if (engine == null) return null; // this keep things running...
	local result = AIVehicle.BuildVehicle(depot, engine._id);
Attachments
HGus Transport, 1790-01-06.png
HGus Transport, 1790-01-06.png (68.24 KiB) Viewed 940 times
marco.r
Engineer
Engineer
Posts: 37
Joined: 16 Aug 2011 01:26

Re: BorkAI

Post by marco.r »

HGus wrote:Another error and my workaround:

Code: Select all

 if (engine == null) return null; // this keep things running...
	local result = AIVehicle.BuildVehicle(depot, engine._id);
Thanks for the report, I will fix it in a short while, hopefully also the previous issue.
Sorry for the lack of updates but it is quite a busy period for me.
marco.r
Engineer
Engineer
Posts: 37
Joined: 16 Aug 2011 01:26

Re: BorkAI

Post by marco.r »

I applied the fix provided by HGus.
Also I realized that in the initial part of the game the AI was trying to hard to build airports (which could not afford to)
instead of going with trucks, leading to very poor performance.
Now it should fare much better.
Wormnest
Engineer
Engineer
Posts: 117
Joined: 14 Jul 2013 12:33
Location: Netherlands

Re: BorkAI

Post by Wormnest »

BorkAI v.22 crashed on this fairly flat map, no NewGRF's. Start was in 1930.
Attachments
AI Test Inflation ON, 1931-07-10#1.png
(449.27 KiB) Not downloaded yet
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 3 guests