[IMPORTANT] 95.0 will got a new folder structure

[IMPORTANT] 95.0 will got a new folder structure

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

[IMPORTANT] 95.0 will got a new folder structure

Post by jK » 30 Mar 2013, 15:17

first the defaults:
  • Linux: will write from now on to ~/.config/spring and default configfile will be ~/.config/spring/springsettings.cfg
  • Windows: won't run anymore by default in portable mode, means it won't write anymore to the installdir just cause it got write access to it, instead it will write everything (including config!) to C:/.../My Games/Spring
    If you want an all-in-one-folder setup (= portable mode), then you need to place a springsettings.cfg next to spring.exe & unitsync.dll.
  • all settings from the old layout will be read, but the engine will write them to the new locations
now the facts:
  • Spring will just write to a single folder (even the config file!).
  • Spring will read from multiple folders (even in portable mode, it will check the known default locations!), except it runs in Isolation Mode.
  • Config files will be read from all DataDirs (that's new!).
  • Checked locations for DataDirs is now simply grouped in 3 sections.
  • Nearly all user defined directories allow to define multiple dirs in one string (separated by ":" on *nix and ";" on windows) and may contain relative paths & EnvVars (like $HOME, %HOME%, ...).
the Math tables:
Scanned DataDirs
Sorted by priority the engine may use multiple data directories,
but it will use only the one with the highest priority as writable, to write cache & log files to.
The hierarchy the engine loads DATA DIRs in can be grouped in 3 sections (don't confuse the 3 sections with the 3 modes!):

Normal Mode:
  • directory defined via --write-dir
  • SPRING_WRITEDIR envvar
  • --------------------
  • CONFIG_HOME
  • ETC_DIRS
  • USR_SHARE
  • --------------------
  • SPRING_DATADIR envvar
  • SpringData configtag
Portable Mode:
  • directory defined via --write-dir
  • SPRING_WRITEDIR envvar
  • --------------------
  • INSTALL_DIR <-- that's the only change to Normal Mode
  • CONFIG_HOME
  • ETC_DIRS
  • USR_SHARE
  • --------------------
  • SPRING_DATADIR envvar
  • SpringData configtag
Isolation Mode:
  • directory defined via --write-dir
  • SPRING_WRITEDIR envvar
  • --------------------
  • ISOLATION_DIR
  • --------------------
  • SPRING_DATADIR envvar
  • SpringData configtag
CONFIG_HOME
  • Config directories in user's home.
    *nix/MacOSX:
    • ${XDG_CONFIG_HOME-"~/.config"}/spring
      ~/.spring
    Windows:
    • C:/.../My Documents/My Games/Spring/
      C:/.../My Documents/Spring/
      C:/.../All Users/Applications/Spring/
INSTALL_DIR Location of {BINARY} binary.
ETC_DIRS Additional ':' separated DATA DIRs defined in /etc/spring/datadir.
USR_SHARE
  • *nix: /usr/.../share/spring
    MacOSX: .../Spring.app/Contents/Resources/share/games/spring/base/
    Windows: Install directory
ISOLATION_DIR
  • Mode A (--isolation): INSTALL_DIR
    Mode B (--isolation-dir): supplied dir
ConfigFiles
Engine scans following directories for config files:
  • file defined via '--config'
  • write DATA DIR (by default ~/.config/spring | ../My Games/Spring)
    • (skipped in Isolated mode)
      *nix/MacOSX: ~/.springrc
      Windows: C:\Users\USER\AppData\Local\springsettings.cfg
  • all read DATA DIRs
The one with highest priority will be used for writing, all other found ones will be opened as readonly.

The filename of such config files can be as following:
  • springsettings-%Engine_Version%.cfg
  • springsettings.cfg
  • springrc-%Engine_Version% (*nix/MacOSX only)
  • springrc (*nix/MacOSX only)
(An example for a versioned config file is "springsettings-94.1.cfg".)

Glossary
DataDir
Data directories are searched for content, and among other things, may contain: config files, logs, games, maps, AIs, cache

Portable Mode
An all-in-one-folder setup, which allows to run Spring without installation.
To do so all relevant files (binaries & basecontent) must be in a single folder,
esp. spring(.exe), libunitsync.so/unitsync.dll and springsettings.cfg.
Spring will then use the all-in-one-folder for writing and won't do so anywhere else on the system,
but it may open other files & directories for reading.

Isolation Mode
Not to confuse with Portable Mode, this mode disables all automatic Data Dir scanning and limit reading & writing to a single folder.
This is very usefull when games want to run separate from other Spring games.

PS: All this information can be found in spring's manpage.
PPS: too much text, too lazy to fix grammar.
0 x

User avatar
PepeAmpere
Posts: 586
Joined: 03 Jun 2010, 01:28

Re: [IMPORTANT] 95.0 will got a new folder structure

Post by PepeAmpere » 30 Mar 2013, 17:20

  • Will be portable folder structure still prepared for download with new release? Or is it portable packs creators work now to place all things correctly?
  • Is there any link with example folder structure and some pre-95.0 version?
  • Is this new folder structure step to multiversion or autoupdate engine feature?
0 x

User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: [IMPORTANT] 95.0 will got a new folder structure

Post by jK » 30 Mar 2013, 17:47

PepeAmpere wrote:Will be portable folder structure still prepared for download with new release? Or is it portable packs creators work now to place all things correctly?
Portable builds are still published.
PepeAmpere wrote:Is there any link with example folder structure and some pre-95.0 version?
The structure of DataDirs is unchanged! (except that config files are now loaded from them, too)
PepeAmpere wrote:Is this new folder structure step to multiversion or autoupdate engine feature?
Yes
1. It allows you to place spring binary & unitsync into a single dir without triggering portable mode in such cases. If portable mode would be triggered Spring would then write into such a dir, something you don't want in multi-engine setups (you want it to still use default config locations in homedir, on the other hand it should _load_ the basecontent from that dir).
2. The order in which datadirs were loaded was totaly foobar before, now you got a pre & post stage where you can force the writedir and add additonal readonly dirs. So you got now full control of the whole process.
0 x

User avatar
Silentwings
Moderator
Posts: 3582
Joined: 25 Oct 2008, 00:23

Re: [IMPORTANT] 95.0 will got a new folder structure

Post by Silentwings » 30 Mar 2013, 17:54

Will the same principles be applied to SpringLobby?
0 x

abma
Spring Developer
Posts: 3544
Joined: 01 Jun 2009, 00:08

Re: [IMPORTANT] 95.0 will got a new folder structure

Post by abma » 31 Mar 2013, 04:13

springlobby uses unitsync to detect data & writeable dirs, so yes.
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14575
Joined: 17 Nov 2005, 02:43

Re: [IMPORTANT] 95.0 will got a new folder structure

Post by Forboding Angel » 31 Mar 2013, 05:58

Yeah, this is definitely confirmed win.

Is ~/.spring on linux finally going to become ~/spring ? Keeping that hidden seems extremely counter intuitive, especially considering that maps and games are in there.

Granted, in linux it's easy to flip on hidden files/folders, but if the user doesn't know it's there in the first place, it creates a very confusing situation when someone says "yep post your infolog" or "just put it in your maps folder".

I understand the want to keep ~/ clean and uncluttered, but imo this is an acceptable exception, isn't it?
0 x

cleanrock
Former Engine Dev
Posts: 115
Joined: 21 Feb 2009, 07:42

Re: [IMPORTANT] 95.0 will got a new folder structure

Post by cleanrock » 31 Mar 2013, 12:40

I also think ~/.spring/ is a little odd, if we change it perhaps use the name spring_data instead of just spring.
0 x

abma
Spring Developer
Posts: 3544
Joined: 01 Jun 2009, 00:08

Re: [IMPORTANT] 95.0 will got a new folder structure

Post by abma » 31 Mar 2013, 18:58

create a symbolic link from ~/spring_data to ~/.spring then?

hiding a directory isn't easily possible, while unhiding is quiet easy... so i would kept it hidden as infolog.txt is only needed when a problem occurs.
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14575
Joined: 17 Nov 2005, 02:43

Re: [IMPORTANT] 95.0 will got a new folder structure

Post by Forboding Angel » 31 Mar 2013, 21:24

Well a symlink would effectively unhide .spring so yeah... That works. However I question whether a symlink as opposed to simply unhiding it makes sense
0 x

User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: [IMPORTANT] 95.0 will got a new folder structure

Post by jK » 31 Mar 2013, 21:33

I won't break linux standards, also my home dir is already cluttered enough, that's why the ~/.config/ standard was made.
0 x

User avatar
danil_kalina
Posts: 505
Joined: 08 Feb 2010, 22:21

Re: [IMPORTANT] 95.0 will got a new folder structure

Post by danil_kalina » 31 Mar 2013, 22:02

Why not to make PORTABLE version only ? ( for all three OSs, windows, linux and mac )

How to uninstall Spring and install a fresh version ( I am not sure that My Current Spring works well ):

How to uninstall Spring forever ?
You don't need to uninstall anything, just delete folder.

How to install Spring ?
Just unpack an archive.

Spring Pack ( main folder )
____Nota Lobby
____Spring Lobby
____Zero-K Lobby
____F Lobby
____Spring Data
________demos
________maps
________games
________screenshots
________...
____Spring Engines
________91.0
________93.1
________95.0
________...

Your hidden folders are crap. Try to un-hide folder on MAC. Without specific application you can't do it easily.

Folders in users data are also crap. "My lobby" can't auto-download Map. Auto-host sent me a link for a map. I have downloaded it manually. so, Where can I find the right folder where should I move this fu... map file ?

"..infolog.txt is only needed when a problem occurs" What ?
Spring Engine has problems all the time. People develope code. Developers make Spring Engine. People are not perfect. you will have problems always
0 x

User avatar
Silentwings
Moderator
Posts: 3582
Joined: 25 Oct 2008, 00:23

Re: [IMPORTANT] 95.0 will got a new folder structure

Post by Silentwings » 31 Mar 2013, 23:13

so i would kept it hidden as infolog.txt is only needed when a problem occurs.
I agree with forb and danil here. I regularly look look at my own and ask other people to pastebin infologs.

It will cause lots of frustration and mean simple bugs not being properly detected/fixed if infolog isn't somewhere easily findable, I think.
0 x

User avatar
hoijui
Former Engine Dev
Posts: 4342
Joined: 22 Sep 2007, 09:51

Re: [IMPORTANT] 95.0 will got a new folder structure

Post by hoijui » 31 Mar 2013, 23:33

"our software is so important, that everyone that installs it, does not mind it cluttering anything, cause it is basically why that person got a PC in the first place; the PCs sole purpose of existence! therefore, standards and all the reasons they were invented for, do not apply to us. we should put shortcuts to the data-folder on the desktop, because our software is so bad, that it always crashes, and thus the user needs very easy access to the log files. also, all accessory software sucks, and the stuff that should work automatically, does usually not, and thus there is even more reason why we should stick it to the users face, and why we are allowed to neglect standards."
this makes sense to the same people for which the GPL does not make sense. it is the "egoist" vs .. i don't know a good name for it... "we are all equal" (?) mentality.

... coming next:
forb, giving us an other 10 posts with content: "i think it is right, because <5 times the same reasons he stated already, because they are so important, and because people _obviously_ don't get them the first, second, ... time>"

the lobbies could auto-upload infolog, or make it easy for the user to upload it, or tell him where it is, or open the folder it is located in, or ....
there are a lot of options like these, which are all: both cleaner and more user-friendly then making the data folder more visible by default.

in general:
if you want to hack around problems by making something else more ugly aswell, and/or by neglect standards, chances are, that you are doing it wrong.
lay back, and think about it again.
if you still see no other way, talk to someone else, and listen.
0 x

User avatar
Silentwings
Moderator
Posts: 3582
Joined: 25 Oct 2008, 00:23

Re: [IMPORTANT] 95.0 will got a new folder structure

Post by Silentwings » 01 Apr 2013, 02:09

the lobbies could auto-upload infolog, or make it easy for the user to upload it, or tell him where it is, or open the folder it is located in, or .... there are a lot of options like these,
Great. Please implement at least one of them before hiding the infolog away.
0 x

cleanrock
Former Engine Dev
Posts: 115
Joined: 21 Feb 2009, 07:42

Re: [IMPORTANT] 95.0 will got a new folder structure

Post by cleanrock » 01 Apr 2013, 10:13

Not sure what i was thinking, .spring is right.

A lobby command to open the current data dir is a good solution to help new players find infolog and map/games folders, unitsync should be able to help finding the dir.
0 x

User avatar
Jools
XTA Developer
Posts: 2804
Joined: 23 Feb 2009, 16:29

Re: [IMPORTANT] 95.0 will got a new folder structure

Post by Jools » 01 Apr 2013, 11:48

I think portable mode is the best invention since sliced bread.

Why would you want to [try to] write in %mygames%? That's an environmental variable that is different depending on the boot drive. You will cause splitting of those dirs for people with multiboot.
0 x

User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: [IMPORTANT] 95.0 will got a new folder structure

Post by jK » 01 Apr 2013, 18:02

If you didn't noticed it, all games install their user stuff into "My Games".
Keep up with the times.
0 x

User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6103
Joined: 29 Apr 2005, 01:14

Re: [IMPORTANT] 95.0 will got a new folder structure

Post by FLOZi » 01 Apr 2013, 18:09

Bf3, Wargame European Escalation
0 x

User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7015
Joined: 16 Nov 2004, 13:08

Re: [IMPORTANT] 95.0 will got a new folder structure

Post by zwzsg » 02 Apr 2013, 13:42

So, from what I understand, to trigger portable mode, I need to have a springsettings.cfg next to spring.exe & unitsync.dll. Is it correct?

And how do I trigger isolation mode?
0 x

klapmongool
Posts: 843
Joined: 13 Aug 2007, 13:19

Re: [IMPORTANT] 95.0 will got a new folder structure

Post by klapmongool » 02 Apr 2013, 14:01

jK wrote:If you didn't noticed it, all games install their user stuff into "My Games".
Keep up with the times.
If you didnt notice all* those games got retarded. No reason for Spring to also become retarded. Why is it retarded? Because for some reason games don't all install to the same user directory. Because for some reason there are all sorts of hidden dirs games dump their stuff in. Because if a deinstall fucks up you don't want to have to screen your entire pc for the remains of that one game.

I like my games to stay in their appointed directory... But I guess I'll switch to portable then.

*actually not all games. There are still games that keep it nice and tidy and stay in their dir. Usually these are the same games as those who like their users and avoid copy protections.
0 x

Post Reply

Return to “Engine”