Skip to content
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

[Discussion] How do we approach the change of the scheme for the persistent data? #309

Open
shpaass opened this issue Oct 9, 2024 · 2 comments

Comments

@shpaass
Copy link
Owner

shpaass commented Oct 9, 2024

Let's suppose that we want to change the name of a persistent field. A persistent field is a class field that was written into a project file.

How would we approach that task? What are the C# conventions regarding the scheme change for the persistent data?

The purpose of this issue is to be a place of discussion for that topic, where we can post relevant data and experiences.

@shpaass
Copy link
Owner Author

shpaass commented Oct 9, 2024

From @SWeini on Discord:

It's one of the recurring topics in my job, there are no solutions without compromise

It's important to know the requirements first. what scenarios do you want to support, e.g. saving in YAFC 1.0, loading in 0.9 - is it supported or not?

Also with 2.0/space age just around the corner we might be just before larger changes in the data format that force us to make incompatible changes

@DaleStan
Copy link
Collaborator

Since we're serializing as text, not binary, the only issue I see is if someone manages to serialize a double larger than ~±3.4E+38 or smaller than ~±1.4e-45 and then load that in a float version of Yafc. float.Parse (and Convert.ToSingle, which just calls float.Parse) happily truncates in-range values with too many decimal places, but out of range values will be converted to -∞, 0, or ∞.

Converting 1/3f to double gives an error of almost exactly 1e-8, which I suspect is less than permissible error in the solver.

Checking my yafc files, the only lines that match /[0-9]E[+-]?[0-9]/ are the ones for autoFillPayback. That will probably need some special handling, or just leaving it as a float.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants