Oni Central Forum

A forum for the Oni community

You are not logged in.

#1 05/15/07 17:05

Tosh
Member
From: Oregon, USA
Registered: 01/14/07
Website

What does Oni look for first in a dat file?

I'm working on the dat patcher for omm at the moment and I was thinking, to do this even remotely successfully with the nameless files, I need a starting point. As such I'd like to use what Oni looks for as a starting point for various things.
I'm pretty sure the engine can only call named files directly.. so like.. is there anything that tells the engine what to call initially? Like a directive file or just some standard naming convention?

Offline

#2 05/15/07 18:05

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: What does Oni look for first in a dat file?

To your defense, the Oni Stuff coverage of the DAT headers is not 100% complete or accurate. It does, however, cover the basics.

Yes, Oni almost certainly looks up only the named files.

There's no global naming convention. Some names are hardcoded, the rest is looked up from string fields in the DAT/RAW, or called up from scripts. So... completely custom.
A few possibly obsolete conventions exist, though. Some named files have 4-character tags as prefixes (the BINA), others have "extra extensions" as suffixes (.aif, .amb, .imp, .grp).
But apart from that, anything goes. An ONCC can have any name at all. And ONWC can have any name at all. A texture can have any name at all.
There are issues like capitalization, though. Environment textures are supposed to be capitalized (at least env_tex_swap uppercases the texture names).
Possibly other issues like special characters: there are not only underscores, but spaces, dots, backslashes... Are any of these part of a convention?
Don't know and honestly don't care. OUP handles all the names as they are stored in a DAT's nametable. Apparently case-sensitive.
So if you want to patch a file, look up the name e basta. Why do you need to bother with obscure naming conventions?

A whole different question is Why The Fish you're obstinately trying to recode OUP... We have two major Oni-parsing projects right now: Alloc's OUP and Neo's OniViewer. Neither of them can patch Oni's data in a systematic, modular way.
But I'd rather encourage either of those guys to go ahead and implement patching (they're close) than set off to build a new project from scratch, that should somehow be more effective than OUP and OniViewer combined (and they are damn effective when combined) hmm
Besides, note that I'm ready to release the "Ni Kanabô" patching system. It lacks a GUI, but it has a full set of backup and install routines.
And it lets modders author binary patches from their current game content with the click of a button. Which is very handy. More, Soon(TM).
(the core is really ready for releasing, I only need to "package" the mods I'll bundle with it, i.e., set up installers for all platforms, write docs etc)
(BTW, I want to include a revised version of your Sniper Mod tongue are you OK with that, or do you want to see it first?)

Last edited by geyser (05/15/07 18:05)


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#3 05/15/07 19:05

Tosh
Member
From: Oregon, USA
Registered: 01/14/07
Website

Re: What does Oni look for first in a dat file?

geyser wrote:

There's no global naming convention. Some names are hardcoded, the rest is looked up from string fields in the DAT/RAW, or called up from scripts. So... completely custom.

Hardcoded.. :X great.

geyser wrote:

Don't know and honestly don't care. OUP handles all the names as they are stored in a DAT's nametable. Apparently case-sensitive.
So if you want to patch a file, look up the name e basta. Why do you need to bother with obscure naming conventions?

Dunno what "e basta" means but I'm looking up the names and stuff, that's no biggie, I was just hoping to standardise file structuring on unpacking so patching would be simpler but eh.

geyser wrote:

A whole different question is Why The Fish you're obstinately trying to recode OUP... We have two major Oni-parsing projects right now: Alloc's OUP and Neo's OniViewer. Neither of them can patch Oni's data in a systematic, modular way.
But I'd rather encourage either of those guys to go ahead and implement patching (they're close) than set off to build a new project from scratch, that should somehow be more effective than OUP and OniViewer combined (and they are damn effective when combined) hmm

If there's one thing I learned from life it is that things won't get done if you wait for them.

geyser wrote:

