-
Notifications
You must be signed in to change notification settings - Fork 58
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
RFC: Getter/Setter Design for liblcf vNext #203
Comments
@fmatthew5876 This get/set API would also allow e.g. to abstract away "lazy loading" of very memory heavy chunks like the battle system chunks (load on first get-call) and the parsing style could be configured via a "LoadOpt (ParseFull/ParseLazy)" The JSON-idea was already evaluated and the result was not worth it. I already got this fully working, but it was really inefficient and memory wasting :). Rewriting whole Player & Editor code is no huge problem, I have a tool which does this automatically by parsing clang compiler error messages (dirty but works for 99% of the code) xD |
Getters and setters are fine. For some of the optimization ideas like #256 , the data would litterally be a huge binary blob and we would use getters to return references for single members and
Stay away from
Lazy loading battles is a great idea and would be enabled by getters. I'd like to see if we can solve this 8-10x memory overhead issue first. If we got the memory usage way down would we still need to worry about introducing the complexity of lazy load?
Not sure what you mean here. If you want to use json instead of xml for on-disk format thats just as well as anything. If you're talking about some kind of dynamic in memory structure using JSON at runtime, performance would be awful and I don't see much benefit.
I'd want to finish correctness (saving lsd with cleared map defaults) and then also performance optimizations before thinking about stabilization. Once stabilized big refactors will be harder to do and need careful planning and delays. For a stable API we also need to consider:
|
I agree, when you can get the footprint down far enough we won't need this.
This is really a good point! Obviously our editor shall have more functionality added when 2k/2k3 stuff works. Maybe you saw this "Custom data" (can't remember the name) button in the EasyRPG Editor Actor Tab. Guess the intention for this was that you can fill a table with custom values which are stored ... somewhere (in xml or json?). Together with new event commands this would be really flexible.
Our current policy is: We support everything that can't have incompatible side-effects in unpatched games. For conflicting patches you will need a huge database that lists all games with patches that must be dynamically applied... |
Thats already 6 years old. Won't happen anymore ^^' |
Because lcf vNext will replace the fields with Getters/Setters to gain more flexibility (this allows changing the data structure in the back, I plan JSON).
I will do an in-between step to make transition easier: The fields will stay and I emit the planned Getters/Setters. This allows an easier migration from old API to new API and better regression testing.
My ideas, lets use parts of Actor as an example:
The text was updated successfully, but these errors were encountered: