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

Brumi
President
President
Posts: 920
Joined: 18 Jul 2009 17:54

Re: CluelessPlus

Post by Brumi »

Congrats on the new release! :)

Anyway, I was just wondering... What do all those smilies mean in the station signs and the vehicle names? What is their order?
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: CluelessPlus

Post by Kogut »

Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Brumi
President
President
Posts: 920
Joined: 18 Jul 2009 17:54

Re: CluelessPlus

Post by Brumi »

Thanks :) I thought they were some sort of information regarding the efficiency of the services...
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: CluelessPlus

Post by Zuu »

Regarding the order, it will take the first combination that is unused for the current industry/town + cargo combination. If you read the explanation that Kougut linked, you know that ':' is zero. From the source code ( http://noai.openttd.org/svn/ai-clueless ... helper.nut ) you can find all the other symbols (1, 2, 3, .. ):

Code: Select all

)D|(/spOo3SP><{}[]$012456789abcdefghijklmnqrtuvwxyzABCEFGHIJKLMNQRTUVWXYZ?&;#=@!\%
After a while there will be combinations like ':A' that do not really make sense as smilies.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
rh1
Engineer
Engineer
Posts: 4
Joined: 03 Aug 2010 20:47

Re: CluelessPlus

Post by rh1 »

Version 22 works good for me now.

I noticed a thing that could be improved... the AI seems to always max out the bank loans, and never repays them, even when it has a lot of money.
bokkie
Transport Coordinator
Transport Coordinator
Posts: 327
Joined: 19 Jan 2007 19:26

Re: CluelessPlus

Post by bokkie »

In my current game CluelessPlus is performing quite good, even better than NoCab and AdmiralAI! There is however one issue: Dr. Clue demolishes roads to build his own stations. This destroyed the fastest path of my busses so they have to take a large detour. On small maps micromanagement is fun but on a large map with many new routes to build, I like to 'set and forget' as much as possible. I guess avoiding that makes it a lot harder to build the stations though... :)
Attachments
J. van Bokhorst Transport, 1954-06-01.png
(669.54 KiB) Downloaded 2 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. I will take a look into it. I don't want CluelessPlus to be too much in the way of players but rather stick to its business.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Samu
Traffic Manager
Traffic Manager
Posts: 236
Joined: 17 Apr 2007 14:28

Re: CluelessPlus

Post by Samu »

There is some weird behaviour with CluelessPlus. Right after it has build a connection with trucks or buses, it immediately starts to manage them and sells all the vehicles it has just built:
Sem nome, 29 Jan 1951.png
(139.6 KiB) Downloaded 2 times
Sem nome, 29 Jan 1951.sav
(77.51 KiB) Downloaded 161 times
It does this in 2 or 3 connections and ends up removing the road even with its own vehicles on it.


This is what happens right before going bankrupt, lost vehicles on road pieces that weren't able to be sold on time:
Sem nome, 5 Jan 1952.png
(94.54 KiB) Downloaded 2 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 samu for the report.

It looks that your problem is caused by the code I had in place to make my AI work for OpenTTD versions without AIOrder.IsOrderInvalid. However since 1.0.4 (or 1.0.3) I think this function has been added to the stable versions, so I didn't bother to fix the backward compatibility code to both work on old and new OpenTTD versions, instead I have made it so that if you use a too old OpenTTD version where AIOrder.IsOrderInvalid does not exist, it will simply not detect vehicles with invalid orders. My hope is that most users now has a recent enough OpenTTD stable/trunk that it shouldn't be a problem. (and if someone has problem with keeping up to date on Windows, they could take a look on my OpenTTD Auto Update program ;-) )

I've also fixed the bug posted above when the AI would block an old road by building a bus stop in it. This I guess has happened due to the road was previously owned by a company that went bankrupt. Thus CluelessPlus had the rights to destroy it while it didn't own the tile so it didn't think it was something to protect. (in theory CluelessPlus could before this fix do the same harm to one of its own routes if it used road owed by nobody)

