Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Thu Nov 15, 2018 3:48 pm

All times are UTC




Post new topic  Reply to topic  [ 165 posts ]  Go to page 1 2 3 4 59 Next
Author Message
 Post subject: CluelessPlus
PostPosted: Sat Jan 17, 2009 1:53 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
Hi all,

Background
Long time ago I wrote an AI called Clueless, it was actually the first posted user AI for the NoAI framework. It has been broken for long time as that was almost a year ago, minus a few months.

Clueless was not a very smart AI, thus the name. ;) One of the problems back then was that there existed lot less functions to query information from the map. Also in the beginning there was no friendly error messages when the AI crashes etc.

Now that the API has improved and matured a lot, and NoAI have been merged with trunk, I got the idea to get Clueless back into a non-broken form. This is actually not the first such attempt. I did some such work in June 2008. All this has resulted in CluelessPlus.


The two most annoying things with Clueless has been addressed. It does no longer spam towns with 10-30 road stations and then picks the best one. Instead it uses test mode and just records which places a station can be placed and after that picks the best one using same old criteria. As this new method is not as failsafe as the old one it restart the process if it can't build at the selected location.

Another thing that has changed is the pathfinder. Clueless now uses the library road pathfinder so it is compatible with built on slope and can get around industries, which the old pathfinder couldn't. To say the truth, the old pathfinder sucked quite a lot :)

Other than that, it manages vehicles which I don't remember if original Clueless had, as I'm quite unsure if it was possible to get number of waiting cargo at stations back then. The number of AI names has been raised from 8 to 16 due to the increased number of possible companies in OpenTTD.

The AI today, early 2010
CluelessPlus has since I brought Clueless up to date got several updates and fixes here and there to make it a better AI. It still only do bus transport between towns, but tries to do that good without being to much in the way.

Kogut - Sun Mar 07, 2010 wrote:
clueless is nice, quiet ai - never crashes (for me), always is profitable (usually it is not very high profit) but sometimes is the richest company (better than Rondje!)


Some screenshots:
Attachment:
File comment: 15 companies, on the map, all starting the same time. The connection from this town has just been completed and all companies has to rush to get their buses into the lead of the worm of buses that competes for the passengers.
release_of_buses.png [77.27 KiB]
Downloaded 666 times

Attachment:
graphs.png [26.73 KiB]
Downloaded 560 times


Download
See last post for most recent version, or use BaNaNaS - the content service for OpenTTD

You can do manual downloads from the bananas website as well as using the in-game content system. It is recommended to use the in-game content download dialog as then you'll automatically get all dependencies as well. If you opt for manual download, then you must make sure you get the dependencies as well.

Dependencies: (AI libraries)
Pathfinder.Road - version 3
Queue.FibonacciHeap - version 2
SuperLib - version 7

http://bananas.openttd.org/en/ailibrary/ (library download at bananas website)

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


Last edited by Zuu on Sat Apr 09, 2011 4:28 pm, edited 7 times in total.

Top
   
 Post subject: Re: CluelessPlus
PostPosted: Sat Jan 17, 2009 9:59 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
Version 2:

- Has Save/Load functions, that detect when user tries to save/load and tries to warn the user that save/load is not supported. Also Load function sets a variable so that stops the AI from doing anything, which is better than starting as if it was a new company.


Attachments:
CluelessPlus-v2.tar [57.5 KiB]
Downloaded 681 times

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Top
   
 Post subject: Re: CluelessPlus
PostPosted: Sun Jan 18, 2009 12:03 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
Version 3

Fix: Don't place signs when selling vehicles. That was a debug thing that I missed to remove.


Attachments:
CluelessPlus-v3.tar [57.5 KiB]
Downloaded 551 times

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Top
   
 Post subject: Re: CluelessPlus
PostPosted: Sat Apr 04, 2009 8:51 am 
Offline
Engineer
Engineer

Joined: Sat May 10, 2008 12:21 am
Posts: 13
I've encountered an error while playing a game against Clueless and several other AIs. Just so you know, I'm not much of a beta tester. I was just curious to see how well the AIs did, so... yeah.

Anyhow, here's the error.


