Page 1 of 2

NotPerfectAI

Posted: 17 Jun 2020 09:12
by RolandKnight
Features:
  • created entirely from scratch (no dependencies)
  • uses all kinds of transport (including NewGRFs)
  • connects industries and towns (and any combination of them)
  • fast and accurate decision algorithm
  • fast road / rail / water pathfinder
  • fast road / rail builder
  • compatible with many popular NewGRFs
If the AI crashes, freezes or behaves incorrectly please let me know here or using my email: grzegorzabedzki@gmail.com . Any feedback appreciated :D

Github: https://github.com/hakerg/NotPerfectAI

License: CC-BY v3.0

Re: NotPerfectAI - a new competitive AI

Posted: 24 Jun 2020 08:06
by Brumi
I wanted to give it a test run, but it crashes right on startup:
screen.png
screen.png (33.74 KiB) Viewed 6157 times
AI was downloaded using the in-game content downloader. OpenTTD version is 1.10.2, full vanilla game, no NewGRFs.

Re: NotPerfectAI - a new competitive AI

Posted: 24 Jun 2020 09:37
by jfs
Brumi wrote: 24 Jun 2020 08:06 I wanted to give it a test run, but it crashes right on startup:
screen.png

AI was downloaded using the in-game content downloader. OpenTTD version is 1.10.2, full vanilla game, no NewGRFs.
That's a bug in OpenTTD, it doesn't handle the way this AI has structured the files inside the tar archive.
Issue #8230 has been fixed, the fix will be in a version 1.10.3 if that ever happens, and is already included in the latest nightly builds. As a workaround, you can find the downloaded tar file and unpack it in-place with a tool such as 7zip or WinRar.

Re: NotPerfectAI - a new competitive AI

Posted: 24 Jun 2020 12:13
by RolandKnight
Brumi wrote: 24 Jun 2020 08:06 I wanted to give it a test run, but it crashes right on startup:
screen.png

AI was downloaded using the in-game content downloader. OpenTTD version is 1.10.2, full vanilla game, no NewGRFs.
Fixed

Re: NotPerfectAI

Posted: 19 Oct 2020 17:41
by cjtron
dude, how to download??? I cant download through ingame cause it never loads, very slown net,.. and the bananas server thing wont let me download, it says its ingame,,,, such BS

Can you upload it plz

Re: NotPerfectAI

Posted: 20 Oct 2020 11:43
by RolandKnight
cjtron wrote: 19 Oct 2020 17:41 dude, how to download??? I cant download through ingame cause it never loads, very slown net,.. and the bananas server thing wont let me download, it says its ingame,,,, such BS

Can you upload it plz
Hello cjtron,

you can download the newest version 1.3 by clicking the file in the attachment from the main post. Put it in folder located in Documents/OpenTTD/ai (or something similar).

Greetings,
hakerg

Re: NotPerfectAI

Posted: 20 Oct 2020 13:13
by odisseus
Your AI builds way too much rail. Infrastructure maintenance costs consume most of its income.

Re: NotPerfectAI

Posted: 11 Feb 2021 11:03
by RolandKnight
Well, it's very difficult to play with infrastructure maintenance costs enabled even for humans. I will take a look at it one day probably, but I officially stopped developing my AI. I am glad that I achieved my goal of beating all existing AIs. Greetings!

Re: NotPerfectAI

Posted: 11 Feb 2021 12:41
by luk3Z
RolandKnight wrote: 11 Feb 2021 11:03 Well, it's very difficult to play with infrastructure maintenance costs enabled even for humans. I will take a look at it one day probably, but I officially stopped developing my AI. I am glad that I achieved my goal of beating all existing AIs. Greetings!
Is it stable enough (at last for few hours) ?

Re: NotPerfectAI

Posted: 12 Feb 2021 08:31
by RolandKnight
luk3Z wrote: 11 Feb 2021 12:41
RolandKnight wrote: 11 Feb 2021 11:03 Well, it's very difficult to play with infrastructure maintenance costs enabled even for humans. I will take a look at it one day probably, but I officially stopped developing my AI. I am glad that I achieved my goal of beating all existing AIs. Greetings!
Is it stable enough (at last for few hours) ?
Yes, it should last for at least 30-40 years with infrastructure maintenance costs enabled and infinitely long with this setting disabled

Re: NotPerfectAI

