Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Fri Sep 21, 2018 10:38 pm

All times are UTC




Post new topic  Reply to topic  [ 73 posts ]  Go to page 1 2 3 4 Next
Author Message
 Post subject: CivilAI
PostPosted: Sun Feb 09, 2014 6:26 am 
Offline
Graphics Moderator
Graphics Moderator
User avatar

Joined: Mon Sep 13, 2004 1:21 pm
Posts: 5302
Location: The Moon
CivilAI version 16 is now on Banananananas, released June 24 2018. OpenTTD 1.6.0 or later is required.

v7 was a major update, and adds trucks and trains to the AI's repertoire, as well as tidying up a lot of its earlier behaviour. It should now be considered a "normal" competitive AI rather than a specialist oddity, although hopefully it's kept its general "civility" and pleasant construction style. Discussion of the latest version starts here.


An AI which builds a road network and fills it with buses and town cars.

CivilAI is my first AI, and one I've been meaning to make for a while. It builds an inter-city road network and entraffics it with buses and, if available, town cars (which it defines as "vehicles with 0 running cost and a capacity of less than 10"). It's non-competitive in that it will avoid building a bus network in towns which already have good passenger service, but it does usually manage to sustain itself. Give it a go, see how it does! And if you look at the code, don't laugh too hard; I was learning as I went. :)

You can download CivilAI from Bananas - the current version is version 6. It has no dependencies except the default road pathfinder, but it does enjoy a good road vehicle set and some eyecandy town cars. OpenTTD 1.4 or later is required.

_________________
Pikkarail.com blog | Patreon
Dev reference: NML Specs - NewGRF Specs - Savegame Internals - NoAi API - NoGo API


Last edited by PikkaBird on Sun Jun 24, 2018 3:36 am, edited 15 times in total.

Top
   
 Post subject: Re: CivilAI
PostPosted: Sun Feb 09, 2014 11:10 am 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
It works, it connected nearby town - but instead of adding some bus service it started connecting next towns. Is it expected ("builds an inter-city road network and entraffics it with buses")?

Due to low number of RV it was unable to sustain itself in my test.

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD


Last edited by Kogut on Sun Feb 09, 2014 11:45 am, edited 3 times in total.

Top
   
 Post subject: Re: CivilAI
PostPosted: Sun Feb 09, 2014 11:10 am 
Offline
Chairman
Chairman

Joined: Sat Jul 18, 2009 5:54 pm
Posts: 885
Nice to see you developing an AI :)

I got a crash on the first run, and it crashes with the same reason even after restarting:
Attachment:
civilai.png [20.09 KiB]
Downloaded 14 times


I am using OpenTTD 1.3.3, and no NewGRFs were used which should affect your AI.


Top
   
 Post subject: Re: CivilAI
PostPosted: Sun Feb 09, 2014 11:51 am 
Offline
Graphics Moderator
Graphics Moderator
User avatar

Joined: Mon Sep 13, 2004 1:21 pm
Posts: 5302
Location: The Moon
Brumi wrote:
Nice to see you developing an AI :)

I got a crash on the first run, and it crashes with the same reason even after restarting:
Attachment:
civilai.png


I am using OpenTTD 1.3.3, and no NewGRFs were used which should affect your AI.


Ooh... I guess it needs a newer version than 1.3.3 then. :)

Yep... HasCargoRating is new in 1.4.0... I should change the required version number. Whoops.

_________________
Pikkarail.com blog | Patreon
Dev reference: NML Specs - NewGRF Specs - Savegame Internals - NoAi API - NoGo API


Top
   
 Post subject: Re: CivilAI
PostPosted: Sun Feb 09, 2014 12:35 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Sep 28, 2009 5:15 pm
Posts: 6165
Location: Eastern KY
Seems nifty so far! I like how the passenger cars all get individually named. Eyecandy Road Vehicles also works pretty well.

_________________
Do you like drones, quadcopters & flying toys? Check out Drone Strike Force!
Image

Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | RoadTypes?


Top
   
 Post subject: Re: CivilAI
PostPosted: Sun Feb 09, 2014 1:06 pm 
Offline
Moderator
Moderator
User avatar

Joined: Mon Dec 26, 2005 8:19 pm
Posts: 17141
Location: Harringay, North London
Another Pikka creation that will become a cornerstone of my game, I've no doubt.

_________________
Albion: A fictional Britain

Official TT-Dave Fan Club
Dave's Screenshot Thread! - Flickr


Why be a song when you can be a symphony? r is a...


