Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - JWP

Pages: 1 ... 3 4 5 6 7 [8]
176
There's an interesting sub at 0x00487DF0 (Steam version) which controls the AI code for monster turns (i.e. it parses section 8 of the .dat files).
Most of the function is essentially a giant switch statement on the current AI byte and then it goes to the next one until it finds 0x00.
The thing I like about this function is that if you replace it, you could make your own AI scripting system (e.g. using Lua), which would make for more interesting battle AI without faffing about with byte code.

the logic is something like: (note that this isn't 100% correct)
Code: [Select]
//0x1D27B10 - note: actual start address is earlier and some of the later items in the struct probably need to be moved to the start
#pragma pack(push, 1)
struct Character
{
uint8_t **monster_info; //pointer to section 7 of a loaded dat file in memory
uint8_t unk[124];
uint8_t unkbyte1D27B90; //unknown flag byte
uint8_t unk1[79];
};
#pragma pack(pop)

//0x1D28E89 - note: actual start address is earlier and some of the later items in the struct probably need to be moved to the start
#pragma pack(push, 1)
struct unk1D28E89
{
uint8_t unk_byte;
uint8_t unk[70];
};
#pragma pack(pop)

Character *ptr1D27B10 = (Character*)0x1D27B10; //208 byte structure - appears to be array of 6 items
bool *init_done = (bool*)0x1D28E09; //1 byte - seems to be 0 at first turn in battle for init then 1 otherwise
unk1D28E89 *ptr1D28E89 = (unk1D28E89*)0x1D28E89; //71 byte structure - appears to be array of 6 items

uint32_t my_sub_487DF0(uint32_t monster_id, uint8_t *AICode, uint8_t *arg3, uint8_t *arg4) //monster id seems to be 3,4 or 5... I'm assuming 0, 1 and 2 are reserved for your party
{
uint32_t local0;
uint32_t local1;
uint32_t local2;
uint32_t local3;
uint8_t next_ai_byte_1; //local.4_0
uint8_t next_ai_byte_2; //local.4_1
uint8_t next_ai_byte_3; //local.4_2
uint32_t local5;
uint8_t current_ai_byte; //local.6_0
uint8_t local7_0;
uint8_t *monster_info; //local.8_0
uint32_t local9;
uint32_t local10;
uint32_t local11;
uint32_t local12;
uint32_t local13;
uint8_t local14_0;
uint32_t local15;
uint32_t local16;
uint32_t local17;
uint32_t local18;
uint32_t local19;
uint32_t local20;
uint8_t local21_0;
uint32_t local22;
uint8_t local23_0;
uint32_t local24;

local22 = (uint32_t)ptr1D28E89[monster_id].unk;
local21_0 = 0;
local7_0 = 0;
local23_0 = 0;
monster_info = *ptr1D27B10[monster_id].monster_info;
local14_0 = 0;
local24 = 0; //esi

//monster_id = 0 - esi
if (init_done && ptr1D27B10[monster_id].unkbyte1D27B90 & 0x20 != 0) {
//TO DO
//jumps somewhere - I've not really seen this section of code called
  }

//loop
do {
current_ai_byte = *AICode++;
switch (current_ai_byte) {
//TO DO
}
} while (current_ai_byte != 0);
}

I'm currently working on reversing this function and the 60 cases of the switch statement (there's also nested switches for cases 0x02 and 0x04 =/) with some help from discoveries by random_npc (http://forums.qhimm.com/index.php?topic=11137.0) and the debug room.
EDIT: Slowly getting there, the structures are starting to make sense and it's helping with the AI opcodes... e.g. opcode 0x3C looks it adds the next word to it's own HP and 0x16 sets the current HP to the max HP.

177
It's possible to change the .dat files for the PS version as they are the same format as the PC version.
The PS files are in a different archive format (i.e. not .fs) and are uncompressed, so it's not currently possible to increase the size of files but it's possible to patch files with ones that are the same size or possibly smaller.
See: http://forums.qhimm.com/index.php?topic=8130.msg99114#msg99114
The offsets in that message are for the PAL version of FF8 but it's fairly easy to scan for the .dat files, I believe I just looked for the bytes 0B 00 00 00 adjacent to each other in FF8DISC1.IMG since most of the .dat files start with that.
Then you can find out where the section you want is by looking at:
http://wiki.qhimm.com/view/FF8/FileFormat_DAT
Then you just jump to the required offset from the start of the file - using the PC files as a reference would probably help make it easier.
It's fairly easy to recognize the right section because the monster info starts with an FF8 string which looks like ASCII (the monster name) followed by a bunch of 00s.
FF8 Strings look something like: Wos_jj - which is Squall and Elecjm - which is Angelo.

178
Here's a basic outline of the geometry stored in the .dat (section 3 of the monster files) files for those that are interested:

the section starts with a list of groups:

LONG                                num_groups
LONG*num_groups             group_offsets

each group has this structure:
SHORT                              num_bones
{
    SHORT                          bone_id
    SHORT                          num_verts
    SHORT[3]*numverts       verts
} * num_bones
SHORT                              num_triangles (32 bit aligned, so when pointer reaches the address at end of bone structure do (pointer + 3) & 0xFFFFFFFC
SHORT                              num quads
--8 NULL BYTES--
{
    SHORT                          verts[3]
    SHORT                          UVcoord
    SHORT                          UVcoord1
    SHORT                          unk
    SHORT                          UVcoord2
    SHORT                          unk1
} * num_triangles
{
    SHORT                          verts[4];
    SHORT                          UVcoord1
    SHORT                          unk
    SHORT                          UVcoord2
    SHORT                          unk1
    SHORT                          UVcoord3
    SHORT                          UVcoord4
} * num_quads


skeleton data is discussed in this topic: http://forums.qhimm.com/index.php?topic=2518.0

179
I'm going to release my dat reader, it's a bit buggy with the directories but it definately works for the PAL version of FF8, it should work on NTSC though. Let me know if you get any problems.
It works on the .IMG file on the root of the FF8 disk.

windows binary:
http://bin.mypage.sk/FILES/datread.exe

source:
http://bin.mypage.sk/FILES/main.c

note: it compiles on linux but I have no idea if it actually works.

usage:     datread.exe img outputdir [log]
eg.         datread.exe "C:\FF8DISK1.IMG" "C:\output\" "C:\logfile.txt"

THE OUTPUT DIRECTORY AND THE DIRECTORY THE LOG IS IN MUST EXIST (didn't really want to spend too much time fixing this issue so I left it as-is)

Feel free to modify the source any way you want but at least give me credit.
Thanks to Qhimm for the FF8 character encoding.

The output of the program is a separate directory for each dat file and within the dir, the whole .dat file and each of the separate parts of it (makes it easier to analyze), for the monsters, the animation section is also split up and placed in the /Animations dir.

EDIT: I've managed to view the geometry for 2 simple .dat models (080 (Right Orb)) and model 123 (which is the orb during Ultimecia's transform) all I need now is the bone rotation data from the animation and I should be able to view most of the models.

180
I started to have another look at the FF8 battle models yesterday, I've nearly re-coded my extractor for the PSX .dat models.
It's fully working but I'm still working on the directory parsing code. I'll release the source code and a .exe when it's done.

I also had a look at the geometry data again and I'm pretty close to getting all the data sorted out thanks to the battle model viewer.
I've basically found out the structure of the geometry (how to get all the triangle/quad structures) and where the texture coords are, I've just got to figure out the rest of the values.

Also here's a log from my PSX extractor which shows the .dat file offsets in the PAL version of the file FF8DISC1.IMG
at the moment it only finds the monster files but I'll see what I can do about finding the weapon models.
EDIT: managed to extract some more files and updated log.

File found at offset 0D82C000-0D832038  name: Dummy
File found at offset 0D832800-0D84FA20  name: GIM52A
File found at offset 0D850000-0D867938  name: Blobra
File found at offset 0D868000-0D8832C0  name: Thrustaevis
File found at offset 0D883800-0D895308  name: Geezard
File found at offset 0D895800-0D8A6CF8  name: Belhelmel
File found at offset 0D8A7000-0D8BDB24  name: Glacial Eye
File found at offset 0D8BE000-0D8D4614  name: SAM08G
File found at offset 0D8D4800-0D8EB710  name: GIM47N
File found at offset 0D8EB800-0D903C58  name: Mesmerize
File found at offset 0D904000-0D916AEC  name: Buel
File found at offset 0D917000-0D9342A8  name: Sphinxaur
File found at offset 0D934800-0D951A08  name: Sphinxara
File found at offset 0D952000-0D96B15C  name: Snow Lion
File found at offset 0D96B800-0D980880  name: Anacondaur
File found at offset 0D981000-0D9997EC  name: Grat
File found at offset 0D999800-0D9B3390  name: Cockatrice
File found at offset 0D9B3800-0D9CE2D4  name: Caterchipillar
File found at offset 0D9CE800-0D9DCA68  name: Red Bat
File found at offset 0D9DD000-0D9F7EA8  name: Blitz
File found at offset 0D9F8000-0DA0F80C  name: Fastitocalon
File found at offset 0DA10000-0DA203C8  name: Fastitocalon
File found at offset 0DA20800-0DA35798  name: Gesper
File found at offset 0DA35800-0DA4BC88  name: Creeps
File found at offset 0DA4C000-0DA6EEA4  name: Hexadragon
File found at offset 0DA6F000-0DA87AB0  name: Blood Soul
File found at offset 0DA88000-0DAA2B9C  name: Elastoid
File found at offset 0DAA3000-0DABD288  name: Armadodo
File found at offset 0DABD800-0DACD4F4  name: Bite Bug
File found at offset 0DACD800-0DAE39F0  name: Jelleye
File found at offset 0DAE4000-0DB0A014  name: Tri-Point
File found at offset 0DB0A800-0DB1C06C  name: Turtapod
File found at offset 0DB1C800-0DB344A0  name: Wendigo
File found at offset 0DB34800-0DB4B854  name: Gayla
File found at offset 0DB4C000-0DB77214  name: Gerogero
File found at offset 0DB77800-0DB98E8C  name: Death Claw
File found at offset 0DB99000-0DBB9B4C  name: Tri-Face
File found at offset 0DBBA000-0DBD768C  name: Grand Mantis
File found at offset 0DBD7800-0DBF45A0  name: Krysta
File found at offset 0DBF4800-0DC0435C  name: Lefty
File found at offset 0DC04800-0DC14AF4  name: Righty
File found at offset 0DC15000-0DC3C4EC  name: Blue Dragon
File found at offset 0DC3C800-0DC5A554  name: Forbidden
File found at offset 0DC5A800-0DC6CC8C  name: Bomb
File found at offset 0DC6D000-0DC95B4C  name: Abyss Worm
File found at offset 0DC96000-0DCBDAA0  name: Ochu
File found at offset 0DCBE000-0DCD9940  name: Adamantoise
File found at offset 0DCDA000-0DD01254  name: Chimera
File found at offset 0DD01800-0DD1E3D8  name: Malboro
File found at offset 0DD1E800-0DD4125C  name: Iron Giant
File found at offset 0DD41800-0DD63CD0  name: Behemoth
File found at offset 0DD64000-0DD85374  name: T-Rexaur
File found at offset 0DD85800-0DDADD98  name: Ruby Dragon
File found at offset 0DDAE000-0DDCA7A8  name: Grendel
File found at offset 0DDCA800-0DDD8BF8  name: Vysage
File found at offset 0DDD9000-0DDE4E40  name: Cactuar
File found at offset 0DDE5000-0DDFE318  name: Tonberry
File found at offset 0DDFE800-0DE1D640  name: Torama
File found at offset 0DE1D800-0DE33318  name: Funguar
File found at offset 0DE33800-0DE4B81C  name: Imp
File found at offset 0DE4C000-0DE5EE94  name: PuPu
File found at offset 0DE5F000-0DE7D0D4  name: Ifrit
File found at offset 0DE7D800-0DE97988  name: Minotaur
File found at offset 0DE98000-0DEB1554  name: Sacred
File found at offset 0DEB1800-0DEC46A0  name: Base Leader
File found at offset 0DEC4800-0DEEBEE0  name: Cerberus
File found at offset 0DEEC000-0DF1947C  name: Diablos
File found at offset 0DF19800-0DF48A38  name: Bahamut
File found at offset 0DF49000-0DF58DA8  name: NORG Pod
File found at offset 0DF59000-0DF60380  name: Garden Faculty
File found at offset 0DF60800-0DF92714  name: Odin
File found at offset 0DF92800-0DF9EC38  name: G-Soldier
File found at offset 0DF9F000-0DFB1EA8  name: Elite Soldier
File found at offset 0DFB2000-0DFBE5F8  name: Wedge
File found at offset 0DFBE800-0DFD1654  name: Biggs
File found at offset 0DFD1800-0DFEB498  name: Fake President
File found at offset 0DFEB800-0DFF7C0C  name: Guard
File found at offset 0DFF8000-0E017ED4  name: NORG
File found at offset 0E018000-0E028AFC  name: Esthar Soldier
File found at offset 0E029000-0E040600  name: Esthar Soldier
File found at offset 0E040800-0E0451FC  name: Right Orb
File found at offset 0E045800-0E04A1FC  name: Left Orb
File found at offset 0E04A800-0E053840  name: Gunblade
File found at offset 0E054000-0E079BB8  name: Tonberry King
File found at offset 0E07A000-0E09701C  name: Jumbo Cactuar
File found at offset 0E097800-0E0AA13C  name: Seifer
File found at offset 0E0AA800-0E0BDE08  name: Seifer
File found at offset 0E0BE000-0E0CFD90  name: Seifer
File found at offset 0E0D0000-0E0EB4EC  name: Edea
File found at offset 0E0EB800-0E11BF60  name: Propagator
File found at offset 0E11C000-0E15B740  name: Ultima Weapon
File found at offset 0E15B800-0E18C640  name: Elvoret
File found at offset 0E18C800-0E1B8DB8  name: X-ATM092
File found at offset 0E1B9000-0E1D5170  name: Iguion
File found at offset 0E1D5800-0E1FED24  name: Gargantua
File found at offset 0E1FF000-0E226DA4  name: Granaldo
File found at offset 0E227000-0E23CF9C  name: Raldo
File found at offset 0E23D000-0E26D760  name: Propagator
File found at offset 0E26D800-0E29DF60  name: Propagator
File found at offset 0E29E000-0E2C2F7C  name: Oilboyle
File found at offset 0E2C3000-0E2DDEDC  name: Edea
File found at offset 0E2DE000-0E30D290  name: BGH251F2
File found at offset 0E30D800-0E339370  name: BGH251F2
File found at offset 0E339800-0E368254  name: Abadon
File found at offset 0E368800-0E37828C  name: Abadon
File found at offset 0E378800-0E394390  name: Mobile Type 8
File found at offset 0E394800-0E3A17EC  name: Left Probe
File found at offset 0E3A1800-0E3AE89C  name: Right Probe
File found at offset 0E3AF000-0E3BB414  name: Paratrooper
File found at offset 0E3BB800-0E3DE438  name: Trauma
File found at offset 0E3DE800-0E3F1354  name: Droma
File found at offset 0E3F1800-0E421F60  name: Propagator
File found at offset 0E422000-0E45A9A0  name: Adel
File found at offset 0E45B000-0E46507C  name: Rinoa
File found at offset 0E465800-0E4AA080  name: Omega Weapon
File found at offset 0E4AA800-0E4C84A8  name: "Sorceress"
File found at offset 0E4C8800-0E4EC00C  name: "Sorceress"
File found at offset 0E4EC800-0E528890  name: "Sorceress"
File found at offset 0E529000-0E5389E8  name: UFO?
File found at offset 0E539000-0E54E510  name: Fujin
File found at offset 0E54E800-0E567580  name: Raijin
File found at offset 0E567800-0E5A2430  name: Ultimecia
File found at offset 0E5A2800-0E5E36D8  name: Griever
File found at offset 0E5E3800-0E5E83E0  name: 
File found at offset 0E5E8800-0E62D700  name: Ultimecia
File found at offset 0E62D800-0E632470  name: Helix
File found at offset 0E632800-0E67624C  name: Ultimecia
File found at offset 0E676000-0E676008, parts: 0
File found at offset 0E676800-0E6769CC, parts: 2
File found at offset 0E677000-0E68CDA0  name: Seifer
File found at offset 0E68D000-0E69DBA4  name: Slapper
File found at offset 0E69E000-0E6C367C  name: Red Giant
File found at offset 0E6C3800-0E6F4CF8  name: Elnoyle
File found at offset 0E6F5000-0E726B88  name: Tiamat
File found at offset 0E727000-0E74B574  name: Catoblepas
File found at offset 0E74B800-0E757CCC  name: Wedge
File found at offset 0E758000-0E76ACF4  name: Biggs
File found at offset 0E76B000-0E78046C  name: Fujin
File found at offset 0E780800-0E799650  name: Raijin
File found at offset 0E799800-0E7AEE4C  name: UFO?
File found at offset 0E7AF000-0E7C4FE0  name: UFO?
File found at offset 0E7C5000-0E7DAC00  name: UFO?
File found at offset 0E7DB000-0E7EF8A0  name: UFO?
File found at offset 0E7F0000-0E7F9190  name: Gunblade
File found at offset 0E7F9800-0E805C6C  name: Base Soldier
File found at offset 0E806000-0E8195B4, parts: 7
File found at offset 0E819800-0E82CC40, parts: 7
File found at offset 0E82D000-0E8362FC, parts: 8
File found at offset 0E836800-0E83FD8C, parts: 8
File found at offset 0E840000-0E849BE8, parts: 8
File found at offset 0E84A000-0E853E78, parts: 8
File found at offset 0E854000-0E85DC18, parts: 8
File found at offset 0E85E000-0E867EA8, parts: 8
File found at offset 0E868000-0E871B34, parts: 8
File found at offset 0E872000-0E8860A8, parts: 7
File found at offset 0E886800-0E89A740, parts: 7
File found at offset 0E89A800-0E8A29EC, parts: 5
File found at offset 0E8A3000-0E8AB1EC, parts: 5
File found at offset 0E8AB800-0E8B39EC, parts: 5
File found at offset 0E8B4000-0E8BC1EC, parts: 5
File found at offset 0E8BC800-0E8D2468, parts: 7
File found at offset 0E8D2800-0E8DAB00, parts: 8
File found at offset 0E8DB000-0E8E36D0, parts: 8
File found at offset 0E8E3800-0E8EBF38, parts: 8
File found at offset 0E8EC000-0E8F46CC, parts: 8
File found at offset 0E8F4800-0E908B6C, parts: 7
File found at offset 0E909000-0E913058, parts: 8
File found at offset 0E913800-0E91D968, parts: 8
File found at offset 0E91E000-0E928138, parts: 8
File found at offset 0E928800-0E932908, parts: 8
File found at offset 0E933000-0E948E04, parts: 7
File found at offset 0E949000-0E9518B0, parts: 8
File found at offset 0E952000-0E95A9A8, parts: 8
File found at offset 0E95B000-0E9639E4, parts: 8
File found at offset 0E964000-0E96C9D0, parts: 8
File found at offset 0E96D000-0E9759E0, parts: 8
File found at offset 0E976000-0E98900C, parts: 7
File found at offset 0E989800-0E99C724, parts: 7
File found at offset 0E99C800-0E9A7790, parts: 8
File found at offset 0E9A7800-0E9B29AC, parts: 8
File found at offset 0E9B3000-0E9BE120, parts: 8
File found at offset 0E9BE800-0E9C9974, parts: 8
File found at offset 0E9CA000-0E9DF6F0, parts: 7
File found at offset 0E9DF800-0E9E85B8, parts: 8
File found at offset 0E9E8800-0EA05EE0, parts: 10
File found at offset 0EA06000-0EA1AD88, parts: 7
File found at offset 0EA1B000-0EA2FF74, parts: 7
File found at offset 0EA30000-0EA389EC, parts: 8
File found at offset 0EA39000-0EA4EF94, parts: 7
File found at offset 0EA4F000-0EA6509C, parts: 7
File found at offset 0EA65800-0EA6D2EC, parts: 5
File found at offset 0EA6D800-0EA82378, parts: 7
File found at offset 0EA82800-0EA972C0, parts: 7
File found at offset 0EA97800-0EAA04DC, parts: 8
File found at offset 0EC00000-0EC213C8, parts: 2
File found at offset 0ECAC800-0ECBB4AC, parts: 4
File found at offset 0EE5B800-0EE60890, parts: 4
File found at offset 0EEDB000-0EEE53C0, parts: 4
File found at offset 0F01B800-0F0297A8, parts: 4
File found at offset 0F074000-0F087730, parts: 4
File found at offset 0F0C8800-0F0D6414, parts: 4
File found at offset 0F5AD800-0F5BE304, parts: 4
File found at offset 0F665800-0F678348, parts: 4
File found at offset 0F6BA800-0F6CAB00, parts: 4
File found at offset 0F75B800-0F76FEE0, parts: 4
File found at offset 0F7A9800-0F7ACB1C, parts: 4
File found at offset 0F7C6800-0F7CDFE0, parts: 4
File found at offset 0F7F7000-0F7F879C, parts: 4
File found at offset 0F805000-0F8115A0, parts: 4
File found at offset 0FA5C800-0FA8484C, parts: 8
Found 143 Monster models.
Found 67 Unknown models.

181
Scripting and Reverse Engineering / Re: AKAO Wiki
« on: 2007-09-21 23:04:28 »
I'd help but I don't really have a clue about sound...not enough to reverse engineer a sound format anyhow.

182
Scripting and Reverse Engineering / Re: FF8 Field Models
« on: 2007-09-17 00:00:26 »
sure, I'll give you the information when I get back home in a few days (I'm at Bristol atm looking for a job for when I go back to uni in October). Do you want me to mod the program to output offsets or just give you a list of the offsets in my FF8 version (PAL)?
Only thing is that the offsets might be region specific. I tried using your FF8 extractor and it extracted a few 64 byte files and then crashed, said "the runtime requested that this application be terminated in an unusual way" or something like that.
atm I'm only on my "craptop" as I like to call it and I don't really have access to anything except the internet lol.
Just let me know if I can help in any other way with finishing your extractor :).

