~ Forums of Enroth ~
Would you like to react to this message? Create an account in a few clicks or log in to continue.

~ Forums of Enroth ~

The Enroth diehard fan community
 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  
Latest topics
» fheroes2 General Announcements
[Ironfist ver 1.3.0] Weight of save files and loading/saving time Icon_minitimeby sirDranik 2024-03-17, 23:35

» Photo Gallery
[Ironfist ver 1.3.0] Weight of save files and loading/saving time Icon_minitimeby Sir Albe 2024-03-07, 06:57

» Heroes Orchestra's 5th Birthday concerts with Paul Romero
[Ironfist ver 1.3.0] Weight of save files and loading/saving time Icon_minitimeby Sir Albe 2024-03-07, 06:55

» Polskie powitanie
[Ironfist ver 1.3.0] Weight of save files and loading/saving time Icon_minitimeby rrravyn 2024-03-05, 04:02

» Heroes II localisation: how to make no-CD patch.
[Ironfist ver 1.3.0] Weight of save files and loading/saving time Icon_minitimeby kiku 2024-02-19, 02:43

» WARNING - The dreaded moment is here: Heroes 6 servers shutting down
[Ironfist ver 1.3.0] Weight of save files and loading/saving time Icon_minitimeby Blake01 2024-02-17, 15:25

» Forum Admins Feed
[Ironfist ver 1.3.0] Weight of save files and loading/saving time Icon_minitimeby GodRage 2024-02-15, 22:10

Poll
Global announcements should be:
Everlasting, 1 for each project.
[Ironfist ver 1.3.0] Weight of save files and loading/saving time Redbar110%[Ironfist ver 1.3.0] Weight of save files and loading/saving time Redbar12
 0% [ 0 ]
Temporary, when there is something new to announce.
[Ironfist ver 1.3.0] Weight of save files and loading/saving time Redbar11100%[Ironfist ver 1.3.0] Weight of save files and loading/saving time Redbar12
 100% [ 6 ]
Holalala... No idea where the Ultimate artifact is.
[Ironfist ver 1.3.0] Weight of save files and loading/saving time Redbar110%[Ironfist ver 1.3.0] Weight of save files and loading/saving time Redbar12
 0% [ 0 ]
Total Votes : 6
Most Viewed Topics
H3SW: General Graphics discussion
Ragoon's Graphics For HoMM3SW
Introduce yourself
H3SW General Discussion
H3SW Map List: Work in progress
H3SW: Dwelling Development
Forum Admins Feed
The Floody Land
Enrothian Fan Art
Heroes III: The Succession Wars v0.8.1 Beta

 

 [Ironfist ver 1.3.0] Weight of save files and loading/saving time

Go down 
3 posters
AuthorMessage
Unknown_Hero
Mage
Mage
Unknown_Hero


Messages : 778
Quality Points : 78
Registration Date : 2015-09-06

[Ironfist ver 1.3.0] Weight of save files and loading/saving time Empty
PostSubject: [Ironfist ver 1.3.0] Weight of save files and loading/saving time   [Ironfist ver 1.3.0] Weight of save files and loading/saving time Icon_minitime2017-07-17, 04:21

Have you changed what is saved in the save files?
Before the last release, a save file was much less than 500 ko (typically around 300-400 ko for a huge map), now it's more than 1 Mo (1200 ko) for a small map.
Almost 10 Mo for a huge map (9860 ko)!!!

The loading and saving times are very long, several seconds to load or save a file and the game hangs during this time.
Outch... [Ironfist ver 1.3.0] Weight of save files and loading/saving time 1872340274

It was so quick before, almost instant.
Back to top Go down
Darmani
Master Modder
Master Modder
Darmani


Messages : 288
Quality Points : 47
Registration Date : 2014-12-27

[Ironfist ver 1.3.0] Weight of save files and loading/saving time Empty
PostSubject: Re: [Ironfist ver 1.3.0] Weight of save files and loading/saving time   [Ironfist ver 1.3.0] Weight of save files and loading/saving time Icon_minitime2017-07-17, 08:05

Yes we have. We've moved more data from the original HoMM II binary format into XML. This gives us much more ability to change the savegame format in the future without breaking old saves.

The new format is a bit verbose, and this is causing problems, as you've noticed.
Back to top Go down
Unknown_Hero
Mage
Mage
Unknown_Hero


Messages : 778
Quality Points : 78
Registration Date : 2015-09-06

[Ironfist ver 1.3.0] Weight of save files and loading/saving time Empty
PostSubject: Re: [Ironfist ver 1.3.0] Weight of save files and loading/saving time   [Ironfist ver 1.3.0] Weight of save files and loading/saving time Icon_minitime2017-07-17, 22:59

Okay I see.

Just a quick idea:

Use a template and save only the values.

Currently:

Save01.sav
***** File Start *****
version="1.0"
blabla01="0" blabla02="0" blabla03="0"
blabla01="0" blabla02="0" blabla03="0"
blabla01="0" blabla02="0" blabla03="0"
blabla01="0" blabla02="1" blabla03="19"
blabla01="0" blabla02="0" blabla03="0"
***** File End *****

