Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Mon Feb 19, 2018 11:29 pm

All times are UTC




Post new topic  Reply to topic  [ 43 posts ]  Go to page Previous 1 2 3 Next
Author Message
 Post subject: Re: MogulAI
PostPosted: Fri Jul 16, 2010 8:13 am 
Offline
Engineer
Engineer

Joined: Sun Apr 19, 2009 11:50 am
Posts: 58
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.

_________________
Russia


Last edited by Dezmond_snz on Mon Aug 02, 2010 9:32 am, edited 1 time in total.

Top
   
 Post subject: Re: MogulAI
PostPosted: Mon Aug 02, 2010 8:12 am 
Offline
Engineer
Engineer

Joined: Sun Apr 19, 2009 11:50 am
Posts: 58
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.

_________________
Russia


Last edited by Dezmond_snz on Mon Aug 02, 2010 9:33 am, edited 1 time in total.

Top
   
 Post subject: Re: MogulAI
PostPosted: Mon Aug 02, 2010 8:56 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Thu Jun 25, 2009 4:42 pm
Posts: 2364
Location: Location, Location
woo!

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


Top
   
 Post subject: Re: MogulAI
PostPosted: Mon Aug 02, 2010 9:33 am 
Offline
Engineer
Engineer

Joined: Sun Apr 19, 2009 11:50 am
Posts: 58
Lord Aro wrote:
are you saying port intentionally or by accident?
Dezmond_snz wrote:
Updated BaNaNaS and first port.

typo + copypaste :)

_________________
Russia


Top
   
 Post subject: Re: MogulAI
PostPosted: Tue Aug 03, 2010 3:48 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4533
Location: /home/sweden
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.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
 Post subject: Re: MogulAI
PostPosted: Tue Aug 03, 2010 3:52 pm 
Offline
Tycoon
Tycoon

Joined: Thu Dec 20, 2007 12:49 pm
Posts: 3653
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.
You can select gplv2 on bananas in either case.

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.


Top
   
 Post subject: Re: MogulAI
PostPosted: Tue Aug 03, 2010 5:36 pm 
Offline
Chairman
Chairman

Joined: Sat Jul 18, 2009 5:54 pm
Posts: 875
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.


Top
   
 Post subject: Re: MogulAI
PostPosted: Tue Aug 03, 2010 7:49 pm 
Offline
Engineer
Engineer

Joined: Sun Apr 19, 2009 11:50 am
Posts: 58
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:
Attachment:
Moguls Trans Corp ltd., 2051-06-08.png [66.87 KiB]
Downloaded 1 time

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


Top
   
 Post subject: Re: MogulAI
PostPosted: Tue Aug 03, 2010 8:11 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Thu Feb 09, 2006 7:15 pm
Posts: 3815
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?
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.


Top
   
 Post subject: Re: MogulAI
PostPosted: Tue Aug 03, 2010 11:11 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4533
Location: /home/sweden
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.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
 Post subject: Re: MogulAI
PostPosted: Wed Aug 04, 2010 6:48 am 
Offline
Engineer
Engineer

Joined: Sun Apr 19, 2009 11:50 am
Posts: 58
Rubidium wrote:
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?
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.

That's easy.
Attachment:
1.sav [16.17 KiB]
Downloaded 35 times


edit:
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


Top
   
 Post subject: Re: MogulAI
PostPosted: Fri Aug 06, 2010 12:52 pm 
Offline
Engineer
Engineer

Joined: Sun Apr 19, 2009 11:50 am
Posts: 58
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. :)

_________________
Russia


Top
   
 Post subject: Re: MogulAI
PostPosted: Sat Aug 07, 2010 5:15 pm 
Offline
Chairman
Chairman
User avatar

Joined: Sat May 12, 2007 1:09 am
Posts: 882
Location: Northeastern USA
I like! I have added MogulAI to my games, along with NoCab (and Town Cars for the eye candy.)

_________________
Who is John Galt?


Top
   
 Post subject: Re: MogulAI
PostPosted: Sun Oct 10, 2010 10:40 am 
Offline
Engineer
Engineer

Joined: Mon Sep 27, 2010 11:58 am
Posts: 2
Bug report:
openttd r20911


Attachments:
BugReport.png
BugReport.png [ 7.02 KiB | Viewed 1723 times ]
RokyTrans, 14. pro 1974.sav [180.38 KiB]
Downloaded 34 times
Top
   
 Post subject: Re: MogulAI
PostPosted: Sun Oct 10, 2010 2:22 pm 
Offline
Engineer
Engineer

Joined: Sun Apr 19, 2009 11:50 am
Posts: 58
LamRis wrote:
Bug report:
openttd r20911

Thank You very much!
Fixed 5900.

_________________
Russia


Top
   
 Post subject: Re: MogulAI
PostPosted: Thu Nov 11, 2010 2:07 pm 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
bugbugbug


Attachments:
mogulaibug.PNG [223.56 KiB]
Downloaded 2 times

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Top
   
 Post subject: Re: MogulAI
PostPosted: Sat Nov 13, 2010 7:45 am 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
In long run MogulAI is collecting RV in depots what is bad afterhitting RV limit.

Code:
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
Top
   
 Post subject: Re: MogulAI
PostPosted: Sat Nov 13, 2010 1:13 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4533
Location: /home/sweden
Hint: that code can be shortened as:
Code:
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)


Top
   
 Post subject: Re: MogulAI
PostPosted: Sat Nov 13, 2010 1:14 pm 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
Zuu wrote:
Hint: that code can be shortened as:
Code:
function AIAI::DeleteVehiclesInDepots()
{
   local list = AIVehicleList();
   list.Valuate(AIVehicle.IsStoppedInDepot);
   list.KeepValue(1);
   list.Valuate(AIVehicle.SellVehicle);
   return list.Count();
}

Thanks!

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD


Top
   
 Post subject: Re: MogulAI
PostPosted: Sat Nov 13, 2010 1:53 pm 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
Warning! It is not working:


Attachments:
Przechwytywanie.PNG [7.32 KiB]
Downloaded 1 time

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 43 posts ]  Go to page Previous 1 2 3 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.