183
Scripting and Reverse Engineering / Re: FF8 Field Models
« on: 2007-09-14 23:24:38 »
well I've extracted the majority of the PSX battle models (143 of them), I'll put a link to a copy of the extractor in this post when I get around to it.
every single section of the data is identical, even the order of the models is the same, only difference I could find is that the pc version has extra copies of the dummy model.
The extra 304 bytes was from when I was searching though a .iso file, so it was probably just sector information or something.

EDIT:
http://bin.mypage.sk/FILES/PSX%20Dat%20Reader.exe

output directory is specified in the command line, same drill as before with the formatting, I think the directory might have to exist aswell.
You will also need c:\ff8disc1.img - just copy it from FF8 disc 1.

same but for mch files (field models):
http://bin.mypage.sk/FILES/PSX%20Mch%20Reader.exe

only does 47 of them atm though

184
Scripting and Reverse Engineering / Re: FF8 Field Models
« on: 2007-09-14 10:31:47 »
I could probably extract the psx data with a few changes, I know roughly where the data is because I can search for the name in the monster info section, the monster info section in the PSX ver has an extra 304 bytes but that's easy enough to compensate for. I'll see what I can do about extracting the PSX data :P.
I'll see what I can do :)

185
Scripting and Reverse Engineering / Re: FF8 Field Models
« on: 2007-09-13 15:54:08 »
http://bin.mypage.sk/FILES/dat%20reader.exe

