[GS] NoCarGoal

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
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: [GS] NoCarGoal

Post by Zuu »

Update - Version 3
  • Fix bug that delivery to industries was counted twice
  • Use user friendly units in the strings (tonnes, litres etc.)
  • Possible to configure if progress news should show every month or every year
  • Progress news show cargo transported + percent completed
  • Goal window now show the bronze + silver + gold goals in the global section (making them visible also to spectators in MP games)
  • For companies, there is only one goal at each time showing the next medal level. This goal include a percentage completed figure at the end. The company goal is updated monthly.
  • The news message that show when you complete a medal level now includes a suggestion to continue with the next level and the end year as a reminder.
Attachments
NoCarGoal-v3.tar
(30 KiB) Downloaded 200 times
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: [GS] NoCarGoal

Post by Alberth »

\o/
User avatar
3iff
Tycoon
Tycoon
Posts: 1093
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Re: [GS] NoCarGoal

Post by 3iff »

I'll give it a try...thanks for the quick update.

*********

I haven't yet had time to give this a thorough test but my brief game yesterday confirmed that the double delivery problem was gone. I should be able to test further over the weekend.
Kjetil
Engineer
Engineer
Posts: 3
Joined: 22 Apr 2004 14:59

Re: [GS] NoCarGoal

Post by Kjetil »

I have a suggestion:

Autogeneration of new goals as the previous goals expire.

Maybe even combined with some sort of scoring system where missing goals are penalized and achiving goals faster than opponents are rewarded. Missing some goals while outperforming the competitors on other goals can then be allowed. Missing too many goals will make a competitors score too low and his/her company will be shut down.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: [GS] NoCarGoal

Post by Yexo »

Another suggestion: make it possible to request the goals and current status via the admin port
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: [GS] NoCarGoal

Post by Zuu »

OpenTTD bug that affects NoCarGoal
If you use NoCarGoal on a server, please be aware of these issues:
https://secure.openttd.org/bugs/task/5283

Namely, preferable don't use the pause setting that forbids all actions when the game is paused. At least if you would like to be able to unpause the server after that the goal has ended.

Kjetil wrote:I have a suggestion:

Autogeneration of new goals as the previous goals expire.

Maybe even combined with some sort of scoring system where missing goals are penalized and achiving goals faster than opponents are rewarded. Missing some goals while outperforming the competitors on other goals can then be allowed. Missing too many goals will make a competitors score too low and his/her company will be shut down.
Those are good possibilities if one want to build upon NoCarGoal and extend it further. However, for the moment I think it is fairly complete as a functional goal script that adds a lot of fun with a game that has a finite length. Also I hope that at the moment it is fairly easy to understand the goals and how it works.

A problem with more complicated goals and formulas is that they tend to be very hard to explain in a few words to players.

I might extend it further later, but for the moment I will probably focus on how OpenTTD can be extended to allow game scripts to show progress of goals in a better way than spamming the player with news items.

Yexo wrote:Another suggestion: make it possible to request the goals and current status via the admin port
Sounds like a good idea to allow server owners to have a website showing status etc. if they wish to do that.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5649
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: [GS] NoCarGoal

Post by andythenorth »

Zuu wrote:However, for the moment I think it is fairly complete as a functional goal script that adds a lot of fun with a game that has a finite length. Also I hope that at the moment it is fairly easy to understand the goals and how it works
+lots

NoCarGoal is simple, and that is important :)
User avatar
3iff
Tycoon
Tycoon
Posts: 1093
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Re: [GS] NoCarGoal

Post by 3iff »

Finally managed to complete a small test game (v3). Seems perfect for a short game challenge. No problems encountered.

Thanks for the script.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: [GS] NoCarGoal

Post by Zuu »

Update - Version 4
  • AI API using Script Communication Protocol (see readme.txt)
  • Sends a monthly update to Admin Port (untested)
  • Fix: Give better information about game end date in the goal gui strings
There will come an example AI and/or CluelessPlus with support for NoCarGoal AI API. With it an AI can get the three goal cargo ids, target and amount of transported. They can also get number of days left and total game length in years. Basically enough data to compete with humans on the three cargoes that count towards the goal. The AI itself decide if it want monthly updates of goal progress or if it want to just poll the GS for information eg. twice a year.
Attachments
readme.txt
(4.56 KiB) Downloaded 306 times
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: [GS] NoCarGoal

Post by Zuu »

Update - Version 6