Posted: 21 Feb 2021 05:40
by odisseus
Your AI doesn't replace obsolete vehicles. In fact, this seems to be the main reason why it eventually bankrupts.

Re: NotPerfectAI

Posted: 21 Feb 2021 09:25
by RolandKnight
odisseus wrote: 21 Feb 2021 05:40 Your AI doesn't replace obsolete vehicles. In fact, this seems to be the main reason why it eventually bankrupts.
AI sells unprofitable vehicles every year, so theoretically it should not bankrupt when infrastructure maintenance costs are disabled

Re: NotPerfectAI

Posted: 21 Feb 2021 22:14
by odisseus
How do you detect unprofitability? Do you just look at the vehicle's yearly profit numbers, or do you take into account the upkeep of the infrastructure used by that vehicle? Said infrastructure upkeep can cost quite a lot even without the "infrastructure maintenance costs" setting.

Re: NotPerfectAI

Posted: 21 Feb 2021 23:36
by RolandKnight
odisseus wrote: 21 Feb 2021 22:14 How do you detect unprofitability? Do you just look at the vehicle's yearly profit numbers, or do you take into account the upkeep of the infrastructure used by that vehicle? Said infrastructure upkeep can cost quite a lot even without the "infrastructure maintenance costs" setting.
There is an event that informs AI about negative income of a vehicle, AI just handles these events and sells the vehicles. It does not sell unused infrastructure, because it's difficult to tell which tiles are used and which are not and they do not generate much costs with the setting disabled anyway.

Re: NotPerfectAI

Posted: 22 Feb 2021 03:01
by odisseus
RolandKnight wrote: 21 Feb 2021 23:36 because it's difficult to tell which tiles are used and which are not
Doesn't your AI use an entirely separated stretch of track for every single train? If that's the case, finding unused tracks shouldn't be too difficult.
RolandKnight wrote: 21 Feb 2021 23:36 they do not generate much costs with the setting disabled anyway.
That's just not true. Build enough tracks, and eventually they will weigh down any company, especially with add-ons that change base costs.

Besides, the "infrastructure maintenance costs" setting is quite a common one. Other AIs seem to have no problem with this setting.

Re: NotPerfectAI

Posted: 22 Feb 2021 06:22
by RolandKnight
odisseus wrote: 22 Feb 2021 03:01
RolandKnight wrote: 21 Feb 2021 23:36 because it's difficult to tell which tiles are used and which are not
Doesn't your AI use an entirely separated stretch of track for every single train? If that's the case, finding unused tracks shouldn't be too difficult.
RolandKnight wrote: 21 Feb 2021 23:36 they do not generate much costs with the setting disabled anyway.
That's just not true. Build enough tracks, and eventually they will weigh down any company, especially with add-ons that change base costs.

Besides, the "infrastructure maintenance costs" setting is quite a common one. Other AIs seem to have no problem with this setting.
Ok, I should probably dig into the code and fix it

Re: NotPerfectAI

Posted: 24 Feb 2021 13:08
by RolandKnight
A new version of the AI has been released. Now it sells unused rails and airports to avoid unnecessary maintenance costs. I also fixed an issue with picking roads with too low max speed, slightly improved performance of rail pathfinder and applied some other minor improvements.

Re: NotPerfectAI

Posted: 24 Feb 2021 13:41
by RolandKnight
I see that trams have trouble turning around at the stops, so it is still not perfect AI :wink:

Re: NotPerfectAI

Posted: 25 Feb 2021 04:12
by odisseus
The new version of your AI is still incompatible with infrastructure maintenance. It bankrupted in 15 years despite having the highest income.

In another game, the AI has been doing good for 30 years, although the ratio of property maintenance to income quickly grew to 70% and kept increasing at a slow rate. In year 1986, the property maintenance exceeded the income for the first time, and after year 1990 the AI had a net loss every year. It bankrupted in year 2007, after spending the funds it had amassed during the earlier years.

In yet another game, the AI evolved in the same pattern: it was making good profits for 40 years, after which point it started losing money every year. However, this time I took control of the company and manually replaced every locomotive with the fastest model available. The profits instantly came back.

Re: NotPerfectAI

Posted: 25 Feb 2021 07:39
by RolandKnight
Thanks for testing @odisseus. I see that replacing old vehicles needs to be implemented