MogulAI
Moderator: OpenTTD Developers
-
- Engineer
- Posts: 58
- Joined: 19 Apr 2009 11:50
Re: MogulAI
Thank you, guys, very much!
Now i totally killed 'for' loops with such damn itteration.
There are some other implovements:
- better route selection;
- better money managment while building roads;
- upgraded queue detector (work only at trunk yet);
- sending vehicles to depot now more solid
- something else, forgot already...
Updated BaNaNaS and first post.
Now i totally killed 'for' loops with such damn itteration.
There are some other implovements:
- better route selection;
- better money managment while building roads;
- upgraded queue detector (work only at trunk yet);
- sending vehicles to depot now more solid
- something else, forgot already...
Updated BaNaNaS and first post.
Last edited by Dezmond_snz on 02 Aug 2010 09:32, edited 1 time in total.
Russia
-
- Engineer
- Posts: 58
- Joined: 19 Apr 2009 11:50
Re: MogulAI
Update. Some changes and fixes improved performance of AI at higher difficulties.
Changelog:
- fix for bridge cost calc;
- imploved queue detector;
- fix bug when AI accidentally sent all vehicles to depots;
- better vehicle replacement;
Updated BaNaNaS and first post.
Changelog:
- fix for bridge cost calc;
- imploved queue detector;
- fix bug when AI accidentally sent all vehicles to depots;
- better vehicle replacement;
Updated BaNaNaS and first post.
Last edited by Dezmond_snz on 02 Aug 2010 09:33, edited 1 time in total.
Russia
Re: MogulAI
woo!
are you saying port intentionally or by accident?
are you saying port intentionally or by accident?
Dezmond_snz wrote: Updated BaNaNaS and first port.
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
-
- Engineer
- Posts: 58
- Joined: 19 Apr 2009 11:50
Re: MogulAI
typo + copypasteLord Aro wrote: are you saying port intentionally or by accident?Dezmond_snz wrote: Updated BaNaNaS and first port.
Russia
Re: MogulAI
I've noticed that on bananas your AI has license := custom. However, in your tar archive you have a license.txt file with the GPL 2 license. In none of your .nut files I've found any statement regarding if your AI is covered by the "or at your opinion any later version" statement that OpenTTD and many AIs do not have.
I would recommend you to mark in at least info.nut and main.nut if it is strictly version 2 or version >= 2 of GPL that you use. If you opt for strictly version 2, then you can select GPL2 at bananas instead of custom license.
I would recommend you to mark in at least info.nut and main.nut if it is strictly version 2 or version >= 2 of GPL that you use. If you opt for strictly version 2, then you can select GPL2 at bananas instead of custom license.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: MogulAI
You can select gplv2 on bananas in either case.Zuu wrote:I would recommend you to mark in at least info.nut and main.nut if it is strictly version 2 or version >= 2 of GPL that you use. If you opt for strictly version 2, then you can select GPL2 at bananas instead of custom license.
If you copy code from an AI that states "gpl v2 only (no later versions)" you can't use "or any later version" at least for the file you copied the code to.
If you copy code from an AI that states "gpl v2 or (at your option) any later version" you can still specify "gpl v2 only" in your AI.
Re: MogulAI
Thank you for the update, I was testing your AI for a while, there were no problems, except that it doesn't behave properly when the vehicle limit is reached. At least from the AI debug window it seems that the AI is constantly trying to add new vehicles to existing routes. I also see lines referring to the construction of stations.
-
- Engineer
- Posts: 58
- Joined: 19 Apr 2009 11:50
Re: MogulAI
Ok, some work made this evening, so...
Update:
- take RV limit into account;
- fix for closing routes.
New tar available at first post and BaNaNaS.
I also noticed strange thing. Look at screenshot: This is r20296. AI removed all order from this vehicle and sent it to depot while this RV stayed at station. And now it stays here forever. Is that normal behavior or bug?
Update:
- take RV limit into account;
- fix for closing routes.
New tar available at first post and BaNaNaS.
I also noticed strange thing. Look at screenshot: This is r20296. AI removed all order from this vehicle and sent it to depot while this RV stayed at station. And now it stays here forever. Is that normal behavior or bug?
Russia
Re: MogulAI
It's probably the "failed" attempt at fixing https://secure.openttd.org/bugs/task/3935 although the deadlock caused by that "fix" has been reverted according to the logs. In any case, adding the savegame to the bug report might be useful.Dezmond_snz wrote:This is r20296. AI removed all order from this vehicle and sent it to depot while this RV stayed at station. And now it stays here forever. Is that normal behavior or bug?
Re: MogulAI
Possible workaround:
* Add two go to depot orders
* Use the skip to order command to switch to the other order
* (remove the last order)
This has worked before to make sure road vehicles actually stop what they are doing and go to depot. That said, I haven't studied this bug enough to know if this procedure has any advantage in this situation.
* Add two go to depot orders
* Use the skip to order command to switch to the other order
* (remove the last order)
This has worked before to make sure road vehicles actually stop what they are doing and go to depot. That said, I haven't studied this bug enough to know if this procedure has any advantage in this situation.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
-
- Engineer
- Posts: 58
- Joined: 19 Apr 2009 11:50
Re: MogulAI
That's easy. edit:Rubidium wrote:It's probably the "failed" attempt at fixing https://secure.openttd.org/bugs/task/3935 although the deadlock caused by that "fix" has been reverted according to the logs. In any case, adding the savegame to the bug report might be useful.Dezmond_snz wrote:This is r20296. AI removed all order from this vehicle and sent it to depot while this RV stayed at station. And now it stays here forever. Is that normal behavior or bug?
Updated to r20357 - no changes. It easy to reproduce: while vehicle full-loading at station pause game, remove all orders and append goto-depot (service) order (what require unpause) - vehicle will stay at station until it full-loaded, only after that it will go to depot. However, if set "stop" flag for goto-depot order after that, vehicle leave station immediately.
Russia
-
- Engineer
- Posts: 58
- Joined: 19 Apr 2009 11:50
Re: MogulAI
And new version again!
Now with more important changes:
- better behavior when coming close to RVs limit;
- use built-in replace functions;
- fixed bug of calculating starting count of vehicles for route;
- some minor tweaks.
Enjoy. And feedback are welcome.
Now with more important changes:
- better behavior when coming close to RVs limit;
- use built-in replace functions;
- fixed bug of calculating starting count of vehicles for route;
- some minor tweaks.
Enjoy. And feedback are welcome.
Russia
Re: MogulAI
I like! I have added MogulAI to my games, along with NoCab (and Town Cars for the eye candy.)
Who is John Galt?
Re: MogulAI
Bug report:
openttd r20911
openttd r20911
- Attachments
-
- BugReport.png (7.02 KiB) Viewed 5215 times
-
- RokyTrans, 14. pro 1974.sav
- (180.38 KiB) Downloaded 150 times
-
- Engineer
- Posts: 58
- Joined: 19 Apr 2009 11:50
Re: MogulAI
bugbugbug
- Attachments
-
- mogulaibug.PNG (223.56 KiB) Viewed 946 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: MogulAI
In long run MogulAI is collecting RV in depots what is bad afterhitting RV limit.
Code: Select all
function AIAI::DeleteVehiclesInDepots()
{
local counter=0;
local list=AIVehicleList();
for (local q = list.Begin(); list.HasNext(); q = list.Next()){ //from Chopper
if(AIVehicle.IsStoppedInDepot(q)){
AIVehicle.SellVehicle(q);
counter++;
}
}
return counter;
}
- Attachments
-
- Przechwytywanie.PNG
- (189.63 KiB) Downloaded 1 time
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: MogulAI
Hint: that code can be shortened as:
Code: Select all
function AIAI::DeleteVehiclesInDepots()
{
local list = AIVehicleList();
list.Valuate(AIVehicle.IsStoppedInDepot);
list.KeepValue(1);
list.Valuate(AIVehicle.SellVehicle);
return list.Count();
}
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: MogulAI
Thanks!Zuu wrote:Hint: that code can be shortened as:Code: Select all
function AIAI::DeleteVehiclesInDepots() { local list = AIVehicleList(); list.Valuate(AIVehicle.IsStoppedInDepot); list.KeepValue(1); list.Valuate(AIVehicle.SellVehicle); return list.Count(); }
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: MogulAI
Warning! It is not working:
- Attachments
-
- Przechwytywanie.PNG (7.32 KiB) Viewed 945 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Who is online
Users browsing this forum: No registered users and 14 guests