Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Mon Nov 19, 2018 12:39 pm

All times are UTC




Post new topic  Reply to topic  [ 126 posts ]  Go to page 1 2 3 4 57 Next
Author Message
 Post subject: OtviAI (version 415)
PostPosted: Mon Sep 22, 2008 3:58 pm 
Offline
Engineer
Engineer

Joined: Fri Aug 08, 2008 11:35 am
Posts: 107
This AI is part of a collection of test AI's written with the intention of training and improving our main AI: rondje (Rondje om de kerk, winner of the TJIP challenge 2008. See seperate post on that.).

OtviAI was previously a collection of a few testing AI's but it's now all merged into one code base.

What does it do?
- busses & trucks
- tram
- trains
- boats
- aircraft

It's mainly passenger and mail, but it will do the occasional cargo route. It's tested with various newgrf's like ECS, FIRS, 2CC etc.

During the challenge we had OtviAI and Convoy running against each other on a 512x512 temperate map for 10 years on a laptop in the background and OtviAI won this :D I had to start this head-to-head game as Truebrain didn't believe us when we said our test ai could beat Convoy ;)

It would be nice to see how it's performing in the tournament here :)

All our code is released under GPL v2, we already made our profit by winning the TJIP challenge anyway ;-)

Comments and suggestions are always welcome, just post them here or use the email address provided in the README's in the tar files.

Changelog:
====
1.1: gpl v3 --> gpl v2, also in the files and repackaging now with directories included.
1.2: update for changes in API (new and improved: now WITH initialized roadtype)
1.3: update for all the latest greatest API changes; also fixes bug in distance boundaries for new routes.
1.4: change directory structure (no more '..' in paths) and change tar packaging again
282: change numbering to only subversion numbers (for bananas), merge subsidyAI into main ai
283: include svn number in info.nut file for bananas
310: update for new subsidy api calls
312: 1.0 API and fix the load() call
379: code restructure, trains, trams, newgrf support
383: bugfix release
395: eastern edition: got rid of this accidental easter egg (aka: bug)
396: doh-edition: remove temporary test code that prevented it from building anything for passengers and/or mail
397: blame it on the gf-edition: fix vehicle count calculation for very slow vehicles
398: fix double routes and mix up town-industry numbers
399: API 1.1 and a few bugfixes and tweaks
411: API 1.2; added boats and numerous tweaks and small changes
413: fixed the boats and various small improvements
414: mostly train improvements to better work with 2cc, nutracks and other newgrfs
415: fix industry filtering bug that popped up in tropical
418: aircraft support and loads of small fixes and tweaks

The AI can be find with the 'find online content' within OpenTTD and there's a downloadable copy attached to this post.


Attachments:
OtviAI.tar [340 KiB]
Downloaded 521 times

_________________
OtviAI
Rondje om de kerk (AI)


Last edited by Maninthebox on Wed Jun 05, 2013 3:00 pm, edited 23 times in total.
Top
   
 Post subject: Re: OtviAI
PostPosted: Mon Sep 22, 2008 4:29 pm 
Offline
Tycoon
Tycoon

Joined: Thu Dec 20, 2007 12:49 pm
Posts: 3653
Nice, I don't have time to look at it now, but I'll do some testing later this week.

Maninthebox wrote:
All our code is released under GPL v3, we already made our profit by winning the TJIP challenge anyway ;-)

OpenTTD is released under GPL v2, so if you want your code to be reusable in an AI that gets included in OpenTTD, you might consider releasing it under GPL v2.


Top
   
 Post subject: Re: OtviAI
PostPosted: Mon Sep 22, 2008 4:44 pm 
Offline
Engineer
Engineer

Joined: Fri Aug 08, 2008 11:35 am
Posts: 107
I sorta half realized that after posting (that realisation might have something to do with a certain mail from teammember michiel :P). So:

:%s/GPL v3/GPL v2/g

I'll change the uploaded files in the start post soon :)

_________________
OtviAI
Rondje om de kerk (AI)


Top
   
 Post subject: Re: OtviAI