Attachments:
Clueless bug.png [150.22 KiB]
Downloaded 229 times
Top
   
 Post subject: Re: CluelessPlus
PostPosted: Sat Apr 04, 2009 7:47 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
Topher wrote:
I've encountered an error while playing a game against Clueless and several other AIs. Just so you know, I'm not much of a beta tester. I was just curious to see how well the AIs did, so... yeah.

Anyhow, here's the error.


It is known that CluelessPlus has not yet been upgraded to the last API changes some time ago. That is the reason you don't find it in the in-game content server when using a recent nightly (or 0.7.0).

Thanks for taking your time reporting it though. Perhaps you downloaded it manually from tt-forums where no compability check is made. (compared to the in-game content service, which has support for min/max required OpenTTD version)

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


Top
   
 Post subject: Re: CluelessPlus
PostPosted: Sun Apr 12, 2009 9:44 am 
Offline
Transport Coordinator
Transport Coordinator

Joined: Sat Jan 03, 2009 5:55 pm
Posts: 301
Will you update CluelessPlus? Or is this the end of CluelessPlusAI?


Top
   
 Post subject: Re: CluelessPlus
PostPosted: Sun Apr 12, 2009 10:13 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
Timmaexx wrote:
Will you update CluelessPlus? Or is this the end of CluelessPlusAI?


I could update it if there is an interest for it. It should only be a few changes to make it compatible again. But for the moment the development is on PAXLink. But if there is an interest I can update CluelessPlus so it run on 0.7.0 and recent nightlies.

Update
While I was just sitting on the train, I decided to try to update it from my laptop. So here is version 4 that works with the current API. I also added a small feature, when there is no buses available (AIEngineList contains zero non-articulated buses) it will not construct any bus stops or roads. But will continue to check for buses and when they become available it will start building. Not sure if this works against turning of buses for AIs as I have no idea if that affects what AIEngineList contains. On the other hand, if you turn of buses then CluelessPlus can't do much of anything anyways.


Edit: There is a bug in the code that lead to clueless having lot of buses without orders after a while.


Attachments:
File comment: Tested with last nightly (11 o clock UTC, 2009-04-12)
CluelessPlus-v4.tar [58 KiB]
Downloaded 430 times

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Top
   
 Post subject: Re: CluelessPlus
PostPosted: Thu Jul 16, 2009 6:34 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
CluelessPlus version 5

Changes:
* Does not get a lot of buses without orders anymore
* Renewal of bus fleet: Sells old buses, and then because of reduced capacity it buys new ones.
* Enhanced selling mechanism so that the AI don't need to wait for a bus to be sent to depot and sold before continueing with the next task.

Attachment:
CluelessPlus-v5.tar [79 KiB]
Downloaded 349 times



Edit: Another thing that changed (internally) was that I removed one data structure that contained all buses for a connection. Now that information is read from the map as the intersection of the buses that visit all the stations that belongs to the connection.

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


Top
   
 Post subject: Re: CluelessPlus
PostPosted: Fri Jul 17, 2009 5:02 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
CluelessPlus version 6

Changes:
* Game loading support (including older saves as long as there is goto depot orders so it finds the depots)
* Use congestion detection code from PAXLink to detect congestion at bus stations.


The congestion detection code is tuned a bit differently from PAXLink, but does still has the problem that it sells/buys buses a bit to much to be good for its economy. The upside though is that it renews the bus fleet as it always sells the oldest bus of a connection. :-)


And yes, now you can use CluelessPlus in your games that you want to save and then load again. Good isn't it?


Attachments:
CluelessPlus-v6.tar [76 KiB]
Downloaded 409 times

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Top
   
 Post subject: Re: CluelessPlus
PostPosted: Fri Jul 24, 2009 4:53 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Thu Aug 03, 2006 7:32 pm
Posts: 318
Skype: woldy_bg
Location: Bulgaria
Got an error :


Attachments:
Fonnton Transport, 2nd Apr 1976.png [80.27 KiB]
Downloaded 86 times

_________________
Image
Top
   
 Post subject: Re: CluelessPlus
PostPosted: Mon Jul 27, 2009 8:39 pm 
Offline
Engineer
Engineer

