XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Mon Jul 23, 2018 7:23 am

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: [request] kao the kangaroo .bin .msh files
PostPosted: Thu Aug 23, 2012 4:05 pm 
Offline
advanced

Joined: Sat Oct 30, 2010 11:57 am
Posts: 75
Has thanked: 1 time
Have thanks: 5 times
hello all
how to import models from kao the kangaroo?
please
i tried find vertex information but don't know where they are
link to a demo:
http://download.exdat.com/file/kao_demo ... 12933.html
you need to click download and enter the code
and script for quickbms to pak file
Code:
get pEOCDR asize
math pEOCDR -= 12
goto pEOCDR

get CDR_NUM long
get CDR_PTR long
idstring "T8FM"   ## assumed magic

goto CDR_PTR

for i = 1 to CDR_NUM

  getdstring R_NAME 80
  get R_POS long
  get R_SIZE long

  log R_NAME R_POS R_SIZE

next i


Top
 Profile  
 
 Post subject: [request] kao the kangaroo .bin .msh files
PostPosted: Mon Sep 03, 2012 11:48 am 
Offline
advanced

Joined: Sat Oct 30, 2010 11:57 am
Posts: 75
Has thanked: 1 time
Have thanks: 5 times
this let me although someone will write where they are vertices
script alone write
please


Top
 Profile  
 
 Post subject: Re: [request] kao the kangaroo .bin .msh files
PostPosted: Fri Sep 07, 2012 12:12 am 
Offline
mega-veteran
mega-veteran

Joined: Sat Jan 09, 2010 9:37 pm
Posts: 190
Has thanked: 8 times
Have thanks: 58 times
Bogus wrote:
this let me although someone will write where they are vertices
script alone write
please


The format is a little strange for the vertexes, what I think is the case is that there is a face index, interspersed with other information at the beginning of the file, followed by the vertexes BUT the vertexes use some types of frames (for animations), so it might be something like every say 40th vertex is a real vertex. Something like that. Like me look more into this. But thank you for the extraction script, which is helping alot.

_________________
I accept ALL requests. Let me know your requests.


Top
 Profile  
 
 Post subject: Re: [request] kao the kangaroo .bin .msh files
PostPosted: Fri Sep 07, 2012 6:56 am 
Offline
advanced

Joined: Sat Oct 30, 2010 11:57 am
Posts: 75
Has thanked: 1 time
Have thanks: 5 times
this not well


Top
 Profile  
 
 Post subject: Re: [request] kao the kangaroo .bin files
PostPosted: Fri Jan 10, 2014 1:52 pm 
Offline
advanced

Joined: Sat Oct 30, 2010 11:57 am
Posts: 75
Has thanked: 1 time
Have thanks: 5 times
to facilitate I give here link to this models
http://www.sendspace.com/file/bfbbxf


Top
 Profile  
 
 Post subject: Re: [request] kao the kangaroo .bin files
PostPosted: Fri Jan 17, 2014 2:34 pm 
Offline
advanced

Joined: Sat Oct 30, 2010 11:57 am
Posts: 75
Has thanked: 1 time
Have thanks: 5 times
if anyone me help?
please


Top
 Profile  
 
 Post subject: Re: [request] kao the kangaroo .bin .msh files
PostPosted: Sat Jan 18, 2014 10:35 am 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran
User avatar

Joined: Fri Apr 20, 2012 9:24 am
Posts: 2314
Location: Nexus, searching for Jim Kirk
Has thanked: 526 times
Have thanks: 1201 times
why don't you use your own creative power?
try
Code:
   print numVerts,'vertices at ', hex(file.tell())
   for i in xrange(numVerts):     
      verts.append(struct.unpack('fff', file.read(3*4)))
      file.read(4)
      file.read(64)
on angel output.bin - it's not the solution but it's a progress.

Also then why don't you upload your python script? (it's yours, isn't it?)

_________________
"you can't always get things served on a silver tray"
extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip

"We are Microsoft. You will be assimilated. Resistance is Futile."


Top
 Profile  
 
 Post subject: Re: [request] kao the kangaroo .bin .msh files
PostPosted: Mon Jul 02, 2018 6:54 pm 
Offline
advanced

Joined: Sat Oct 30, 2010 11:57 am
Posts: 75
Has thanked: 1 time
Have thanks: 5 times
ok here is result
I had to print output to a file because not was can be seen was cut

744 vertices at 0x5644L


Top
 Profile  
 
 Post subject: Re: [request] kao the kangaroo .bin .msh files
PostPosted: Mon Jul 02, 2018 6:56 pm 
Offline
advanced