These two fixes have been published as Version 23 - already uploaded to BaNaNaS, and for you who can't use bananas for one or another reason here's the tar-file:
CluelessPlus-v23.tar
Dependencies: (AI libraries that you need to make sure you install correctly, if you download CluelessPlus manually)
Pathfinder.Road - version 3
Queue.FibonacciHeap - version 2
SuperLib - version 6
(200 KiB) Downloaded 204 times
Changelog
  • Fixed problem with checking for invalid orders that caused correct orders to be seen as invalid (reported by bokkie)
  • Be more careful when expanding stations to not block an existing road (reported by samu)
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 »

I think that Clueless may sometimes add more vehicles to route, even without station expanding.
Attachments
Przechwytywanie.PNG
Przechwytywanie.PNG (86.78 KiB) Viewed 6051 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
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 feedback, not sure why it does not add more trucks. Maybe it already have 500 road vehicles? Do you have a savegame?

Edit: Nevermind - I found the problem stations in the yes.sav that you posted in your test game thread.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
luk3Z
Traffic Manager
Traffic Manager
Posts: 197
Joined: 25 Dec 2005 17:42
Location: Kielce, Poland (Mars sometimes)

Re: CluelessPlus

Post by luk3Z »

I don't know why but I downloaded this CluelessPlus-v23.tar [200 KiB] from here and from BaNaNaS and I noticed that some files in archive have different size (I checked choochoo AI and it also has different). So what is the original CluelessPlus-v23 ?
Find new graphics easier:
GRFCrawler -> http://grfcrawler.tt-forums.net
BaNaNaS -> https://bananas.openttd.org/
32 bit gfx in OTTD (32bpp) -> https://wiki.openttd.org/en/Community/N ... 20graphics
TTDPatch 2.6 -> viewtopic.php?f=19&t=67694
How to subtract tax from income (workaround) -> viewtopic.php?t=89763&start=20
How to ban distance from income -> Simple Cargo Decay Override
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: CluelessPlus

Post by Lord Aro »

Its probably something that the bananas uploader does to the files, like a license entry
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
User avatar
luk3Z
Traffic Manager
Traffic Manager
Posts: 197
Joined: 25 Dec 2005 17:42
Location: Kielce, Poland (Mars sometimes)

Re: CluelessPlus

Post by luk3Z »

Lord Aro wrote:Its probably something that the bananas uploader does to the files, like a license entry
Rather looks like "nighty" and final:

http://yfrog.com/hqcluelessplusj

but both has signed as v23
Find new graphics easier:
GRFCrawler -> http://grfcrawler.tt-forums.net
BaNaNaS -> https://bananas.openttd.org/
32 bit gfx in OTTD (32bpp) -> https://wiki.openttd.org/en/Community/N ... 20graphics
TTDPatch 2.6 -> viewtopic.php?f=19&t=67694
How to subtract tax from income (workaround) -> viewtopic.php?t=89763&start=20
How to ban distance from income -> Simple Cargo Decay Override
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: CluelessPlus

Post by Zuu »

Hmm, I'm not sure why. But indeed there is some differences. I've untared both one version 23 from the forum and one from bananas.

Code: Select all

diff -q <dir1> <dir2>
This gives me a few files. I checked one file return_values.nut and ran a diff on those files and came up with that these two lines differed:

Bananas:

Code: Select all

RETURN_SUCCESS <- 0;
Forum:

Code: Select all

RETURN_SUCCESS <- 0;
However, I can't visually see what the difference is nor does gvim show any partial new-line characters.

I've also checked the other files that are reported different and they all show similar strange reports.


Edit: The differences are most likely an effect of the re-packaging that bananas does. Especially since it is very long time since I touched the return_values.nut file. For uploading to bananas and forum, I use the same tar file which is generated by a script. Between those versions there is the SVN version that of course could differ, but then you need an SVN client to get hold of the AI code.
Last edited by Zuu on 21 Nov 2010 08:49, edited 1 time in total.
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 »

Maybe windows-linux new line conversion?
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
User avatar
luk3Z
Traffic Manager
Traffic Manager
Posts: 197
Joined: 25 Dec 2005 17:42
Location: Kielce, Poland (Mars sometimes)

Re: CluelessPlus

Post by luk3Z »

