Stats data format I wish to have.

For code related discussions and questions
User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: Stats data format I wish to have.

Post by Duha »

Lord Apocalypse wrote:
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.
I don't see how you could really do this piecemeal w/o seriously breaking things.
For example:
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.
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.
IMHO everything loads at start. compain stats, scrimish stats and mp stats.
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.
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.
http://addons.wz2100.net/ developer
User avatar
vexed
Inactive
Inactive
Posts: 2538
Joined: 27 Jul 2010, 02:07

Re: Stats data format I wish to have.

Post by vexed »

Lord Apocalypse wrote:
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.
I don't see how you could really do this piecemeal w/o seriously breaking things. 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.
Pardon ?
All versions of warzone are already capable of this, even the original.
It loads data as it needs it, according to what the wrf files tell it to load.
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.
Um, I don't think you know how Warzone works, it is split into SP & Skirmish/MP files.
We would still have a database for either SP or for skirmish/MP stats. There is no reason to have one big one.
(Well, I suppose it would be possible to have "one database to rule them all", but that gets very messy when dealing with the campaign.)
Based on what you start or load, then it loads the correct files (stats, database, sound, whatever) that are either for SP or Skirmish/MP games. It then tries to load files based on a directory hierarchy + "override", so, if it don't find X in mp/... then it tries base/.. and then fails if it can't find it in either, assuming you are starting/loading a skirmish/MP game. The override would kick in above the main paths, and use those files from there.

The problem with mods is, there is currently no way to pick them once the game starts, so your stuck with what already has been set (unless it is a override for the main stuff, then the mod has already loaded).
This is why autoload is so error prone, and also can lead to odd crashes.
We need GUI support to allow users picking the mod, but this is getting way off topic.
/facepalm ...Grinch stole Warzone🙈🙉🙊 contra principia negantem non est disputandum
Super busy, don't expect a timely reply back.
Post Reply