Joined: Sat Oct 30, 2010 11:57 am
Posts: 75
Has thanked: 1 time
Have thanks: 5 times
edit:
New link to kao.pak file from demo version.

https://www.sendspace.com/file/4f9kvq

Script for quickbms in first post.

I write a script for noesis, only I do not know how to skip unknown values with a faces at the beginning of the file, with vertices are null bytes.
Code:
from inc_noesis import *
import noesis
import rapi

def registerNoesisTypes():
    handle = noesis.register("Kao the Kangaroo", ".bin")
    noesis.setHandlerTypeCheck(handle, noepyCheckType)
    noesis.setHandlerLoadModel(handle, noepyLoadModel)
    return 1

def noepyCheckType(data):
    bs = NoeBitStream(data)
    Header = bs.readBytes(4)
    if Header != b'T83d':
        return 0
    return 1

def noepyLoadModel(data, mdlList):
    noesis.logPopup()
    ctx = rapi.rpgCreateContext()
    bs = NoeBitStream(data)
    bs.seek(0x0C, NOESEEK_ABS)
    nummeshes = bs.readInt()
    print("number of meshes", nummeshes)
    numfaces = bs.readInt()
    print("number of faces", numfaces)
    numanims = bs.readInt()
    print("number of animations", numanims)
    bs.seek(0x4C, NOESEEK_ABS)

    for i in range (0, nummeshes):
        numverts = bs.readInt()
        print("number of vertices", numverts)
        unknown = bs.readInt()
        meshname= (bs.readBytes(32).decode("ASCII").rstrip("\0"))
        print(meshname)
        unknown2 = bs.readInt()

    rapi.rpgClearBufferBinds()
    return 1


Top
 Profile  
 
 Post subject: Re: [request] kao the kangaroo .bin .msh files
PostPosted: Mon Jul 02, 2018 11:10 pm 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran
User avatar

Joined: Fri Apr 20, 2012 9:24 am
Posts: 2314
Location: Nexus, searching for Jim Kirk
Has thanked: 526 times
Have thanks: 1201 times
well, Bogus, you don't give up, I really like that. :)

For your Noesis script, dunno whether the vertex counts you get in the for loop are correct (often it's 3 only).
In general I'd say it doesn't make much sense to care for meshes here as long as you don't have the correct counts.

From the output.bin it seem they have different FVF sizes (angel, FVF size=80, iirc).
For the eskimo and the snowman it seems to be 16. As soon as you found the correct FVF size you can identify the vertex block length and divide it by the FVF size to get the vertex count (for that block).

The problem is the FIs (face indices). It's triangle strips (with bytes to skip) but dunno whether I got them correctly.

edit: well, seems I confused myself with tristrips, because the culling showed a decent mesh. Of course, it's standard triangles [roll] , and the snowman looks much better then.

The "Eskimo" looks rather weird. For the snowman it seems I'm on the right track (toggled face culling in Noesis).



btw: no, you can't get this with hex2obj directly, I had to manipulate the FIs block in the output.bin files


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.


_________________
"you can't always get things served on a silver tray"
extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip

"We are Microsoft. You will be assimilated. Resistance is Futile."


Last edited by shakotay2 on Tue Jul 03, 2018 9:39 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: [request] kao the kangaroo .bin .msh files
PostPosted: Tue Jul 03, 2018 12:14 am 
Offline
advanced

Joined: Sat Oct 30, 2010 11:57 am
Posts: 75
Has thanked: 1 time
Have thanks: 5 times
What is FVF?
This look wrong, you can use kao_tools.exe made by Flower35 Radek krzyskow.
http://www.mediafire.com/file/cimodczub ... _tools.exe
or denis editor, also made by Flower35
http://www.mediafire.com/file/834zhti26 ... Wizard.zip
With this tools models looks better.
How to implement for loop for vertices?
I have skip null bytes with NOESEEK_REL?
What values are between faces, vertex normals probably no?


Top
 Profile  
 
 Post subject: Re: [request] kao the kangaroo .bin .msh files
PostPosted: Tue Jul 03, 2018 7:28 am 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran
User avatar

Joined: Fri Apr 20, 2012 9:24 am
Posts: 2314
Location: Nexus, searching for Jim Kirk
Has thanked: 526 times
Have thanks: 1201 times
Bogus wrote:
What is FVF?
flexible vertex format
Quote:
This look wrong,
nope, the eskimo is just uncomplete, the snowman is ok, more or less :D

Quote:
With this tools models looks better.
yeah, and Flower35 has spend much time on creating them.
My approach was just a, well, not 15 min, but 90 min job.
Quote:
How to implement for loop for vertices?
to be displayed as a mesh? This is simple, Noesis uses a buffer for such. There's a myriad of py samples where you can see how to do it.
Quote:
I have skip null bytes with NOESEEK_REL?
yep
Quote:
What values are between faces, vertex normals probably no?
dunno. You don't need them (skip)

_________________
"you can't always get things served on a silver tray"
extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip

"We are Microsoft. You will be assimilated. Resistance is Futile."


Top
 Profile  
 
 Post subject: Re: [request] kao the kangaroo .bin .msh files
PostPosted: Tue Jul 03, 2018 4:05 pm 
Offline
advanced

Joined: Sat Oct 30, 2010 11:57 am
Posts: 75
Has thanked: 1 time
Have thanks: 5 times
I not have idea how should look script.
Faces are between unknown values, if the faces were next to each other, would be easier.


Top
 Profile  
 
 Post subject: Re: [request] kao the kangaroo .bin .msh files
PostPosted: Thu Jul 05, 2018 11:03 am 
Offline
ultra-n00b
User avatar

Joined: Mon Sep 08, 2014 7:34 pm
Posts: 6
Location: Polska
Has thanked: 0 time
Have thanks: 9 times
Hi there! :)