don't blame me if it's buggy :P
USAGE:

it's a command line program, you specify the path to a directory with lots of .dat files in it in the argument and it must have a "\" at the end (otherwise it crashes :P)
eg. C:\battle\
and the path can't have any spaces or quotes around it.

symbols that can't be displayed in the folder name are replaced with a $ sign ie. the ? in UFO? and the "s in "Sorceress"

the program will create a data folder in the folder you specified and nicely organises all the file parts for you :).

to get all the .dat files in the first place, use mirex's unmass to extract them all, they're in the battle.fi file.

186
Scripting and Reverse Engineering / Re: FF8 Field Models
« on: 2007-09-12 22:52:31 »
ok, nothing new so far on the field model front because I've not had much time lately, that and I've been looking a bit at the battle models recently.

I've managed to find the vertex count, and all the UV coords in the geometry section, now all I've got to do is sort out the remaining data (shouldn't be too hard since there isn't that much of it left now and I have a pretty good idea of what's what, though I haven't tried rendering anything yet)

The verticies appear to be sets of 3 shorts though I don't know exactly when the vertex data starts and ends due to there being some other values around it.
the other 2 sections of the geometry appear to be as follows:

struct unk16 { //triangles
   short verts[3];
   short UVcoord;
   short UVcoord1;
   short unk;
   short UVcoord2;
   short unk1; //AA00, AB00
}