Top
   
 Post subject: Re: CivilAI
PostPosted: Mon Feb 10, 2014 12:26 pm 
Offline
Graphics Moderator
Graphics Moderator
User avatar

Joined: Mon Sep 13, 2004 1:21 pm
Posts: 5302
Location: The Moon
Kogut wrote:
It works, it connected nearby town - but instead of adding some bus service it started connecting next towns. Is it expected ("builds an inter-city road network and entraffics it with buses")?

Due to low number of RV it was unable to sustain itself in my test.


It's hard to tell without a save game or screenshot, but perhaps its initial town was too small or hilly to build its bus stops. In that case, if it manages to connect to another large town before it runs out of money, it will try building a bus network there. If not, oh well; not much it can do. :)

_________________
Pikkarail.com blog | Patreon
Dev reference: NML Specs - NewGRF Specs - Savegame Internals - NoAi API - NoGo API


Top
   
 Post subject: Re: CivilAI
PostPosted: Tue Feb 11, 2014 10:27 am 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
It constructed bus stops in initial town but it was not enough to survive burden of 500k initial loan used to build roads. Are you interested in save where this happens or is it something expected for this special purpose AI?

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD


Top
   
 Post subject: Re: CivilAI
PostPosted: Tue Feb 11, 2014 11:41 am 
Offline
Graphics Moderator
Graphics Moderator
User avatar

Joined: Mon Sep 13, 2004 1:21 pm
Posts: 5302
Location: The Moon
Kogut wrote:
It constructed bus stops in initial town but it was not enough to survive burden of 500k initial loan used to build roads. Are you interested in save where this happens or is it something expected for this special purpose AI?


Ah. Well, it certainly can overextend itself if it builds roads faster than it builds buses. :) Especially with a high initial loan and infrastructure maintenance costs turned on.

It really is a special purpose AI, so I'm not too worried about it. One thing I might do in future versions is randomise the starting location slightly, so that if it does start somewhere difficult and go bankrupt its replacement may try and start in a better place.

_________________
Pikkarail.com blog | Patreon
Dev reference: NML Specs - NewGRF Specs - Savegame Internals - NoAi API - NoGo API


Top
   
 Post subject: Re: CivilAI
PostPosted: Thu Feb 20, 2014 4:33 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Sep 28, 2009 5:15 pm
Posts: 6165
Location: Eastern KY
One thing I noticed - the inter-city bus stations will be built with a small loop of road, but the buses won't actually use them, preferring to turn around at the end of roads.


Attachments:
civilai.png
civilai.png [ 11.79 KiB | Viewed 9990 times ]

_________________
Do you like drones, quadcopters & flying toys? Check out Drone Strike Force!
Image

Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | RoadTypes?
Top
   
 Post subject: Re: CivilAI
PostPosted: Thu Feb 20, 2014 9:31 am 
Offline
Graphics Moderator
Graphics Moderator
User avatar

Joined: Mon Sep 13, 2004 1:21 pm
Posts: 5302
Location: The Moon
True! That's just the vehicle pathfinder, I guess, and nothing I or the AI can help. :)

_________________
Pikkarail.com blog | Patreon
Dev reference: NML Specs - NewGRF Specs - Savegame Internals - NoAi API - NoGo API


Top
   
 Post subject: Re: CivilAI
PostPosted: Sun Feb 23, 2014 4:13 am 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Sun Jul 13, 2008 12:57 am
Posts: 313
PikkaBird wrote:
CivilAI is my first AI, and one I've been meaning to make for a while. It builds an inter-city road network and entraffics it with buses and, if available, town cars

Cool! And I just wanted to say that "entraffic" is a wonderful word :)

_________________
Building Powargrid: a turn based strategy game


Top
   
 Post subject: Re: CivilAI
PostPosted: Sun Feb 23, 2014 12:36 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Wed Oct 30, 2013 1:57 pm
Posts: 199
CivilAI is not showing up in my "download online content" menu, can it be that it has been released only for a newer version? I run OTTD 1.3.2 (should I be ashamed of myself?)

_________________
Skippern
OpenTTD Mac user


Top
   
 Post subject: Re: CivilAI
PostPosted: Sun Feb 23, 2014 4:48 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9036
Location: Sol d
skippern wrote:
CivilAI is not showing up in my "download online content" menu, can it be that it has been released only for a newer version? I run OTTD 1.3.2 (should I be ashamed of myself?)

