CluelessPlus

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

krinn
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 29 Dec 2010 19:36

Re: CluelessPlus

Post by krinn »

hi zuu,
i've been hit by a bug with cluelessplus v27
i'm aware that bug might already be fix in a 28 or 29, but as it happen just after a vehicle lost event, maybe it's an harder one to fall on and it might still be there.
Attachments
Non nommé, 1982-11-24.png
Non nommé, 1982-11-24.png (187.61 KiB) Viewed 624 times
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: CluelessPlus

Post by Zuu »

I think this one has been fixed, but thanks for reporting it. I'll look into it later when I work with CluelessPlus again.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
MrKikker
Engineer
Engineer
Posts: 20
Joined: 23 Sep 2011 13:47

Re: CluelessPlus

Post by MrKikker »

error using this AI in the Scotland 1956 original TTDLX scenario:
cluelesspluserror.PNG
cluelesspluserror.PNG (115.48 KiB) Viewed 624 times
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: CluelessPlus

Post by planetmaker »

Install the required libraries and / or use the online content to obtain those automagically
MrKikker
Engineer
Engineer
Posts: 20
Joined: 23 Sep 2011 13:47

Re: CluelessPlus

Post by MrKikker »

will do, thanks :)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: CluelessPlus

Post by Zuu »

Update - version 30

Small bug-fix release:
  • Fix: remove road bit next to depots when removing depot + station of failed connections. Now, CluelessPlus shouldn't leave any road bits for failed connections anymore.
  • Fix: CluelessPlus could get stuck trying to rename a vehicle that didn't exist anymore.
  • Change: Use SuperLib v13
CluelessPlus can be downloaded from BaNaNaS. If you can't download it using the in-game client, make sure to get SuperLib v13 and the other library dependencies (see first post in this thread).
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: CluelessPlus

Post by Zuu »

Update - version 31

Yesterday I received a bug report from a person who used OpenTTD 1.0.1. It appeared that I had used a function that is not available in 1.0, so therefore, this release that moves up to API version 1.1 and set a higher requirement on bananas.
  • Updated minimum required OpenTTD version (1.0 => 1.1)
Otherwise no changes other than moving up from SuperLib v15 to SuperLib v16 which contain a slight speedup of one function.
Attachments
CluelessPlus-v31.tar
(230 KiB) Downloaded 143 times
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: CluelessPlus

Post by Zuu »

Sorry, but there is a need for a new update again.

Update - Version 32
I completely forgot to check what other API changes there were between 1.0 and 1.1 to make sure that both CluelessPlus and SuperLib doesn't use any of the old API calls. Since setting 1.1 as minimum required OpenTTD version in the AI file, also means removing the compatibility layer for API functions that has been removed/changed in 1.1.

This has now been done in both SuperLib v17 and in this new CluelessPlus 32 version.
Attachments
CluelessPlus-v32.tar
(230 KiB) Downloaded 170 times
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
GossG
Engineer
Engineer
Posts: 2
Joined: 28 Sep 2010 20:09

Re: CluelessPlus V23

Post by GossG »

I haven't read the whole thread, so I don't know which AIs are still being maintained, but the game asks me to report crashes, so here goes.
Attachments
autosave9.sav
Last autosave before crash
(99.15 KiB) Downloaded 118 times
Pundingbury Transport, 2nd Jul 1961.sav
Save after crash
(99.52 KiB) Downloaded 135 times
Pundingbury Transport, 2nd Jul 1961#1.png
Better screenshot (all of crash report)
(233.75 KiB) Downloaded 4 times
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: CluelessPlus

Post by Zuu »

Thanks for the report. Mind that you use a 9 versions old version of the AI. (you use version 23 and the latest is 32)

I'll later take a look and see if this crash can still happen with your savegame. Still, I would recommend you to upgrade to version 32.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Core Xii
Traffic Manager
Traffic Manager
Posts: 228
Joined: 08 Apr 2008 09:47
Location: Finland

Re: CluelessPlus

Post by Core Xii »

Crash report.
Attachments
Unnamed, 1958-04-02.png
(390.77 KiB) Downloaded 5 times
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: CluelessPlus

Post by Zuu »

Thanks for your bug report. Unfortunately that is a known bug that I've spent some time trying to solve without being able to figure out why it happens. It usually only happens many years into a game. What makes it worse is that the crash happens inside a library which I would guess other AI authors have used without this problem.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Ishamael
Engineer
Engineer
Posts: 1
Joined: 24 Mar 2012 06:51

Re: CluelessPlus

Post by Ishamael »

Hi, Zuu.

I tried to play with your AI and it seems to hang right at the beginning of the game.
On the attached screenshot I outlined two cities where CluelessPlus built bus stations but then destroyed them.

In another game it tried to build two airports but (probably) run out of money and was not able to buy an airplane. I only have a savegame, didn't make a screenshot of debug console.

