[PC] Kao the Kangaroo .bin files

Skeletons, animations, shaders, texturing, converting, fixing and anything else related to read game models
Bogus
Posts: 8
Joined: Mon Jun 25, 2018 6:40 pm

[PC] Kao the Kangaroo .bin files

Post by Bogus »

Hello all, i'm new here.
Does anyone know how to import models from Kao the Kangaroo?
Maybe DGlorio?
Here is link to demo:
http://download.gamesurf.tiscali.it/demo/kao_demo.zip
and Blender script, some specification:

Code: Select all

import Blender
import struct

def load_bin(filename):

   scn = Blender.Scene.GetCurrent()
   if scn == None:
      return "No scene to import to!"

   file = open(filename, 'rb')

   scn.objects.selected = []
   mesh = Blender.Mesh.New("name")
   meshOb = scn.objects.new(mesh)

   file.seek(12,0)

   numobjects = struct.unpack('L', file.read(4))[0]

   file.seek(16,0)

   numFaces = struct.unpack('L', file.read(4))[0]

   file.seek(76,0)

   numVerts = struct.unpack('L', file.read(4))[0]

   file.seek(120,0)

   faces = []
   for i in xrange(numFaces):
      x = struct.unpack('H',file.read(2))[0]
      file.read(2)
      y = struct.unpack('H',file.read(2))[0]
      file.read(2)
      z = struct.unpack('H',file.read(2))[0]
      file.read(2)
      file.read(2)
      file.read(2)
      faces.append([x,y,z])

   verts = []
   for i in xrange(numVerts):
      verts.append(struct.unpack('fff', file.read(3*4)))
      file.read(4)

   mesh.verts.extend(verts)
   mesh.faces.extend(faces)

Blender.Window.FileSelector(load_bin, 'import kao bin', '*.bin')

and script to quickbms for kao.pak:

Code: Select all

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

If Windows is 64-bit, you need to download is3Engine.zip http://toastytech.com/files/Is3Engine.zip, put setup32.exe and launch.
BCGhost
Posts: 35
Joined: Fri Dec 15, 2017 1:42 pm

Re: [PC] Kao the Kangaroo .bin files

Post by BCGhost »

You should have uploaded the pak files instead of expecting people to install the game for your sake.
Bogus
Posts: 8
Joined: Mon Jun 25, 2018 6:40 pm

Re: [PC] Kao the Kangaroo .bin files

Post by Bogus »

ok, i send file
https://www.sendspace.com/file/4f9kvq

3d files are output.bin, T83d header, number of meshes, number of vertices, number of faces, number of frames etc
Anexenaumoon
Posts: 119
Joined: Sun Dec 27, 2015 10:22 pm

Re: [PC] Kao the Kangaroo .bin files

Post by Anexenaumoon »

Ironically enough, I was just looking at this format the other day... Glad someone got to it!!! However, I don't think this supports UV-coordinates at all
Bogus
Posts: 8
Joined: Mon Jun 25, 2018 6:40 pm

Re: [PC] Kao the Kangaroo .bin files

Post by Bogus »

Is kao_tools.exe on xentax forum, only animation not convert, convert .bin file to .obj, but latest version crash, even with xp compatibility mode, this model supports UV mapping, in this models are numbers of objects, numbers of faces, numbers of motions for animation, next onknown values some commands?
0x4c offset, for each object, numbers of vertices, unknown values maybe group number, object name 32 bytes, unknown values 4 bytes, next faces data, vertices data, next unknown values, next animation data, next maybe UV mapping data.
I write import script for noesis, but is not easy, because null bytes are in each vertices and faces.
edit:
Mistake, i discovered, that faces are on end of file with UV mapping, before vertices i not know what is this.
edit2:
On begin file are faces with unknown values before vertices, on end of file are faces with UV mapping in groups.