[GS] Technology Advancement

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
Firrel
Engineer
Engineer
Posts: 36
Joined: 13 Aug 2019 17:06

[GS] Technology Advancement

Post by Firrel »

Technology Advancement GS


Technology Advancement (TEAD) is a game script which changes the availability of technology: rail, road, water, air. The script allows to start at a certain technology year, slow down or speed up the technology advancement or unlock all technology. Supports any combination of NewGRF.

How the script works:
The way this script works is that the technology date is separated from the game date, so it can advance at different speed or be paused completely. Based on this date, new vehicles are released or old are
shelved.

See more in readme:
readme.txt
(4.67 KiB) Downloaded 102 times

Requirements:
  • OpenTTD version 1.10.x or newer
  • SuperLib v. 40
Download:
The first release (v0) is available on BaNaNaS. This might contain bugs, which I wait you to report, so you help me to make the script better

Limitations:
The game script is limited at the time of writing by these factors:
  • only vehicles can be enabled/disabled by game script
  • vehicle reliability is not relevant to technology date, using no breakdowns is almost mandatory
  • the game script cannot access model life parameter of vehicles, so a fixed model life has to be selected
  • the technology speed is modified in game script settings; story book buttons are currently worked on, which will allow better control over the speed
  • enabling new vehicles by game script command does not trigger new vehicle news

Updates:
Version 0 (2020/05/10):
- initial release
Attachments
TechnologyAdvancement-0.tar
(50.5 KiB) Downloaded 57 times

User avatar
andythenorth
Tycoon
Tycoon
Posts: 5233
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: [GS] Technology Advancement

Post by andythenorth »

This looks interesting, so I gave it a go.

First thing I did was use cheats to change game date, sorry :twisted:

Cheating date causes newgrf to introduce new vehicles, which the GS does then un-introduce again. :)

Firrel
Engineer
Engineer
Posts: 36
Joined: 13 Aug 2019 17:06

Re: [GS] Technology Advancement

Post by Firrel »

andythenorth wrote:
06 Jun 2020 09:41
This looks interesting, so I gave it a go.

First thing I did was use cheats to change game date, sorry :twisted:

Cheating date causes newgrf to introduce new vehicles, which the GS does then un-introduce again. :)
Thank you for your feedback.

As I see it there are still too many issues to make this script work properly. I dont know if I will get to it or it will get shelved... I looked forward for the addition of changing engine availability and tried what can be done with it, but as I see it, there is still a long way for proper tech tree or daylength script.

As you say, the enabling/disabling is not working properly with cheating the year. I can make the techology date to not advance when the game year is cheated, which might solve it.

I finally checked the source code on how the engine enabling/disabling actually works and as it seems there is no way for this script to fully function as it is now (I may have missed something). The enable/disable will just force it to a state for the selected company, which can be then overriden by natural availability.
The engine could be disabled after it is released as the release date that can be acquired. But the natural disabling is dependant on engine reliability and model life, which are not available from game script. It would still be bothersome that a popup shows about new engine and it will just get disabled silently, confusing the player.
Checking engine availability in every loop can make the list always up to technology date. Issue is, disabling engine for a company will still return IsBuildable as true, so in every loop all disabled engines will be again disabled for each company. Disabling 13 engines takes 13 ticks, so 100 engines for 4 companies would take 400 ticks, which is too much.

The engine reliability is a whole other story. It is calculated per engine when it is naturally introduced, so releasing it early makes it almost unusable (50-60%). It would require to have the reliability calculated per engine per company, which would break the competition, because reliability is randomized.

User avatar
jfs
Tycoon
Tycoon
Posts: 1245
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: [GS] Technology Advancement

Post by jfs »

You're right, the way the availability is handled by OpenTTD probably needs more tweaks. It probably needs an additional bit for whether the availability has been overridden or not, and a way for the GS to reset the availability to "default".

A way to modify the max reliability curve for an engine could also be useful, but I'm sure if that was made available to GS, several NewGRF authors would cry foul ;)

Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 8 guests