FelicitusAI v0.2.1

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

User avatar
Timitry
Transport Coordinator
Transport Coordinator
Posts: 313
Joined: 01 Oct 2004 15:28
Contact:

Re: FelicitusAI v0.2

Post by Timitry »

The AI somehow failed to build the second track back to the primary cargo station, but it keeps sending new trains...
The stations look good, though - just wondering, why don't you use path signals on those? Would be easier + save some space, while increasing throughput a little bit!

[e] + the queuing does not work that well... See screenshot #2
Attachments
Felicitus AI.png
(197.03 KiB) Downloaded 199 times
Felicitus AI 2.png
(172 KiB) Downloaded 177 times
Felicitus
Engineer
Engineer
Posts: 29
Joined: 17 Feb 2009 06:35

Re: FelicitusAI v0.2

Post by Felicitus »

Well, the reason is simple: I didn't use path signals when I parsed the stations :) I don't have an in-depth knowledge of path signals, so I build the stations like I'm used to build them ;).

I guess the problem is at the other side, can you make a screenshot of the other station?
User avatar
Timitry
Transport Coordinator
Transport Coordinator
Posts: 313
Joined: 01 Oct 2004 15:28
Contact:

Re: FelicitusAI v0.2

Post by Timitry »

Oh, i am sorry, i don't have that game saved or running anymore. However, the other station looked exactly like the other one. The AI kept sending more and more trains, then had no money and soon went bankrupt... However, restarting it on the same map, it worked quite well.
Felicitus
Engineer
Engineer
Posts: 29
Joined: 17 Feb 2009 06:35

Re: FelicitusAI v0.2

Post by Felicitus »

Yes, for some reason the second line couldn't be built, maybe there was a slope or something. Currently the AI buys trains as soon as the cargo waiting is over a defined amount, and then it clones the train. I might do an improved algorithm later, but the real challenge for now is to find out why it couldn't build the second line :)
User avatar
Timitry
Transport Coordinator
Transport Coordinator
Posts: 313
Joined: 01 Oct 2004 15:28
Contact:

Re: FelicitusAI v0.2

Post by Timitry »

Hm, just tested the AI again, and only then i thought of the autosaves being made automatically, but it was too late already then, sorry.
Testing 4 of your AIs on a 1024² map froze my computer for a minute like 4 times, but then worked. Starting 6 at once made it really freeze ;-)
One mistake i found: The ai build a T.I.M. as train engine, which is dual-headed, with the result that the whole train was half a tile too long, which made trains queue up before the depot/station - probably just a missing check, but i wanted to tell you.
However, nice work so far! - But you should really try out path signals ;-) , see my example above :D
Greetings, Tim
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: FelicitusAI v0.2

Post by planetmaker »

Hi,
being a bit sleepless, I ran another testrun of your AI today. Working quite successfull so far While it starts with an awesome moneymaker and builds a decent route, the main thing which struck me is that it didn't continue to build once it made sufficient money, but kept going with that one line for years, though it had millions (after 10 years, still the first line which was built after 6 months or so, but 5 million cash available; AI was still running according to console). Restarting the AI resulted in exactly the same result: exact same tracks were built, but again no activity was picked up beyond this first line which was complemented with half a dozen trains or so; the savegame is attached. You should obtain the exact same results again, if you restart the AI (maybe delete your own airports before you do so).

Some smaller issues I noted:
station builder: missing signal
station builder: missing signal
felicitus_signal issue.png (39.57 KiB) Viewed 5163 times
At the exit of the station seems to be a missing signal (right after the join)
pathfinding: unnecessary corners
pathfinding: unnecessary corners
felicitus_pathfinding.png (16.34 KiB) Viewed 5169 times
Probably the same issue with pathfinding as yesterday :) - the lines could be smoothed a lot, even w/o terraforming.

- The loan is not paid back as it seems
- The trains barely make the slopes. Using two engines or shorter trains might even increase your profits.

Despite this, good job so far. You probably make more money than a lot of people initially :) - and you're never in danger of bancruptcy. I know it's a damn hard job to tell a computer what a human considers "just sensible" :) - there's not much which can beat human visual pattern recognition, which basically track building / pathfinding is about
Attachments
Saarfurt Transport, 12. Apr 1987.sav
savegame (r15566)
(485.28 KiB) Downloaded 151 times
railnut
Engineer
Engineer
Posts: 4
Joined: 11 Feb 2009 19:03

Re: FelicitusAI v0.2

Post by railnut »

OK,

When I first tried it, it was with 0.7.0-beta, got the nightly build (r15557) and actually got it working until it tried building something and then - boom - script error (see screenshot below). Fixed that but now on my test scenario it does not do anything - just stating that it can't find a sane placement for source/target station. Keeps on trying and eventually goes bankrupt. Possible that the station it is trying to build is too big?

Scenario is 'Africa & Middle East' from '0.4.x' release ? Have added the test scenario on as well.

Keep up the good work.
Attachments
Sharkey & Co., 8th Apr 1948.png
(95.2 KiB) Downloaded 117 times
Africa & Middle-East (AI Testing).scn
(702.81 KiB) Downloaded 145 times
Felicitus
Engineer
Engineer
Posts: 29
Joined: 17 Feb 2009 06:35

Re: FelicitusAI v0.2