Third try to begin a game and again ClulessPlus hung the same way as in the first case.
On the fourth try the AI succeded and built live air connection.

I used OpenTTD 1.2.0-RC3, no NewGRFs. Attached savegames for the first two cases.
Attachments
CluesessPlus_hangs.zip
(539.86 KiB) Downloaded 135 times
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: CluelessPlus

Post by Zuu »

Update - version 33

This version is mainly a bugfix release. It fixes both the buses problem reported by Ishamael (but not his aircraft problem), and the long standing issue where CluelessPlus could crash many years into a game. The later bug has been in CluelessPlus for more than a year without me being able to solve it. In the end it turned out that the crash is caused by CluelessPlus passing a very large value to the Fibonacci library that malfunctioned with that input.

The release also contain some tweaks to the pairfinder. Some of it is work in progress to support airports for industry to industry transport. However, that is not working well enough yet, so it has been disabled.


Hopefully you'll enjoy this release. If you find any bugs, please report theme here. :-)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: CluelessPlus V23

Post by Zuu »

Here follows responses to the individual bug reports
GossG wrote:I haven't read the whole thread, so I don't know which AIs are still being maintained, but the game asks me to report crashes, so here goes.
I have not been able to reproduce this error with version 33.
Core Xii wrote:Crash report.
Fixed
Ishamael wrote:Hi, Zuu.

I tried to play with your AI and it seems to hang right at the beginning of the game.
On the attached screenshot I outlined two cities where CluelessPlus built bus stations but then destroyed them.
This has been fixed.

The issue was that it could not afford to build the connection. Previously it always took max loan before building, but due to some suggestion, SuperLib is now more restrictive about taking needless loans. In your case it run out of money without having instructions on how to loan more. Now I've added instructions so that it will take more loan if it runs out of money while building.
Ishamael wrote:In another game it tried to build two airports but (probably) run out of money and was not able to buy an airplane. I only have a savegame, didn't make a screenshot of debug console.
This has not been fixed, but I believe it is related to some accounting problem. I didn't took me time to look into it now, but will probably in the future.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Brumi
President
President
Posts: 920
Joined: 18 Jul 2009 17:54

Re: CluelessPlus

Post by Brumi »

Congratulations on the new release!
Good to see such a well-maintained AI as this one :)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: CluelessPlus

Post by Zuu »

Update - Version 34

This release mostly contain improvements to make the AI more robust and some fixes.
  • Fix: Don't leave road bits around from failed stations/connections
  • Add: Close connections from secondary industries if the secondary industry had zero production for log time (previously, connection close could only get triggered if the station at the secondary industry got crowded as a result of the zero production)
  • Feature: When we fail to build a connection, remove a previously blacklisted connection from the blacklist so that they can be tried again. - Improves CluelessPlus on small maps
  • Add: When building magic DTRS fails, try to fall back to building a non-DTRS connection (if engine availability allows).
  • Add: When building non-DTRS, try a bit harder to not block the only possible connection from a road station when placing the depot.
  • Fix: Try harder to remove road bits from road stations/depots when they are removed.
  • Selection of airport location for industries have been improved. (actually an improvement in SuperLib)
  • Add/Fix: Upgrading of industry airports has also been improved and use a new dedicated method in SuperLib 26 instead of the same as upgrading airports that serve a town.
In addition this release benefits from a SuperLib fix:
  • Fix: Tile.IsBuildOnSlope_Flat returned true on steep slopes. (a consequence of this fix is that CluelessPlus will be better and faster at finding a good location for road stops)

While this release improves robustness on several points, I know that there are some remaining issues regarding air connections. In my test games, it sometimes end up with "lost" airports floating around. Possible due to issues when upgrading airports and/or closing down air connections. These issues are however not show-stoppers, only things that makes the AI look a bit clueless. ;-)

Brumi wrote:Congratulations on the new release!
Good to see such a well-maintained AI as this one :)
Thank you :-)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Brumi
President
President
Posts: 920
Joined: 18 Jul 2009 17:54

Re: CluelessPlus

Post by Brumi »

Definitely a proof of CluelessPlus being well-maintained :)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: CluelessPlus

Post by Zuu »

Update - Version 35

Changelog
  • Update to SuperLib from version 27 to 34.
  • Aircraft range (I hope it works, however I have disabled Air by default for CluelessPlus as the AI often perform better without aircraft enabled)
  • NoCarGoal support

I'm personally most excited about the last point. If you play a game with NoCarGoal version 4 or later (although only tested with v9), this AI will be able to understand which cargoes that it should prioritize in order to score as high as possible in a NoCarGoal game.

For this to work both NoCarGoal and CluelessPlus must have the setting for "AI-GS Commnication" enabled (which is the default). Note that CluelessPlus may (especially in the beginning) also transport other cargoes in order to make profit.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: CluelessPlus

Post by Kogut »

Zuu wrote:the AI often perform better without aircraft enabled
Is it also happening with disabled infrastructure costs?
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 9 guests