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

slap head2
Engineer
Engineer
Posts: 31
Joined: 30 Jul 2009 19:13
Location: Hull or Cambridge

Re: CluelessPlus

Post by slap head2 »

I am using both cluelessplus and admiral AI. clueless crashed when i did the ctrl+alt+c cheat link to swap companies to clueless' company to change some road elemnts that it had created.
Attachments
CluelessAI Debug Info.jpg
CluelessAI Debug Info.jpg (172.54 KiB) Viewed 690 times
Just doing what I can to help :)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: CluelessPlus

Post by Zuu »

Hehe, thats nasty of you. :-)

To resolve your problems quickly, save the game and then reload and CluelessPlus should be up and running again. (I'm quite sure it does not save anything to the savegames but instead just reads everything from the map)


For the actually crash error, I will probably look into it the next time I work with CluelessPlus but I don't see this as a serious issue if it was caused by cheating.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
slap head2
Engineer
Engineer
Posts: 31
Joined: 30 Jul 2009 19:13
Location: Hull or Cambridge

Re: CluelessPlus

Post by slap head2 »

I was playing quite happily, as has Clueless. It just randomly crashed. It has never happened before. See the screenshot.
Attachments
Black Transport, 18-03-2017.png
(55.93 KiB) Downloaded 1 time
Just doing what I can to help :)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: CluelessPlus

Post by Zuu »

Thank you very much for the report. I'll look into it and see if I can see what have happened. Thank you for the big screenshot you provided.

Maybe you can just make a copy of your entire autosave directory before playing more to rescue the autosave just before it happened? Unless you have a regular save from just before it. I'm not sure if I need or if it can be reproduced.


Edit: I just want to say that I have found out what the problem is and a fixed version is on the way. (not really a fix on the root problem, but handle the causes of broken links better)

Your problem most likely was caused by loading a game with a connection (at least one bus between two stations) which had no depots.
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 »

Upbate - verison 12

Thanks slap head 2 for reporting the bugs fixed in this release.

Changes:
  • Fixed the bug reported by slap head 2 above. It is not a fix of the cause, but better safe guarding against crashes because incomplete connections not being reported as incomplete.
  • Fixed the bug slap ahead 2 reported when he was cheating. It could happen if the AI failed to construct a route, regardless if the player was cheating or not. Just really bad luck with a new industry for example could cause it to fail too.
I've checked the station expander code and it should not be able to demolish depots when it tries to expand a station. (Unless AIRoad.BuildRoadStation demolish the depot, which it usually can not do) In this update I explicitly tell it to not demolish any road stations or road depot when it expands a station.

CluelessPlus-v12.tar
(96 KiB) Downloaded 161 times
This update has also been uploaded to BaNaNaS.
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 13

* Detect if a line makes less money that usual and then see if the road connection can be repaired. (someone might have destroyed a road in it) This check happens as earliest one year after the connection is constructed.
* Fixed code that retries if constructing a road connection failed because someone built something in the way or changed the terrain. Now it actually works. (earlier it retried with the wrong tiles) :-)
* Added a setting "Think and build slower" which is disabled by default unless you play on easy difficulty. This setting makes the AI slow down significantly. When constructing road it does it tile by tile, even for long straight sections with a significant delay between each tile. When it builds its HQ it becomes so happy so it forgets about what it is doing for a while. :-p Searching for towns to connect takes longer as well as the path-finding when it tries to connect two tiles with road.


So some more robustness as well as a new slow-mode.
Attachments
CluelessPlus-v13.tar
(100 KiB) Downloaded 182 times
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: CluelessPlus

Post by fanioz »

Zuu wrote:* Added a setting "Think and build slower" which is disabled by default unless you play on easy difficulty. This setting makes the AI slow down significantly. When constructing road it does it tile by tile, even for long straight sections with a significant delay between each tile. When it builds its HQ it becomes so happy so it forgets about what it is doing for a while. :-p Searching for towns to connect takes longer as well as the path-finding when it tries to connect two tiles with road.
Wow.. nice feature :D
Correct me If I am wrong - PM me if my English was bad :D

**[OpenTTD AI]** Image
***[NewGRF] *** Image
User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: CluelessPlus

Post by fanioz »

Hai zuu, :D
here is a screenshoot of CluelessPlus v.13 after loading a saved game.
Attachments
Unnamed, 22nd Sep 1968.png
(162.83 KiB) Downloaded 1 time
Correct me If I am wrong - PM me if my English was bad :D

**[OpenTTD AI]** Image
***[NewGRF] *** Image
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: CluelessPlus

Post by Zuu »

Thank you for the report. I'll look into it when I've got some sleep. :-) I think I fixed some loading errors just prior to uploading CluelessPlus (had to re-tar it) which I think got uploaded. So I'll see if it is a new bug or just old code.
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, took a bit more than a night to get me into looking up this, but I have now fixed the crash on load that could happen (in v13 only) if there was a bus that had less than two stations in its schedule when loading a game. This happens if there is a vehicle on the way to get sold for example.

If BaNaNaS is kind today I might also be able to upload this release. :-) [Edit: Bananas was kind today, so now v13 + v14 has been uploaded there]


As usual, if you download the AI manually you need to make sure you got the pathfinder.road AI library (version 3).
Attachments
CluelessPlus-v14.tar
(100 KiB) Downloaded 152 times
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: CluelessPlus

Post by fanioz »

