View Full Version : AAO File Format
Freakouter
25th January 2005, 22:15
Hello,
does somebody know, whats in an aao-file? (e.g. Chunks...) I want to code my owen AAO Map Loader and Editor, but i dont know the format.
TY,
Coder
T0m
26th January 2005, 01:25
the map files are in .aao file format.
i dont know what else to ya
Zilbob14
26th January 2005, 05:59
Read antonio's package docs. Google em, I don't have a link.
Oh, and its not easy, but why not try anyways? (Those docs describe around 40 classes, but according to unreal there are around 100. So, you will wind up doing some guess-and-check).
Oh, and the actual AAO file format is a tad bit different, as are some of the classes.
Basic001
26th January 2005, 14:29
http://www.acordero.org/
Freakouter
26th January 2005, 15:09
Thank u very much. This tutorial is amazing. I start coding in my holidays and maybe, we have a new, cool Map editor soon. :laugh:
Cu
arnold991
26th January 2005, 16:53
Thank u very much. This tutorial is amazing. I start coding in my holidays and maybe, we have a new, cool Map editor soon. :laugh:
Cu
haha Freakouter, Best of Luck with your project. :classic:
And keep us informed about it. :knockedou
Freakouter
26th January 2005, 18:13
haha Freakouter, Best of Luck with your project. :classic:
And keep us informed about it. :knockedou
So, after haf an hour coding and reading, my programm can read the basic chunks. Unfortunately, i have to do lots of things for school, and so i just can start "real coding" in march or april. But, maybe i can realease a bis map-hacker soon (e.g. wepaons changing, vip get rpg on hospital)
Cu,
C
I have still my first problem. I dont know, how to read this Compact Indices Type.
In the tutorial is a code, but I dont understand it. Can I read a Compact Index like this?
DWORD CAAOMap::ReadIndex(ifstream& fstream)
{
DWORD dwOut;
return dwOut;
}
arnold991
26th January 2005, 18:17
haha Freakouter, Best of Luck with your project. :classic:
And keep us informed about it. :knockedou
So, after haf an hour coding and reading, my programm can read the basic chunks. Unfortunately, i have to do lots of things for school, and so i just can start "real coding" in march or april. But, maybe i can realease a bis map-hacker soon (e.g. wepaons changing, vip get rpg on hospital)
Cu,
C
vip with rpg and full health has already been done. ;)
http://www.mpcdownloads.com/_mpc_d0wn_h4x_/AAO/Other%20Hacks/sfhospital3.rar
nekura
26th January 2005, 18:30
index read/write code from old epic docs:
Compact indices exist so that small numbers can be stored efficiently. An index named "Index" is stored as a series of 1-5 consecutive bytes with the following C++ code. Basically, the "Ar << B0" type code serializes the byte stored in the variable B0. Serialize can mean read or write, depending on the internal implementation of the archive object Ar.
//
// FCompactIndex serializer.
//
FArchive& operator<<( FArchive& Ar, FCompactIndex& I )
{
INT Original = I.Value;
DWORD V = Abs(I.Value);
BYTE B0 = ((I.Value>=0) ? 0 : 0x80) + ((V < 0x40) ? V : ((V & 0x3f)+0x40));
I.Value = 0;
Ar << B0;
if( B0 & 0x40 )
{
V >>= 6;
BYTE B1 = (V < 0x80) ? V : ((V & 0x7f)+0x80);
Ar << B1;
if( B1 & 0x80 )
{
V >>= 7;
BYTE B2 = (V < 0x80) ? V : ((V & 0x7f)+0x80);
Ar << B2;
if( B2 & 0x80 )
{
V >>= 7;
BYTE B3 = (V < 0x80) ? V : ((V & 0x7f)+0x80);
Ar << B3;
if( B3 & 0x80 )
{
V >>= 7;
BYTE B4 = V;
Ar << B4;
I.Value = B4;
}
I.Value = (I.Value << 7) + (B3 & 0x7f);
}
I.Value = (I.Value << 7) + (B2 & 0x7f);
}
I.Value = (I.Value << 7) + (B1 & 0x7f);
}
I.Value = (I.Value << 6) + (B0 & 0x3f);
if( B0 & 0x80 )
I.Value = -I.Value;
if( Ar.IsSaving() && I.Value!=Original )
appErrorf("Mismatch: %08X %08X",I.Value,Original);
}
return Ar;
} So if I understood correctly they have variable size.
EDIT: DOH, it's the same code
Freakouter
26th January 2005, 18:33
vip with rpg and full health has already been done. ;)
http://www.mpcdownloads.com/_mpc_d0wn_h4x_/AAO/Other%20Hacks/sfhospital3.rar
who cares. lol
I have seen that, too. Unfortunately, i dont undestand that "way of cooding"
nekura
26th January 2005, 19:13
I don't understand how it exactly is encoded either
anyway, here's another (slightly modified) code from UTCMS
// --------------------------------------------------------------------
// public: Read an index - special compression used in Un files
// --------------------------------------------------------------------
#define INDEX_SIGN_BIT 0x80 // Sign bit on first test
#define INDEX_CONT1_BIT 0x40 // Continuation bit on first test
#define INDEX_BYT1_MASK 0x3f // Data mast on first test
#define INDEX_CONT_BIT 0x80 // Continuation bit on other bytes
#define INDEX_BYTE_MASK 0x7f // Data mask on other bytes
// --------------------------------------------------------------------
DWORD ReadIndex( void )
{
BYTE test;
DWORD data;
DWORD result;
WORD shift = 6;
bool sign;
// ------------------------------------------------------------
// Read in the first test separately
// ------------------------------------------------------------
test = ReadByte();
sign = (test & INDEX_SIGN_BIT) != 0;
result = test & INDEX_BYT1_MASK;
// ------------------------------------------------------------
// Read in the following bytes as needed
// ------------------------------------------------------------
if( test & INDEX_CONT1_BIT )
{
do
{
test = ReadByte();
data = ((DWORD)test) & INDEX_BYTE_MASK;
data = data << shift;
result = result | data;
shift = (WORD)(shift + 7);
} while ( ( test & INDEX_CONT_BIT ) && ( shift < 32 ) );
}
if( sign )
{
result = (DWORD)( -((INT)result) );
}
return result;
}
You'll have to write your own "ReadByte()"
It may or may not work correctly, don't remember now
Zilbob14
27th January 2005, 06:05
Ok this is the format:
First byte:
bit 1- Determines weather positive or negative
bit 2- if 1, then there is another byte after this one
all the rest are just the actual number data
Second byte:
bit 1- determines if there is a third byte
the rest are the actual number
Third and fourth byte are same as second
Fifth byte:
ALL the bits in here go towards value
*HINT*: YOu can check those values using AND. Thats what I did.
Oh, BTW if you figure AA's export table out, tell me. It is not in the format that those docs say.
PS
I am trying to do the same thing, though for mac os (seing as I like that development environment better and they don't have UTPT). Maybe we could work together? Despite the platform barrier, I think that it could be mutually benificial. I am not much further than you, my prog reads the name and import tables (and cross references them, naturally). My email is zilbob14@etho.no-ip.com
Powered by vBulletin™ Version 4.0.2 Copyright © 2010 vBulletin Solutions, Inc. All rights reserved.