PostPosted: Mon Sep 22, 2008 6:22 pm 
Offline
Engineer
Engineer

Joined: Sun May 30, 2004 8:48 pm
Posts: 39
Eager to try it out, however, it doesn't show up when I type list_ai (yes, it's placed in the right folder along with other AI's that do show up). Have I missed something... Maybe it's a problem with the licence?? (just kidding :wink: )


Top
   
 Post subject: Re: OtviAI
PostPosted: Mon Sep 22, 2008 6:51 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Mon May 31, 2004 9:21 am
Posts: 1303
They f*** up packing the tar, like most people do :p They seem to think it is a good idea to omit 'dirs', while our system depends on it. Most linux 'tar's do this correct, but most GUI based ones don't ... ;) It is silly, I know ..

Either way, here are the tars in their form which OpenTTD understands.

(removed files, as first post has now working files ;))

_________________
The only thing necessary for the triumph of evil is for good men to do nothing.


Top
   
 Post subject: Re: OtviAI
PostPosted: Mon Sep 22, 2008 10:28 pm 
Offline
Engineer
Engineer

Joined: Fri Aug 08, 2008 11:35 am
Posts: 107
I actually did use a linux tar, but I did a rather manual tarring with a find on *.nut to prevent packing all the subversion files in the tar, I'll try to remember to add the directories to it next time. Better yet... I'll make it a Makefile target :P Thanks for the retarring anyway :)

_________________
OtviAI
Rondje om de kerk (AI)


Top
   
 Post subject: Update
PostPosted: Thu Sep 25, 2008 11:56 am 
Offline
Engineer
Engineer

Joined: Fri Aug 08, 2008 11:35 am
Posts: 107
Changed the GPL version to version 2 (in the post, the COPYING and each and every source file). Also changed the way the tarballs are created: new: now WITH directory structure 8)

_________________
OtviAI
Rondje om de kerk (AI)


Top
   
PostPosted: Mon Nov 10, 2008 1:10 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Fri Jan 19, 2007 7:26 pm
Posts: 326
I was going to try to compare some AI's but the latest NoAI binary doesn't load OtviAI (or the other ones in this thread).


Top
   
PostPosted: Mon Nov 10, 2008 1:58 pm 
Offline
Engineer
Engineer

Joined: Fri Aug 08, 2008 11:35 am
Posts: 107
Hmmmm... I verified this with the lastest subversion version and it does fail to load the tarred version. I forgot to include the top level directory in the tarball. Adding this solves the problem of loading the tar, but leads to a new problem:

dbg: [misc] [squirrel] Failed to compile '%aitar%otviai/RoadFinder/../graph/AStar.nut'
dbg: [ai] [1] [S] Your script made an error: cannot open the file

It almost looks like the tar loader can't handle '..' in filenames anymore?

Unpacking the tarball (I think winrar can do this for windows users) solves the problem for now.

_________________
OtviAI
Rondje om de kerk (AI)


Top
   
PostPosted: Thu Nov 13, 2008 12:26 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Fri Jan 19, 2007 7:26 pm
Posts: 326
Tried it with some other AI's for a few years and there were some things I noticed:
- OtviAI builds drive-through stops for mail but only connects one side of it. This looks a bit awkward.
- Builds a lot of unnecessary road, if cities are already connected OtviAI 'often' builds extra road which isn't significantly faster. (Esthetics are important for me in an OpenTTD AI ;)).

Other than that, it's very active in connecting cities and that's very nice IMO!


Top
   
PostPosted: Tue Jan 06, 2009 12:46 pm 
Offline
Engineer
Engineer

Joined: Fri Aug 08, 2008 11:35 am
Posts: 107
Updated all three AI's to reflect changes in road API. Tarballs are in the first post :)

_________________
OtviAI
Rondje om de kerk (AI)


Top
   
PostPosted: Tue Jan 20, 2009 1:12 pm 
Offline
Engineer
Engineer

