The International Simutrans Forum

Development => Technical Documentation => Topic started by: Matthew on March 10, 2026, 10:09:56 PM

Title: When should parameters be stored in cityrules.tab?
Post by: Matthew on March 10, 2026, 10:09:56 PM
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?
Title: Re: When should parameters be stored in cityrules.tab?
Post by: Matthew on March 18, 2026, 12:40:16 AM
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.
Title: Re: When should parameters be stored in cityrules.tab?
Post by: prissi on March 18, 2026, 11:54:43 AM
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.
Title: Re: When should parameters be stored in cityrules.tab?
Post by: Matthew on March 20, 2026, 02:06:53 PM
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.
Title: Re: When should parameters be stored in cityrules.tab?
Post by: prissi on March 21, 2026, 11:14:03 AM
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.