The Forum is up for sale: XeNTaX Forum looking for new owner

Kimi ga Yobu, Megiddo no Oka de

Post questions about game models here, or help out others!
Post Reply
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Kimi ga Yobu, Megiddo no Oka de

Post by finale00 »

http://www.youtube.com/watch?v=yzknvTocakI

lol kind of cute, and since I had this game ever since it came out (C74..which is like 6-7 years ago) and just found an extractor (although I wanted to write a bms script myself).

Models aren't particularly high-quality, but whatever :D
You do not have the required permissions to view the files attached to this post.
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1411 times

Re: Kimi ga Yobu, Megiddo no Oka de

Post by chrrox »

quickbms script.

Code: Select all

#Kimi ga Yobu, Megiddo no Oka de
#script by chrrox
get temp long
get files long
savepos tbl
comtype PUYO_LZ01
for i = 0 < files
goto tbl
savepos nstart
findloc NameEnd string "\x0"
math NameEnd - nstart
filexor "0xff"
getdstring name NameEnd
filexor ""
set skip 31
math skip - NameEnd
getdstring null skip
get comp byte
get zsize long
math zsize - 4
get offset long
savepos tbl
goto offset
get size long
savepos offset
clog name offset zsize size
next i
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Kimi ga Yobu, Megiddo no Oka de

Post by finale00 »

Hmm how did you figure out the compression type?
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1411 times

Re: Kimi ga Yobu, Megiddo no Oka de

Post by chrrox »

well i had the extractor source code of asmodean but that was not even really needed.
all i did was find the zipped size and the size then use the compscan2.bat to try all the compressions then look at the files that it spit out to find the correct one.
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Kimi ga Yobu, Megiddo no Oka de

Post by finale00 »

Here is a rough outline of the format. I've identified the vertices, but the faces are still unknown and especially models with multiple meshes are weird.

Here's an outline of a tree

Image

Code: Select all

#for mesh type 0x01 only. Other type found: 0x81

char_3 idstring
byte meshType
word unk
word numMesh
word sectionSize

numMesh unk { #lots of unknowns. Total 193 bytes
   float_8 unk
   dword_10 unk
   float unk
   byte unk
   char_40 name
   char_??? texture (maybe)
   #just read bytes till you have 193 for this struct
}

#(seek to sectionSize + 53)

word numCoords
numCoords {
   float_3, vx, vy, vz
}

word numNormals
numNormals {
   float_3, nx, ny, nz
}

word numUV
numUV {
   float_2, tu, tv
}

word unkCount
unkCount {
   float unk
}

#a bunch of floats, followed by faces section
#face indexes coords, normals, and UV, but I haven't figured out the structure for a single face. Maybe material as well, since all mesh names and textures are defined at once.
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Kimi ga Yobu, Megiddo no Oka de

Post by finale00 »

There are only two types of meshes: skinned and unskinned. They are identified by 0x81 and 0x01 respectively.
The outline above correctly loads vertices for all tested unskinned meshes (even large ones like stages)

Four samples with increasing number of vertices, all less than 10 vertices.

Have not found a way to determine how many faces there are.
You do not have the required permissions to view the files attached to this post.
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Kimi ga Yobu, Megiddo no Oka de

Post by finale00 »

Ok so right now I'm going with the assumption that all faces will have the same structure and the same size.

Here is the leftover section that I didn't fill out from before.

Code: Select all

<--continue from previous unk section -->

byte unk
dword_11 unk (nulls?)
float_4 unk
dword_4 unk (nulls?)
word unk
dword sectionLength (or num shorts)

#then we run into a bunch of shorts.
After messing around with the hex looking for a way to re-arrange them nicely,

Here are two of them I attached before

From the tree_02_bli, 4 coords, 4 normals, 4 UV, 1 unk

Code: Select all

00 00 01 00 02 00 03 00 03 00 00 00 00 00 00 00 00 00 01 00 01 00 00 00 01 00 02 00
02 00 00 00 03 00 03 00 00 00 00 00 00 00 01 00 02 00 02 00 00 00 02 00 03 00 03 00 00 00
monument: 0C coords, 1E normals, 1A UV's, 0D unks

Code: Select all