Joined: Mon Jul 27, 2009 8:28 pm
Posts: 5
Hi,
Wold wrote:
Got an error :

i also keep getting this one. Hope you can fix it. Nonetheless, this is some terrific AI. :)


Top
   
 Post subject: Re: CluelessPlus
PostPosted: Mon Jul 27, 2009 11:50 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
Thanks for reminding me. I have looked on the code and a fix for the crash is easy. It is simply the case that it failed to build one of the stations and tries to get the station ID of a null tile. Though I wonder why it in first place failed to place a bus stop in the town. Do any of you have an idea of what settings/situation in your games that caused it to fail in the town mentioned in the log?

Save games are welcome if you have any.

I'll soon upload a fix to the crash, but I am interested if I can find any bugs/short comings in the station construction code.


Edit: I have not been able to reproduce the problem myself and would be very interested in a save game that might help me find out why it fails to build a bus station. Does it happens to you at the beginning of every game or just at some times? The best would be a save game before it happens, but having the AI crash-log + save game would help a bit I think.

For now I will not upload the fix, as while it fixes a bug in the error handling I would be happy to track down the reason the bus/truck/depot station placement routine fails.

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


Top
   
 Post subject: Re: CluelessPlus
PostPosted: Wed Jul 29, 2009 4:19 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
Version 7

* Crash when failed to build bus stop in town fixed. (failure to build bus stop in those cases are however not fixed, but it should handle the failure without crashing again)
* Respect the disable road transport mode setting.
* Implements the MinVersionToLoad() function. (returns 1)


Attachments:
CluelessPlus-v7.tar [77 KiB]
Downloaded 310 times

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Top
   
 Post subject: Re: CluelessPlus
PostPosted: Wed Jul 29, 2009 9:26 am 
Offline
Engineer
Engineer

Joined: Mon Jul 27, 2009 8:28 pm
Posts: 5
Zuu wrote:
Thanks for reminding me. I have looked on the code and a fix for the crash is easy. It is simply the case that it failed to build one of the stations and tries to get the station ID of a null tile. Though I wonder why it in first place failed to place a bus stop in the town. Do any of you have an idea of what settings/situation in your games that caused it to fail in the town mentioned in the log?

Save games are welcome if you have any.

I'll soon upload a fix to the crash, but I am interested if I can find any bugs/short comings in the station construction code.


Edit: I have not been able to reproduce the problem myself and would be very interested in a save game that might help me find out why it fails to build a bus station. Does it happens to you at the beginning of every game or just at some times? The best would be a save game before it happens, but having the AI crash-log + save game would help a bit I think.

For now I will not upload the fix, as while it fixes a bug in the error handling I would be happy to track down the reason the bus/truck/depot station placement routine fails.

It actually happens to me every time I load a saved game with a CPU player using this AI module, playing in Hard difficulty (unaltered). Although i don't remember this happening very early in the game.
Here's a savegame, hope it helps. :)


Attachments:
Quito Transportes, 18º Abr 2038.sav [502.19 KiB]
Downloaded 555 times
Top
   
 Post subject: Re: CluelessPlus
PostPosted: Thu Jul 30, 2009 1:12 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
Thank you for posting the save game. The reason why it failed to place the bus stop was that it had a fixed maximum of number of road tiles to visit in order to find an empty road tile next to a road tile where it can build a bus stop. Now I have changed this limit so it depend on the population of the town so that it should have a possibility to find the edge of really big cities too.

Version 8
* Tuned the maximum tiles it search to find a place to build bus stops/depots in towns. It also now depend on town size (population).


Attachments:
CluelessPlus-v8.tar [77 KiB]
Downloaded 338 times

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Top
   
PostPosted: Wed Sep 02, 2009 7:46 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
Version 10
Last version was marked as version 8 on BaNaNaS, but in info.nut it returned version 9, so therefore I jump directly to version 10.