yes. And yes - because you didn't try a newer version like 1.4.0-beta nor read the first posting's last sentence:
PikkaBird wrote:
A recent OpenTTD nightly or 1.4 beta is required.

_________________
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
   
 Post subject: Re: CivilAI
PostPosted: Mon Feb 24, 2014 12:15 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Wed Oct 30, 2013 1:57 pm
Posts: 199
planetmaker wrote:
skippern wrote:
CivilAI is not showing up in my "download online content" menu, can it be that it has been released only for a newer version? I run OTTD 1.3.2 (should I be ashamed of myself?)

yes. And yes - because you didn't try a newer version like 1.4.0-beta nor read the first posting's last sentence:
PikkaBird wrote:
A recent OpenTTD nightly or 1.4 beta is required.

:oops: :oops: :oops: Will update my version as soon as I get on a quicker and more stable internet line (before next weekend I hope) :oops: :oops: :oops:

_________________
Skippern
OpenTTD Mac user


Top
   
 Post subject: Re: CivilAI
PostPosted: Sat Sep 27, 2014 3:12 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Jan 18, 2014 6:10 pm
Posts: 1079
I tried this particular AI to use within multiplayer game (dedicated server 1.4.3, see signature), but it fails.
One company slot is occupied by AI, but this company is "Unnamed" and do nothing (in multiplayer game).
If saved gamestate is loaded in singleplayer mode, AI works fine.
Of course Allow AIs in multiplayer is On, Disable road vehicles for computer: Off.
I'm not user if this particular IS failed, or it is my mistake.
I didn't tried others AIs, I just need one to build roads and use buses.

EDIT: I discovered, that ai_in_multiplayer = false is set in my server cfg - I set it true in scenario editor, probably it is ignored and taken from server cfg.
I never know which setting is client/company/server/game related.

_________________
My experimental openTTD server: 149.156.194.203:3979 non-standard client, now testing: JGRPP http://tiny.pl/ggnch
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, preindustrial houses, wired, ECS industry extension.
Addicted to freeciv longturn.


Top
   
 Post subject: Re: CivilAI
PostPosted: Sun Sep 28, 2014 1:43 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9036
Location: Sol d
McZapkie wrote:
I tried this particular AI to use within multiplayer game (dedicated server 1.4.3, see signature), but it fails.
One company slot is occupied by AI, but this company is "Unnamed" and do nothing (in multiplayer game).
If saved gamestate is loaded in singleplayer mode, AI works fine.
Of course Allow AIs in multiplayer is On, Disable road vehicles for computer: Off.
I'm not user if this particular IS failed, or it is my mistake.
I didn't tried others AIs, I just need one to build roads and use buses.

EDIT: I discovered, that ai_in_multiplayer = false is set in my server cfg - I set it true in scenario editor, probably it is ignored and taken from server cfg.
I never know which setting is client/company/server/game related.

It's a bit tricky, but on the other hand it's not:
every setting which describes the map to some extend, which every player needs in order to continue the game is found in the savegame. All settings which are related to server operation, thus server-specific are not stored in the savegame. Neither are stored those settings which are player-specific (like language, unit settings, money settings, signal density...). There are only very few company-specific things, like company colour, which actually need exchange.

_________________
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
   
 Post subject: Re: CivilAI
PostPosted: Tue Sep 30, 2014 4:43 pm 
Offline
Engineer
Engineer
User avatar

Joined: Mon Jan 31, 2011 4:51 pm
Posts: 99
Location: Farming stuff
I'm getting the following error from the AI whenever it tries to start a company. I got the same message in 1.4.2 and now, after updating, in 1.4.3 as well. Any clues?

Image


Top
   
 Post subject: Re: CivilAI
PostPosted: Tue Sep 30, 2014 4:50 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9036
Location: Sol d
Arexander wrote:
I'm getting the following error from the AI whenever it tries to start a company. I got the same message in 1.4.2 and now, after updating, in 1.4.3 as well. Any clues?

Image

Did you in install the AI using the ingame content download?

You're missing one of the required libraries, road pathfinder in version 4.

_________________
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
   
 Post subject: Re: CivilAI
PostPosted: Tue Sep 30, 2014 5:10 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Jan 18, 2014 6:10 pm
Posts: 1079
I got similar error, moving library from content_download/ai/library to ai/library solved problem.

On the other hand, AI still is refusing to build anything, despite of proper settings of ai_in_multiplayer = true both for server config.cfg
and scenario (server is starting with -g "scenario.scn" option).


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

All times are UTC


Who is online

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