An AI that would not build roads
Moderator: OpenTTD Developers
-
- Engineer
- Posts: 26
- Joined: 01 May 2016 12:56
An AI that would not build roads
I have very limited knowledge of coding but have an idea for a new AI. It would build stations and manage road traffic, but would rely on player built roads and not build them itself. How hard would it be to write one? I have tested Rondje, but it always builds drive-trough stops over tramway lines and blocks all traffic.
Re: An AI that would not build roads
Not very different from a normal AI, is my guess. You don't build road, but for making money you still need to have a road connection so you need to verify which connections exist. Also, as you don't own the roads, its builder can also delete the road at any time, which is another challenge.
Of course, relying on your opponent to allow you to have a profitable road connection isn't a very smart idea
Of course, relying on your opponent to allow you to have a profitable road connection isn't a very smart idea

Being a retired OpenTTD developer does not mean I know what I am doing.
-
- Engineer
- Posts: 26
- Joined: 01 May 2016 12:56
Re: An AI that would not build roads
The idea was that there was a player-controlled(via cheats) company beside the "no-road-AI" that acts like a department for roads and builds the roads for all players. That would also prevent some AI weirdness, like bridges cutting distance when there is a coast to follow or level crossing on six-track mainline.Alberth wrote: 21 Jul 2019 14:33 Not very different from a normal AI, is my guess. You don't build road, but for making money you still need to have a road connection so you need to verify which connections exist. Also, as you don't own the roads, its builder can also delete the road at any time, which is another challenge.
Of course, relying on your opponent to allow you to have a profitable road connection isn't a very smart idea![]()
Re: An AI that would not build roads
Find an AI that uses road vehicles and change its pathfinder to give max penalties to anything except already existing roads, bridges and tunnels.
-
- Engineer
- Posts: 26
- Joined: 01 May 2016 12:56
Re: An AI that would not build roads
I can change the code but can`t get OpenTTD to recognise it as an AI.Wormnest wrote: 21 Jul 2019 16:03 Find an AI that uses road vehicles and change its pathfinder to give max penalties to anything except already existing roads, bridges and tunnels.
Re: An AI that would not build roads
Sounds like an error in your changes, maybe a missing bracket or quote. Did you change the info.nut to give it a different name and shortname?Denswillow wrote: 21 Jul 2019 18:45 I can change the code but can`t get OpenTTD to recognise it as an AI.
-
- Engineer
- Posts: 26
- Joined: 01 May 2016 12:56
Re: An AI that would not build roads
Yes, changed the name and also changed the class name in the main.nut.Wormnest wrote: 21 Jul 2019 19:49Sounds like an error in your changes, maybe a missing bracket or quote. Did you change the info.nut to give it a different name and shortname?Denswillow wrote: 21 Jul 2019 18:45 I can change the code but can`t get OpenTTD to recognise it as an AI.
Who is online
Users browsing this forum: No registered users and 12 guests