File Format

Everything about development and the OpenMW source code.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: File Format

Post by Zini »

The format strikes me as pretty archaic.
That is a rather subjective argument. The same could be said about XML.
There's little-to-no defined hierarchy for the data structure (e.g. is this 'ARBA' record part of the previous 'FOOB', or is it defining its own object?). You're given flat data, and are expected to build structure out of it based on the kind of object you're defining, which you don't know what kind of object you're defining until you've gotten the records. The existence and ordering of the records makes it even more questionable.
None of these deficits are causing us any problems at all. Switching from something that works well to something else that we would still need to get working doesn't look like a wise move to me.
I don't know why there is a distinction between a plugin and a master (or base and extension) to begin with. Sure, there is going to be the distinction of whether a file has dependencies on other files or not (the detail you use to distinguish between omwbase and omwext), but I think we should go the opposite route and consolidate the number of file types from 3 (ESP/ESM/ESS) down to 1 (OMW).
Mixing up save files with content files would be bad. Wouldn't work anyway, because the data in a save file is notably different from the data in a content file. A clear no to that.

I do see your point about ESP and ESM being the same. That would also be true for omwbase and omwext for the most part. The difference is more of a semantic nature. An omwbase file represents a game. An omwext file represents an extension to an existing game. For the end user that would be an important difference IMO.
User avatar
Greendogo
Posts: 1467
Joined: 26 Aug 2011, 02:04

Re: File Format

Post by Greendogo »

Chris wrote:Because they wouldn't create or modify ESMs with the CS. They can't restrict an ability that was never there. They'd create patches (ESPs) with the CS, having it depend on whatever master(s) they were currently developing for, then use an external tool to merge ("commit") them to the ESM.
I somehow doubt that Bethesda didn't have a more advanced CS than the one they released with the game. Instead I bet the ability to create and modify masters was present in Bethesda's own build of the CS. They probably neutered the tool somewhat for business reasons, or perhaps because Gamebryo asked them to.

Regardless, however, the ability to create and modify master/omwbase files is an absolute must have for the Editor.

@Zini: Yes, I agree with you now regarding the divide between omwbase and omwext files being important. Also, I'm surprised that ESS files are structurally different from ESP/ESM files. I'd think it would have been easier for Bethesda if they just made them like ESPs, modifying the game world to the player's current progress.

Anyway, continue with the more technical stuff; sorry for diluting the thread with this semi-off topic subject.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: File Format

Post by Zini »

I did not say ESS files are structured differently. But we are not using the ESS format (except for an importer). We haven't designed a saved game format yet and it may very well be similar in the overall structure to ESX/ESS. Still, we are organising our data in a completely different way and ESX files and our save files will barely have any record types in common.


Regarding owmbase and omwext: It is kinda unfortunate that I had to explain the meaning of these. Maybe the names are chosen poorly. Maybe omwgame and omwaddon instead?
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: File Format

Post by sirherrbatka »

what about *.master *.plugin ;-)
User avatar
Greendogo
Posts: 1467
Joined: 26 Aug 2011, 02:04

Re: File Format

Post by Greendogo »

I think the names are already too long, but do what you want; I'm sure it will be fine. I don't think they are unclear at all.

@sirherrbatka: I think those would be good too :D
Tarius
Posts: 574
Joined: 24 Oct 2011, 19:29

Re: File Format

Post by Tarius »

Zini wrote:Regarding owmbase and omwext: It is kinda unfortunate that I had to explain the meaning of these. Maybe the names are chosen poorly. Maybe omwgame and omwaddon instead?
I agree with these new names.
But why not omwmast and omwplug.

I also agree they seem kinda long though but dont see a better way of describing them unless you just use .mast and .plug
Chris
Posts: 1626
Joined: 04 Sep 2011, 08:33

Re: File Format

Post by Chris »

Zini wrote:None of these deficits are causing us any problems at all.
I disagree. We may be handling it, but it's still not an ideal situation, IMO. Don't forget too that so far we've only been handling Morrowind.esm... we have no idea what it will be like once we gain support for the thousands of available mods.

We should also consider content creators and 3rd party tools. A robust format should be simple to create, with a clear definition. Errors in the data should be easy to spot, report, and handle. An ESM-like format doesn't do any of this: the format leaves a lot of questions (are sub-records order-sensitive? can they be missing to specify a default? do the FOURCCs actually have meaning beyond being an ID for the loader?), and errors in the data are difficult to deal with (what do we do if a sub-record has an unexpected size? what if there's an unexpected sub-record?).

