[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: 195
Joined: 30 Oct 2013 13:57

[AI] CityConnecter

Post by skippern »

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 1544 times
Skippern
OpenTTD Mac user
User avatar
skippern
Traffic Manager
Traffic Manager
Posts: 195
Joined: 30 Oct 2013 13:57

Re: [AI] CityConnecter

Post by skippern »

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: 117
Joined: 25 Jul 2016 23:44
Location: Soviet Russia

Re: [AI] CityConnecter

Post by sevenfm »

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 15368 times
Cityconnecter 2.png
Cityconnecter 2.png (558.39 KiB) Viewed 15368 times
User avatar
skippern
Traffic Manager
Traffic Manager
Posts: 195
Joined: 30 Oct 2013 13:57

Re: [AI] CityConnecter

Post by skippern »

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: 222
Joined: 18 Jun 2016 19:05

Re: [AI] CityConnecter

Post by Diesel Power »

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 »

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: 195
Joined: 30 Oct 2013 13:57

Re: [AI] CityConnecter

Post by skippern »

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 »

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: 195
Joined: 30 Oct 2013 13:57

Re: [AI] CityConnecter

Post by skippern »

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 »

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

Image
vrn
Engineer
Engineer
Posts: 66
Joined: 07 Mar 2018 17:00

Re: [AI] CityConnecter

Post by vrn »

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: 195
Joined: 30 Oct 2013 13:57

Re: [AI] CityConnecter

Post by skippern »

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
SeiterSK
Engineer
Engineer
Posts: 6
Joined: 27 Dec 2019 20:21

Re: [AI] CityConnecter

Post by SeiterSK »

Last edited by kamnet on 29 Dec 2019 10:45, edited 1 time in total.
Reason: Image too large to display on forums, switched to link to image, embedded image inside spoiler tag for those who still wish to see it on the forums.
Lucius6
Engineer
Engineer
Posts: 3
Joined: 10 Sep 2011 22:37

Re: [AI] CityConnecter

Post by Lucius6 »

I guess you have completely abondoned this project.
John Philips
Engineer
Engineer
Posts: 1
Joined: 13 Jan 2024 20:42

Re: [AI] CityConnecter

Post by John Philips »

As I understand it, the problem has not been solved yet
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 2 guests