News:

Congratulations!
 You've won the News Item Lottery! Your prize? Reading this news item! :)

Loading Simutrans/pakXY/config/simuconf.tab

Started by infernalmachine, September 26, 2011, 07:39:00 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

infernalmachine

I was wondering if it would be possible to also search for Simutrans/pakXY/config/simuconf.tab when using pakXY in a game? Or to do the same for all the files in the Simutrans/simutrans/pakXY/config directory?

This would allow us to leave the default pakset config/ directory as is, and make any changes within the addon directory.  I'm not suggesting that this only be loaded using load-with-addons, but just that this be always searched for and loaded after the vanilla version (and perhaps before the Simutrans/simuconf.tab). [More on this at end of post.]

The problem now is that if you play with different paksets regularly (and wish to leave simutrans/pakXY/config/simuconf in its default state, but also wish to override some values in it) then Simutrans/simuconf.tab might need to be changed every time you switch from pakXY to pakYZ for example.

The other issue is that every time you update a pakset via the Nightly Builds page, you then have to re-edit the new simuconf.tab file, or risk overwriting the new one with an old one (when there might possibly be new values or even new variables initialised in the newer version).  It would be far easier to just keep the old addons directory as is when updating the pakset (or just copy it if the pakset name changes -- ie when the revision number changes.)

The reason I suggest always loading it (if it exists), rather than only loading when load-with-addons is specified, is that one might not want the addons themselves but want the simuconf.tab loaded.  That's already a slight issue with loading the citylist_xx.txt from the addons directory.  It's all or nothing with load-with-extensions.  On the other hand, it does mean that you have to remove/rename it each time you want to use the default pakset values, and change it back when you want to use it.

One advantage of my suggestion for both pakset maintainers and game developers is that you can request that people leave the original config files alone (at least for the paksets) and if someone reports a bug that's unexpected, that they rerun the game/pakset with default config values. (This came up recently with a drastic change someone made to a value in their cityrules.tab that had dramatic results, which appeared to be bug-like.)

I'd even suggest that a similar approach be used for the simutrans/config directory.  If Simutrans/simuconf.tab remains the last file read (for legacy reasons) then perhaps a Simutrans/config directory should be used for user changes to those files (and be read immediately after simutrans/config files but before the other 2 pakXY configs followed at last by Simutrans/simuconf.tab?)

greenling

infernalmachine
With whit pakset do you play?
And with what´s for Version do you play?
Opening hours 20:00 - 23:00
(In Night from friday on saturday and saturday on sunday it possibly that i be keep longer in Forum.)
I am The Assistant from Pakfilearcheologist!
Working on a big Problem!

infernalmachine

I usually play pak128.open with Standard simutrans (both latest versions from the Nightly Build page).  Also some Experimental (just downloaded 10.1) with pak64-exp or pak128.Britiain-ex.  But I also wish to play other paksets in Standard.

Why do you ask?

DirrrtyDirk

Quote from: infernalmachine on September 27, 2011, 12:12:40 AM
Why do you ask?

Probably because he's hoping you're using something he hasn't collected yet.  ;) Just wait until he asks you to either send your whole simutrans folder (including all paksets) to him or upload it somewhere...  ;)
  
***** PAK128 Dev Team - semi-retired*****

VS

On topic! These days, simuconf.tab is read from the following directories:

1) program dir/config
2) user dir
3) pakset dir/config
4) user dir (again)

So, what you might be suggesting is adding

5) user dir/pakset dir

or something like that. Do I understand this well?

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

infernalmachine

DirrrtyDirk:  Ah, I see.   ??? 
Well, luckily I have few addons. Only Gauthier's SNFOS fences and Fabio's recent test work on roads, tram tracks and trams, all of which I'm happy to share (actually, I just did.)

VS:  Exactly. Well almost.  user_dir/pakset_dir/config/ is what I'm requesting.  (Similar to how for city street names, town names and Translator language file we can now place them in user_dir/pakset_dir/text and then select load_with_addons when loading a pakset to use them in game.  Except I'm also requesting that this would load even if we don't select load_with_addons. And that it would apply to any files in the pakset config/ directory (ie cityrules.tab, etc.), not just simuconf.tab.

If you usually only play one pakset, then user_dir/ is really all that is needed.  But when you want to regularly switch from one pakset to another, it would be far more tidy to have user_dir/pakset_dir/config/ to keep things separate.  For example, in pak128, I have raised the initial cash by ten times (because I no longer find the initial challenge of avoiding bankruptcy all that interesting), but I wouldn't necessarily want that amount if playing pak128.Britain or pak.german.

By the way,  is the reason user_dir/ is checked twice that the program is searching for different variables to initialize each time?  I suppose it must be, because otherwise the first check is redundant, no?

prissi

COmpletely forgot about this. Well added in r4956.