What's this?

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
trainrover
Transport Coordinator
Transport Coordinator
Posts: 283
Joined: 29 Nov 2014 23:23

What's this?

Post by trainrover »

Now the 2nd downloaded scenario I'm playing, I always get the message (shown at the bottom now, this post around) whenever I load any of its savegames. What's it for?

For some time now I've still been unsuccessful at comprehending any ai tutorial, such that I've ultimately no clue of how useful or even challenging an ai can be, so I'd be grateful were anybody to guide me toward a scenario or savegame that would at least expose me to some hands-on experience if you will.
Attachments
aipane-1.png
aipane-1.png (22.96 KiB) Viewed 2626 times
User avatar
Sylf
President
President
Posts: 957
Joined: 23 Nov 2010 21:25
Location: ::1

Re: What's this?

Post by Sylf »

Just follow the instruction here, but instead of downloading Game Scripts, download AI. One shouldn't need any tutorial on using AIs. Are those tutorials how to make your own AI?
trainrover
Transport Coordinator
Transport Coordinator
Posts: 283
Joined: 29 Nov 2014 23:23

Re: What's this?

Post by trainrover »

^^ Security certificate's supposedly expired on the link you're sharing. I think you're right, however, that the (ottd wiki) tutorial I must've been trying to grasp is all about creating your own ai. I've just come across a beginner's tutorial about ai in the content downloads, so I'll give that a go for now. Thank you.

In the meanwhile, any tip on what that pane tries to relate would be appreciated.
User avatar
Sylf
President
President
Posts: 957
Joined: 23 Nov 2010 21:25
Location: ::1

Re: What's this?

Post by Sylf »

"No available AI" means exactly that - you haven't downloaded any AI for OpenTTD. It sounds like the scenarios you downloaded were created with AI competitors enabled. But when you loaded the scenario, OpenTTD couldn't find any real AI. So you just need to download some AI using in-game content downloader.

The link in the last post is to another thread on this forum. It's safe. The security certificate for the site is valid until July of 2016.
trainrover
Transport Coordinator
Transport Coordinator
Posts: 283
Joined: 29 Nov 2014 23:23

Re: What's this?

Post by trainrover »

Alright, please bear with me, that beginner's tutorial I thought I could try out didn't seem packaged-and-ready if you will.

Why did their authors make dummy ais that do nothing? Are downloading players supposed to be playing with ais or just being encouraged to do so? Why 2 slots? Had neither author done so, would it be hard or impossible for (plucky) players to adjust the scenarios to wrap ais into their gameplay, or did the authors place them there merely for the sake of full preparation/configuration so that downloaders needn't fuss with tweaks/adjustments?
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: What's this?

Post by Alberth »

DummyAIs are inserted by OpenTTD to avoid a crash, where a save game needs an AI, and there is none available.

That is, the DummyAI is part of OpenTTD itself.
Being a retired OpenTTD developer does not mean I know what I am doing.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: What's this?

Post by Zuu »

trainrover wrote:Alright, please bear with me, that beginner's tutorial I thought I could try out didn't seem packaged-and-ready if you will.
Please give details on how you tried to download the beginner tutorial, and did you play it using play scenario button? When it is downloaded using in-game content download, it should grab all dependencies for you.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
trainrover
Transport Coordinator
Transport Coordinator
Posts: 283
Joined: 29 Nov 2014 23:23

Re: What's this?

Post by trainrover »

Thank you for replying me, Zuu, otherwise I mightn't have overcome my unbearable hesitancy at trying stuff out while having no idea about what the next steps must be. I think I've figured it out. I set up AI before starting a new game, and it seems that I'm going to have to wait 2 years to see what happens. (I can't remember ever experiencing suspense by way of computer..this has gone on way too long {i.e., my being clueless, not the forthcoming 2-year wait}.)
trainrover
Transport Coordinator
Transport Coordinator
Posts: 283
Joined: 29 Nov 2014 23:23

Re: What's this?

Post by trainrover »

Ship ai hasn't done anything since its advent, although neither has my own company (fresh game's been just a test). In the now 4-year-old game, Ship ai's not listed as Company 2 in the status table (finances?). I've reviewed my advance settings but see nothing amiss. Please help.

Plus searching the boards here with the 2 words ship and ai, the results page keep indicating ai as being ignored, even when prefixing it with a + symbol.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: What's this?

Post by Zuu »

If you refer to Beginner Tutorial - Ship AI, it is not ment to be used in random games. See its description. Furthermore, it has parameters set to disobey to be selected as random AI or even show up in the AI selection window, unless you enabled AI developet tools.

If you want to play the beginner tutorial, go to play scenario in main menu, click on online content and select to download the scenario named Beginner Tutorial. Then back in the play scenario dialog, select Beginner Tutorial and click on the play/load button.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
trainrover
Transport Coordinator
Transport Coordinator
Posts: 283
Joined: 29 Nov 2014 23:23

Re: What's this?

Post by trainrover »

I see. I'd meant to ask whether the tutorial itself was for the game, as opposed to just ais. Thanks.
trainrover
Transport Coordinator
Transport Coordinator
Posts: 283
Joined: 29 Nov 2014 23:23

Re: What's this?

Post by trainrover »

