How to create waypoints with the AI API?

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
Felicitus
Engineer
Engineer
Posts: 29
Joined: 17 Feb 2009 06:35

How to create waypoints with the AI API?

Post by Felicitus »

The title says it all - I have found nothing, and I am under impression that a function just doesn't exist - right? :)
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: How to create waypoints with the AI API?

Post by Roujin »

Can't really tell you if there's a function for creating waypoints hidden somewhere or not, but you can use stations pretty much in the same manner as waypoints (even better, since you can make them multiple tracks wide, which you can't do with waypoints). You just have to set appropriate orders (go via, instead of go to).

Or aren't "go via" orders supported by NoAI either? I think they are, though.

edit: since your AI goes for performance rather than realistic looks, I think you won't care about using a one-piece station instead of a waypoint.. or not? ;)
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: How to create waypoints with the AI API?

Post by Zuu »

Depends on if it should comply with rules like that no unused stations are allowed, since all stations you have, even the unserved are counted when the company score is calculated.

Also I don't know if the waypoints are cheaper in maintenance. But as long as you won't try to do intra-city (in single city) transport you probably make enough money to pay the maintenance costs. A big railway station has the same cost as a small bus stop.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Felicitus
Engineer
Engineer
Posts: 29
Joined: 17 Feb 2009 06:35

Re: How to create waypoints with the AI API?

Post by Felicitus »

Well, because one-tile stations are pretty bad to handle (it could accidently pick up cargo where it shouldn't etc), I prefer real waypoints, and that's also what the AI will prefer ;)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: How to create waypoints with the AI API?

Post by Zuu »

Felicitus wrote:Well, because one-tile stations are pretty bad to handle (it could accidently pick up cargo where it shouldn't etc), I prefer real waypoints, and that's also what the AI will prefer ;)
If you make sure to use non-stop orders on all your trains, then no trains will accidently stop on a one-tile station. That of course depend on if you have a strategy that depend on not having all stations in the order list as with non-stop orders you are required to add all stations the train should stop at on the list.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Felicitus
Engineer
Engineer
Posts: 29
Joined: 17 Feb 2009 06:35

Re: How to create waypoints with the AI API?

Post by Felicitus »

Well, yes, it would be possible, but it makes the whole thing even more complex. So I prefer having real waypoints, just like I prefer them in the game itself ;)
User avatar
CommanderZ
Tycoon
Tycoon
Posts: 1872
Joined: 07 Apr 2008 18:29
Location: Czech Republic
Contact:

Re: How to create waypoints with the AI API?

Post by CommanderZ »

I definitely woudln't use an AI which builds one tile stations near every junction. I like when the AI behaves more or less like a human.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: How to create waypoints with the AI API?

Post by Yexo »

It's currently missing from the API indeed. Please have a little patience, I'm working on implementing it.
Felicitus
Engineer
Engineer
Posts: 29
Joined: 17 Feb 2009 06:35

Re: How to create waypoints with the AI API?

Post by Felicitus »

That's great :) You already have someone who will actually use it :)
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: How to create waypoints with the AI API?

Post by Roujin »

CommanderZ wrote:I definitely woudln't use an AI which builds one tile stations near every junction. I like when the AI behaves more or less like a human.
depends on which human you mean. There are humans using such as multi-track waypoints and/or penalties ;)

His AI also uses the depot trap, which I think you dislike for its un-realisticness (or am I confusing you with someone else), so it won't be your favorite anyway ;)

---
Felicitus: as Zuu said, proper usage of "non-stop" orders will prevent trains from stopping there. Anyway, the point is moot now since Yexo is quick as always implementing new stuff :)
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
Felicitus
Engineer
Engineer
Posts: 29
Joined: 17 Feb 2009 06:35

Re: How to create waypoints with the AI API?

Post by Felicitus »

His AI also uses the depot trap, which I think you dislike for its un-realisticness (or am I confusing you with someone else), so it won't be your favorite anyway ;)
That's not for sure yet. The station builder builds the depot from a set of templates, and if such a template will be included later or not depends on for what I decide. Maybe the AI could be configured to resemble several playstyles (like the one on Kurt's goal servers, which is dirty and quick) or the "nicer" ones found on the openttdcoop servers.
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Re: How to create waypoints with the AI API?

Post by Zutty »

PathZilla - A networking AI - Now with tram support.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: Bing [Bot] and 6 guests