For example:Lord Apocalypse wrote:I don't see how you could really do this piecemeal w/o seriously breaking things.Per wrote:I'd be happy with SQL as data format, but I think it is more work, and probably harder to do piecemeal, and I'm not doing that work.
1. Create module that represents inner database. (wrapper for stats)
2. Make all access to stats via wrapper (it is big changes but it can be done step by step)
3. Change inner realization of wrapper.
It is good patter to make software as group of modules that connect to each other via API.
IMHO everything loads at start. compain stats, scrimish stats and mp stats.If this were to be done first thing that needs to be sorted is what, when, and how everything should be loaded. So what order would you want things loaded. Do you preload all the stats or wait to see what kind of mod is running or load the mod data after loading the normal game data since the mod will overwrite everything. Or do you keep an extra copy of all data loaded (with each copy holding each useable mod). One thing WZ needs is an internal mod selector.
I don`t work with sqlite a lot, but it looks like insert is very expensive operation and reading is cheap. But in_memory sqlite should be more faster.With an internal mod selector it becomes easy to know what to do upon load. As most mods do not replace or change the cam data two stats tables may be needed though unless you want to discard mod data when a player chooses a campaign option. The problem with this though is the extra load time when tossing out the mods data in favor of the cam data. That or adding to the load times for ski and mp games.