Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Sun Jul 22, 2018 2:49 pm

All times are UTC




Post new topic  Reply to topic  [ 73 posts ]  Go to page Previous 1 2 3 4 Next
Author Message
 Post subject: Re: CivilAI
PostPosted: Fri Apr 13, 2018 12:05 am 
Offline
Traffic Manager
Traffic Manager

Joined: Thu Feb 26, 2015 12:52 am
Posts: 212
Hi. I found a crash with v8. Cannot iterate null.


Attachments:
Unnamed, 1982-01-08.png [266.4 KiB]
Not downloaded yet
Unnamed, 1982-01-05.png [267.81 KiB]
Not downloaded yet
Unnamed, 1981-11-11.sav [22.69 MiB]
Downloaded 20 times

_________________
Formerly known as Samu
Top
   
 Post subject: Re: CivilAI
PostPosted: Fri Apr 13, 2018 2:35 am 
Offline
Graphics Moderator
Graphics Moderator
User avatar

Joined: Mon Sep 13, 2004 1:21 pm
Posts: 5295
Location: The Moon
Thanks!

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

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


Top
   
 Post subject: Re: CivilAI
PostPosted: Fri Apr 13, 2018 10:14 pm 
Offline
Traffic Manager
Traffic Manager

Joined: Thu Feb 26, 2015 12:52 am
Posts: 212
Hi again. The index 'Count' does not exist.


Attachments:
Unnamed, 1977-05-13.png [52.8 KiB]
Not downloaded yet

_________________
Formerly known as Samu
Top
   
 Post subject: Re: CivilAI
PostPosted: Sat Apr 14, 2018 1:51 am 
Offline
Graphics Moderator
Graphics Moderator
User avatar

Joined: Mon Sep 13, 2004 1:21 pm
Posts: 5295
Location: The Moon
Damn.

Try this one please. :)

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


Last edited by PikkaBird on Sun Apr 15, 2018 8:52 am, edited 1 time in total.

Top
   
 Post subject: Re: CivilAI
PostPosted: Sun Apr 15, 2018 8:51 am 
Offline
Graphics Moderator
Graphics Moderator
User avatar

Joined: Mon Sep 13, 2004 1:21 pm
Posts: 5295
Location: The Moon
Er, yuck. It's one of those classic corner cases where industries shut down between being listed and being tested, leading to it trying to test an industry that's not on the map any more. I'll try and get a fix up tonight. :)

Edit: okay, version 10 is up, stress-tested and (seems to be) crash free!

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


Top
   
 Post subject: Re: CivilAI
PostPosted: Sat Apr 21, 2018 4:15 pm 
Offline
Graphics Moderator
Graphics Moderator
User avatar

Joined: Mon Sep 13, 2004 1:21 pm
Posts: 5295
Location: The Moon
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/SimpleAI for the list/array conversion code.

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

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


Top
   
 Post subject: Re: CivilAI
PostPosted: Sun Apr 29, 2018 6:40 pm 
Offline
Graphics Moderator
Graphics Moderator
User avatar

Joined: Mon Sep 13, 2004 1:21 pm
Posts: 5295
Location: The Moon
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.

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


Top
   
 Post subject: Re: CivilAI
PostPosted: Sun Apr 29, 2018 9:53 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Fri Jun 15, 2007 9:27 am
Posts: 365
Skype: madchimiste
Location: Berlin, Deutschland
Hello!

Nice work on the IA, it is really interesting to play with.
I have 2 questions:
CivilIA tends to build airports early in the game, which can be pretty suicidal when infrastructure costs are on. Deactivating planes for IA players is a solution to this problem, but could it be possible to make CivilIA take this setting into account? (if infrastructure costs are on, do not build airports, or build airports only when it is not suicidal to do so)
Does CivilIA cares about the weight factor setting?

_________________
Some screenshots of mine...


Top
   
 Post subject: Re: CivilAI
PostPosted: Sun Apr 29, 2018 10:50 pm 
Offline
Graphics Moderator
Graphics Moderator
User avatar

Joined: Mon Sep 13, 2004 1:21 pm
Posts: 5295
Location: The Moon
The AI doesn't take either of those into consideration, currently.

In the case of infrastructure maintenance, it's hard to imagine what the response should be. If the maintenance costs make using small airports (which is all this AI builds) prohibitively expensive, then building no airports seems to be the only option. If the costs are tolerable, then business-as-usual should be fine. In either case, infrastructure maintenance costs is a terrible feature and should be avoided. ;)

The cargo weight factor is not currently considered, bur it probably could be; I can see how a very high weight factor, combined with a NewGRF that provides both low-power locomotives and high-capacity wagons, might be a problem. It wouldn't be difficult to vary the minimum power requirement and/or limit the train capacity. Do you have some examples (either screenshots or savegames) of trains which have struggled?

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


Top
   
 Post subject: Re: CivilAI
PostPosted: Tue May 01, 2018 1:56 am 
Offline
Graphics Moderator
Graphics Moderator
User avatar

Joined: Mon Sep 13, 2004 1:21 pm
Posts: 5295
Location: The Moon
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.

Maybe I'll take a break before adding any more big features, like trunk railways between cities or ships. It's just too easy to spend all day tinkering with this stuff. :)

*To clarify, I don't mean the "slope steepness for trains" setting; I'd forgotten that exists. I mean the actual profile of the route; hillier lines get more powerful locomotives.

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


Top
   
 Post subject: Re: CivilAI