Change log:
  • Feature: Use color highlight in goal GUI (inspired by Silicon Valley GS)
  • Feature: Show time left in progress news
  • Feature: The selected cargoes have been constrained so that at least one cargo come from a raw industry and at least one from a processing industry. The third cargo is obtained by random from the remaining cargoes. Hopefully this should balance the cargo selection better.
  • Feature: Show current medal status of each company by placing a sign at their HQ. If there is no HQ, no sign is placed.
  • Fix: Show correct end date information in the goal info news that is shown when a new game starts.
  • Fix: Pause game after all game end dialogs have been shown. This works around that FS#5283 can block the game end dialogs from appearing.
  • Add: ChangeLog.txt
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: [GS] NoCarGoal

Post by Zuu »

Update - Version 7

This update only contains visual tweaks and fixes:
  • Fix: Number of years left was not shown when there was a year and some days left. Only when there was 2 or more years. Now it show also for 1 year left.
  • Fix: Use 'days' instead of 'day' as it is far more frequently correct.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
3iff
Tycoon
Tycoon
Posts: 1093
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Re: [GS] NoCarGoal

Post by 3iff »

Fails for me. I'm using nightly 24495 (I know it's a bit old, perhaps this is the reason?)
Am I doing something wrong? Older versions (V4 I think) work fine.
Unnamed, 1st Jan 1950.png
Unnamed, 1st Jan 1950.png (23.27 KiB) Viewed 4839 times
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 988
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: [GS] NoCarGoal

Post by frosch »

3iff wrote:Fails for me. I'm using nightly 24495 (I know it's a bit old, perhaps this is the reason?)
Yes, you will need at least r24513 for "IsProcessingIndustry". But better use something even newer :)
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
User avatar
3iff
Tycoon
Tycoon
Posts: 1093
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Re: [GS] NoCarGoal

Post by 3iff »

Thanks. I update my 'current version' every so often (a few months) rather than updating it every week...

Maybe I'm due for a new latest nightly.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: [GS] NoCarGoal

Post by Zuu »

Thanks for your version info. With that I could update bananas to hold this information.

I tend to update just before starting OpenTTD.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
3iff
Tycoon
Tycoon
Posts: 1093
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Re: [GS] NoCarGoal

Post by 3iff »

Grabbed a later nightly (24758) and things work fine.

I wonder if you could add an option for the progress update to be every 3 months. Every month is just too often and yearly is a bit too far.

Thanks for your efforts on this script.
3298
Traffic Manager
Traffic Manager
Posts: 143
Joined: 02 Apr 2011 12:55

Re: [GS] NoCarGoal

Post by 3298 »

I managed to crash OpenTTD with just NoCarGoal (no AIs, no NewGRFs). Steps to reproduce:
- turn on "pause on new game"
- start new game
- click on the middle of the status bar.
With other scripts or no script at all OpenTTD simply shows no news message. Same with a NoCarGoal game saved and re-loaded between starting it and clicking on the status bar.
I am currently using an unmodified r24947 and the latest NoCarGoal from BaNaNaS. I tried it on 64-bit Win7 (at home) and 32-bit Lubuntu 12.10 (on my laptop), same results (except for the window informing me about the crash, which is missing on the laptop).
My guess is that the news message about the goals is only partially created.
Attachments
crash.dmp
(2.14 MiB) Downloaded 126 times
crash.png
(424.05 KiB) Downloaded 2 times
crash.log.txt
(8.96 KiB) Downloaded 130 times
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: [GS] NoCarGoal

Post by Zuu »

Update - Version 8

For users with today's nightly or later, an intro message is displayed in the new Story Book window. For users with older versions of OpenTTD, the new intro message is displayed in a blue info window.

This update do not make fully use of the Story Book window, however at this point I value keeping backward compatibility and also getting a GS out that uses the Story Book at all.
Attachments
T. Nelson Transport, 6th Feb 1950.png
T. Nelson Transport, 6th Feb 1950.png (27.06 KiB) Viewed 4214 times
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
2006TTD
Route Supervisor
Route Supervisor
Posts: 428
Joined: 05 Mar 2006 02:46
Location: Hong Kong

Re: [GS] NoCarGoal

Post by 2006TTD »

Sorry for nitpicking, but I'm wondering if you meant 'scarce' resources instead of 'scare'.
Overall it's nice to see this feature. :)
Face the fearful with no fear, and its fearfulness disappears.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: [GS] NoCarGoal

Post by Zuu »

2006TTD wrote:Sorry for nitpicking, but I'm wondering if you meant 'scarce' resources instead of 'scare'.
Overall it's nice to see this feature. :)
Thank you for noticing it. I'll fix that in the next update along with some commas that are missing.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 6 guests