Create History of Changes
There should be three main "commit types":
- RCP-Selection done. This way you can see what entries you had at which level at the very beginning, so you can also check what RCP select options you've chosen.
- Character creation done. This way, you can see what changed between RCP values and final values for playing.
- Getting new AP for an adventure (or just manually create a history save point). This way you can track changes between every adventure or other important events.
Each "commit" should contain the following information:
- Title
- Optional description
- Date
- Changes between the current hero and the hero at the last commit
I wouldn't create a detailed history of every single change, since you can go back and forth all the time, which would make it harder to read and also harder to maintain.
It would probably be better to create a "session protocol", combining all the changes made on save.
Just adding my two cents...
If the TypeScript does allow it, I would recommend to create a local git repository for the character file(s).
- Title = commit message
- Optional description = extended commit message
- Date = does git add automatically
- Changes between the current hero and the hero at the last commit = this can also be done by git
And for all other features like marking of RCP-Selection done and Character creation done, etc. we can use tags.
There is an npm package for that (since TypeScript is JavaScript), but how would you display the changes? I can't just display the diffs so I would need to get the file for each commit, read it and then diff them manually to create a diff representation I can use – which would need a bit of work together with the Git implementation itself. Also, what if I need to change internal representations? I mean, sure, I could just rewrite the Git history, but that's not what Git is meant to solve … 😅🙈🙈🙈
I'm also not quite sure how this could work together with cloud syncing. 🤔 'd need to think about that.
I love Git but I'm not yet sure if this would be a viable solution. 🤔
I would need to get the file for each commit, read it and then diff them manually to create a diff representation I can use
Correct, checkout the file from a specific commit, parse it and compare it with the existing one. You are right that this is a bit of work but I think it could be easier maintained in the future.
And cloud sync would be easy to, just add a remote repository and you don't have to worry about file versions conflicts like "Is the version in the cloud newer or older then the local file".
But maybe that's just me looking at Optolith through my rose-colored glasses. :wink: You have a much better project overview then any one else and I'm sure you'll find a solution that fits the project best. And I don't care how it will be implemented as long as it does work :smile:
Not sure if this belongs here, but I would also have my two cents ;-)
My problem: I have Optolith on several computers (PC and laptop) and move the characters back and forth with export and import. Of course, sometimes I forget to synchronize the character with the other Optolith right after a change. So I'm not sure anymore if I did the last adjustment now on the PC or on the laptop. Also, I had once imported a current character and the old version but not yet deleted. Since the characters have the same name, I could no longer distinguish them from each other. So I no longer knew which one I could delete. As a basis, even a simple "last modified" date and time stamp directly in the character overview would be helpful.
Thanks for your input!
If you do manual synchronization then yes, this will contribute. There are upcoming features, though, that will reduce the need to sync all of this manually.
Displaying a timestamp would be a useful enhancement nonetheless, I think. 🤔
Maybe, when at it, add the option to insert a comment when adding AP (or editing a character), so you can see for what the character got the AP (why the change was made) in the history. Would be useful to remember planned skills for the next time when the AP amount isn't sufficient at the time.