"denis Wizard" can display any "Kao the Kangaroo" model with complete list of keyframes. This game uses vertices group animations.

I still haven't completed model or worldmap documentation, but I could post some C++ syntax functions for reading data from files.

If you want to talk more, please visit Kao's Discord server:
https://discord.gg/B33jjUu

Currently I am working on displaying skeletal animations from "Kao the Kangroo: Round 2".

Best regards!


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.



Top
 Profile  
 
 Post subject: Re: [request] kao the kangaroo .bin .msh files
PostPosted: Thu Jul 05, 2018 5:33 pm 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran
User avatar

Joined: Fri Apr 20, 2012 9:24 am
Posts: 2314
Location: Nexus, searching for Jim Kirk
Has thanked: 526 times
Have thanks: 1201 times
Bogus wrote:
I not have idea how should look script.
Faces are between unknown values, if the faces were next to each other, would be easier.
I really don't like python, but here you go (script is for the Kao snowman, and ONLY the snowman):
Code:
from inc_noesis import *
import noesis
import rapi

def registerNoesisTypes():
    handle = noesis.register("Kao-snowman", ".bin")
    noesis.setHandlerTypeCheck(handle, noepyCheckType)
    noesis.setHandlerLoadModel(handle, noepyLoadModel)
    return 1

def noepyCheckType(data):
    bs = NoeBitStream(data)
    idstring = bs.readUInt()
    if idstring != 0x64333854:
        print("not a Kao file!")
        return 0
    return 1

def noepyLoadModel(data, mdlList):   
    ctx = rapi.rpgCreateContext()
    bs = NoeBitStream(data)
    #rapi.rpgClearBufferBinds()
    bs.seek(0xD0, NOESEEK_ABS)
    size = 0x1970 - 0xD0
    idxbuf_tmp = bs.readBytes(size)

    numFaces = size // 16
    print("numFaces", numFaces)
    idxBuf = []
    for i in range(numFaces):
        idx = idxbuf_tmp[i*16] + idxbuf_tmp[i*16 + 1]*256
        idxBuf.append(idx)
        idx = idxbuf_tmp[i*16 + 4] + idxbuf_tmp[i*16 + 5]*256
        idxBuf.append(idx)
        idx = idxbuf_tmp[i*16+ 8] + idxbuf_tmp[i*16 + 9]*256
        idxBuf.append(idx)

    #print(idxBuf)

    bs.seek(0x1970, NOESEEK_ABS)
    vertsCount = 170
    VertBuf = bs.readBytes(vertsCount * 64)
    b = struct.pack('H' * len(idxBuf), *idxBuf)

    rapi.rpgBindPositionBufferOfs(VertBuf, noesis.RPGEODATA_FLOAT, 16, 0)
    rapi.rpgCommitTriangles(b, noesis.RPGEODATA_USHORT, numFaces*3, noesis.RPGEO_TRIANGLE, 1)

    mdl = rapi.rpgConstructModel()
    mdlList.append(mdl)

    return 1
It should give you the idea for other meshes. (You might improve it to automatically read the vertexCount.)
As you can see the snowman looks a little bit weird. It's up to you to improve this, I'm off for now.


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.


_________________
"you can't always get things served on a silver tray"
extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip

"We are Microsoft. You will be assimilated. Resistance is Futile."


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group