Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Feature] Button to clear [Log] #1583

Closed
xehnlp opened this issue Sep 26, 2022 · 4 comments
Closed

[Feature] Button to clear [Log] #1583

xehnlp opened this issue Sep 26, 2022 · 4 comments
Assignees
Labels
bug To be tested Dev is done, it should now be tested

Comments

@xehnlp
Copy link

xehnlp commented Sep 26, 2022

When playing long games or campaign games the huge amount of text lines in the save.ini file will start to lag out the whole application, this is more noticable when playing on an android device. Manually clearing the [Log] section of the save.ini file fixes the lag. Having a way to clear the log inside the application would be a huge improvement to avoid this problem.

@xehnlp
Copy link
Author

xehnlp commented Sep 26, 2022

Attaching example file of a save.ini containing over 5k lines of log entries.

save2.zip

@Quantumrunner
Copy link
Collaborator

Quantumrunner commented Sep 26, 2022

Very good finding! This seems also to be the root cause of this issue I had created some time ago: #1484

Manual log clearance would be ok but I would prefer if the app could do this itself automatically. E.g. it is not necessary to have logs available for a complete campaign. Therefore it would maybe make sense to clear logs after a fixed amount of messages (e.g. 100, 500...).

@mayjak mayjak self-assigned this Sep 27, 2022
@mayjak
Copy link
Collaborator

mayjak commented Oct 26, 2022

Ok, after a brief investigation it seems that the slowness comes from the Undo feature. Essentially the whole log is tuned to a string on pretty much every button press. I have a few ideas on improvements.

@mayjak
Copy link
Collaborator

mayjak commented Oct 26, 2022

I added a solution that doesn't involve clearing the log (for debugging purposes if something goes wrong at a later point in the campaign) or manual actions.
I also added an additional "Undo" notice to the logs.

Technically:

  1. ArrayList replaced with LinkedList (we never access the log randomly anyway) - this should help with "random" slowdowns when Valkyrie had to copy the whole log to a larger array when full.
  2. The logs are ignored while serializing the undo state and the current's Quest log is used instead. This gives us an additional benefit of having an "Undo" notice in the logs.

To be released in 2.5.8 this week.

@mayjak mayjak added the To be tested Dev is done, it should now be tested label Oct 26, 2022
@mayjak mayjak closed this as completed in 477aa2e Jan 2, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug To be tested Dev is done, it should now be tested
Projects
None yet
Development

No branches or pull requests

3 participants