struct unk20 { //quads
   short UVcoord;
   short UVcoord1;
   short verts[4];
   short UVcoord2;
   short unk;
   short UVcoord3;
   short unk1; //AA00, AB00
}

kinda weird way to store the data if you ask me =\. The first vertex in each set appears to be indexed at 0x8000.

the monster info section decyphered so far:

struct Item {
   BYTE id;
   BYTE amount;
};

struct Action {
   BYTE type; //??? 0x02 = generic magic
   BYTE animscript; //???
   BYTE id; //???
   BYTE unk;
};

struct MonsterInfo {
   char name[24]; //FF8 encoded - length might be less than this

   BYTE HP[4]; //HP = (HP[0]*x*x)/20 + (HP[0] + 100*HP[2])*x + 10*HP[1] + 1000*HP[3], where x = monster lvl
   BYTE unk0[24];

   Action RosterL[16];
   Action RosterM[16];
   Action RosterH[16];

   BYTE Unk1[4];

   BYTE Card[3]; //1st Byte = Card Drop, 2nd Byte = Carded into, 3rd Byte = Rarely Carded into, 0xFF = no drop/can't card
   BYTE Devour[3]; //Low, Med and High lvl Devour effect id's

   BYTE unk2[6];

   USHORT LowLvlDraw[4];
   USHORT MedLvlDraw[4];
   USHORT HighLvlDraw[4];