Besides, note that I'm ready to release the "Ni Kanabô" patching system. It lacks a GUI, but it has a full set of backup and install routines.
And it lets modders author binary patches from their current game content with the click of a button. Which is very handy. More, Soon(TM).
(the core is really ready for releasing, I only need to "package" the mods I'll bundle with it, i.e., set up installers for all platforms, write docs etc)

Eh? Well if you're doing what I'm doing I'd like to combine them; but really.. from what I've done so far on this, this patching won't be a problem.

geyser wrote:

(BTW, I want to include a revised version of your Sniper Mod tongue are you OK with that, or do you want to see it first?)

It's okay if you do, I don't mind, I'll see it on release. smile

Offline

#4 05/18/07 10:05

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: What does Oni look for first in a dat file?

"basta" is "enough"... in Italian... I think... hmm

Hardcoded or ignored names... usually one-of-their-kind files (game_settings.ONGS etc), win/lose splashscreens, out-of-game music entries... that kind of thing.

Standardizing unpacking and patching (like those folders and subfolders, for instance)... you're totally welcome, but just keep in mind there are other folks who may have their word to say in that standardization.
Not because we're dictators or anything: just because we've been looking at that stuff for some time now, and even if we haven't implemented a patching system yet, we've put more than a little thought into it.

For instance... Browsing the subtree of a named file recursively to patch some fields with values is not the hard part; what's tricky is to handle links in a portable way.
Let's say we mod w12_ba2.ONWC so that it becomes "Loser' Chaingun". We'll want to make it link to a bunch of TXMPs and to the Screaming Cannon's M3GM. By ID.
Now, we can't just author the patch with our version and tell the patch to overwrite the IDs in the user's ONWC with "the modded ones".
Because in the user's level0_Final, resource IDs may be off by 1 or 2 or whatever. Same for character texture arrays (TRMA).
And same for evey DAT-link or RAW/SEP-link out there. If we just overwrite links with authored ones, they may be broken.
Now the only clean way to do that is to specify something like: go to w9_scr.ONWC; read M3GM link; go to w12_ba2.ONWC; write M3GM link.
And thus for every DAT/RAW/SEP link, with possibly many several levels of recursion before you get to read/write the modified field.
Now even though that modus operandi is quite clear, it's dissuasive when it comes to implementing it. Because we're not sure what to allow smile
Looking at the ONWC, the original OWNC all have their own, unique M3GM. To what extent should we regard cross-linking as "legal"? neutral

If there's one thing I learned from life it is that things won't get done if you wait for them.

Fair enough, but not universally true. Besides, no one's asking you to sit and wait...


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#5 05/18/07 15:05

Tosh
Member
From: Oregon, USA
Registered: 01/14/07
Website

Re: What does Oni look for first in a dat file?

geyser; no worries about linking.. I have that totally covered. In a very, VERY, obfuscated way.
Also I don't mean standarizing the packing and unpacking globally, I meant within my program, so that it was only possible to create one directory tree per file rather than the two or three that are actually possible.

On that note, I have the unpacking engine completely done, but I need to implement more stuff for it to actually be complete.. next will be patching. Wish me luck. smile

EDIT: Oh by the way, it reads in numerical order, exporting all named files and their links first, then reruns through to see if there are any unnamed files that haven't been exported. Currently the process only takes a few seconds, but it only writes a few of the files so far. Namely only the ABNA, IGSA, IGSt, and DPge files. ^^;

Last edited by Tosh (05/18/07 15:05)

Offline

#6 05/18/07 16:05

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: What does Oni look for first in a dat file?

Good luck. smile

Systematically unpacking unnamed orphans is not necessary.

My basic questions about your unpacking philosophy haven't changed:
What does your extractor do if two or more unnamed files share an unnamed resource?
What does it do if the subtree of a named resource includes a resource that is named?


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#7 05/18/07 18:05

Tosh
Member
From: Oregon, USA
Registered: 01/14/07
Website

Re: What does Oni look for first in a dat file?

Eh I'm only unpacking it for completeness, the packer won't pack them.

By sharing a resource I assume you mean a link? Well, it unpacks it to a directory by the name of the first one (numerically) and the second will point to the first's directory/file. Which I forgot to put in, so thanks for reminding me. ^^;
When a resource links to a named resource the directory the resource is in isn't included in the path in the file that is linking to it, only the name and extension of the file. As there can be no duplicate names in the entire structure.. at least to my knowledge... that's right isn't it? >__>;

Offline

#8 05/19/07 12:05

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: What does Oni look for first in a dat file?

Good to know you're handling all that. Keep it up.

Resource names are case-sensitive. Extensions count.
So you can have WOOHOO.TXMP and woohoo.TXMP in the same file. That's something to avoid with export in mind, of course. Ingame, though, TXMPs are hardly ever looked up by name.
You can also have woohoo.TXMP and woohoo.ONCC in the same file. That's much less annoying in every respect. It doesn't seem to occur all that much if at all, and I never actually checked.

So you effectively transform links-to-named into links-by-name... hmm... not sure that's perfectly logical, but I can't think of anything more logical right now, except (of course) an actual database like in OUP.


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

Board footer

Powered by FluxBB