00 00 01 00 10 00 03 00 08 00 00 00 00 00 00 00 02 00 01 00 01 00 01 00 07 00 02 00
02 00 02 00 03 00 07 00 02 00 02 00 02 00 02 00 01 00 01 00 01 00 01 00 03 00 03 00
03 00 03 00 0B 00 04 00 04 00 04 00 0A 00 05 00 05 00 05 00 04 00 06 00 06 00 06 00
03 00 0A 00 05 00 05 00 05 00 05 00 07 00 07 00 07 00 04 00 06 00 06 00 06 00 03 00
02 00 08 00 08 00 01 00 04 00 09 00 09 00 06 00 05 00 0A 00 0A 00 07 00 03 00 02 00
08 00 08 00 01 00 05 00 0A 00 0A 00 07 00 01 00 0B 00 0B 00 03 00 03 00 00 00 0C 00
0C 00 08 00 03 00 0D 00 0D 00 09 00 02 00 08 00 08 00 01 00 03 00 03 00 0D 00 0D 00
09 00 04 00 09 00 09 00 06 00 02 00 08 00 08 00 01 00 03 00 09 00 0E 00 0E 00 0A 00 
0B 00 0F 00 0F 00 04 00 03 00 10 00 10 00 09 00 03 00 0B 00 0F 00 0F 00 04 00 04 00
11 00 11 00 06 00 03 00 10 00 10 00 09 00 03 00 06 00 12 00 12 00 0B 00 00 00 13 00
13 00 08 00 08 00 14 00 14 00 00 00 03 00 08 00 14 00 14 00 00 00 00 00 13 00 13 00
08 00 02 00 15 00 15 00 01 00 03 00 06 00 12 00 16 00 0B 00 09 00 0E 00 17 00 0A 00
03 00 10 00 18 00 09 00 03 00 06 00 12 00 16 00 0B 00 03 00 10 00 18 00 09 00 00 00
13 00 19 00 08 00 03 00 0A 00 16 00 1A 00 05 00 07 00 17 00 1B 00 02 00 05 00 18 00
1C 00 07 00 03 00 07 00 17 00 1B 00 02 00 01 00 19 00 1D 00 03 00 05 00 18 00 1C 00 00 00
This is assuming that the sectionLength I wrote down is an integer rather than a short (if I considered it a short, it'd have a limit of 65536 shorts, and considering how a single face probably references a bunch of stuff, it may or may not be enough for very large models.

And if it were a short, none of the stuff lines up nicely, so I would stick with this for now.

The extra two 00's at the end I'd probably just chop off, so let's say the integer represents numShorts - 1.

Using the values provided, we can probably look at the maximum index and then use some elimination to guess at what they could be. Presumably they're all triangles so there'd be 9 shorts for coords, normals, and UV, and then another short possibly for that unknown.

But then checking for the location of all the 0B's (max coord index, it shows up in the column that has values greater than it, so perhaps this isn't right.

So then I treat the numShorts as a short, and get

Code: Select all

00 00 00 00 01 00 10 00 03 00 08 00 00 00 00 00 00 00 02 00 01 00 01 00 01 00 07 00
02 00 02 00 02 00 03 00 07 00 02 00 02 00 02 00 02 00 01 00 01 00 01 00 01 00 03 00
03 00 03 00 03 00 0B 00 04 00 04 00 04 00 0A 00 05 00 05 00 05 00 04 00 06 00 06 00
06 00 03 00 0A 00 05 00 05 00 05 00 05 00 07 00 07 00 07 00 04 00 06 00 06 00 06 00
03 00 02 00 08 00 08 00 01 00 04 00 09 00 09 00 06 00 05 00 0A 00 0A 00 07 00 03 00
02 00 08 00 08 00 01 00 05 00 0A 00 0A 00 07 00 01 00 0B 00 0B 00 03 00 03 00 00 00
0C 00 0C 00 08 00 03 00 0D 00 0D 00 09 00 02 00 08 00 08 00 01 00 03 00 03 00 0D 00
0D 00 09 00 04 00 09 00 09 00 06 00 02 00 08 00 08 00 01 00 03 00 09 00 0E 00 0E 00
0A 00 0B 00 0F 00 0F 00 04 00 03 00 10 00 10 00 09 00 03 00 0B 00 0F 00 0F 00 04 00
04 00 11 00 11 00 06 00 03 00 10 00 10 00 09 00 03 00 06 00 12 00 12 00 0B 00 00 00
13 00 13 00 08 00 08 00 14 00 14 00 00 00 03 00 08 00 14 00 14 00 00 00 00 00 13 00
13 00 08 00 02 00 15 00 15 00 01 00 03 00 06 00 12 00 16 00 0B 00 09 00 0E 00 17 00
0A 00 03 00 10 00 18 00 09 00 03 00 06 00 12 00 16 00 0B 00 03 00 10 00 18 00 09 00
00 00 13 00 19 00 08 00 03 00 0A 00 16 00 1A 00 05 00 07 00 17 00 1B 00 02 00 05 00
18 00 1C 00 07 00 03 00 07 00 17 00 1B 00 02 00 01 00 19 00 1D 00 03 00 05 00 18 00 1C 00 
Which still doesn't work out. Could be possible they reference all of the coords, then the normals, then UV's, though unlikely since you can see the same index showing up multiple times (12, 12, 0B)
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Kimi ga Yobu, Megiddo no Oka de

Post by finale00 »

Image

position, normal, uv buffer
n position, normal, uv index buffers all indexing into the above.

Would've been really slow if I used rpg interface for this.
tomatopasta
beginner
Posts: 32
Joined: Thu Aug 16, 2012 7:49 pm
Has thanked: 1 time
Been thanked: 1 time

Re: Kimi ga Yobu, Megiddo no Oka de

Post by tomatopasta »

I had this game too, could I modify the models in the game and then insert the mods back into the games with this tools? There are a numbers of games I would like to mods them but couldnt find appropriate tools. This threads is the closet solutions to my goals.
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Kimi ga Yobu, Megiddo no Oka de

Post by finale00 »

No this is just a viewer and I barely have the format figured out.
Post Reply