Save only the values:

Save01.sav
***** File Start *****
template version="1.0"
0 0 0
0 0 0
0 0 0
0 1 19
0 0 0
***** File End *****

Adding new values to the save file.

Currently:

Save01.sav
***** File Start *****
version="1.1"
blabla01="0" blabla02="0" blabla03="0"
blabla01="0" blabla02="0" blabla03="0"
blabla01="0" blabla02="0" blabla03="0"
blabla01="0" blabla02="1" blabla03="19"
blabla01="0" blabla02="0" blabla03="0"
addedblabla01="0" addedblabla02="0" addedblabla03="0"
addedblabla01="0" addedblabla02="0" addedblabla03="0"
addedblabla01="0" addedblabla02="5" addedblabla03="8"
***** File End *****

Save only the values with added values:

Save01.sav
***** File Start *****
template version="1.1"
0 0 0
0 0 0
0 0 0
0 1 19
0 0 0
0 0 0
0 0 0
0 5 8
***** File End *****

You can even go further and compress the save file, a kind of "zip" save file. Very Happy

If it is necessary to consult and change the values in a save file, this can be done by a small external tool that generates an xml file using the template and the save file and can save the changes to a file in the format of the save file.
If it is necessary to change the save file format to add new values, simply create and add a new template and it is thus possible to keep compatibility with save files of different versions of the program.
This tool can also allow you to update an old version of a save file to the latest version.

Currently, it takes between 12 seconds and 20 seconds of waiting each time the player presses the end of turn button, or when the player loads or saves a save file, this is insane. Twisted Evil
This really makes the game unpleasant to play. Razz

Original Heroes 2 launches and load/saves a save file in a fraction of a second, this makes the game transparent in its use and contributes to the pleasure of playing. <3  ... &lt;3 Smile
Back to top Go down
ComputerPhreak
Pikeman
Pikeman
ComputerPhreak


Messages : 30
Quality Points : 23
Registration Date : 2016-03-02

[Ironfist ver 1.3.0] Weight of save files and loading/saving time Empty
PostSubject: Re: [Ironfist ver 1.3.0] Weight of save files and loading/saving time   [Ironfist ver 1.3.0] Weight of save files and loading/saving time Icon_minitime2017-08-24, 21:05

I see some quick changes that can be made which could potentially speed up the save function.  In game/save.cpp, there are a ton of places that can benefit by using reserve():

Code:
for (int i = 0; i < MAP_WIDTH * MAP_HEIGHT; i++) {
    int x = i % MAP_HEIGHT;
    int y = i / MAP_HEIGHT;
    gs.mapRevealed().push_back(ironfist_save::gamestate_t::mapRevealed_type(x, y));
    gs.mapRevealed().back().revealed(mapRevealed[i]);
  }

In the above, this may cause dozens of memory allocations to the tree::sequence container.  Use its reserve() function at the start to allocate all the memory it will need, since you know the total size needed at the start (in this case, MAP_WIDTH * MAP_HEIGHT).
Back to top Go down
Darmani
Master Modder
Master Modder
Darmani


Messages : 288
Quality Points : 47
Registration Date : 2014-12-27

[Ironfist ver 1.3.0] Weight of save files and loading/saving time Empty
PostSubject: Re: [Ironfist ver 1.3.0] Weight of save files and loading/saving time   [Ironfist ver 1.3.0] Weight of save files and loading/saving time Icon_minitime2017-08-30, 04:51

Thanks. Good idea!
Back to top Go down
Unknown_Hero
Mage
Mage
Unknown_Hero


Messages : 778
Quality Points : 78
Registration Date : 2015-09-06

[Ironfist ver 1.3.0] Weight of save files and loading/saving time Empty
PostSubject: Re: [Ironfist ver 1.3.0] Weight of save files and loading/saving time   [Ironfist ver 1.3.0] Weight of save files and loading/saving time Icon_minitime2018-09-05, 04:53

Has there been progress for loading and saving time? Currently, the game is impractical because of this, it's really too long.
Every turn is a real martyr. [Ironfist ver 1.3.0] Weight of save files and loading/saving time 4033187047
Back to top Go down
Sponsored content





[Ironfist ver 1.3.0] Weight of save files and loading/saving time Empty
PostSubject: Re: [Ironfist ver 1.3.0] Weight of save files and loading/saving time   [Ironfist ver 1.3.0] Weight of save files and loading/saving time Icon_minitime

Back to top Go down
 
[Ironfist ver 1.3.0] Weight of save files and loading/saving time
Back to top 
Page 1 of 1
 Similar topics
-
» [Ironfist ver 1.3.0+] Fatal error when loading an old save file
» [Ironfist ver 1.3.0] Bug with tables in lua script when loading a save file
» [Ironfist ver 1.2] scrXXXX.tmp files
» Ironfist installer ver 0.8.2 dll missing files
» [Ironfist ver 1.3.0] Missing files after installation

Permissions in this forum:You cannot reply to topics in this forum
~ Forums of Enroth ~ :: Modding Guild :: Heroes of Might and Magic II: Project Ironfist-
Jump to: