Changes:

Version 19:
- Minimum OpenTTD version is now 1.9.
- This update has extensive rewrites of a lot of existing code. Please do report any odd behaviour or crashes.

Features:
	- Added 2cc company colours, and different colours for different vehicle types.
	- AI has a configurable option to not build an intercity road network, but just to build within towns in its radius.

Tweaks:
	General:
	- Reworked selection code for vehicles and added company biases towards big, cheap, or fast vehicles, to add some variety between companies and games.
	- Reworked the freight train route selection code, for performance and extendability.
	Aircraft:
	- AI has alternative behaviour to build airports if road vehicles are disallowed.
	- AI will build an initial aircraft as soon as it has two airports.
	- AI will attempt to replace small airports with commuter airports (attached to a different station in the same town) after commuter airports become available.
	- Increased the maximum number of aircraft servicing each small and commuter airport (from 3 and 6 to 5 and 10 respectively).
	Ships:
	- AI will now build only two ship docks per town.
	- AI will not build ferries with a capacity less than 50 if larger ferries exist (to avoid building FISH/Squid trawlers).
	Road Vehicles:
	- Increased the maximum maximum bus count from 500 to 5000, as requested by Samu on IRC (the default maximum remains 250).
	- AI will now build only two mail truck stops per town.
	- AI will wait 10 years before trying to build a bus network in a town it previously failed to build enough stops in.
	
Bug fixes:
	- fixed the AI sometimes failing to build goods trucks (because it was trying to build them in another company's depot, whoops).


Version 18:
- There is no version 18 - version number bumped to 19 to coincide with OpenTTD 1.9.

Version 17:
Bug fixes:
	- do not count mail, goods and food trucks in towncar count (Apparently I haven't tested town cars since version 6!)
	- fixed the AI not building airports when noise level feature is disabled.

Version 16:
Tweaks:
	- Intercity road connections are now built via a middle point, to make connecting cities faster and more reliable.
	- Tweaks to the road pathfinder values to (possibly) reduce route duplication and messy road junctions.
	- AI will not build trucks with top speed below 40km/h if faster vehicles are available (to avoid building HEQS crawlers).


Version 15:
- Rewrote the level crossing removal code (again) to remove the lost vehicle repathing - it was another of those 'clever' ideas that never really worked and took a lot of processing time.
- fixed a hang condition when rail depot building failed.
- Made the AI even more bridge-happy.
- Various other bug fixes and tweaks.

Version 14:
- Fixed a bug in introduced in v13, which was preventing the AI connecting small towns to expand its train network (oops).

- Added ships:
	- CivilAI will now build docks at town bus stops, and passenger ferries between and within towns in its network.
	
Road Network:
- Finally revised the oldest and hackiest part of the AI: replaced the cross "spikes" at bus stops with path-based loops.
- Forked the standard road pathfinder to add pathing cost for drive-through road stops.
- Bus stop placement in towns is now more randomised, and the AI will avoid placing stops near existing stops (of any company).
- Added a stricter attempt limit for road pathfinding, and visualised pathfinder progress in the debug log.
- Made the AI more bridge-happy.
- Various other bug fixes and tweaks to pathfinding and record keeping.	

- Set default brake van date to 1975, to better align with air-braked stock date of UKRS3.	
- Better station spread and local authority checking when attempting to place airports.



Version 13:

CivilAI will now check for other company HQs, and avoid setting up in the same town.

Trains:
- Improved locomotive selection for trains, taking freight_trains setting and hill steepness into account (thanks arikover).
- Trains will have brakevans before a certain year (configurable, default 1965), if a NewGRF provides them.
- Version 12 occasionally built a sharp 90 degree turn when building passing places or retrying a blocked route. To address this:
	- AI removes passing places with 90 degree turns (if 90 degree turns are forbidden).
		- If no passing place is built, one train will be built instead of two.
	- When retrying a blocked route, the AI will backtrack three tiles and build a straight rail before continuing, to avoid constructing 90 degree turns.

Version 12:

- Figured out the correct filename for the changelog. :)

- The connected town list is now cached, and only recalculated on loading the game or building new connections. This should greatly improve the AI's response time, particularly later in the game.
- Added more company, director and train names.
- Readded statue building.

- Sometimes, bus and mail services would not come close enough to depots for automatic servicing, resulting in low reliability. To combat this:
	- Road vehicles with poor reliability are periodically sent for servicing manually.
	- Additional road depots are built in large cities.

Trains:
- Improved wagon selection.
- Made rail building a little more robust, with retrying if the path is blocked and better detection of station orientation.
- Added an additional station/route type.


Version 11:

- Fixed a bug introduced in v10, which was preventing the AI from building goods trucks (oops).
- CivilAI now attempts to recover poor town ratings by planting trees.

- Lists of unconnectable towns and industries are now stored in save games, to prevent wasting time retrying connections when the game is saved and loaded. Thanks to Brumi/[url=https://www.tt-forums.net/viewtopic.php?f=65&t=44809]SimpleAI[/url] for the list/array conversion code.

Trains:
- Added more variety to AI locomotive selection.
- Improved wagon building.

Version 10:
- Fixed reported crash (for real).

version 9:
- Fixed collision causing company director name not to be set.
- Fixed reported crash.

version 8:

- Added Water to the cargos to be trucked to towns.
- Cargo truck selection now prefers native vehicles over refits, like train wagons.
- Minor bug fixes.

version 7:

This is 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.

- Added better company and owner names.

Trucks added:
- CivilAI will now build trucks for mail, goods and food.
- Truck stops are added to busy bus stops for mail pickup and goods delivery.
- Supply depots are built near goods- and food-producing industries to supply cargos to towns.

Trains added:
- CivilAI will build short train lines to support goods- and food-producing industries.

Air network tweaks:
- Increased the default minimum air route distance from 80 to 128 tiles.
- Made sure redirected aircraft are redirected from the correct airport.
- Improved land levelling for airport construction.

Road network tweaks:
- simplify the ugly "loop" built at outer bus stops - these never worked properly and were just clutter.
- Reduced the number of station tiles for central bus stops from 4 to 3 (to allow space for a truck stop).
- Tweaks to when and how many vehicles are bought.
- Improve road network integrity by scanning for lost vehicles.
- Simplify crossing replacement code (which never really worked).
- More conservative network construction:
	- Road network construction search now limited to towns the AI can build in.
	- The AI will only expand the road network once it has built up the network it has, to avoid spending all its money on roads.
	
- CivilAI no longer funds roadworks, because that's not very civil.
- Various other tweaks and fixes.

version 6:

Air network tweaks:
- Prevent building new airports too close to all existing airports.
- Redirect a few existing aircraft to newly built airports to refresh the air network.

Road network tweaks:
- Make our vehicle list nicer to look at by grouping cars and buses separately.
- Build a depot in large towns even if we're not servicing them, to keep town cars spread out.
- Remove rail crossings and rebuild as bridges following collisions.

version 5:

- Increase default network size from 256 to 512 tiles radius.
- Disallow setting up in towns with no centre road tile. 
- Set up in a random town which meets the size and unserviced criteria, rather than the largest.
- Replace "monthly" tasks with a constant cycle. AI now builds faster and will not skip tasks.
- Tweaked conditions for building intercity bus routes to make them more common (but not much).
- Slightly reduced maximum number of buses on a route to relieve city crowding (but not much).
- Added building small airports and air routes. Yes, really!

