Oni Central Forum

A forum for the Oni community

You are not logged in.

#1 30/4/07 19:01

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

RAW tools

Here's a couple of tools designed as a complement to OUP. They may be rewritten as part of OUP eventually.
OUP can only apply "structdefs" to the DAT so far, and that makes it hard to edit some RAW/SEP parts.

PATHFINDING GRIDS
Those are probably the one RAW resource for which basic conversion tools make the most sense.
First, the binary format of a pathfinding grid is not too human-readable (as opposed to most BINA, TRAM and even TXMP parts).
Second, the grids are 2D, and thus easily representable in ASCII (text file).

HERE is a ZIP archive of the tools (with source and Dev-C++ project).
You can read the readme before you download, even if it doesn't make much sense.

What you get in the ZIP are 2 command-line tools a2b.exe and b2a.exe, which can convert grids from binary to ascii and back.
The archive also includes a test file 008.AKVA_0, as an example of the expected name and extension for the binary grids.
The binary grid in 008.AKVA_0 (from level1_Final) looks a bit like this in hex view:

 Offset    0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F

00000000  00 14 11 14 29 18 19 00 14 11 14 19 38 00 14 11  ....).......8...
00000010  14 29 18 19 00 15 11 14 19 18 19 00 15 11 14 39  .).............9
00000020  00 16 11 34 00 17 31 00 4B 31 00 16 11 34 00 15  ...4..1.K1...4..
00000030  11 14 39 00 15 11 14 19 18 19 00 15 11 14 19 18  ..9.............
00000040  19 00 15 11 14 19 18 19 00 15 11 14 19 18 19 00  ................
00000050  15 11 14 19 18 19 00 15 11 14 19 18 19 00 15 11  ................
00000060  14 19 18 19 E0 21 50 11 14 19 18 19 D0 11 24 11  ....à!P.....Ð.$.
00000070  40 11 14 19 18 19 20 B1 14 29 14 51 14 19 18 19  @..... ±.).Q....
00000080  10 11 C4 29 74 19 18 19 11 14 09 16 18 19 11 14  ..Ä)t...........
00000090  09 16 18 19 11 14 29 04 13 19 18 19              ......).....

You can then run test.bat (which just calls b2a on 008.AKVA_0 the way you should call it yourself) and get 008.txt

00000000000000000000149989
00000000000000000000149888
00000000000000000000149989
00000000000000000000014989
00000000000000000000014999
00000000000000000000001444
00000000000000000000000111
00000000000000000000000000
00000000000000000000000000
00000000000000000000000111
00000000000000000000001444
00000000000000000000014999
00000000000000000000014989
00000000000000000000014989
00000000000000000000014989
00000000000000000000014989
00000000000000000000014989
00000000000000000000014989
00000000000000000000014989
00000000000000110000014989
00000000000001441000014989
00111111111114994111114989
01444444444444994444444989
14999999999999999999999989
14999999999999999999999989
14994444444444444444444989

Then you're supposed to edit 008.txt with any text editor, reconvert it using a2b.exe and reimport it with OUP.

Enjoy. Feedback expected.

Last edited by geyser (1/5/07 9:35)


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

#2 30/4/07 21:43

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

Re: RAW tools

Ooo.. big_smile Very cool idea, though I don't know AKVA at all... so I dunno what the 0-9's are, I assume groups. :X
Anyways, what would be a nice addition - as I see that it gives you the size of the grid - is if there was an option to tell you at least what tile dimension combinations are possible (like in the example it's 26x26). Unless there's a way to actually get the dimensions from the file, but I'd figure if there were you'd have already done it.

Offline

#3 1/5/07 8:20

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

Re: RAW tools

Of course I know that no one reads the docs, and that fellow coders are the least likely to read them, but still, Tosh... hmm

b2a (binary to ascii) takes 3 arguments:
    number of tiles along x
    number of tiles along z
    index of the BNV to convert

The size of a grid (can be "anything") is specified in the DAT (HERE).
The format of the RAW part (HERE) holds no information on the size.
You're supposed to look up the size for every BNV and supply it to a2b and b2a.
The 0-9 are tile types: clear, nearwall, border1, border2, semipassable, border3, border4, stairs, danger, impassable.

The main purpose of those tools is to fix a few messy grids. Sometimes there are "impassable" tiles in the middle of a room.
Sometimes there are whole blocks of tiles reflecting some old piece of furniture that's not there anymore.
And there are the hidden doors in the Warehouse. Easy editing of the grids finally makes Warehouse Cheese a reality smile
A good place for a list of grids worth fixing is HERE.

Last edited by geyser (1/5/07 8:23)


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

#4 1/5/07 18:45

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

Re: RAW tools

xD I read it! Really! Mostly... yeah.
I didn't know there was a difference between AKVA and AKVA_0 though. >__>; I need to read up on the binary stuff.
Makes more sense though. ^^;

And also, yeah, I noticed there were a lot of permanently locked doors in the warehouse.. always meant to no-clippings-mode through them, hehe. tongue

One thing I can forsee myself doing for this though is getting rid of some invisible walls, like on the Regional State Building level.

Offline

#5 1/5/07 20:22

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

Re: RAW tools

Yes, you may want to do some reading up (on scripting, even: on the old forum). OG and the previous OCF are your friends smile

AKVA_0 is an extension we made up in order to handle the RAW parts of AKVA separately. a2b and b2a are the only programs using it so far smile
Actually, as it's often the case, it doesn't make much sense to store that data separately since it can't be read and edited independently from the DAT...
So in the long run, export of RAW chunks (and even export of unnamed subresources: of M3GM and AKEV and such) will probably be discontinued.

Invisible walls: please tell us HERE which ones they'd be. We'll have to look up the quad IDs, and I know only one man who can do that easily ATM.
All of the doors in the warehouse are unlockable, but for those that are hidden by walls, we'll have to take the walls away. I've already done it. Works.

Last edited by geyser (1/5/07 20:44)


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