[AI] CityConnecter

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

Post Reply
User avatar
skippern
Traffic Manager
Traffic Manager
Posts: 199
Joined: 30 Oct 2013 13:57

[AI] CityConnecter

Post by skippern » 23 Feb 2014 12:28

I have just uploaded my first attempt on an AI, mostly done as a try on Squirrel and the NoAI API. It will select the largest cities (towns marked as city) and connect it with nearby towns (of any size), when distance to next town is too great, it jumps to the next city, and continues like that. Since it is a company, it will eventually go bankrupt as it doesn't try to make money in any way, but I have tried to make it so that it reduces the amount of loan while calculating the routes, so that, hopefully it can live a little longer and connect a few more towns.

Version 1 available on BaNaNaS
Attachments
CityConnecter-1.zip
CityConnecter v1
(4.86 KiB) Downloaded 1101 times
Skippern
OpenTTD Mac user

deny_05
Engineer
Engineer
Posts: 1
Joined: 04 Mar 2014 08:27

Re: [AI] CityConnecter

Post by deny_05 » 04 Mar 2014 08:30

Nice post

User avatar
skippern
Traffic Manager
Traffic Manager
Posts: 199
Joined: 30 Oct 2013 13:57

Re: [AI] CityConnecter

Post by skippern » 31 Oct 2014 14:23

I have just started to recreate this AI as a GameScript, that way I will get the purpose of the AI covered without occupying a company slot.

I am still not sure of how I would want the GameScript to work other than I would like all towns and cities to build out the network towards their neighbouring towns.

One idea I have is that the speed of building will depend on town size, for example a town builds 4 tiles per 1000 citizen, while a city builds 8 tiles per 1000 citizen.

Another idea is that after a certain date, for example 1960, Cities will prioritise building dual carriage ways towards other cities (this does not apply to town links)

Further another idea, is large cities will try to make ring-roads circling the circumference of the city, this work might start in 1985.

I might do minor adjustment to the AI but will not do any major alterations. If any bugs encountered, please report them here.
Skippern
OpenTTD Mac user

User avatar
sevenfm
Engineer
Engineer
Posts: 67
Joined: 25 Jul 2016 23:44
Location: Soviet Russia

Re: [AI] CityConnecter

Post by sevenfm » 22 Jan 2018 08:50

Doesn't seem to work well with bridges.
Also it builds unrealistic long bridges over lakes when it's possible to make a route on land around the lake.
Tested with JGR patchpack.
Attachments
Cityconnecter 1.png
Cityconnecter 1.png (267.91 KiB) Viewed 4711 times
Cityconnecter 2.png
Cityconnecter 2.png (558.39 KiB) Viewed 4711 times

User avatar
skippern
Traffic Manager
Traffic Manager
Posts: 199
Joined: 30 Oct 2013 13:57

Re: [AI] CityConnecter

Post by skippern » 23 Jan 2018 09:38

Thanks for feedback. I will make a note of this in case I do update this AI. I have somewhat abandoned the AI to re-create the same as a game script, though are far from having anything playable. I am currently in a play break from OTTD, and have no immediate plans to pick it up again.

Seems like the router have changed behavior since the AI was made, can't remember the turn immediately after bridge being an issue earlier


Sent from my iPhone using Tapatalk
Skippern
OpenTTD Mac user

Diesel Power
Traffic Manager
Traffic Manager
Posts: 132
Joined: 18 Jun 2016 19:05

Re: [AI] CityConnecter

Post by Diesel Power » 31 Mar 2018 16:13

Please come back soon!
This AI would suit a GS perfectly. I've been building a road network at the start of my games using an idle AI for ages. I'd start by joining all The towns with motorways using The Dutch road furniture GRF, then join up all The primary industries to The nearest road creating a huge network. The problem with AIs was if the road was in your way, you were screwed. With a GS I'm assuming the roads would be town owned, so easier to "move" if you needed to. That and the money problems.
Hope you get this up and running. I'm available for testing and suggestions if needed.

User avatar
Zoeff
Engineer
Engineer
Posts: 33
Joined: 29 Jul 2005 15:22
Location: Haarlem, Netherlands

Re: [AI] CityConnecter

Post by Zoeff » 31 May 2018 14:05

Another player here that would love a GS like this. :D

Having cities connect to one another with roads would increase the immersion a heck of a lot. :)

User avatar
skippern
Traffic Manager
Traffic Manager
Posts: 199
Joined: 30 Oct 2013 13:57

Re: [AI] CityConnecter

Post by skippern » 19 Jun 2018 16:53

I have barely initiated the code for this as GS, than ran out of time. Currently I don't have OTTD installed, but hope to reinstall shortly


Sent from my iPhone using Tapatalk
Skippern
OpenTTD Mac user

User avatar
Zoeff
Engineer
Engineer
Posts: 33
Joined: 29 Jul 2005 15:22
Location: Haarlem, Netherlands

Re: [AI] CityConnecter

Post by Zoeff » 19 Jun 2018 16:55

skippern wrote:I have barely initiated the code for this as GS, than ran out of time. Currently I don't have OTTD installed, but hope to reinstall shortly


Sent from my iPhone using Tapatalk
Yeesss you're still active! Awesome! :D

User avatar
skippern
Traffic Manager
Traffic Manager
Posts: 199
Joined: 30 Oct 2013 13:57

Re: [AI] CityConnecter

Post by skippern » 19 Jun 2018 18:51

Wouldn't call it active, rather a semi-present idle...


Sent from my iPhone using Tapatalk
Skippern
OpenTTD Mac user

User avatar
bladez
Engineer
Engineer
Posts: 2
Joined: 02 Jan 2012 16:45

Re: [AI] CityConnecter

Post by bladez » 26 Jun 2018 23:54

I have a problem, the AI wouldn't start. Always outputs this error:

Image

vrn
Engineer
Engineer
Posts: 62
Joined: 07 Mar 2018 17:00

Re: [AI] CityConnecter

Post by vrn » 27 Jun 2018 10:47

bladez wrote:I have a problem, the AI wouldn't start. Always outputs this error:
Looks like you haven't downloaded all the required SuperLibs. If you download AIs via ingame content download, dependencies would be automatically selected for download aswell.

User avatar
skippern
Traffic Manager
Traffic Manager
Posts: 199
Joined: 30 Oct 2013 13:57

Re: [AI] CityConnecter

Post by skippern » 27 Jun 2018 14:47

Or a compatibility issue, anyway the correct version of minchin super lob should solve the problem


Sent from my iPhone using Tapatalk
Skippern
OpenTTD Mac user

Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 2 guests