Here's an analysis of the /lib directory structure with proposed changes.
I'm posting this for suggestions, comments and corrections.
I will later post a ticket for Vanilla and make changes for Sangband.
First we take a look at the directory structure:
/lib/apex:
Contains the high-score list.
Needs to be game-writeable, and should preferably be global.
/lib/bone:
Contains player ghost information on variants with them.
Needs to be game-writeable, and should preferably be global.
/lib/data:
Contains the 'compiled' versions of the files in /lib/edit.
Should preferably be game-writeable and global.
/lib/edit:
Contains the text-version of the files in /lib/data.
Should be global.
/lib/file:
Contains text files used by the game that neither fits in to
/lib/edit or /lib/help category.
Should be global.
/lib/help:
Contains text files used by the in-game help.
Should be global.
/lib/info:
Serves no useful in-game purpose. Used in some variants to
store text-files that aren't used in-game.
Should be removed. Eventual content should be moved to /doc.
/lib/pref:
Contains global preset preference files. Overrided by files in
/lib/user.
Should be global.
/lib/save:
Contains savegames.
Needs to be game-writable. Should preferably be user-specific.
/lib/user:
Contains user editable preference files.
Should preferably be game-writable and user-specific.
/lib/xtra:
Contains multimedia files.
Should be global.
Then we take a look at what certain defines do.
PRIVATE_USER_PATH:
This replaces /lib/user with the path specified in the define.
USE_PRIVATE_PATHS:
This replaces apex, bone, save and data with subdirs of PRIVATE_USER_PATH.
This makes all game-writable dirs user-specific.
So far, so good, but what about save? I listed it above as preferably
user-specific. IMO, it should be user-specific always, if PRIVATE_USER_PATH
is defined. This would also allows us to remove the SAVEFILE_USE_UID code.
So to summarize my suggestions:
- Remove /lib/info, move eventual content to /doc.
- Use PRIVATE_USER_PATH/save for savefiles always if PRIVATE_USER_PATH is
defined.
- Remove the SAVEFILE_USE_UID code.
I'm posting this for suggestions, comments and corrections.
I will later post a ticket for Vanilla and make changes for Sangband.
First we take a look at the directory structure:
/lib/apex:
Contains the high-score list.
Needs to be game-writeable, and should preferably be global.
/lib/bone:
Contains player ghost information on variants with them.
Needs to be game-writeable, and should preferably be global.
/lib/data:
Contains the 'compiled' versions of the files in /lib/edit.
Should preferably be game-writeable and global.
/lib/edit:
Contains the text-version of the files in /lib/data.
Should be global.
/lib/file:
Contains text files used by the game that neither fits in to
/lib/edit or /lib/help category.
Should be global.
/lib/help:
Contains text files used by the in-game help.
Should be global.
/lib/info:
Serves no useful in-game purpose. Used in some variants to
store text-files that aren't used in-game.
Should be removed. Eventual content should be moved to /doc.
/lib/pref:
Contains global preset preference files. Overrided by files in
/lib/user.
Should be global.
/lib/save:
Contains savegames.
Needs to be game-writable. Should preferably be user-specific.
/lib/user:
Contains user editable preference files.
Should preferably be game-writable and user-specific.
/lib/xtra:
Contains multimedia files.
Should be global.
Then we take a look at what certain defines do.
PRIVATE_USER_PATH:
This replaces /lib/user with the path specified in the define.
USE_PRIVATE_PATHS:
This replaces apex, bone, save and data with subdirs of PRIVATE_USER_PATH.
This makes all game-writable dirs user-specific.
So far, so good, but what about save? I listed it above as preferably
user-specific. IMO, it should be user-specific always, if PRIVATE_USER_PATH
is defined. This would also allows us to remove the SAVEFILE_USE_UID code.
So to summarize my suggestions:
- Remove /lib/info, move eventual content to /doc.
- Use PRIVATE_USER_PATH/save for savefiles always if PRIVATE_USER_PATH is
defined.
- Remove the SAVEFILE_USE_UID code.
Comment