How to change NewGRFs mid-game (DON'T DO THIS!)

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Locked
User avatar
kamnet
Moderator
Moderator
Posts: 8507
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

How to change NewGRFs mid-game (DON'T DO THIS!)

Post by kamnet »

How to Change NewGRFs Mid-Game In OpenTTD
(but, here's why you should not do this!)


Note: A shortcut URL for this post is available for social media: https://is.gd/TTDAddNewGRFs

One of the most frequently asked questions in the entire history of OpenTTD is "How do I change NewGRFs?" It is an issue that all players eventually come across once they start adding mods to their gameplay. You download content, you add it to your NewGRF settings, you start a new game, and somewhere along the way you decide that you're not satisfied with what you've selected. Either the NewGRF isn't what you thought it would be, it's missing something, or it's too confusing to use. Or perhaps you've found a bug and need to remove or update the set. Perhaps there's a new tasty set of graphics you'd like to play with in your current game?

Whatever the reason, it is obvious that the players of OpenTTD are of the curious type, they're eager to try new things, even take risks. So the question gets asked frequently, but until today the answer is often elusive, and sometimes even gets a hostile response from other players. In the past many others attempt to head this off in hopes that players would develop good habits and not engage in activity that could lead them to a path of ruin. Some have even gone as far as to obfuscate the answer being sought. Rather than continue the cycle of confusion and obscurity, it is better than the answer be plainly stated.

However, first allow me to explain how we got to this point, and offer a guide as to why this is considered a bad practice, and what actions you may want to take into consideration whether you decide for or against making these changes. Afterward, I will publish the steps needed to make this action.

How It Started

In the beginning, Patchman created the TTDPatcher, and it was good. And then Ludde released the source code for what would be OpenTTD, and it was also good. And somebody asked if the NewGRF system that was created to allow modifications in patched Transport Tycoon Deluxe could be applied to OpenTTD, and the developers who inherited the code found a way. A whole new level of fantasy and freedom was unleashed onto the community.

With it, however, problems appeared. As the game's code became more complex eventually it was discovered that while you could openly change the NewGRF settings, doing so while in the middle of a game could cause the game to crash or introduce corruptions. As more and more players did this, they started to create more and more bug reports. However, the problem was not bugs in OpenTTD source code, but the game state becoming modified in a manner which it was never supposed to. These issues technically were not bugs, they were effectively player-created problems that the developers had no way to predict and continually offer patches to resolve.

After many months of debate, it was eventually decided by the developers that this feature would be disabled. This did not sit well with many in the community, many who decided that even if there was a risk of corrupting a game that it was still an option they wanted to decide for themselves. A compromised was reached that this option would now be disabled by default, but with a few magic key strokes by the player, this feature would be re-enabled. Doing so would invoke a notable warning screen that the user needed to accept, including a notice that any bug reports would not be accepted if it was seen through the log files that this setting was overridden by the player. Once this warning was displayed and cleared by the player, there would be no further restrictions in the game - and no further warnings. The player is now in uncharted territory.

Image

What Happens When You Allow NewGRFs To Be Changed Mid-Game?

As explained, changing NewGRFs in the middle of a game alters the game state. This, in turn, starts to introduce errors that may result in things not working right, or possibly crashing the game entirely. How, why or when this happens is not predictable. NewGRFs allow for many types of features and settings to be modified from the original game. NewGRFs can even modify how other NewGRFs work. Whatever these changes may be, the game depends on them remaining the same throughout the game once they're started. Any modification therefore creates instability. Some of it may immediately present itself, such as broken graphics, incorrect cargoes, vehicles that appear to be stuck. Some of it may not be immediately present and is only observed after a period of time has passed. Sometimes a player may not even notice it because whatever changed didn't affect their gameplay and they ended their game before it was obvious. Make no mistake, though. Once a changed is introduced, that game is technically broken, and a player must accept these consequences, whatever they may be, and there may not be a way to reverse them.

This applies to modifying live games, saved games, and scenario files that are saved or in the middle of being created. If you must change NewGRFs, it is strongly advised that you end the current game or scenario and start a new game using the NewGRFs that you intend to use throughout the whole game, and modifying any parameters before you start.

"So, There is NO WAY to Ever Safely Change NewGRFs?"

As explained above, technically, no. Also noted above, there are changes which may be made which may not introduce any noticeable error or corruption. This is not considered an endorsement of such activity, but after fifteen-some years of active development and player interaction, many have been able to identify activity which may have few, if any, noticeable negative consequences.

MOST HARMFUL: By and large, it's generally agreed that the most harmful type of action is adding or removing an industry or economy NewGRF, or modifying its settings and parameters. In almost every case, this will result in broken graphics and industries producing incorrect cargoes or no longer accepting or receiving cargoes. This can also modify vehicles so that they no longer carry the correct cargoes. If this happens your game is pretty much ruined. Hopefully you have an unmodified and uncorrupted savegame you can go back to. Another type of NewGRF which can be very harmful is adding or removing a town name NewGRF. Modifying the town names may generally result in an error message that the NewGRF could not be loaded, or it may completely corrupt everything, since much of the game mechanics depend on this not changing.

LEAST HARMFUL: Experience has shown that if all a player does is add a new NewGRF (that is not an industry or economy NewGRF) to a game that this usually has no serious negative effect on the game. The least harmful of all may be the addition of house/building sets or vehicle sets which ONLY change the graphics of the default game sprites without adding, removing or modifying any of the settings. With some NewGRFs one may be able to safely make those changes by modifying the openttd.cfg file and adding the NewGRF's file name into the [newgrf-static] section before starting the game. This would allow the NewGRF to always be present, even in multiplayer games, without modifying the game state. Adding NewGRFs for new vehicles, stations, bridges, objects and GUI elements are also generally considered to be low risk, but not without any risk. Doing so may make some changes to the in-game costs of other things in the game, which may or may not be noticed by the player and may or may not be acceptable. If you attempt to do this, it's also highly advised that you pause the game and create a new save file before making these changes. Do not rely on autosave, as the autosave file could be overwritten.

MODERATELY HARMFUL: While adding a NewGRF may be considered the least harmful, there is a somewhat more complicated matter when it comes to removing or updating a NewGRF to an older or newer version. Most NewGRF developers will warn players if a newer version of the mod will break backwards compatibility. However, if it is not noted anywhere do not assume that this is safe to do, as this may not have been tested. Even if the developer says that it is backwards compatible, they may not have thoroughly tested this to be certain, so proceed with caution. Any NewGRF which modifies any properties of the default game settings, other NewGRFs or is an update which changes cargo capacities or other features may potentially be harmful to your game. If you are going to remove a NewGRF, it is highly advised that you first remove all elements of it from within the game itself, which can be a daunting task if you used it a lot. Trains, vehicles, objects, stations, rails, roads, tracks, buildings, industries, etc. - all of it will need to be scrubbed from the game map. Again, pause the game, make a new save before proceeding.

How To Permanently Enable Changing NewGRFs In Mid-Game

One last reminder that you will be presented with a warning about the consequences of doing so. Once this warning is cleared, you will not be reminded again. These changes are permanent unless you go back and revert them or remove the old installation and configuration files and replace them with fresh files or a new installation. If you have not read the paragraphs before this, I beg that you do so now. With all warnings and suggestions aside, it is now time to deliver on the promise.

To change this setting, first open the game console by pressing the ~ or ` key (or if you modified the hotkeys, whatever key you may have changed this to). Next, type the following command:

Code: Select all

set scenario_developer true
As noted, you will then be presented with a warning message to read and clear.

Image

Once this setting is changed and the message cleared, it is permanent. If you wish to revert this setting, type the command again, and change "true" to "false". Toggle the game console key to close the console.

I hope that this guide has been helpful to you in making the decision on whether or not to change the NewGRFs in your game. If you have any suggestions for improving this guide, please send a message to the author. Continued discussion about this subject should be taken to another topic. Also, please do not message me asking for assistance with fixing errors after NewGRFs have been modified. This is beyond my capabilities, and seeking assistance from others after ignoring warnings will likely result in little to no help. To summarize my suggestions again, first, don't do this. Second, if you do and it goes bad, either revert to an uncorrupted save or start a new game. The pain of starting a new game is easier than the pain of struggling to fix something that cannot be repaired.

Thank you for reading!
Locked

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 0 guests