   Item LowLvlMug[2];
   Item LowLvlRMug[2];
   Item MedLvlMug[2];
   Item MedLvlRMug[2];
   Item HighLvlMug[2];
   Item HighLvlRMug[2];

   Item LowLvlDrop[2];
   Item LowLvlRDrop[2];
   Item MedLvlDrop[2];
   Item MedLvlRDrop[2];
   Item HighLvlDrop[2];
   Item HighLvlRDrop[2];

   BYTE unk3[20];

   BYTE ElemRes[8]; //These are how resistant the monster is to each element 0 = very weak
               //0 - Fire
               //1 - Ice
               //2 - Thunder
               //3 - Earth
               //4 - Poison
               //5 - Wind
               //6 - Water
               //7 - Holy
   BYTE StatusRes[20]; //Status resistances 0xFF = immune
               //0 - Death
               //1 - Poison
               //2 - Petrify
               //3 - Darkness
               //4 - Silence
               //5 - Beserk
               //6 - Zombie
               //7 - Sleep
               //8 - Haste
               //9 - Slow
               //10 - Stop
               //11 - Regen
               //12 - Reflect
               //13 - Doom (red timer) - command/doomtrain
               //14 - Slow Petrify? (white timer) - cast using doomtrain
               //15 - Float
               //16 - Confuse
               //17 - Drain
               //18 - ???
               //19 - ???
};


