Open SadPencil opened 7 months ago
@Belonit
In https://github.com/CnCNet/cncnet-yr-client-package/pull/288 you said "At the moment, the client does not have a mechanism for processing saves from different game modes."
.sav
file is an OLE document, which means the spawner is able to deliver arbitrary information from the client to save files (e.g., PR #19), for example, the game mode number. The client is then able to read these additional information (it does not require much time to implement) from the save files, and does whatever needs to be done based on these information.
This design should be better than the current workaround.
@Belonit
In CnCNet/cncnet-yr-client-package#288 you said "At the moment, the client does not have a mechanism for processing saves from different game modes."
.sav
file is an OLE document, which means the spawner is able to deliver arbitrary information from the client to save files (e.g., PR #19), for example, the game mode number. The client is then able to read these additional information (it does not require much time to implement) from the save files, and does whatever needs to be done based on these information.This design should be better than the current workaround.
This is already contained in the .sav
file.
To let identify which mission corresponds to a saved game file, I request an addtional data field, described as below.
xna-cncnet-client
@SadPencil Maybe it's worth using the meta information that already exists? It seems to me that it is quite enough:
Campaign
- indicates the campaign index
Scenario number
- indicates the scenario index
Version
- indicates the unique identifier of the mod
Internal Version
- indicates the unique identifier of the engine (including Ares and Phobos)
What really needs to be done is to force the spawner to correctly write the Campaign
and Scenario number
fields.
To let identify which mission corresponds to a saved game file, I request an addtional data field, described as below.
xna-cncnet-client
@SadPencil Maybe it's worth using the meta information that already exists? It seems to me that it is quite enough:
Campaign
- indicates the campaign indexScenario number
- indicates the scenario indexVersion
- indicates the unique identifier of the modInternal Version
- indicates the unique identifier of the engine (including Ares and Phobos)What really needs to be done is to force the spawner to correctly write the
Campaign
andScenario number
fields.
According to @chaserli 's investigation, Scenario number
seems to be used in game, and I don't know if it is safe to use this field.
Besides, now I start questioning what should happen if a player wins a campaign and then the next campaign starts. Should the Scenario number
increase itself by 1? In original RA2/YR, Scenario number
will be increased by 1 on next mission, and correctly loaded when user loads a saved game from in-game menu.
A
.sav
file is an OLE document that can be considered as a "dictionary". For example, the OLE keyScenario Description
refers to a UTF-16 LE string corresponds to the title of a saved game file.I am currently working on a feature to let
xna-cncnet-client
support loading custom missions. In order to support this feature,xna-cncnet-client
must have a way to identify which mission corresponds to a saved game file, along with other restrictions to prevent user loads a different mission (to prevent potential conflicts; as supplemental files are copied by the client)Thus, I request an addtional data field, described as below.
CustomMissionID
This value will be specified via the
spawn.ini
file, given when the spawner is launchered.CustomMissionID
is anint32
integer. If this value is omitted, consider it 0.In a
.sav
file, the OLE keyCustomMissionID
should corresponds with 4 byte-values that contains such anint32
integer in little-endian order. The number is untouched, saved as-is.Rename of missionmd.ini file
When
CustomMissionID
is specified and not 0, the access ofmissionmd.ini
shall be redirct tospawn.ini
file. This enables the client automatically generates the corresponding mission info without interrupting the game.Full example of a
spawn.ini
file:Saved games list filter
When
CustomMissionID
is specified and it is not 0, only saved game files with the sameCustomMissionID
shall be displayed.Otherwise, when
CustomMissionID
is not specified or is 0, only saved game files withoutCustomMissionID
or with a zero-valuedCustomMissionID
shall be displayed.Reading CustomMissionID from saved game file
When loading a saved game, the spawner loads
CustomMissionID
based on the OLE keyCustomMissionID
in a .sav file.CustomMissionID
will not be specified inspawn.ini
in this case.