Files have diffrent size but they are the same inside.
I cheked these files in WinMerge and it says that files have diffrent EOL (end of line) signs.
Find new graphics easier:
GRFCrawler -> http://grfcrawler.tt-forums.net
BaNaNaS -> https://bananas.openttd.org/
32 bit gfx in OTTD (32bpp) -> https://wiki.openttd.org/en/Community/N ... 20graphics
TTDPatch 2.6 -> viewtopic.php?f=19&t=67694
How to subtract tax from income (workaround) -> viewtopic.php?t=89763&start=20
How to ban distance from income -> Simple Cargo Decay Override
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: CluelessPlus

Post by planetmaker »

luk3Z wrote:Files have diffrent size but they are the same inside.
I cheked these files in WinMerge and it says that files have diffrent EOL (end of line) signs.
Windows line endings are two byte while linux line endings are one.
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: CluelessPlus

Post by Alberth »

I downloaded CluelessPlus-23.tar through bananas, and from http://www.tt-forums.net/viewtopic.php?p=912081#p912081 I downloaded CluelessPlus-v23.tar .

When unpacking, the bananas version creates a directory CluelessPlus-23 (I renamed it to CluelessPlus-23_bananas), while the manually downloaded one creates directory CluelessPlus (renamed to CluelessPlus_download).

Running diff gives:

Code: Select all

$ diff --brief --recursive CluelessPlus-23_bananas CluelessPlus_download 
Only in CluelessPlus-23_bananas: license.txt
Files CluelessPlus-23_bananas/pairfinder.nut and CluelessPlus_download/pairfinder.nut differ
Files CluelessPlus-23_bananas/return_values.nut and CluelessPlus_download/return_values.nut differ
Files CluelessPlus-23_bananas/strategy.nut and CluelessPlus_download/strategy.nut differ
Thus, one extra license file, and three changed files.

Looking in more detail into the return_values.nut file:

Code: Select all

$ xxd CluelessPlus_download/return_values.nut | head -5
0000000: 0d0a 5245 5455 524e 5f53 5543 4345 5353  ..RETURN_SUCCESS
0000010: 203c 2d20 303b 0d0a 5245 5455 524e 5f46   <- 0;..RETURN_F
0000020: 4149 4c20 3c2d 2031 3b0d 0a52 4554 5552  AIL <- 1;..RETUR
0000030: 4e5f 4e4f 545f 454e 4f55 4748 5f4d 4f4e  N_NOT_ENOUGH_MON
0000040: 4559 203c 2d20 323b 0d0a 5245 5455 524e  EY <- 2;..RETURN
The 'xxd' command dumps the whole file in hex format, 'head -5' limits the output to the first 5 lines. Doing the same for the banas variant:

Code: Select all

$ xxd CluelessPlus-23_bananas/return_values.nut | head -5
0000000: 0a52 4554 5552 4e5f 5355 4343 4553 5320  .RETURN_SUCCESS 
0000010: 3c2d 2030 3b0a 5245 5455 524e 5f46 4149  <- 0;.RETURN_FAI
0000020: 4c20 3c2d 2031 3b0a 5245 5455 524e 5f4e  L <- 1;.RETURN_N
0000030: 4f54 5f45 4e4f 5547 485f 4d4f 4e45 5920  OT_ENOUGH_MONEY 
0000040: 3c2d 2032 3b0a 5245 5455 524e 5f54 494d  <- 2;.RETURN_TIM
As you can see, the windows end-of-line \r\n (0d 0a) sequences got replaced by unix end-of-line \n (0a).

This happens for the whole file, and for both other files as well (I checked the last part of both other files as well).
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: CluelessPlus

Post by planetmaker »

I just started a test game I'm running with a couple of AI for the rest of the day. A detailed analysis will follow later, but what I saw when I just looked around the map initially is the behaviour of CluelessPlus on its first bus route: it seems quite overloaded with busses.

All content should be available from either bananas or the devzone.
Attachments
Oskarsåker Transport, 1950-08-08.sav
(339.62 KiB) Downloaded 130 times
Oskarsåker Transport, 1950-08-04.png
Oskarsåker Transport, 1950-08-04.png (91.2 KiB) Viewed 5815 times
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 6 guests