PostPosted: Tue May 01, 2018 7:49 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 31, 2007 2:23 pm
Posts: 4676
Location: Lost in Music
Trying it now ;)

EDIT: I like this, not even snark, keep this feature :twisted:


Attachments:
Civil AI.png
Civil AI.png [ 249.42 KiB | Viewed 1097 times ]

_________________
FIRS Industry Replacement Set (Released) | HEQS Heavy Equipment Set (trucks, industrial trams and more) (Finished)
Squid Ate FISH (ships) (Released) | CHIPS Has Improved Players' Stations (Finished)
Iron Horse (trains, released) | Termite (tracks for Iron Horse, released) | Busy Bee (game script, released)

Road Hog (road vehicles, released)
Top
   
 Post subject: Re: CivilAI
PostPosted: Wed May 02, 2018 9:34 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Fri Jun 15, 2007 9:27 am
Posts: 365
Skype: madchimiste
Location: Berlin, Deutschland
PikkaBird wrote:
Version 13:


Thank you for having taken into account the weight issue, and having corrected it. Before, with a weight factor of 5, CivilAI always chose UKRS2 0-4-2 Tanks to haul 120 tonnes of coal, whatever the profile of the route. Now, for a short route with 3 height levels difference upwards, it chooses a EE 10000 Diesel instead. It's a bit exaggerated, but it works perfectly.
Sorry for not having been able to provide screenshots in time, and thank you for this fix, and for this AI which is really interesting to play with.

_________________
Some screenshots of mine...


Top
   
 Post subject: Re: CivilAI
PostPosted: Sun May 06, 2018 3:23 am 
Offline
Graphics Moderator
Graphics Moderator
User avatar

Joined: Mon Sep 13, 2004 1:21 pm
Posts: 5295
Location: The Moon
Uhoh, Version 14. The big NEW FEATURE is this version is ships, which are currently limited to passenger ferries. Cargo ships to maritime industries coming soon (tm). It's a big update, so let me know what you think or if there are any bugs or strange behaviour.

Also, this AI now uses a custom fork of the road.pathfinder library, so make sure you get that too (it should download the library automatically if you use the in-game downloader, I think).

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.

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


Top
   
 Post subject: Re: CivilAI
PostPosted: Fri May 11, 2018 6:05 am 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Wed Mar 30, 2005 9:43 am
Posts: 1534
Won't load on a fresh install, Pathfinder.CRoad depends on Graph.AyStar version 6 but it is not listed as a dependency.

_________________
He's like, some kind of OpenTTD developer.


Top
   
 Post subject: Re: CivilAI
PostPosted: Fri May 11, 2018 6:13 am 
Offline
Graphics Moderator
Graphics Moderator
User avatar

Joined: Mon Sep 13, 2004 1:21 pm
Posts: 5295
Location: The Moon
peter1138 wrote:
Won't load on a fresh install, Pathfinder.CRoad depends on Graph.AyStar version 6 but it is not listed as a dependency.


Oops. Fixed. :)

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


Top
   
 Post subject: Re: CivilAI
PostPosted: Fri May 11, 2018 6:14 am 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Wed Mar 30, 2005 9:43 am
Posts: 1534
Thanks :-)

I've got infrastructure costs enabled. Seems to be very common that a CivilAI is going bankrupt after a year as they build unaffordable airports, sometimes only one.

_________________
He's like, some kind of OpenTTD developer.


Top
   
 Post subject: Re: CivilAI
PostPosted: Fri May 11, 2018 6:42 am 
Offline
Graphics Moderator
Graphics Moderator
User avatar

Joined: Mon Sep 13, 2004 1:21 pm
Posts: 5295
Location: The Moon
peter1138 wrote:
I've got infrastructure costs enabled. Seems to be very common that a CivilAI is going bankrupt after a year as they build unaffordable airports, sometimes only one.


Turning on "Disable aircraft for computer" will (or should - I'm not sure I've ever tested it!) prevent CivilAI building airports. Infrastructure maintenance costs are GRF-adjustable, so I don't want to assume that just because the setting is on that airports are untenable.

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


Top
   
 Post subject: Re: CivilAI
PostPosted: Fri May 11, 2018 6:48 am 
Offline
Graphics Moderator
Graphics Moderator
User avatar

Joined: Mon Sep 13, 2004 1:21 pm
Posts: 5295
Location: The Moon
Just a quick bug-fixy update, before embarking on any more major features.

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 hang condition when rail depot building failed.
- Made the AI even more bridge-happy.
- Various other bug fixes and tweaks.

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


Top
   
 Post subject: Re: CivilAI
PostPosted: Fri May 11, 2018 7:25 am 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Wed Mar 30, 2005 9:43 am
Posts: 1534
Hmm, are infrastructure costs GS queryable?

_________________
He's like, some kind of OpenTTD developer.


Top
   
 Post subject: Re: CivilAI
PostPosted: Fri May 11, 2018 9:13 am 
Offline
Graphics Moderator
Graphics Moderator
User avatar

Joined: Mon Sep 13, 2004 1:21 pm
Posts: 5295
Location: The Moon
peter1138 wrote:
Hmm, are infrastructure costs GS queryable?


Yes, they are.

On the other hand, since there is already an exhaustive set of solutions to the problem (you can turn infrastructure costs off, or you can use NewGRFs which reduce the costs, or you can disable aircraft for AI), is there any reason why AIs should go out of their way to quietly conceal game-breakingly silly airport maintenance costs? At least, unlike inflation, infrastructure maintenance costs aren't on by default. ;)

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


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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.