I'm getting there slowly :)

oh, I also made a quick proggy that splits the dat files up into the different sections into folders with the filename and the monster name in brackets. I might release it if anyone is interested but I wont bother otherwise because I can't be arsed :P.

I noticed 2 enemies called "Gunblade" c0m082.dat and c0m142.dat, there's dialogue in the latter that goes something like this:

Zell "...the hell is this!?"
Squall "What the...?"
Selphie "Ewww!  Nasty!"

EDIT: just realised it's the same text as when you face Gerogero

It'd be interesting to battle this thing but I don't have anything to replace files in .fi archives :( (I used unmass to extract them).

How did you get that model Lucleonhart?

187
you only need the update.rar file and that link works, the borland libraries it asks for can easily be found on google

188
Scripting and Reverse Engineering / Re: PSX FF VII
« on: 2007-09-01 18:34:35 »
it's not just that, it's because the PSX stores the data in sectors rather than files, so it's a lot harder to modify the data. I remember reading a topic about a week or so back in the game tweaking section asking the exact same thing.

EDIT: http://forums.qhimm.com/index.php?topic=6386.0
         http://forums.qhimm.com/index.php?topic=6367.0
         http://forums.qhimm.com/index.php?topic=6408.0
         http://forums.qhimm.com/index.php?topic=6591.0

a little bit of digging goes a long way :P
use the search button next time ;)