Post by Felicitus »

Okay, that's clearly a mistake on my side. Seems that it wants to build a tunnel, but its using the old constant. Will fix that for the next release :)

If you want to fix it yourself, just replace VEHICLE_RAIL with VT_RAIL in the source code.
railnut
Engineer
Engineer
Posts: 4
Joined: 11 Feb 2009 19:03

Re: FelicitusAI v0.2

Post by railnut »

Felicitus wrote:Okay, that's clearly a mistake on my side. Seems that it wants to build a tunnel, but its using the old constant. Will fix that for the next release :)

If you want to fix it yourself, just replace VEHICLE_RAIL with VT_RAIL in the source code.
Already did ... :mrgreen:
X_stream
Engineer
Engineer
Posts: 18
Joined: 04 Nov 2004 13:29
Location: Bussum => Netherlands
Contact:

Re: FelicitusAI v0.2

Post by X_stream »

I have been playing around with your AI for a bit. I must admit that I'm really excited by your approach and I hope you will get the AI to work as you intend.

I did found a bug which caused the AI to go bankrupt allot of times in my games.
It waits for full load of the train, and in some cases the loc of the train can transport mail or passengers.
This means that if the station isn't near a city, the train will never leave the loading station.

I think you can set trains to 'wait for any load' to solve this problem.

Keep up the good work!

Edit:

Also when the AI builds dual headed loc's, the trains become too long and thus block the entrance of the station.
As a result the trains don't enter the depot and this in turn makes the AI believe it needs to build more trains for the route I think.
Attachments
Duel head engine blocks entrance to depot making the AI create a lot of trains
Duel head engine blocks entrance to depot making the AI create a lot of trains
Unnamed, 13th Oct 2003.png (48.41 KiB) Viewed 4743 times
Train waiting for ever to full load passengers
Train waiting for ever to full load passengers
Unnamed, 1st Mar 2006.png (49.44 KiB) Viewed 4761 times
Felicitus
Engineer
Engineer
Posts: 29
Joined: 17 Feb 2009 06:35

FelicitusAI v0.2.1

Post by Felicitus »

Yes, here you are. This time only a few bugfixes, e.g. it builds trains only to the maximum station length. This should fix the problem with the dual headed trains.

Fixes
- Fixed the VT_RAIL-problem
- Uses in-process estimation of the maximum train length

Download here: http://www.timohummel.com/temp/felicitus-ai-0.2.1.tgz
Aali
Traffic Manager
Traffic Manager
Posts: 144
Joined: 01 Oct 2008 00:04
Location: Sweden

Re: FelicitusAI v0.2.1

Post by Aali »

Any chance of seeing this AI on bananas?
Felicitus
Engineer
Engineer
Posts: 29
Joined: 17 Feb 2009 06:35

Re: FelicitusAI v0.2.1

Post by Felicitus »

Yes, sure, as soon as I talked to TrueBrain, since Bananas' upload failed for the tar file ;)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: FelicitusAI v0.2.1

Post by Zuu »

Keep in mind that bananas only work good with integer versions. Because it uses the integer value of what you input to compare if a version is newer than another.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Felicitus
Engineer
Engineer
Posts: 29
Joined: 17 Feb 2009 06:35

Re: FelicitusAI v0.2.1

Post by Felicitus »

Yes I know - FelicitusAI uses Version 1 as offical version, so that should have worked. v0.2.1 is my internal versioning scheme.
defaultluser
Engineer
Engineer
Posts: 34
Joined: 01 Mar 2009 19:56

Re: FelicitusAI v0.2.1

Post by defaultluser »

I tried to get your AI workng, but I was unsuccessful. I copied the tgz file to openttd\content_download\ai. With other AIs, I've been able to do this, and see the it the AI options menu. Yours does not show up.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: FelicitusAI v0.2.1

Post by Yexo »

defaultluser wrote:I tried to get your AI workng, but I was unsuccessful. I copied the tgz file to openttd\content_download\ai. With other AIs, I've been able to do this, and see the it the AI options menu. Yours does not show up.
tgz != tar. OpenTTD supports only tar files. Your best bet is to extract the archive and put it in the right directory.
defaultluser
Engineer
Engineer
Posts: 34
Joined: 01 Mar 2009 19:56

Re: FelicitusAI v0.2.1

Post by defaultluser »

Yexo wrote:
defaultluser wrote:I tried to get your AI workng, but I was unsuccessful. I copied the tgz file to openttd\content_download\ai. With other AIs, I've been able to do this, and see the it the AI options menu. Yours does not show up.
tgz != tar. OpenTTD supports only tar files. Your best bet is to extract the archive and put it in the right directory.
I thought this might be the case, although why the authors didn't include something as rudimentary as gzip in OpenTDD is beyond me.

The question is, why didn't the author post a TAR if the game can't use it? I just tried creating my own TAR archive, but when I bring-up OpenTTD, it still doesn't see it.

EDIT: I re-crated the TAR with the proper directory structure, and tried it again. This time, I saw the AI under the menu, but when I played a game, the AI came up as Unnamed, and did absolutely nothing. I even used start_ai felicitusai from the console, and the AI it created still did nothing.

Using 0.7 beta 1 on WinXP.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: Ahrefs [Bot] and 10 guests