Sorry - they're not errors, but ChooChoo makes heavy use of exceptions, which the Squirrel VM always outputs to the console, even if they are caught and handled by the AI.planetmaker wrote:Also the current bananas version still creates continuously errors (though not fatal, it's annoying as it spams the console, which is nothing I like when doing casual testing, of also other stuff concurrently)
ChooChoo, a train network AI
Moderator: OpenTTD Developers
Re: ChooChoo, a train network AI
Re: ChooChoo, a train network AI
I cannot use choochoo v361, there's no real errors here, just a play style
choochoo refuse to work because of construction.road_stop_on_town_road is off
well, as AI are nearly all bad guys when we speak about town and traffic, at least removing this option (i still allow them to build it on all route but not for town) this will lower chance of road stucks by a waiting bus/truck to load on a town road (because everyone use town roads). It happen too with too many vehicle waiting in front of a station, but with road_stop_on_town_road, it happen with just 1 vehicle waiting.
If i understood clear (didn't test choochoo because of the setting), choochoo isn't even really use it! It's just to extend its station coverage.
You wish keep that setting as-is or change your mind ?
choochoo refuse to work because of construction.road_stop_on_town_road is off
well, as AI are nearly all bad guys when we speak about town and traffic, at least removing this option (i still allow them to build it on all route but not for town) this will lower chance of road stucks by a waiting bus/truck to load on a town road (because everyone use town roads). It happen too with too many vehicle waiting in front of a station, but with road_stop_on_town_road, it happen with just 1 vehicle waiting.
If i understood clear (didn't test choochoo because of the setting), choochoo isn't even really use it! It's just to extend its station coverage.
You wish keep that setting as-is or change your mind ?
Re: ChooChoo, a train network AI
I'll think about itkrinn wrote:You wish keep that setting as-is or change your mind ?
Re: ChooChoo, a train network AI
Without industries CHhooChoo crashes
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: ChooChoo, a train network AI
Oh, that's kinda bad. I'll see if I can fix that, thanks!
Re: ChooChoo, a train network AI
And it will loop over and over with more freight lines to do than industries.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: ChooChoo, a train network AI
There are two bugs:
- Attachments
-
- choochoo_bug.JPG
- (218.73 KiB) Downloaded 3 times
-
- choochoo_bug2.JPG
- (173.64 KiB) Downloaded 3 times
Re: ChooChoo, a train network AI
it helps if you actually read the error message.
You need to enable "Allow building drive-through road stations on town roads" setting in the advanced setting.
Also, try to use .png for screenshots, using OTTDs built in screenshot 'taker' (click far right menu button, and select desired screenshot option)
You need to enable "Allow building drive-through road stations on town roads" setting in the advanced setting.
Also, try to use .png for screenshots, using OTTDs built in screenshot 'taker' (click far right menu button, and select desired screenshot option)
AroAI - A really feeble attempt at an AI
It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
Re: ChooChoo, a train network AI
Thanks for the bug report, Curly, and thanks LordAro for already providing the answer for me
Re: ChooChoo, a train network AI
i got this bug right after the ai starts
- Attachments
-
- bug.PNG (26.68 KiB) Viewed 11282 times
-
- Engineer
- Posts: 4
- Joined: 08 Dec 2011 21:52
- Location: South Yorkshire, UK
Re: ChooChoo, a train network AI
If i remember rightly i got that error like 7 years into the game (1978). Yes I start at 1971!Endymion wrote:i got this bug right after the ai starts
Re: ChooChoo, a train network AI
Thanks, I'll have a look!
Re: ChooChoo, a train network AI
Perhaps you are already aware of this but your AI can completely lock up OTTD on large maps with many industries.
The problem is of course the gigantic list of routes generated then sorted with a comparator function. (sort is a native call and can not be suspended)
Since you are only ever interested in the best 10 routes this is completely unnecessary and the following change will make OTTD run smooth as silk during the bootstrap phase even on a 2048x2048 map with industries set to "high":
This is definitely one of my favorite AIs, keep up the good work!
The problem is of course the gigantic list of routes generated then sorted with a comparator function. (sort is a native call and can not be suspended)
Since you are only ever interested in the best 10 routes this is completely unnecessary and the following change will make OTTD run smooth as silk during the bootstrap phase even on a 2048x2048 map with industries set to "high":
Code: Select all
local routes = [];
foreach (cargo, _ in cargoList) {
Debug(AICargo.GetCargoLabel(cargo));
local consumers = AIIndustryList_CargoAccepting(cargo);
local producers = AIIndustryList_CargoProducing(cargo);
producers.Valuate(AIIndustry.GetLastMonthProduction, cargo);
producers.KeepAboveValue(0);
foreach (producer, _ in producers) {
foreach (consumer, _ in consumers) {
local distance = AIMap.DistanceManhattan(AIIndustry.GetLocation(producer), AIIndustry.GetLocation(consumer));
if (distance < MAX_CARGO_DISTANCE) {
local route = CargoRoute(producer, consumer, cargo)
if (route.payback > 0) {
//Debug(route)
routes.append(route)
routes.sort(CompareRouteValue)
routes = routes.slice(0, min(10, routes.len()))
}
}
}
}
}
Re: ChooChoo, a train network AI
That's a great idea! I'll put it on the to do list, but I must admit I haven't been getting around to AI development recently...
ThanksAali wrote:This is definitely one of my favorite AIs, keep up the good work!
Re: ChooChoo, a train network AI
my mailbox wrote: Błąd
- Attachments
-
- ottd.JPG
- (271.32 KiB) Downloaded 3 times
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
Re: ChooChoo, a train network AI
LOL, just the other day I was telling Maninthebox that ChooChoo managed to go without a real crash for so long
Added to The List (TM)
Added to The List (TM)
Re: ChooChoo, a train network AI
nice AI, though howd u get that kind of graphics?
Re: ChooChoo, a train network AI
What kind?sss wrote:that kind of graphics?
Re: ChooChoo, a train network AI
Thanks! But as FooBar said... what kind of graphics?sss wrote:nice AI, though howd u get that kind of graphics?
Re: ChooChoo, a train network AI
I've got an issue with ChooChoo on OpenTTD 1.2 beta 4.
I guess it's a Squirrel parser update in the 1.2 version of OpenTTD that broke the comparator function by not returning a 0 on similar values. The Squirrel engine returned an "Inconsistent compare function" error without this modification.
I have modified the CompareRouteValue function to make it look like this:
It now works for me on the latest version. Hope it helps...
I guess it's a Squirrel parser update in the 1.2 version of OpenTTD that broke the comparator function by not returning a 0 on similar values. The Squirrel engine returned an "Inconsistent compare function" error without this modification.
I have modified the CompareRouteValue function to make it look like this:
Code: Select all
function CompareRouteValue(a, b) {
if (a.payback==b.payback) return 0;
return a.payback > b.payback ? 1 : -1;
}
Who is online
Users browsing this forum: No registered users and 44 guests