Currently Online

Latest Posts

Topic: Replay savegame not loadable: Clarification

Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 899
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2020-06-20, 22:03

WorldSavior wrote:

From my point of view, it is a workaround though. There should never be a file in "saves" with gametype=kReplay (gametype=4). So when loading a replay via "Watch replay" and then saving it, gametype should be correctly set to the correct value. Don't know how much work this is...

Currently "4" is the correct value ; )

Perhaps you could deign to explain to us mere coders what the intended use and semantics of the kReplay constant is and how you come to the conclusion that it should not be either kNetHost or perhaps kSingleplayer (which I believe is more appropriate, without digging into the code too deeply) instead? face-wink.png

When a replay is successfully loaded via single/multiplayer load menu (possible on the new branch

Why would one load a replay in single/multiplayer?

"Replay" = short for "savegame created from a replay"
It is not possible to load replays from the SP/MP load screens.

) and then once again saved, its gametype is changed... After all, it looks a bit messy to me face-wink.png

Those problems could (and should ? ) be fixed by "there aren't 4 different types of saves, but just one"

Again, which lines of code lead you to the conclusion that there are no differences between the various savegame loading codepaths that require the existence of four distinct savegame file specifications?


Edit:
In my opinion, the cleanest way to solve the issue is to have the in-replay Save menu figure out whether the running replay was created from a singleplayer or multiplayer savegame, and set the new savegame's type accordingly. Probably not trivial. I'm not familiar with the details of how the InteractivePlayer data is saved and what the differences between SP and MP games there are though.

Edited: 2020-06-20, 22:09

Top Quote
jmoerschbach
Avatar
Joined: 2019-09-26, 21:40
Posts: 17
Ranking
Pry about Widelands
Posted at: 2020-06-21, 10:11

Nordfriese wrote:


Edit:
In my opinion, the cleanest way to solve the issue is to have the in-replay Save menu figure out whether the running replay was created from a singleplayer or multiplayer savegame, and set the new savegame's type accordingly. Probably not trivial. I'm not familiar with the details of how the InteractivePlayer data is saved and what the differences between SP and MP games there are though.

very strong +1 from me face-smile.png


Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 1870
Ranking
One Elder of Players
Location: Germany
Posted at: 2020-06-21, 10:32

Nordfriese wrote:

In my opinion, the cleanest way to solve the issue is to have the in-replay Save menu figure out whether the running replay was created from a singleplayer or multiplayer savegame, and set the new savegame's type accordingly. Probably not trivial. I'm not familiar with the details of how the InteractivePlayer data is saved and what the differences between SP and MP games there are though.

Yes face-smile.png


Top Quote
WorldSavior
Avatar
Joined: 2016-10-15, 04:10
Posts: 1683
Ranking
One Elder of Players
Location: North of Germany
Posted at: 2020-06-22, 22:41

Nordfriese wrote:

WorldSavior wrote:

From my point of view, it is a workaround though. There should never be a file in "saves" with gametype=kReplay (gametype=4). So when loading a replay via "Watch replay" and then saving it, gametype should be correctly set to the correct value. Don't know how much work this is...

Currently "4" is the correct value ; )

Perhaps you could deign to explain to us mere coders what the intended use and semantics of the kReplay constant is and how you come to the conclusion that it should not be either kNetHost or perhaps kSingleplayer (which I believe is more appropriate, without digging into the code too deeply) instead? face-wink.png

It doesn't matter. All savegames should be of one type.

) and then once again saved, its gametype is changed... After all, it looks a bit messy to me face-wink.png

Those problems could (and should ? ) be fixed by "there aren't 4 different types of saves, but just one"

Again, which lines of code lead you to the conclusion that there are no differences between the various savegame loading codepaths that require the existence of four distinct savegame file specifications?

The line of the code with the number. If just one number has to be changed in order to convert fully, it could be theoretically done.


Edit:
In my opinion, the cleanest way to solve the issue is to have the in-replay Save menu figure out whether the running replay was created from a singleplayer or multiplayer savegame, and set the new savegame's type accordingly. Probably not trivial. I'm not familiar with the details of how the InteractivePlayer data is saved and what the differences between SP and MP games there are though.

That sounds complicated and doesn't solve the problem that not any savegame can be loaded with any gametype


Top Quote