:D hello zuu,
Your "Think and build slower" feature work like a charm. And remind me for the first time playing TTD, building road tile by tile :D
I've tried to put a piece of rail track just in front of CLUP road-slow-building. But he knows how to get out from there. Great.

In other chance, I've got this crash. (I'm not sure whether CLUP handling Airports too).
Attachments
Clup-14.png
Clup-14.png (12.77 KiB) Viewed 4026 times
Correct me If I am wrong - PM me if my English was bad :D

**[OpenTTD AI]** Image
***[NewGRF] *** Image
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: CluelessPlus

Post by Zuu »

The code that crashed is shared with PAXLink and actually handles all transport modes, maybe not ships, but all other. Thank you for your report.
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 »

If I understand it correctly you produced this error by changing company to CluelessPlus and then built an airport for it linked with an existing bus stop?

Update - Version 15
Here is a fix that simply remove the statistics part for airports. It contained usage of a a few (>=3) functions that are located at a different place in PAXLink compared to CluelessPlus. So until it is needed, I've just disabled statistics collection for airports in CluelessPlus.
Attachments
CluelessPlus-v15.tar
(96.5 KiB) Downloaded 177 times
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: CluelessPlus

Post by fanioz »

Subject: CluelessPlus
Zuu wrote:If I understand it correctly you produced this error by changing company to CluelessPlus and then built an airport for it linked with an existing bus stop?
No, although I didn't remember exactly.
Since a few months ago, I only play OpenTTD to test-run my under development AI, Trans. Which make me playing as Trans instead of playing as my self. Therefore it was almost impossible (for me) when I switching company to CLUP instead of Trans. And then, building airport and connecting to CLUP bus stop, which is located "inside" of town (or have to press ctrl for distant join). Believe me, I have no intention to make your AI crash, although there is no way to prove it due to the saved game was overridden.
I could agree with you if there is no other reason how the crash could be triggered.
However you've fixed it now, and that should not be problem anymore.
Peace :lol:
Correct me If I am wrong - PM me if my English was bad :D

**[OpenTTD AI]** Image
***[NewGRF] *** Image
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: CluelessPlus

Post by Zuu »

Well, there might be other ways to trigger it than linking an airport with a bus stop. If you involved a save + load then all needed should be that you constructed an airport with a bus stop that was served by at least one bus that visit 2 or maybe more bus stops.

Even if you didn't have an intention to crash the AI, I'm glad you posted about the bug so that I could fix it. Thank you.

Yes, playing as the AI or letting the AI to play is mostly how I play OpenTTD nowdays. I sometimes do stuff only myself or on #openttdcoop or on some other servers, but mostly it is AI-related. After having made algorithms to weight many factors when you choose cities/industries/engines etc. you kind of miss them when you try to play as a human player. :-)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: CluelessPlus

Post by Alberth »

Cluelessplus AI v15 tries to drive into a bus station sideways.
Attachments
wrongly placed depot?
wrongly placed depot?
depot_wrongly_placed.png (19.56 KiB) Viewed 3885 times
Brumi
President
President
Posts: 920
Joined: 18 Jul 2009 17:54

Re: CluelessPlus

Post by Brumi »

In my game, CluelessPlus v15 did this: (on r18968)
clueless bug.png
clueless bug.png (32.14 KiB) Viewed 3818 times
EDIT: It seems that this kind of problem occurs on every bus route.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: CluelessPlus

Post by Zuu »

Thank you for your report. Looks like something I better look at rather soon.
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 »

It is the same bug that both of you two have reported. The source of it is most likely the r18803 commit.
-Feature [FS#3318]: make building (long) roads work like building rail; build upon the first obstruction instead of failing totally. Patch by Terkhen.
This changed the behavior of AIRoad.BuildRoad so it would return true even if the full road was not built. CluelessPlus tries to build the road from the new bus stop/depot to the road tile. This could with the changes in r18803 return true even if the road was a slope or a bus stop. And since it "succeeded" to connect the adjacent tile with road it continued with the construction and built a bus stop / depot at the adjacent tile.

r18986 have changed back the AIRoad.BuildRoad behavior to the old way to maintain backward compatibility. So if you upgrade to the nightly that will come in about 22 hours or so, CluelessPlus should work again. Since the beta3 came in between this issue was introduced and resolved today it is also affected and users of it will need to upgrade to the nightlies instead. (If they are win32 users they could checkout my updating tool to keep the nightly up to date ;-) )

For this particular bug I could make an updated CluelessPlus that work around it by using test mode and trying to connect the tiles from both directions. However it is likely that also the road builder for connecting towns is broken in case there is an obstacle in the way. This will also need to be worked around as well.

I will not update CluelessPlus unless someone gives a good reason for it.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: CluelessPlus

Post by planetmaker »

CluelessPlus v15 (light blue) seems to perform quite well (top 3 or 4), but it could need some fleet management, improving possible performance doing so: It's standing clearly in its own way (it was even worse when Rondje (dark blue) was still having just as many vehicles on the same route with even a DTRS on it):
Attachments
CluelessPlus (nearly) alone
CluelessPlus (nearly) alone
Neu Hahnmünster Transport, 25-03-1981.png (275.13 KiB) Viewed 3687 times
Clueless jam around the church
Clueless jam around the church
Neu Hahnmünster Transport, 01-01-1979.png (284.16 KiB) Viewed 3687 times
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: Google Adsense [Bot] and 23 guests