Besides, even if we can handle the majority of mods, it's still a poor format. If we're going to do something new and incompatible, we may as well do it correctly. It's different anyway, so let's take the opportunity to clear up the problems with the format, to make it robust, easy to understand, and easy to handle, with as little guesswork as possible (for both us, and makers of 3rd party tools).
Switching from something that works well to something else that we would still need to get working doesn't look like a wise move to me.
Just because we can handle what we've been so far been able to test doesn't mean it "works well". Like I said before, the data format of the game should be closely tied to the way it's handled internally. We currently treat it as a data stream that gets transformed into easier-to-handle data structures, rather than handling the records and sub-records themselves. It wouldn't at all surprise me if the vanilla game has accessor methods to read/write/create whatever (sub-)record is needed directly, and loads the esm/esp/ess files into a flat chunk of memory.
Mixing up save files with content files would be bad. Wouldn't work anyway, because the data in a save file is notably different from the data in a content file. A clear no to that.
The save file is effectively just a patch on top of the esm/esp data. It contains extra information you wouldn't normally find in esm or esp files, true (since it's working with an active game rather than specifying what to start the game with), but it also contains a lot of the same information and is a patch very similar to an esp (e.g. a moved/modified reference in a save game is the same as a moved/modified reference in an esp).
I do see your point about ESP and ESM being the same. That would also be true for omwbase and omwext for the most part. The difference is more of a semantic nature. An omwbase file represents a game. An omwext file represents an extension to an existing game. For the end user that would be an important difference IMO.
Personally, I don't see the need to separate the two. It's all game data. Sometimes they require other game data, sometimes they don't. It just creates confusion to arbitrarily split 'base' from 'ext'. Someone will say something should be 'base', another will say it should be 'ext', even though it's all the same.

What I'd like to see is a combined BSA/ESP setup. You have an archive (BSA, zip, 7z, whatever), and in the root of the archive are files that act as ESM/P files. You'd enable this package to enable a mod, then the data files (sounds, textures, meshes, etc) will be used by the game as well as the ESM/P files. Disable it, and none of it will be used. The package could be extracted into a directory if you want more control over what's actually used, but for the majority of mods you'd just enable the package and play.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: File Format

Post by Zini »

I disagree. We may be handling it, but it's still not an ideal situation, IMO. Don't forget too that so far we've only been handling Morrowind.esm... we have no idea what it will be like once we gain support for the thousands of available mods.
I do not expect problems from 3rd party content. I guess it is possible, that we haven't implemented one or two features that are not used in Morrowind/Bloodmoon/Tribunal, but that shouldn't be much of a bother.
I tested OpenMW with the Redemption.esm, which is probably as complex as 3rd party content gets. In the early days we found some unimplemented ESX records, but we are way past that and the only problems I have with Redemption these days are unimplemented NIF features.
We should also consider content creators and 3rd party tools.
I do not see where 3rd party tools would come into it. This is an Open Source project after all. If something needs to be done, it can be done in the main project and with the code base, that already handles the transition between ESX and the runtime data.
Just because we can handle what we've been so far been able to test doesn't mean it "works well".
Yes, it does. What ever extensions we are going to have, they will be conceptually similar to what is already in the format. There is no reason to expect that we will run into new problems.
Someone will say something should be 'base', another will say it should be 'ext', even though it's all the same.
No. Read the definition of these new types again. There is a clear separation. Under no circumstances can there ever be any ambiguity.
What I'd like to see is a combined BSA/ESP setup. You have an archive (BSA, zip, 7z, whatever), and in the root of the archive are files that act as ESM/P files. You'd enable this package to enable a mod, then the data files (sounds, textures, meshes, etc) will be used by the game as well as the ESM/P files. Disable it, and none of it will be used. The package could be extracted into a directory if you want more control over what's actually used, but for the majority of mods you'd just enable the package and play.
That would make sense, but it is probably easier to let the ESX file specify which BSA it wants to use. At least that is nothing we can pull of on short notice without delaying 1.0 progress.
blunted2night
Posts: 63
Joined: 28 Dec 2012, 08:29

Re: File Format

Post by blunted2night »

Does this mean that openmw is doing an on-the-fly conversion when it sees the original data files, but not when it sees something from the editor?
Zini wrote: Yes? I see absolutely no reason at all to switch to a different format. The ESX format is very extensible and serves our purposes well enough. A switch to a different format would require a huge amount of work for very little gain.
I could see making smaller changes to the format to cleanup oddness in the format. For instance, the special casing used to tie INFO records to their DIAL records, or potentially optimizing how cell data is stored.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: File Format

Post by Zini »

Does this mean that openmw is doing an on-the-fly conversion when it sees the original data files, but not when it sees something from the editor?
No. I thought I made that clear. Once more: The new format is identical to the old one. We are just replacing one record per file and the compiled script data is different since we are targeting a different VM (for old ESX files OpenMW ignores the VM code and compiles the scripts on the fly instead). There is little to no conversion involved. For future extensions we are probably going to add some new record types and some sub-records to existing record types (all optional). But that's it. We are essentially staying compatible (at least in one direction).
Post Reply