Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
ENGINES: Add an engine id #1210
Currently games are uniquely identified by their gameId. This is good because a single value can be used to identify a game across all the engines. The gameId is stored in the configuration file under the game target section.
However, as more game engines have been added to ScummVM, the concern of gameId clashes across engines became apparent. A feature was added to the Advanced Detector to work around this issue: singleId. For engines that enable the singleId feature, the gameId is always the same for all the games supported by the engine, allowing to avoid collisions.
In this PR, I propose to use a different approach. Engines have a new engineId property that can be used to uniquely identify them. That way, the gameIds for an engine are namespaced by the engineId. This removes the need for the singleId feature which I propose to remove. The engineIds are stored in the configuration file under the game targets sections along with the gameIds.
This pull request contains code allowing to automatically upgrade the game targets to add an engineId and set the appropriate gameId when trying to launch a game (and other operations that require an active game target context such as editing the game options or loading a saved game).
On the command line, I have added the ability to use qualified game names where gameIds were previously used. Qualified game names have the following form:
On the command line, I have also added a new
sev- left a comment
The idea is great.
However, it is not quite clear why you're also changing the single game engine names into names of those games (besides Cryo and Xeen, where there are the inconsistencies). Also, I am worried a bit about the obsolete target upgrading. I am not sure it still works.
In general, the code looks clean, but I would like to test it before releasing, especially for it working well with non-upgraded config files.
This is to make the output of the
With the game engines renaming:
Without the game engine renaming:
I don't care too much about that change and would not mind reverting it.
If I do the same thing with the current master It finds 55 games (It reported some duplicates also for Zork CD, and Labyrinth of Time). It may have missed a game as there are lots of different languages added as different games so maybe I miss counted.
#0 0x0000555557a24a2c in Common::SharedPtr::operator_bool() const (this=0x8) at ./common/ptr.h:166
I feel like this is a bit outside of the scope of this PR. Especially since BASS was not using the singleId system. It can be changed later using the obsoleteId mechanism.
I'm not sure what you mean. sword25 appears after the other two sword games in the example output I posted above.
I've pushed a fix for this to master. It was introduced in one of my previous pull requests.
For 2. I get a different ordering for --list-games vs. --list-engines
When I run ./scummvm --list-games I get the following for the sword games:
so I am seeing sword25 before sword2
If however I run mass add again on the same directory I get another crash.
#0 0x00007ffff40c8e97 in __GI_raise (sig=sig@entry=6)
I still have the crash if I use this branch. If I merge this branch into master I hit issues with pink when compiling.
Okay, I've updated this branch with master so you don't have to.
I don't care too much about the order in those lists, so I have removed the custom sort. The games now appear in the same order as everywhere else.
The engine ID identifies which engine should be used to launch the target. Also remove the 'single ID' system. Different games from engines that used that system now have different game IDs. Also-By: Matthew Hoops <email@example.com>