News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

When should parameters be stored in cityrules.tab?

Started by Matthew, March 10, 2026, 10:09:56 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Matthew

I am deciding where to store a new parameter and I can't find any explanation of why some parameters are stored in cityrules.tab (and accessed in simcity.cc) and some are stored in simuconf.tab (and accessed in settings.cc).

Based on the code, I think that the values of cityrules.tab parameters are not saved in the savegame, except by network servers (so that clients all have the same values), whereas the values of simuconf.tab parameters are saved in the savegame. But I might have misunderstood, because I don't see why this is a useful thing to do.

The other factor is that cityrule.tab only contains parameters that are used in stadt_t, but it's not obvious to me why this class gets its own file, given that simuconf.tab has many parameters used all over the game. Is it just an accident of history or does this solve a problem?
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

Matthew

It's been a week and no one has answered. I guess that might be a kind of answer in itself.... It's just not important! So I can put parameters in either.
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

prissi

cityrules.tab is never written to by the game, it is only read. And any parameter could be save by the game, especially for networkgames.

The cityrules.tab cannot be touched by many installations (Android, some Linux) whereas the simuconf.tab is more accessible and is overwritten by personal instances without editing the "master" simuconf.tab. This is because the paksets are closely connected with the house and street building rules.

But any parameters likely to be modded should go into the simuconf.tab so the can be modded. Also, all meaningful parameters of simuconf.tab are available in the extended setting window.

Matthew

Thank you so much for the explanation, Prissi. I have added this explanation to the tikiwiki.

Quote from: prissi on March 18, 2026, 11:54:43 AMAnd any parameter could be save by the game, especially for networkgames.

Just to confirm: you mean that the parameter set at the start of the game in cityrules.tab is saved into the .sve file and cannot be altered later by changing the cityrules.tab?

That is indeed very different from simuconf.tab files which has "progdir_overrides_savegame_settings", etc.
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

prissi

Most settings in simuconf.tab cannot be altered later with the usual trick, i.e. using the new game settings to repare the simuconf.tab settings then save the game and reload it. Especially most settigns affecting the game state are save and overwrite the values from simuconf.tab.