Open Ghabry opened 8 years ago
Hi Ghabry ! Very glad to see that the team is moving to the Editor :).
Imho I'm not a big big fan of spliting LDB in a lot of files, it will multiply the number of syscalls at Player startup and will be a bit messy (there are already a lot of file in an RPG Maker project). But you make some good points and I'm not a core engine developper so my opinion doesn't really count.
More important, your suggestion to move to JSON format is really interesting for two reasons :
Anyway, I wish you Bon Courage over my Java OCA/OCP preparations books !
Forgot to make this clear: This doesn't need a directory indexing on startup because the filename is case friendly: number.xml.
Oh please forget my sentenses about multiply files. Your idea bring a lot of good point for the editor : the possibility to have lighter save/load (just save what have been modify, asynchronious save/load etc.). This would permit to have a really fast Editor.
RPG Maker 2000/2003 become really slow in big project. MV is just a shame : one or two second of loaging to display the database editor with a new created project. . . With a SSD in 2016, and using .JSON format my god.
I like the spare files approach, I defend this way since the first day. It should be a must to make the project collaboration easier by sharing small snippets or keep the project under some version control system. To prevent local conflicts when not using SCM, some revision number could be added (like the "number of times saved 0x5B" in lcf) or just rely on timestamp checks then checksum to, if any, show comprehensive differences compared with the local cache (git-like integration for dummies somehow? :D).
About the performance slowdown, create a large cache file (just a physfs-like dump?) and check the timestamp of spare files to keep them on sync (also useful for crash backup). When exporting a game (production status) it could be again a large package similar to the mentioned cache. To prevent too much file I/O, just use some simple archiving method, physfs-like as commented by Ghabry, keeping an abstraction should make it cheaper to maintain while keeping faster file reading.
JSON looks clearer and a bit smaller indeed, no significant performance differences but maybe a bit more human readable, yet widely supported. Cons: As BlisterBoy commented, no schema, but do we really need this? probably we don't need to do formal public specifications ;).
About naming: maybe is safer to add some semantic prefix despite the subfolder for simple spare file sharing purposes: Actors/Actor0001.xml (or .json ^^)
Well, I'm not adding nothing new, so thumbs up for all proposals so far :+1:.
I want to add a Pro to the list: The editor can read the files on demand, so, until you edit the character Tab of Actor 10, or find an Event Command wanting it's name the file doesn't need to be loaded. Same happens with Chipset and souch.
Well the new winner is now obviously JSON here.
But this also depends now on a ForEachField
Api. With this API the different project layouts can be quickly prototyped to find the best solution. (and then put the final solution in liblcf to ensure that Player can load it)
Currently we simply convert the LDB & co. to XML and rename it to .edb & co. This needs a solution before the editor is released to the public imo because when the first people start using it, it is too late.
Imho this could be heavily improved by splitting everything in small XML (or JSON?) files.
Though we don't want to copy from MV so I suggest something different. We split it even more:
Cons:
Pros:
So this is in general stuff that is only relevant for the power user and for revision control.
You can vote :-1: now ;)