AI assistant?

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
jimbob
Engineer
Engineer
Posts: 87
Joined: 24 Nov 2014 21:13
Location: At a desk
Contact:

AI assistant?

Post by jimbob »

Is it possible to create a game script or ai to assist the player company? What methods are there for the player to communicate with it?

I'm more familiar with the ai api than the gs one so is it possible to create an interactive gui in a gs?
Image
Real life transport planner
My projects:Link to my UK Scenario|Scenario Builder GS
Do check out my 3D unity transport game: transporter
User avatar
odisseus
Director
Director
Posts: 552
Joined: 01 Nov 2017 21:19

Re: AI assistant?

Post by odisseus »

That's an interesting idea, and it's definitely feasible. In fact, something similar can already be achieved with the current AIs.

You can use cheats to take control of an AI company in a single player game. This will effectively turn the AI into your ally. However, every AI has its own ideas about what to build and when, and it won't actually assist you in building according to your plans.

I can imagine a dedicated assistant AI, which would take hints from the signs or the rail structure, and would complete menial tasks, such as building long stretches of rails, or adding new vehicles when cargo supply grows.
User avatar
jimbob
Engineer
Engineer
Posts: 87
Joined: 24 Nov 2014 21:13
Location: At a desk
Contact:

Re: AI assistant?

Post by jimbob »

Reading the api it looks like a gs can perform actions as any company which is half the problem.

Is there a good way to communicate with the script either via the console or gs story pages?
Image
Real life transport planner
My projects:Link to my UK Scenario|Scenario Builder GS
Do check out my 3D unity transport game: transporter
User avatar
kamnet
Moderator
Moderator
Posts: 8532
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: AI assistant?

Post by kamnet »

You could start the game in server mode, that way Player 1 can be populated by an AI and directly controlled by a GameScript. You can then join the server and take control of Player 1.
User avatar
jimbob
Engineer
Engineer
Posts: 87
Joined: 24 Nov 2014 21:13
Location: At a desk
Contact:

Re: AI assistant?

Post by jimbob »

Okay so assisting the player's company is the easy half, how can the player and ai communicate easily?

I'd like to avoid reading and writing to signs if possible, can the ai read/write to:
  • chat
  • the debug console
  • a settings page?
  • a GS story?
Image
Real life transport planner
My projects:Link to my UK Scenario|Scenario Builder GS
Do check out my 3D unity transport game: transporter
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: Ahrefs [Bot] and 8 guests