Cost estimation

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

User avatar
Dustin
Transport Coordinator
Transport Coordinator
Posts: 272
Joined: 07 Dec 2005 19:22

Re: Cost estimation

Post by Dustin »

Blustuff wrote:I want to do cost estimation to guide the pathfinder, not to know how much money is necessary. It don't have to be perfect, but the imprecision must be controlled.
You can always do what Denver & Rio Grande does: Never build tunnels. :)

Otherwise: Check the source code and see how tunnel costs are computed and/or suggest a tunnel costing API in the API changes thread.
Blustuff
Engineer
Engineer
Posts: 112
Joined: 21 Aug 2008 09:37
Location: France

Re: Cost estimation

Post by Blustuff »

Actually, the tunnels are just one of the problems I have to solve. Except bridges costs which can be retrived, I need every costs which is useful to estimate (approximatively but with a bounded and small imprecision) a path cost.
Blustuff
Engineer
Engineer
Posts: 112
Joined: 21 Aug 2008 09:37
Location: France

Re: Cost estimation

Post by Blustuff »

The function AIBridge::GetPrice() return an amount of money which is dependent of the inflation but which is not the actual price of a bridge. What does this function ?

Is there a way to raise the number of lines the AI console keep ?
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Re: Cost estimation

Post by Zutty »

Blustuff wrote:Is there a way to raise the number of lines the AI console keep ?
If you start the game from the command line (or from a shortcut in Windows) add the switch "-d ai=5". All the debug output will go to a different window, which can have as much history as you configure it with.
PathZilla - A networking AI - Now with tram support.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Cost estimation

Post by Yexo »

Blustuff wrote:The function AIBridge::GetPrice() return an amount of money which is dependent of the inflation but which is not the actual price of a bridge. What does this function ?
It was depended on the price of a bridge, but it returned incorrect values. Fixed in r16986. If it returned strange values again in r16986 or newer, please report back.
Blustuff
Engineer
Engineer
Posts: 112
Joined: 21 Aug 2008 09:37
Location: France

Re: Cost estimation

Post by Blustuff »

Thanks.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 7 guests