Page 14 of 14

Re: SimpleAI v13 - trying to remake the old AI

Posted: 15 Jan 2019 05:54
by HGus
It seems Brumi forgot to apply the fix sugested by krinn here

runningcost_limit still falls to zero when Banker.GetInflationRate() is over 6000

Re: SimpleAI v13 - trying to remake the old AI

Posted: 15 Jan 2019 14:22
by Brumi
I wish I had been using some proper version control software, I had no idea how I missed that :) The thing is, I was aware of the inflation problem in v9, and actually did something about it in v10. But why I didn't include the fix that both krinn and SirkoZ were suggesting, I have no idea. My bad! And it's not just some integer/float conversion problem, the logic itself is bad...

So I will make a new release this week, including this fix (finally!). I still have to review SirkoZ's fix for the road deletion bug though.

I really appreciate you guys not only finding bugs in my AI, but even fixing them. Apologies for the bad code though, the bulk of SimpleAI was written before I started attending university...

Re: SimpleAI v13 - trying to remake the old AI

Posted: 16 Jan 2019 17:07
by SirkoZ
No apologies are necessary as I see it, I'm just grateful for your wonderful effort of making this AI. We'll get it right. :mrgreen:

Re: SimpleAI v14 - trying to remake the old AI

Posted: 20 Jan 2019 14:43
by Brumi
There is a new version out!

Two things were changed:
The inflation issue in the train engine valuator is now fixed. Thanks SirkoZ and krinn for the fix!
The AI sometimes did not remove the C-shaped road pieces when failing to build a road station. I implemented a fix for that, which should work in theory (if my assumption was correct about the root cause of the problem), but as I had no reliable reproduction of the case, I could only make a best-effort fix. (for those interested, the fix is in cBuilder::BuildRoadStation, removing the remainders when AIRoad.BuildRoadStation fails)

As usual, the AI can be downloaded from BaNaNaS or the first post.

Re: SimpleAI v14 - trying to remake the old AI

Posted: 25 Apr 2019 11:01
by burt
Hello !
Sorry I am new on open ttd, and I try to install AI but I have always this message.
Can you help me ?
Thanks !


Image

Re: SimpleAI v14 - trying to remake the old AI

Posted: 26 Apr 2019 09:27
by Brumi
It seems that your [OpenTTD installation directory]/ai/compat_1.2.nut file is outdated for some reason.

What version of the game are you using? 1.9.1? JGRPP? How exactly did you install this version? Did you upgrade from an older version?

Anyway, compat_1.2.nut has to contain this piece of code at the end:

Code: Select all

/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
	return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}
If it's not there, try to re-install your game, and make sure that the compatibility files are also updated.

Re: SimpleAI v14 - trying to remake the old AI

Posted: 26 Apr 2019 18:47
by burt
Very sorry, it was the switch version and everything work perfectly ! ^^
https://gbatemp.net/threads/openttd-tra ... 941/page-4
Thanks a lot for your work ! :)

Re: SimpleAI v14 - trying to remake the old AI

Posted: 22 Jan 2021 14:42
by Wuzzy
This is the only AI I use in my games right now. Because it's simple and works and does not crash or does strange things. So, thanks. :)

Unfortunately, it does not seem to support ships, I hope it will be added in a later version. I'm craving for a simple, yet functional and stable general-purpose AI that does not crash and does not do stupid things. Most AIs around here are experimental, broken, outright weird, too specialized (e.g. 1 vehicle type only), or have other problems, sadly.

Re: SimpleAI v14 - trying to remake the old AI

Posted: 28 Mar 2021 14:46
by Wuzzy
Sadly, SimpleAI v14 now crashed on me:

https://satoshiupload.com/images/lxtV8RqJi5.png

However, this happened in 2d7b34bc68f7fb0e707129e4d97383b18f1da55e of OpenTTD. I don't know if it is really SimpleAI's fault, or if it's actually OpenTTD's fault.
SimpleAI v14 NEVER crashed on me before, but this crash happened only after a few minutes. Is this really a bug in SimpleAI or could there be a new incompability in the AI API? What do you think?

EDIT: Okay, so it turned out I launched OpenTTD the "wrong way". This caused the compability script to fail to load, which SimpleAI apparently needs. After I started it the "right way", the compability script was loaded, and SimpleAI works again. Phew. :)

Re: SimpleAI v14 - trying to remake the old AI

Posted: 28 Mar 2021 16:10
by Brumi
Got scared seeing this :)

But you're right, SimpleAI definitely needs those compatibility scripts, so a crash is quite much expected when they fail to load.

Re: SimpleAI v14 - trying to remake the old AI

Posted: 07 Mar 2022 12:17
by RailwAI
This AI seems to have some difficulties with the Dutch Trainset & Dutch Tracks. Simple AI decides to use high speed tracks with 3 tiles long stations, and use a high speed train (max 320km/h) combined with 2 slower carriages (max 140 km/h). The train is much longer than the platforms, such that loading/unloading takes a lot of time, and it doesn't gain advantage from using a high speed train or high speed track.

Re: SimpleAI v14 - trying to remake the old AI

Posted: 16 Mar 2022 14:44
by Brumi
Welp, the problem of different railtypes and train sets seems to be forever haunting...

Using slower carriages with a high-speed locomotive is something I probably didn't account for, but the train being longer than the platform definitely seems to be a bug. Thanks for noticing!

Re: SimpleAI v14 - trying to remake the old AI

Posted: 05 Apr 2024 13:44
by ArjanS87
Played today with the SimpleAI. It seems to build small train routes well, until it tries to build a passenger route. Here it sinks all their money in 1 mail truck and all passenger carts. This will cause them to go bankrupt, particularly if there were no other freight routes in action before trying a passenger route.