Change log:
  • Expand stations up to N number of bus stops as the stations get overcrowded. N can be configured in the AI Settings. Default is {1, 2, 4, 2} for {easy, normal, hard, custom}.
  • Don't buy/sell vehicles if a buy/sell vehicle(s) operation was performed the last 30 days. => reduces the behavior of buying tons of buses and then selling them soon.
  • Sometimes use full load orders. (during the first year and if station rating is low while not too many passengers is waiting on either of the stations)
  • When selecting pairs of towns to connect some more things adds up to the score now:
    • If town center is on desert/snow
    • The equality of the pair (population difference and that either both or none are on desert/snow)
  • Reduced the number of buses initially built a bit
  • Now uses the AISignList instead of the deprecated function to get the maximum sign ID.


For those who like CluelessPlus for its not to overcrowded behavior compared to some other AIs should probably set maximum number of bus stops per station to 2 or maybe 3. That said, it will take some time before CluelessPlus reaches 4 bus stops since it requires the usage to be over 150% and number of waiting at least 150 passengers at either town before it adds another bus stop. 100% usage = one bus per station tile. Since bus stops can have up to 3 buses on the bus stop tile the usage can go over 100%. All statistics it uses for expansion decisions are sliding averages over time. If you enable showing debug signs, then you can reed these stats for each station in the following format:

w<num waiting> r<rating> u<usage in %> a<airport holding queue + num non-stopped in hangar>

While CluelessPlus don't build airports it shares this code with PaxLink which makes use of the amount of planes that wait to land or are stuck in the hangar.


If you download CluelessPlus manually you need to obtain and install version 3 of the road pathfinder library.


Attachments:
CluelessPlus-v10.tar [91 KiB]
Downloaded 267 times

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Top
   
 Post subject: Re: CluelessPlus
PostPosted: Thu Sep 03, 2009 4:20 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
Version 11

Change log:
  • Fixed the limits for when it will upgrade a station with more bus stops. (I had reduced all the limits by factor 10 in order to check the save/load code without having to wait too long for it to expand)
  • Bonus: Now CluelessPuls places the HQ close to the first bus stop. It only places the HQ next to roads and consider both the cost and distance to bus stop when it chooses the location to build it. If placing the HQ close to first town of first connection it will retry with the first town of the second connection and continue until it succeed.


Attachments:
CluelessPlus-v11.tar [95 KiB]
Downloaded 432 times

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Top
   
 Post subject: Re: CluelessPlus
PostPosted: Fri Oct 09, 2009 9:00 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Feb 05, 2005 2:35 pm
Posts: 1190
Location: Netherlands, Utrecht
I tried a game with Cluelessplus v11 among other AI's.
IMO it performed reasonably, though not more than that. After 10 years it had over 350 road vehicles, of which only incidentically one did have a 10k+ GBP profit per year. On average, each vehicle made about 3500 per year. Also, it had a habit of clogging up cities. Maybe using destinations further apart would improve both points?
See attached save game.
OpenTTD 0.7.3
NewGRFs: OpenGFX, better vehicles names, Av8 1.501

(I will post comparable posts in the other AI's topics)


Attachments:
AI game.sav [658.84 KiB]
Downloaded 283 times

_________________
*hmz*
Top
   
 Post subject: Re: CluelessPlus
PostPosted: Fri Oct 09, 2009 11:33 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
Thanks for your report!


I loaded the save game you posted, but I can't really see where CluelessPlus have clogged up any of the cities. Yes it has quite some buses, and some of them sometimes break down, even if they are just 1-3 years old with a reliability of 80%, but I can't really see any serious traffic jams. CluelessPlus analyses how congested its stations are and makes sure not to overload them with to much buses so that there will not be a too long queue from its stations.

I can agree that in your scenario there are town pairs which have a bit too many buses and it could benefit from having less buses there which runs with a higher fill rate.

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


Top
   
 Post subject: Re: CluelessPlus
PostPosted: Sat Oct 10, 2009 3:00 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Feb 05, 2005 2:35 pm
Posts: 1190
Location: Netherlands, Utrecht
Zuu wrote:
...

I can agree that in your scenario there are town pairs which have a bit too many buses and it could benefit from having less buses there which runs with a higher fill rate.


That was about what I meant to say (not really congestion, ok, sorry :) ). Also, when competing against other bus-AI's, towns get bus-filled much faster of course. That is something which certainly played a part in this game.

_________________
*hmz*


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 165 posts ]  Go to page 1 2 3 4 59 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.