-
-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Differentiate save files based on game type #2122
Differentiate save files based on game type #2122
Conversation
Things to keep track:
You don't have to add all of them right now, but make sure it will be easy to do in the future. |
Hi @eos428 , it's a very good but critical change which also breaks the backward compatibility. We will definitely come back to this pull request after 0.8.3 which is just in few days. |
No problem with that, take your time 👍 There's also campaign data which I do partially for this PR so I'd imagine there'll be a lot to review here haha |
Some update on the latest state of this PR:
Things left to do for this PR:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @eos428 , great stuff! We need to polish the code right now so move forward. Could you please take a look into given comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @eos428 I left few more comments. Please take a look.
Fixes done. A bit unsure if I misunderstood some of the reviews so let me know if I do! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @eos428 , I left multiple comments. Could you please take a look and see if they make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @eos428 , I left multiple comments. Could you please take a look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @eos428 I left few comments and also some of previous comments haven't been addresses.
On top of this we have to modify CURRENT_FORMAT_VERSION
and LAST_FORMAT_VERSION
values. Please check if ( binver > CURRENT_FORMAT_VERSION || binver < LAST_FORMAT_VERSION ) {
line in game_io.cpp file for more details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @eos428 I left multiple comments mostly regarding the architecture of your changes. Could you please take a look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @eos428 I left multiple comments. Could you please take a look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @eos428 I left multiple comments. Could you please take a look?
Hi @eos428 , In
where we load a header. The issue here that modified HeaderSAV will read extra information from save file which is not present in the old saves.
after this we have to rename |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @eos428 , I left just few comments. Could you please take a look into them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @eos428 , things we need to change:
- pass game type to
Game::LoadSAV2FileInfo
function and check it with read game type. If it's different then return false - revert changes in dialog_selectfile.cpp related to cursor. It breaks save file interaction
- fix loading hot head and multiplayer file types. I think we mixed them together
The rest of changes I corrected. Please take a look :)
{ | ||
fheroes2::Display & display = fheroes2::Display::instance(); | ||
Cursor & cursor = Cursor::Get(); | ||
LocalEvent & le = LocalEvent::Get(); | ||
|
||
cursor.Hide(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert back all changes related to cursor.Hide()
and cursor.Show()
as it breaks the behaviour of typing a name for new save.
Also @eos428 could you please squash all commits into one as GitHub behaves strangely with so many commits in a branch? |
82619a7
to
55aa57c
Compare
Hi @ihhub I have made the changes as you requested. However, in loading multiplayer saves separately (hotseat and network) I had to make more changes to the code. Mostly copy-pasted stuff though, but I hope you don't mind with that. Also, I have to revert cursor Show/Hide changes in |
@eos428 great thanks for your work! Well done! |
relates to #2122 and also some code cleanup
relates to #2122 and also some code cleanup
relates to ihhub#2122 and also some code cleanup
Solves #323
So far the actual saving and loading seems alright for standard and campaign maps. However, I haven't saved the extra things needed for campaign maps.
@ihhub @idshibanov Any pointers on what to save? I think it should the player's hero data so maybe one of the
heroes
stream operators?