Company Value GS

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
xarick
Transport Coordinator
Transport Coordinator
Posts: 342
Joined: 26 Feb 2015 00:52

Company Value GS

Post by xarick »

Company Value GS
================


Company Value GS is a Game Script that uses the goal list to rank companies by their current company value. It can also be used to challenge companies not only to be the first to reach a user defined company value target as a goal, but also to do it as fast as they can.


Configuration Settings
----------------------


Goal mode:
- Only rank companies by their values:
In this mode, Company Value GS only uses the goal list window to rank companies by their current company value. The value of the most valuable company is used to determine the progress of every company in relation to it. No goal is assigned to any company.

- Reach target company value below:
In this mode, Company Value GS uses the goal list window to also rank companies by their current value. The target value, which is set on the next setting, is used to determine the progress of every company in relation to it. Each company is given the same challenge, to become the first to reach the target value. Once reached, Company Value GS pauses the game and informs every company of the winner and the time it took to reach it since its inauguration, while asking if they want to continue playing. The moment any company continues playing, the game is unpaused and Company Value GS switches Goal mode to ranking mode.

Target company value (in thousand £):
- Sets the value companies need to reach. Used when Goal mode is set to reach this target value. Has no effect when Goal mode is set to ranking mode.

Amount of debug messages to log:
- Essential:
Logs only the minimum necessary, when Company Value GS is reaching key points, such as pausing the game, reaching the goal, switching game mode.

- Normal:
Also logs minimum details for loading, saving, starting, initializing, opening and closing of questions, and changes to the target company value.

- Too many:
Logs more details for loading, saving, starting and initializing. Also logs creation and removal of company goal details during Goal mode.

- Insane:
Logs every internal variable changes and every goal computations in near real time.

AI-GS communication support:
- Enable to allow Company Value GS to communicate with AI companies via signs, by using the Script Communication Protocol (SCP).


Change log
================

v4
- Added Script Communication Protocol support.

v3
- Added a feature to Goal mode: displays how many days the winner company needed to reach the target company value since the day of its inauguration.
- In the unlikely event that multiple companies reach the target value simultaneously, then the one with the highest value wins. If their values are identical, then the newest wins.
- Changed the amount of debug messages to be displayed on the various preset levels, and shifted all the near real time logs to Insane preset.

v2
- Fixed a bug that was causing the ranking order to be displayed in na unordered manner, when switching from Goal mode to Ranking mode.
- Unpausing the game is done immediately now, and not after company goal clean up, which improves responsiveness.

v1
- Uploaded to BaNaNaS.
Last edited by xarick on 02 Jan 2019 03:39, edited 10 times in total.
Formerly known as Samu
xarick
Transport Coordinator
Transport Coordinator
Posts: 342
Joined: 26 Feb 2015 00:52

Re: Company Value GS

Post by xarick »

I took this GS to do some sort of competition between AIs. Each game started in 1960 and 3 Random AIs would try to be the first to reach a Company Value of €25.000 k.
Once that happens, I take note of the winner and how long it took to reach the goal. Then I start new games every time I get the winner of each game, until I get a sizeable sample and display it in a scoreboard of sorts as below.

Code: Select all

Easy Preset; 1960+; 1.8.0; Temperate; 256x256; Company Value GS; 3 Random AIs
AI Name    (version); End Value;  Days taken
--------------------------------------------
AIAI           (v97); €25.005 k;  2.975 days
LuDiAI          (v1); €25.002 k;  3.617 days
Convoy         (v11); €25.002 k;  3.638 days
AIAI           (v97); €25.003 k;  3.651 days
trAIns          (v2); €25.003 k;  3.937 days
SynTrans       (v15); €25.007 k;  4.169 days
SnakeAI         (v9); €25.001 k;  4.212 days
NoNoCAB         (v5); €25.028 k;  4.325 days
LuDiAI AfterFix (v5); €25.006 k;  4.552 days
WormAI          (v7); €25.010 k;  4.888 days
ChooChoo      (v412); €25.018 k;  4.896 days
NoNoCAB         (v5); €25.032 k;  5.222 days
OtviAI        (v422); €25.002 k;  5.715 days
WrightAI        (v3); €25.001 k;  5.853 days
Trans      (v180622); €25.000 k;  6.558 days
TeshiNet        (v4); €25.007 k;  6.873 days
CluelessPlus   (v38); €25.002 k;  7.119 days
BorkAI         (v23); €25.013 k;  7.155 days
RailwAI        (v12); €25.001 k;  7.191 days
EmotionAI       (v1); €25.002 k;  7.217 days
BorkAI         (v23); €25.020 k;  8.256 days
CluelessPlus   (v38); €25.000 k;  8.876 days
EpicTrans       (v1); €25.000 k;  9.244 days
HeliFerry       (v3); €25.002 k;  9.841 days
Here's a screenshot of my last match.
Image

I attach the savegame of it and the config file used for all these matches.
Attachments
Sem nome, 24 Abr 1985.png
(60.94 KiB) Not downloaded yet
Sem nome, 24 Abr 1985.sav
(209.7 KiB) Downloaded 168 times
openttd.cfg
(10.89 KiB) Downloaded 185 times
Formerly known as Samu
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 3 guests