The game IDs for Net (and Netslide) have always been random seeds

rather than literal grid descriptions, which has always faintly
annoyed me because it makes it impossible to type in a grid from
another source. However, Gareth pointed out that short random-seed
game descriptions are useful, because you can read one out to
someone else without having to master the technology of cross-
machine cut and paste, or you can have two people enter the same
random seed simultaneously in order to race against each other to
complete the same puzzle. So both types of game ID seem to have
their uses.

Therefore, here's a reorganisation of the whole game ID concept.
There are now two types of game ID: one has a parameter string then
a hash then a piece of arbitrary random seed text, and the other has
a parameter string then a colon then a literal game description. For
most games, the latter is identical to the game IDs that were
previously valid; for Net and Netslide, old game IDs must be
translated into new ones by turning the colon into a hash, and
there's a new descriptive game ID format.

Random seed IDs are not guaranteed to be portable between software
versions (this is a major reason why I added version reporting
yesterday). Descriptive game IDs have a longer lifespan.

As an added bonus, I've removed the sections of documentation
dealing with game parameter encodings not shown in the game ID
(Rectangles expansion factor, Solo symmetry and difficulty settings
etc), because _all_ parameters must be specified in a random seed ID
and therefore users can easily find out the appropriate parameter
string for any settings they have configured.

[originally from svn r5788]
This commit is contained in:
Simon Tatham
2005-05-16 18:57:09 +00:00
parent aa1185f3f5
commit 2534ec5d69
16 changed files with 976 additions and 800 deletions

View File

@ -31,9 +31,10 @@
#define IDM_SOLVE 0x0060
#define IDM_QUIT 0x0070
#define IDM_CONFIG 0x0080
#define IDM_SEED 0x0090
#define IDM_HELPC 0x00A0
#define IDM_GAMEHELP 0x00B0
#define IDM_DESC 0x0090
#define IDM_SEED 0x00A0
#define IDM_HELPC 0x00B0
#define IDM_GAMEHELP 0x00C0
#define IDM_PRESETS 0x0100
#define IDM_ABOUT 0x0110
@ -416,7 +417,7 @@ static frontend *new_window(HINSTANCE inst, char *game_id, char **error)
fe->me = midend_new(fe, &thegame);
if (game_id) {
*error = midend_game_id(fe->me, game_id, FALSE);
*error = midend_game_id(fe->me, game_id);
if (*error) {
midend_free(fe->me);
sfree(fe);
@ -476,7 +477,8 @@ static frontend *new_window(HINSTANCE inst, char *game_id, char **error)
AppendMenu(bar, MF_ENABLED|MF_POPUP, (UINT)menu, "Game");
AppendMenu(menu, MF_ENABLED, IDM_NEW, "New");
AppendMenu(menu, MF_ENABLED, IDM_RESTART, "Restart");
AppendMenu(menu, MF_ENABLED, IDM_SEED, "Specific...");
AppendMenu(menu, MF_ENABLED, IDM_DESC, "Specific...");
AppendMenu(menu, MF_ENABLED, IDM_SEED, "Random Seed...");
if ((fe->npresets = midend_num_presets(fe->me)) > 0 ||
thegame.can_configure) {
@ -1159,6 +1161,10 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
if (get_config(fe, CFG_SEED))
new_game_type(fe);
break;
case IDM_DESC:
if (get_config(fe, CFG_DESC))
new_game_type(fe);
break;
case IDM_ABOUT:
about(fe);
break;