Closed christopho closed 6 years ago
More reasons to remove project_db.dat are the use cases of #630 and https://github.com/christopho/solarus-quest-editor/issues/4.
Cons:
Closing this issue, we won't remove project_db.dat after all, it now contains useful metadata.
The project resource list file project_db.dat adds useless work to quest makers to keep consistency between physical files are files recognized by the quest. It is also a source of conflicts when working on a project with several people. This discussion proposed to remove project_db.dat: http://forum.solarus-games.org/index.php/topic,291.msg1045.html#msg1045
Resources could be auto-detected. This project_db.dat file had 2 purposes, but both of them are now probably obsolete:
1 Provide the list of files very quickly for performance
Now that the quest editor is able to detect very efficiently files that are created or destroyed (thanks Qt!), another reason to maintain this database disappears. We need to investigate whether the engine really needs the resource list too (in early versions, this file was completely ignored), and if yes, whether performance would still be okay with auto-detection.
2 Associate a friendly name to obscure integer ids
In early versions, it was really important to associate friendly names with resources like maps and tilesets, because maps file names and tileset file names were only integer numbers (1.dat, 2.dat, etc.). So we really needed a database file to associate file names with their friendly names. Now that any file name is allowed and that files can be organized in a hierarchy, friendly names is much less necessary.
If we decide to remove project_db.dat, we have to give users some time to refactor their quest files, because some people working with Solarus for a very long time may have old maps and tileset file names (1.dat, 2.dat, etc.). The quest editor must provide refactoring tools to make this possible without risk. These refactoring features are planned for the quest editor 1.5: https://github.com/christopho/solarus-quest-editor/issues/56 and https://github.com/christopho/solarus-quest-editor/issues/57
Therefore, project_db.dat will not be removed before Solarus 1.6, in order to give time to quest makers to refactor their quest with the 1.5 editor.