SimpleAI v14 - trying to remake the old AI
Moderator: OpenTTD Developers
Re: SimpleAI v13 - trying to remake the old AI
It seems Brumi forgot to apply the fix sugested by krinn here
runningcost_limit still falls to zero when Banker.GetInflationRate() is over 6000
runningcost_limit still falls to zero when Banker.GetInflationRate() is over 6000
Re: SimpleAI v13 - trying to remake the old AI
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...

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
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. 

NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Re: SimpleAI v14 - trying to remake the old AI
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.
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
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 !

Sorry I am new on open ttd, and I try to install AI but I have always this message.
Can you help me ?
Thanks !

Re: SimpleAI v14 - trying to remake the old AI
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:
If it's not there, try to re-install your game, and make sure that the compatibility files are also updated.
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);
}
Re: SimpleAI v14 - trying to remake the old AI
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 !
https://gbatemp.net/threads/openttd-tra ... 941/page-4
Thanks a lot for your work !

Re: SimpleAI v14 - trying to remake the old AI
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.

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
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.
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
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.

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
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.
- Attachments
-
- simpleAIdutch.png (223.31 KiB) Viewed 12129 times
Re: SimpleAI v14 - trying to remake the old AI
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!
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
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.
Re: SimpleAI v14 - trying to remake the old AI
Well, in my experience, getting a passenger train first doesn't cause the AI to go bankrupt by itself... Perhaps the settings are a bit too strict? The AI prefers the default settings of OpenTTD, starting in the year 1950 when trains are not too expensive yet.
Re: SimpleAI v14 - trying to remake the old AI
Found a crash with Supersimplev48...screenshot enclosed.
I was reloading a savegame and the AI was in the red. Within a few seconds it crashed. Tried reloading twice but the same result.
It's the only crash I've had while running 7 versions of the AI in the same game for a large number of hours...
I was reloading a savegame and the AI was in the red. Within a few seconds it crashed. Tried reloading twice but the same result.
It's the only crash I've had while running 7 versions of the AI in the same game for a large number of hours...
- Attachments
-
- V100 test, 24th Jul 1969.png
- (223.43 KiB) Not downloaded yet
Re: SimpleAI v14 - trying to remake the old AI
Hahaha, thank you for this crash report, 3iff 
This crash will be fixed at next version of SuperSimpleAI. Be patient, in a few days will be published.
Thank you!

This crash will be fixed at next version of SuperSimpleAI. Be patient, in a few days will be published.
Thank you!
Re: SimpleAI v14 - trying to remake the old AI
No rush. Sorry for finding it!!
-
- Engineer
- Posts: 2
- Joined: 02 Oct 2024 12:58
Re: SimpleAI v14 - trying to remake the old AI
this happens all the time with default settings for me as wellArjanS87 wrote: 05 Apr 2024 13:44 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.
Last edited by ultratensai on 03 Oct 2024 01:21, edited 1 time in total.
-
- Engineer
- Posts: 2
- Joined: 02 Oct 2024 12:58
Re: SimpleAI v14 - trying to remake the old AI
As a workaround, i've changed the following line railbuiler.nut to (length > 15) so the AI never builds mail wagons... couldn't figure out the exact logic to determine number of mail + passenger length;ArjanS87 wrote: 05 Apr 2024 13:44 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.
SimpleAI-14/railbuilder.nut:388
Code: Select all
if ((length > 3) && (AICargo.GetTownEffect(crg) == AICargo.TE_PASSENGERS))
Who is online
Users browsing this forum: No registered users and 15 guests