CivilAI
Moderator: OpenTTD Developers
Re: CivilAI
Whoops.
I also took the opportunity to fix some logic which was largely preventing the AI building new cargo trains once it had a passenger network.
Version 29:
Bug fixes:
Trains
- Fix AI getting stuck trying to build a junction on a station tile.
Version 28:
Tweaks:
Road Network:
- Unified and revised the road depot building code, removing the old concept of "Home Depot."
Version 27:
Bug fixes:
Trains:
- Fixed AI getting stuck building wagons if it fails to build a locomotive.
Version 26:
Bug fixes:
- Correctly updated version number in-game.
Trains:
- Fixed AI not building new rail lines if it has existing termini with available connections but no supplying industries.
I also took the opportunity to fix some logic which was largely preventing the AI building new cargo trains once it had a passenger network.
Version 29:
Bug fixes:
Trains
- Fix AI getting stuck trying to build a junction on a station tile.
Version 28:
Tweaks:
Road Network:
- Unified and revised the road depot building code, removing the old concept of "Home Depot."
Version 27:
Bug fixes:
Trains:
- Fixed AI getting stuck building wagons if it fails to build a locomotive.
Version 26:
Bug fixes:
- Correctly updated version number in-game.
Trains:
- Fixed AI not building new rail lines if it has existing termini with available connections but no supplying industries.
- andythenorth
- Tycoon
- Posts: 5664
- Joined: 31 Mar 2007 14:23
- Location: Lost in Music
Re: CivilAI
Hurrah! More trains!
Found something weird in v29, got a train with only one order. It's plugged up that route.
Found something weird in v29, got a train with only one order. It's plugged up that route.
- Attachments
-
- Civil29.png (605.8 KiB) Viewed 12417 times
FIRS Industry Replacement Set (released) | HEQS Heavy Equipment Set (trucks, industrial trams and more) (finished)
Unsinkable Sam (ships) (preview 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 and trams) (released)
Unsinkable Sam (ships) (preview 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 and trams) (released)
Re: CivilAI
That's odd. I'll look out for that. In the meantime, I guess it will sell such trains after 2 years when they fail to make any income.
Version 30:
Bug fixes:
- Fixed crash when loading a savegame (due to the changes in v28, oops!).
Trains
- Fixed crash when AI attempts to electrify tracks of another company (reported by andythenorth).
Version 30:
Bug fixes:
- Fixed crash when loading a savegame (due to the changes in v28, oops!).
Trains
- Fixed crash when AI attempts to electrify tracks of another company (reported by andythenorth).
Re: CivilAI
I really do enjoy Civi's naming + the "Silly" toyland townnames.
- Fairyfloss
- Traffic Manager
- Posts: 159
- Joined: 03 Aug 2011 14:10
- Location: Yes
Re: CivilAI
I've found a bug that's likely to do with the vehicle GRFs I use, but I thought it would be a good idea to bring this to your attention.
It bought a Metro Cammell EMU, then decided it wanted carriages, and proceeded to buy 827.7 tiles worth of carriages it could not attach to the train, for a total of about 2000-ish carriages?
It bought a Metro Cammell EMU, then decided it wanted carriages, and proceeded to buy 827.7 tiles worth of carriages it could not attach to the train, for a total of about 2000-ish carriages?
Re: CivilAI
Thanks! Yep, clearly a problem with the wagons not being able to attach to the loco. Damn NewGRF authors and their BAD FEATURES.
Which newgrf is it? I'll experiment and see what I can come up with.
Which newgrf is it? I'll experiment and see what I can come up with.
- Fairyfloss
- Traffic Manager
- Posts: 159
- Joined: 03 Aug 2011 14:10
- Location: Yes
Re: CivilAI
It's a NewGRF that goes by the name of UKRS2, you might have heard of it?
The carriages are from RUKTS, meanwhile, so the issue might be purely because of NewGRF mixing? Still, maybe it's fixable?
Re: CivilAI
I'm sure it is. I'll try out the GRF combination, thanks.
Re: CivilAI
I figure I've got enough bug fixes and tweaks to release another version. I really need to focus on the new pathfinder for v32 though, as the route building is what's really slowing the AI down now.
Version 31:
Features:
Trains:
- AI can now build stations and trains of varying lengths, instead of always 3 tiles.
- AI will build additional freight trains to meet demand.
Road Network:
-Building the intercity road network has been disabled.
Tweaks:
- AI will now avoid planting trees on farm fields.
- Most parameters (max buses, minimum air route distance etc) have been removed from the player-adjustable AI options.
- If you're an advanced user and really want to change these numbers, you'll find them at the end of saveload.nut.
Trains:
- Made avoiding double-connecting industries more reliable.
- Tinkered with locomotive selection to avoid using high-speed locomotives for freight.
Aircraft:
- AI can now buy a cheaper aircraft if its ideal aircraft is too expensive.
Bug fixes:
Trains:
- Fixed wagon selection bug that was preventing electrified freight trains from renewing.
- Disallowed PBS-locked track loops at station entrances.
- Fixed AI ripping up newly built routes because it couldn't quite afford the locomotive yet.
- Added code to handle NewGRF wagons not being attachable (thanks Darthrafael).
Goods Trucks:
- Fixed the AI repeatedly trying to build goods pickup routes to unroutable factories.
- Fixed the AI buying lots of goods trucks if the dropoff station stops accepting goods.
- Fixed the AI building a goods pickup depot when it cannot afford the trucks.
Version 31:
Features:
Trains:
- AI can now build stations and trains of varying lengths, instead of always 3 tiles.
- AI will build additional freight trains to meet demand.
Road Network:
-Building the intercity road network has been disabled.
Tweaks:
- AI will now avoid planting trees on farm fields.
- Most parameters (max buses, minimum air route distance etc) have been removed from the player-adjustable AI options.
- If you're an advanced user and really want to change these numbers, you'll find them at the end of saveload.nut.
Trains:
- Made avoiding double-connecting industries more reliable.
- Tinkered with locomotive selection to avoid using high-speed locomotives for freight.
Aircraft:
- AI can now buy a cheaper aircraft if its ideal aircraft is too expensive.
Bug fixes:
Trains:
- Fixed wagon selection bug that was preventing electrified freight trains from renewing.
- Disallowed PBS-locked track loops at station entrances.
- Fixed AI ripping up newly built routes because it couldn't quite afford the locomotive yet.
- Added code to handle NewGRF wagons not being attachable (thanks Darthrafael).
Goods Trucks:
- Fixed the AI repeatedly trying to build goods pickup routes to unroutable factories.
- Fixed the AI buying lots of goods trucks if the dropoff station stops accepting goods.
- Fixed the AI building a goods pickup depot when it cannot afford the trucks.
- andythenorth
- Tycoon
- Posts: 5664
- Joined: 31 Mar 2007 14:23
- Location: Lost in Music
Re: CivilAI
I broke it again, sorry
2 types of crash, see attached
2 types of crash, see attached
- Attachments
-
- civil-crashed.png (369.14 KiB) Viewed 4835 times
-
- civil-crashed-2.png (670.15 KiB) Viewed 4835 times
FIRS Industry Replacement Set (released) | HEQS Heavy Equipment Set (trucks, industrial trams and more) (finished)
Unsinkable Sam (ships) (preview 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 and trams) (released)
Unsinkable Sam (ships) (preview 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 and trams) (released)
Re: CivilAI
Excellent. Fun fact: this bug did not manifest before v31 because of a typo that was causing it to build a passenger car if it couldn't find a mail van. Fix a bug, make a bug.
Version 32:
Bug fixes:
Trains:
- Fixed crash when there is no appropriate mail van available for a new passenger train (reported by andythenorth).
Version 32:
Bug fixes:
Trains:
- Fixed crash when there is no appropriate mail van available for a new passenger train (reported by andythenorth).
- 2TallTyler
- Route Supervisor
- Posts: 508
- Joined: 11 Aug 2019 18:15
- Contact:
Re: CivilAI
I got a crash when playing before any trains or ships were available. The only NewGRFs loaded are eGRVTS and a town set I'm developing.
- Attachments
-
- crash.PNG
- (56.36 KiB) Not downloaded yet
Re: CivilAI
I don't think I've done anything with ships since I allegedly fixed a similar bug in v20, but nonetheless please update to the latest version of the AI (v32) and let me know if the bug persists.
- 2TallTyler
- Route Supervisor
- Posts: 508
- Joined: 11 Aug 2019 18:15
- Contact:
Re: CivilAI
My apologies. I've got the latest version on my Windows partition but haven't updated on MacOS and was running version 6...
- 2TallTyler
- Route Supervisor
- Posts: 508
- Joined: 11 Aug 2019 18:15
- Contact:
Re: CivilAI
Upgraded to Version 32 and still getting the same crash before ships or trains are available.
Savegame is attached. I just published the town set on BaNaNaS, but if you need to look at the code it's here.
Savegame is attached. I just published the town set on BaNaNaS, but if you need to look at the code it's here.
- Attachments
-
- civilAI_crash.PNG
- (52.01 KiB) Not downloaded yet
-
- crash.sav
- (116.74 KiB) Downloaded 167 times
Re: CivilAI
Ta, I'll look into it.
-
- Engineer
- Posts: 16
- Joined: 08 Apr 2020 13:23
Re: CivilAI
I love how this AI focuses on expanding the city and then spread out to other city near it. But what bothers me is that they seems only build small airport and 2 type of small planes. Then, it has a habit of merging a station, which is fine, but the buses just taking the most cargo, resulting in very low income train and airplane. It didn't even upgrade the plane. After 50 years it only has 2.000k operating profits. The other AI has around 6.000k - 40.000k / 3 months.
My settings:
airplane speed factor: 1/1
Maintenance cost: high
construction cost: high
My settings:
airplane speed factor: 1/1
Maintenance cost: high
construction cost: high
- 2TallTyler
- Route Supervisor
- Posts: 508
- Joined: 11 Aug 2019 18:15
- Contact:
Re: CivilAI
Not a crash this time, but a train line where one station and the main line is rail, but the other station is monorail. Version 32.
- Attachments
-
- wrong_track.PNG (798.96 KiB) Viewed 10397 times
-
- Transport Coordinator
- Posts: 318
- Joined: 22 May 2006 18:25
- Location: London-ish.
- Contact:
Re: CivilAI
I have the same crash when no ships are available with CivilAI 32, it looks like it's caused by line 163 of ship.nut where it does the following:
When there are no ships available the function returns null, and causes a crash. I fixed it in my local copy with a quick null check, but that was just a hack to get things working without having to dig around too much in what BuyAFerry() actually does.
Code: Select all
cost = cost + BuyAFerry(dock1, dock2, beams1, beams2, intersect, depot, true, null);
Who is online
Users browsing this forum: No registered users and 6 guests