Joined: Fri Aug 08, 2008 11:35 am
Posts: 107
Updated OtviAI (others aren't updated yet) to reflect all the latest greatest API changes. Also fixes bug with too large boundaries on checking for new cities to connect after a few years.

_________________
OtviAI
Rondje om de kerk (AI)


Top
   
PostPosted: Wed Jan 21, 2009 10:23 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
So finally *.openttd.org came online again and I finnaly could download your AI from bananas. (hmm, man is stupid, I could just have downloaded it from here.. :p )

However I got some errors, see attached image. So I restarted OpenTTD incase it was a cacheproblem, but same result. Second thing I did was to unpack the tar file and move the tar-file out of searched path. This solved the errors.
Attachment:
cannot_open_file.png [264.89 KiB]
Downloaded 86 times


Third thing I tested was to make a tar using 7zip. Exactly the same way as I made my own tars and with my own tars. And with this tar I got the same problems as with the tar I downloaded from BaNaNaS.

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


Top
   
PostPosted: Wed Jan 21, 2009 11:11 pm 
Offline
Tycoon
Tycoon

Joined: Thu Dec 20, 2007 12:49 pm
Posts: 3653
I have the same problem here, it is caused by this line in roadfinder.nut:
Code:
require("../graph/AStar.nut");


OpenTTD seems to fail on the "../" in that path, for now it can be circumvented by removing the require from roadfinder.nut and adding
Code:
require("graph/AStar.nut");

to main .nut.

Just to be clear: using ".." in the path when your files are inside a tar is not and will not be supported by OpenTTD


Top
   
PostPosted: Thu Jan 22, 2009 1:30 pm 
Offline
Engineer
Engineer

Joined: Fri Aug 08, 2008 11:35 am
Posts: 107
Tar and I are not on speaking terms anymore :P

Anyhow... changed directory structure to avoid having to use '..' in pathnames, also changed tar packaging again. New version available via online content system and in the first post (note: only OtviAI.tar is up to date at the moment, repackaging others as soon as main version is problem free :) ).

---
edit: '..' seems to be handled in the source code?

_________________
OtviAI
Rondje om de kerk (AI)


Top
   
PostPosted: Thu Jan 22, 2009 10:10 pm 
Offline
Tycoon
Tycoon

Joined: Thu Dec 20, 2007 12:49 pm
Posts: 3653
Maninthebox: can you start using integer versions (ie not 1.3)? OpenTTD reads the version from info.nut as integer, so both 1.3 and 1.4 of OtviAI register to openttd as version 1, which might give problems with loading the correct version for savegames and such.


Top
   
PostPosted: Fri Jan 23, 2009 10:26 am 
Offline
Engineer
Engineer

Joined: Fri Aug 08, 2008 11:35 am
Posts: 107
Hmmm... guess I'll better stop the whole dual versioning then and just use the svn version. Now if only I could automagically put that number in my info.nut on the right spot... think I need to script something :)

_________________
OtviAI
Rondje om de kerk (AI)


Top
   
PostPosted: Sat Jan 24, 2009 2:54 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9052
Location: Sol d
The AI died on me:
I'm playing with r15235 and OtviAI v1.4.


Attachments:
File comment: error log for the AI
AI Observer GmbH & Co KG, 1953-10-15.png
AI Observer GmbH & Co KG, 1953-10-15.png [ 19.31 KiB | Viewed 21653 times ]
File comment: save of time when I noticed
AI Observer GmbH & Co KG, 1953-02-08.sav [1.19 MiB]
Downloaded 174 times
AI Observer GmbH & Co KG, 1948-11-19.sav [1.15 MiB]
Downloaded 301 times

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Top
   
PostPosted: Sat Jan 24, 2009 11:15 am 
Offline
Tycoon
Tycoon

Joined: Thu Dec 20, 2007 12:49 pm
Posts: 3653
AIEventVehicleCrash has been renamed to AIEventVehicleCrashed some time ago.


Top
   
PostPosted: Fri Jan 30, 2009 3:13 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Thu Apr 03, 2008 8:18 am
Posts: 215
Drive through bus stops + full load orders = bad mix


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 126 posts ]  Go to page 1 2 3 4 57 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 8 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.