Sylf wrote:"No available AI" means exactly that - you haven't downloaded any AI for OpenTTD.
Actually, I downloaded ais ages ago but have never used any of them. My problem now is activating any of them in my savegame. How do I achieve this, because it seems the scenario author's pair of ais are locked (can't select either one in the AI/Game script menu), although increasing the number of competitors does open the 4th slot? Meanwhile, eliminating all competitors (to a count of zero), then saving and abandoning the game, and then loading the resultant save doesn't clear the slate if you will, because the dummies are still there. Please help me at commanding them, they're making me feel like the daft one.
User avatar
Sylf
President
President
Posts: 957
Joined: 23 Nov 2010 21:25
Location: ::1

Re: What's this?

Post by Sylf »

It sounds like there are AI companies already in existence, taking up those AI slots. Because those AIs are active, you can't change the settings for those AI slots.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: What's this?

Post by Zuu »

trainrover wrote:I see. I'd meant to ask whether the tutorial itself was for the game, as opposed to just ais. Thanks.
Yes the tutorial scenario is ment to be played by newbie OpenTTD users. The tutorial is however coded using a game script and it also has an AI which complete the ship chapter if you jump to the chapter after that which rely on the oil refinery to produce goods. This ship AI will do nothing until a trigger sign is placed by the game script.

What is a bit special with the tutorial compared to many other scenarios you will find, is that when you select to download the scenario, it will auto-select all dependencies for it, so the scenario load fine. For an author to do this, they have to use our command line tool musa which is available to anyone, not just developers. But it is a bit less "click n play" than the web upload which most content uploaders are using. So most often, unfortunately, downloading a scenario will not download its dependencies for you.

trainrover wrote:
Sylf wrote:"No available AI" means exactly that - you haven't downloaded any AI for OpenTTD.
Actually, I downloaded ais ages ago but have never used any of them. My problem now is activating any of them in my savegame. How do I achieve this, because it seems the scenario author's pair of ais are locked (can't select either one in the AI/Game script menu), although increasing the number of competitors does open the 4th slot? Meanwhile, eliminating all competitors (to a count of zero), then saving and abandoning the game, and then loading the resultant save doesn't clear the slate if you will, because the dummies are still there. Please help me at commanding them, they're making me feel like the daft one.
When you load/play a scenario or save game, it works the same (because a scenario is basically a save game). The save/scenario contain a list of AIs used in that game. OpenTTD tries to find the code/program of the same AI that was used in the save file. It will pick the highest compatible version it find locally on your computer (in the readme you can see which folders it searches). If this fails, it will pick a random AI to take over the company. If there are no AI scripts available at all, it will use the Dummy AI which will do nothing.

For NewGRFs we have a strong reference in the save file which NewGRF file that was used. With strong I mean, it is that good that we can offer in the load dialog a list of missing NewGRFs and a button to download missing NewGRFs from online content. For AIs and Game Scripts, the reference is unfortunately weaker and we do not have this facility. All you can do is to download all AIs and hope that it will solve your problem. If the scenario used a version of AI XYZ that is incompatible with the last version of XYZ (which is what you'll get when you download it without a strong reference from a save game), then resolving that AI will fail.

So,
What you can do is to download all AIs from online content if you didn't yet, and try to play the scenario again. Don't use the save game you saved after loading AIs failed. It will miss out AI-specific data which only a live running AI can provide OpenTTD upon saving.

If this doesn't help, you can point out which scenario it is you try to load, and I or someone else could have a look at it. With a C++ debugger it is possible to inspect the names of the AIs that the scenario tries to load.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
trainrover
Transport Coordinator
Transport Coordinator
Posts: 283
Joined: 29 Nov 2014 23:23

Re: What's this?

Post by trainrover »

Zuu wrote:it will auto-select all dependencies for it, so the scenario load fine. For an author to do this, they have to use our command line tool musa which is available to anyone, not just developers.
Right, I do remember your relating to me its auto-select feature beforehand..had I not done so, then I'd have become..errrr..especially jumpy upon noticing many other files as also being selected in the content download selection menu. I shan't enable any ai developer tool until comfortable with the basics of ais.

Anyhow, your reply above here makes sense to me, I'm bookmarking it for future reference. As for the scenario, it's been usav1, although I've just piggybacked onto some other member's thread about it, asking whether s/he know what ais it draws from..downloading all ais would be unbearably overwhelming. Thank you.
trainrover
Transport Coordinator
Transport Coordinator
Posts: 283
Joined: 29 Nov 2014 23:23

Re: What's this?

Post by trainrover »

Sylf wrote:It sounds like there are AI companies already in existence, taking up those AI slots. Because those AIs are active, you can't change the settings for those AI slots.
Hmmm. So is eliminating activated ais impossible?
User avatar
Sylf
President
President
Posts: 957
Joined: 23 Nov 2010 21:25
Location: ::1

Re: What's this?

Post by Sylf »

trainrover wrote:is eliminating activated ais impossible?
It is possible.
Use the console command in the game. The command you need is
stop_ai 2
stop_ai 3 <-- those are the company IDs where the companies have started by AIs.
trainrover
Transport Coordinator
Transport Coordinator
Posts: 283
Joined: 29 Nov 2014 23:23

Re: What's this?

Post by trainrover »

Ah! thank you. I'm going to try that out and then sometime afterwards try activating an ai I'm curious to observe.
trainrover
Transport Coordinator
Transport Coordinator
Posts: 283
Joined: 29 Nov 2014 23:23

Re: What's this?

Post by trainrover »

Thanks again. The libraries and scripts/attributes(?) of the substituting ai I've selected (wmdot) have supposedly all loaded and linked up..maybe I should go ahead now at replicating it in further slots.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 5 guests