189
Q-Gears / Re: Halkun can't be "The Leader Guy" anymore....
« on: 2007-08-24 15:27:22 »
It's a shame to see you go halkun but good luck with your software development :).
Heh, I doubt I'll be applying, I couldn't even organise my room let along a massive project lol.
How is the new leader going to be decided, are you going to pick yourself halkun, or are you going to put it down to voting?

190
Scripting and Reverse Engineering / Re: FF8 Field Models
« on: 2007-08-24 14:07:43 »
yer, I've read most of them already, thx for the help though anyway.
I'm also looking at the battle models (.dats), what do you know about the format of those mirex?
I've managed to decypher roughly what each of the sections are but I haven't yet managed to decypher the geometry, it looks like it's split into 3 sections each with different size structures, one looks like it might be 6 bytes, the second structure looks like 16 bytes and the third looks like 20 bytes. I'm not able to figure out how to know when one type of structure ends and the other begins since I haven't been able to find any counts, all I know is that there appears to be some 0x00's between the first type of structure and the second, I'll probably have a better look in a couple of days.
what I think the file structure is atm (correct me if I'm wrong):

1: Bones
2: Geometry
3: Animation?
4: Unknown (was empty on the models I looked at)
5: no idea
6: Bone-vertex links?
7: Monster Info
8: Looks like a script for the monster moves etc. (I saw some text in there that appears in battle)
9: Sound/music data? (contains "AKAO")
10: Sound/music data? (contains "AKAO")
11: Texture

in the geometry section, I'm guessing the 1st section is verticies and the 2nd and 3rd are to do with triangles/quads. The problem I'm having is that only 2 of the items in the 2nd stucture appear to be vertex references (shorts) and 3 in the 3rd structure, which leaves me puzzled as to how it's structured. I'm also clueless as to what the "AA00" or "AB00" short means, so in less I find some more clues, I'm pretty unlikely to decrypt the data anytime soon. It's kinda a waste to spend time on something that's already been decrypted by other people though =\.
I'm trying to decypher as much data as I can because I'm looking into possibly making a converter (depending on public opinion probably) and possibly helping put FF8 support into Q-Gears, since FF8 has long been one of my favourite FF games (and the first one I ever owned).

EDIT: I've managed to obtain a copy of the FF8 battle model viewer, although this may help somewhat (face counts, vertex counts, animation data and skeleton structure), it's still not quite as good as a file desciption =\

191
Scripting and Reverse Engineering / Re: FF8 Field Models
« on: 2007-08-23 17:10:00 »
sure:




the renders were made in 3ds max, as you can see there are a few obscurities like the hands being upside-down and squall being anorexic but it's workable. I have a hunch that the arms are messed up because the hands are supposed to be up in the air in the base pose, as for the body, I don't have a clue atm. It would be helpful if someone that has worked with the format before could post some more info though.

192
Scripting and Reverse Engineering / FF8 Field Models
« on: 2007-08-22 18:16:20 »
I've been having a few issues extracing the data from the field models. I can find the locations of each section of data, I just think that my interpretation of the data is slightly off.
I've been trying to extract the geometry from the d002.mch file, here are the structures I'm using:

struct vertex {
   short x;
   short y;
   short z;
   short unk;
};

struct TextureMap {
   BYTE u;
   BYTE v;
};

struct face {
   u32 opcode; 0x07060125 = triangle, 0907012d = Quad
   BYTE unk[8];
   u16 verticies[4]; //vertex id's
   u16 verticies1[4]; //Edge data???
   u32 Vertex_Colours[4];
    TextureMap TextureData[4]; //haven't tested yet
    u32 Padding[3];
   //64 bytes
};

my understanding of the skeleton is such that I've managed to work out how all the bones fit together and the various lengths and I know that all the vertex offsets are relative to the bones that they are linked with. I can tell that most of what I've extracted seems to be alright since I have a (mostly) intact head of squall and body.

EDIT 1: I've fixed the missing polys issue, it was to do with importing the quads wrong and due to this I've also managed to fix the normals issue just by flipping all the
normals.

The issues that I'm having:
      FIXED: I've had trouble with the normals, so I've just duplicated all the polygons with the opposite normals for now.
      FIXED: There appear to be some polygons missing, like a few triangles of the head and body. (I'll upload a screenshot when I find somewhere to upload it)
      The arms and legs appear disjointed and there's a large gap between the body and the arms (I'm guessing this is mostly due to the arrangement of the skeleton  and the orientation of the various limbs). I've managed to reduce the deformation somewhat but it's still slightly messed up.

EDIT: I managed to get the textures working now, although I had to manually scale and flip the coords.

Does anyone with a better understanding of the format have a clue what's going wrong?

193
here's the structure for the monster info section (section 7 of the .dat files) - well... what I managed to decypher before my hd packed in anyway =\:

typedef unsigned __int16 USHORT;
typedef unsigned __int32 ULONG;
typedef unsigned char BYTE;

struct Item {
   BYTE id;
   BYTE amount;
};

struct UnkStat {
   BYTE stats[64];
};

struct MonsterInfo {
   char name[24]; //FF8 encoded - length might be less than this

   BYTE unk0[28];

   UnkStat Stats[3];

   BYTE Unk1[4];

   BYTE Card[3]; //1st Byte = Card Drop, 2nd Byte = Carded into, 3rd Byte = Rarely Carded into, 0xFF = no drop/can't card
   BYTE Devour[3]; //Low, Med and High lvl Devour effect id's, 0xFF = can't devour

   BYTE unk2[6];

   USHORT LowLvlDraw[4];
   USHORT MedLvlDraw[4];
   USHORT HighLvlDraw[4];

   Item LowLvlMug[2];
   Item LowLvlRMug[2];
   Item MedLvlMug[2];
   Item MedLvlRMug[2];
   Item HighLvlMug[2];
   Item HighLvlRMug[2];

   Item LowLvlDrop[2];
   Item LowLvlRDrop[2];
   Item MedLvlDrop[2];
   Item MedLvlRDrop[2];
   Item HighLvlDrop[2];
   Item HighLvlRDrop[2];

   BYTE unk3[20];

   BYTE ElemRes[8]; //These are how resistant the monster is to each element 0 = very weak
               //0 - Fire
               //1 - Ice
               //2 - Thunder
               //3 - Earth
               //4 - Poison
               //5 - Wind
               //6 - Water
               //7 - Holy
   BYTE StatusRes[20]; //Status resistances 0xFF = immune
               //0 - Death
               //1 - Poison
               //2 - Petrify
               //3 - Darkness
               //4 - Silence
               //5 - Beserk
               //6 - Zombie
               //7 - Sleep
               //8 - Haste
               //9 - Slow
               //10 - Stop
               //11 - Regen
               //12 - Reflect
               //13 - Doom (red timer) - command/doomtrain
               //14 - Slow Petrify? (white timer) - cast using doomtrain
               //15 - Float
               //16 - Confuse
               //17 - Drain
               //18 - ???
               //19 - ???
};

I'll get around to finding out more information when I manage to sort my pc out.
Does anyone know the difference between the white timer and the red timer? (note: the red one can't be cured with esuna and the white one can)
I can't think of anything that the last 2 status effects could be, I've tried LV-up/LV-down, protect, shell, double/triple, hero, aura, vit 0 and diablos' atk - basically I'm looking for an atk that sometimes misses on enemies.

194
I thought there seemed a distict lack of information on FF8 compared to FF7, so today I thought I'd tear apart the FF8 battle models.

Using some information from mirex I've been able to make a program that separates a .dat file into it's different parts.
I've just been looking at the 2 simplist sections to start with, these are:
section 7 - monster data, things like the name of the monster, draw magic, devour info, mug, dops etc are stored here - I've managed to decode a fair chunk of this section.
section 8 - this appears to be some sort of battle script, the only thing I've looked at so far in this section is the dialogue that appears near the end of the file, I've deduced that 0x3F is the start of a dialogue box and 0x3E ends it and I've managed to find some codes that place character names instead.

What I was wondering is if anyone has decoded any of the battle script format because it'd be pretty stupid to waste time on something that's already been done.

Pages: 1 ... 3 4 5 6 7 [8]