Join also our Discord channel! Click here.

.KRV extension in Wii Models?

Post questions about game models here, or help out others!
Lizz
n00b
Posts: 14
Joined: Wed Jun 09, 2010 6:21 pm
Has thanked: 2 times

.KRV extension in Wii Models?

Post by Lizz » Wed Jun 09, 2010 6:26 pm

I am trying to get the models from 'how to train your dragon' and 'alice in wonderland' out of the game, but most of the files are .krv and I have no clue what those do. Can anyone tell me how to get usable 3d models out of those files?

Thanks ;)

FurryFan
mega-veteran
mega-veteran
Posts: 190
Joined: Sat Jan 09, 2010 9:37 pm
Has thanked: 8 times
Been thanked: 62 times

Re: .KRV extension in Wii Models?

Post by FurryFan » Thu Jun 10, 2010 2:31 am

Both of those games were developed by Etranges Libellule, (EDIT) They also use .KP2 (K Playstation 2) files in Spyro: Dawn of the Dragon for the PS2. If they are anything related to those, then each level will have it own KRV (K (Nintendo) Revolution) file(s) which will contain all of the assets for that level. There should be a list of file address offsets near the beginning. Can you upload a file from How to train your dragon, so I can attempt to get models from it
Last edited by FurryFan on Sun Jun 13, 2010 6:49 pm, edited 1 time in total.
I accept ALL requests. Let me know your requests.

Lizz
n00b
Posts: 14
Joined: Wed Jun 09, 2010 6:21 pm
Has thanked: 2 times

Re: .KRV extension in Wii Models?

Post by Lizz » Thu Jun 10, 2010 11:09 am

Thanks for the fast reply ^^ If you manage to get stuff out of it, can you tell me how you did it so I can check the rest as well? ;)

Can't upload those directly into here it seems (they do not like .krv and it is just a tad to big as rar), but you can download it here to see if it works: http://www.mediafire.com/?cj0atzqzw2g

This file comes from 'LVL1' apparently and there are several more of these small files along with a 17 MB one...

FurryFan
mega-veteran
mega-veteran
Posts: 190
Joined: Sat Jan 09, 2010 9:37 pm
Has thanked: 8 times
Been thanked: 62 times

Re: .KRV extension in Wii Models?

Post by FurryFan » Fri Jun 11, 2010 9:09 pm

Lizz wrote:Thanks for the fast reply ^^ If you manage to get stuff out of it, can you tell me how you did it so I can check the rest as well? ;)

Can't upload those directly into here it seems (they do not like .krv and it is just a tad to big as rar), but you can download it here to see if it works: http://www.mediafire.com/?cj0atzqzw2g

This file comes from 'LVL1' apparently and there are several more of these small files along with a 17 MB one...
The file you uploaded is compressed, but it is just a renamed zip file so you can change the extension to .zip and then extract it. This file only has some png textures, probably just the graphics from the title screen judging from the names of the files like tyd0.png
Could you upload the 17MB file as that is most likely to have models in it, or even better a 17MB or larger file from same LVL2 as in some games the first "level" is just a title screen or a cutscene that will not contain any models.
I accept ALL requests. Let me know your requests.

Lizz
n00b
Posts: 14
Joined: Wed Jun 09, 2010 6:21 pm
Has thanked: 2 times

Re: .KRV extension in Wii Models?

Post by Lizz » Sat Jun 12, 2010 1:29 pm

The contents of this post was deleted because of possible forum rules violation.

FurryFan
mega-veteran
mega-veteran
Posts: 190
Joined: Sat Jan 09, 2010 9:37 pm
Has thanked: 8 times
Been thanked: 62 times

Re: .KRV extension in Wii Models?

Post by FurryFan » Sun Jun 13, 2010 7:11 pm

The contents of this post was deleted because of possible forum rules violation.
I accept ALL requests. Let me know your requests.

Lizz
n00b
Posts: 14
Joined: Wed Jun 09, 2010 6:21 pm
Has thanked: 2 times

Re: .KRV extension in Wii Models?

Post by Lizz » Thu Jun 17, 2010 10:37 am

Any luck yet beyond this?

revelation
mega-veteran
mega-veteran
Posts: 183
Joined: Mon May 12, 2008 5:15 pm
Has thanked: 5 times
Been thanked: 85 times

Re: .KRV extension in Wii Models?

Post by revelation » Thu Jun 17, 2010 1:27 pm

None of the links above work for me. i'll see if i can find some, but if you have sample files, i'll take a look.

Lizz
n00b
Posts: 14
Joined: Wed Jun 09, 2010 6:21 pm
Has thanked: 2 times

Re: .KRV extension in Wii Models?

Post by Lizz » Tue Jun 22, 2010 8:49 pm

The contents of this post was deleted because of possible forum rules violation.

Lizz
n00b
Posts: 14
Joined: Wed Jun 09, 2010 6:21 pm
Has thanked: 2 times

Re: .KRV extension in Wii Models?

Post by Lizz » Wed Jul 28, 2010 1:10 pm

Any updates yet on how it goes?

Quetzalcoatil
n00b
Posts: 17
Joined: Sat Oct 02, 2010 3:12 am
Has thanked: 1 time
Been thanked: 1 time

Re: .KRV extension in Wii Models?

Post by Quetzalcoatil » Mon Oct 18, 2010 8:47 pm

Hey FurryFan,

I see you're using blender to load the tri-strips. I'm slightly proficient with python, but I'm not familiar with the loading of tri-strips. Could you post the script you used for that import?
Also, what did you mean by "98 2ByteInteger#Vertexes"? Did you mean there are 98 uint16 index values or the byte '0x98' followed by a uint16 'number of vertices' ?

Here's the very broken script I'm using to (try and) locate the vertex data. Basically I'm using HexEdit to find a candidate for some float3's, then skipping ahead in the file with a skip_bytes variable then reading in 10 triangles out of them. Needless to say, I'm not finding much.

Code: Select all

######################################################
# TriStrip Importer ... eventually
# This script should be run from the text editor in 
# Blender2.49b (I think it will work with Blender 2.3 
# on to 2.49b, but I've only tested it in 2.49b). 
# As it stands 
#
######################################################
# Importing modules
######################################################
import struct as S

import Blender
from Blender import NMesh
from Blender.BGL import *
from Blender.Draw import *
 
import math

import io
 
# functions
def dec(this): return int(this.encode('hex'),16)
def fourbyte(this): return S.unpack(">f", this)[0]

# variables
skip_bytes = 808 #change this variable to skip to known byte

######################################################
# Main Body
######################################################
def import_Tris(path): 
   Blender.Window.WaitCursor(1) 
   name = path.split('\\')[-1].split('/')[-1]

   # create a new mesh with filename 
   mesh = Blender.NMesh.New( name )  

   # parse the file 
   tris = open(path, 'rb') 

   tris.read(8) #read blank bytes

   if (tris.read(4) == "Her_"): 
	print "File is valid" #(debug)

	# get the name of the mesh from file
	mesh_name = tris.read(6) 

	#skip to tristrip indices?
	tris.read(skip_bytes) 

	# print number of vertices?
	NumVerts = dec(tris.read(2)) 
	print "Number of Verts =",NumVerts

	# create 10 tri's 
	for i in range(0,10):
		Triangle(tris)

   else: print "File is not valid" #(debug)
   tris.close()
	
def Triangle(tris):
	### create a new triangle mesh
	tri = NMesh.GetRaw()
	
	### populate vertices in triangle mesh 
	for i in range(0,3):
		x = fourbyte(tris.read(4))
		y = fourbyte(tris.read(4))
		z = fourbyte(tris.read(4))
		v = NMesh.Vert(x,y,z)
		tri.verts.append(v)
	
	### connect the verts to form a triangle face
	f = NMesh.Face()
	for i in range(0,3):
		f.v.append(tri.verts[i])
	tri.faces.append(f)
	triObj = NMesh.PutRaw(tri)
	Blender.Redraw()

Blender.Window.FileSelector(import_Tris, 'Import')
-Q13

FurryFan
mega-veteran
mega-veteran
Posts: 190
Joined: Sat Jan 09, 2010 9:37 pm
Has thanked: 8 times
Been thanked: 62 times

Re: .KRV extension in Wii Models?

Post by FurryFan » Sun Oct 24, 2010 3:51 am

Quetzalcoatil wrote:Hey FurryFan,

I see you're using blender to load the tri-strips. I'm slightly proficient with python, but I'm not familiar with the loading of tri-strips. Could you post the script you used for that import?
Also, what did you mean by "98 2ByteInteger#Vertexes"? Did you mean there are 98 uint16 index values or the byte '0x98' followed by a uint16 'number of vertices' ?

Here's the very broken script I'm using to (try and) locate the vertex data. Basically I'm using HexEdit to find a candidate for some float3's, then skipping ahead in the file with a skip_bytes variable then reading in 10 triangles out of them. Needless to say, I'm not finding much.

Code: Select all

######################################################
# TriStrip Importer ... eventually
# This script should be run from the text editor in 
# Blender2.49b (I think it will work with Blender 2.3 
# on to 2.49b, but I've only tested it in 2.49b). 
# As it stands 
#
######################################################
# Importing modules
######################################################
import struct as S

import Blender
from Blender import NMesh
from Blender.BGL import *
from Blender.Draw import *
 
import math

import io
 
# functions
def dec(this): return int(this.encode('hex'),16)
def fourbyte(this): return S.unpack(">f", this)[0]

# variables
skip_bytes = 808 #change this variable to skip to known byte

######################################################
# Main Body
######################################################
def import_Tris(path): 
   Blender.Window.WaitCursor(1) 
   name = path.split('\\')[-1].split('/')[-1]

   # create a new mesh with filename 
   mesh = Blender.NMesh.New( name )  

   # parse the file 
   tris = open(path, 'rb') 

   tris.read(8) #read blank bytes

   if (tris.read(4) == "Her_"): 
	print "File is valid" #(debug)

	# get the name of the mesh from file
	mesh_name = tris.read(6) 

	#skip to tristrip indices?
	tris.read(skip_bytes) 

	# print number of vertices?
	NumVerts = dec(tris.read(2)) 
	print "Number of Verts =",NumVerts

	# create 10 tri's 
	for i in range(0,10):
		Triangle(tris)

   else: print "File is not valid" #(debug)
   tris.close()
	
def Triangle(tris):
	### create a new triangle mesh
	tri = NMesh.GetRaw()
	
	### populate vertices in triangle mesh 
	for i in range(0,3):
		x = fourbyte(tris.read(4))
		y = fourbyte(tris.read(4))
		z = fourbyte(tris.read(4))
		v = NMesh.Vert(x,y,z)
		tri.verts.append(v)
	
	### connect the verts to form a triangle face
	f = NMesh.Face()
	for i in range(0,3):
		f.v.append(tri.verts[i])
	tri.faces.append(f)
	triObj = NMesh.PutRaw(tri)
	Blender.Redraw()

Blender.Window.FileSelector(import_Tris, 'Import')
-Q13
Oh I do not know any scripts, the way that I import tristrips of the type used in this game is by using microsoft word, to past in the tristrips and then add in a "00 00" in between strips strips in this seem to start with the hex byte "98" so I do find and replace all in microsoft word, which will not work all the time because not all 98 are strip starters hence the dragon in the picture is not filled in correctly. After I do the replacements I append it 3 times, removing no bytes, the firstbyte, then the second byte and paste it in an ogre3d file with the vertexes and then import using someone else's ogre3dxml importer mesh into blender. Then I delete the vertex at the first location and then the thousands of null ones at 0,0,0.
I use excel formulas to change the edninan into the other edinan type.
I accept ALL requests. Let me know your requests.

Quetzalcoatil
n00b
Posts: 17
Joined: Sat Oct 02, 2010 3:12 am
Has thanked: 1 time
Been thanked: 1 time

Re: .KRV extension in Wii Models?

Post by Quetzalcoatil » Mon Oct 25, 2010 2:56 pm

FurryFan wrote: Oh I do not know any scripts, the way that I import tristrips of the type used in this game is by using microsoft word, to past in the tristrips and then add in a "00 00" in between strips strips in this seem to start with the hex byte "98" so I do find and replace all in microsoft word, which will not work all the time because not all 98 are strip starters hence the dragon in the picture is not filled in correctly. After I do the replacements I append it 3 times, removing no bytes, the firstbyte, then the second byte and paste it in an ogre3d file with the vertexes and then import using someone else's ogre3dxml importer mesh into blender. Then I delete the vertex at the first location and then the thousands of null ones at 0,0,0.
I use excel formulas to change the edninan into the other edinan type.
o_0

Well, thanks FurryFan, I'll try to follow your work-flow, then adapt a blender importer for it... eventually. <)
-Q13

User avatar
chrrox
Moderator
Posts: 2565
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1311 times

Re: .KRV extension in Wii Models?

Post by chrrox » Mon Oct 25, 2010 3:26 pm

tri-strip is easy to load.
just read them as triangle list values like so.

Code: Select all

StartDirection = 1 
f1 = (ReadBEword f) + 1 
f2 = (ReadBEword f) + 1   
FaceDirection = StartDirection 
while (ftell f) != (FaceStartPos + (FaceCount * 2))Do ( 
f3 = (ReadBEword f) 
if (f3==0xFFFF) then ( 
f1 = (ReadBEword f) + 1 
f2 = (ReadBEword f) + 1 
FaceDirection = StartDirection    
) else ( 
f3 += 1 
FaceDirection *= -1 
if (f1!=f2)AND(f2!=f3)AND(f3!=f1) then ( 
if FaceDirection > 0 then append Face_array [(f1),(f2),(f3)] 
else append Face_array [(f1),(f3),(f2)] 
) 
f1 = f2 
f2 = f3 
)   
) 

FurryFan
mega-veteran
mega-veteran
Posts: 190
Joined: Sat Jan 09, 2010 9:37 pm
Has thanked: 8 times
Been thanked: 62 times

Re: .KRV extension in Wii Models?

Post by FurryFan » Mon Oct 25, 2010 3:57 pm

chrrox wrote:tri-strip is easy to load.
just read them as triangle list values like so.

Code: Select all

StartDirection = 1 
f1 = (ReadBEword f) + 1 
f2 = (ReadBEword f) + 1   
FaceDirection = StartDirection 
while (ftell f) != (FaceStartPos + (FaceCount * 2))Do ( 
f3 = (ReadBEword f) 
if (f3==0xFFFF) then ( 
f1 = (ReadBEword f) + 1 
f2 = (ReadBEword f) + 1 
FaceDirection = StartDirection    
) else ( 
f3 += 1 
FaceDirection *= -1 
if (f1!=f2)AND(f2!=f3)AND(f3!=f1) then ( 
if FaceDirection > 0 then append Face_array [(f1),(f2),(f3)] 
else append Face_array [(f1),(f3),(f2)] 
) 
f1 = f2 
f2 = f3 
)   
) 
chrrox while we are on the topic of tristrips do you know of a script that can export meshes as implicit tristrips where the strip is in order (00, 01,02,03,04...N) where vertexes can repeat (ie vertex #4 could be vertex#55) so that the sequenital tristrip spans the whole mesh.
This could be used to inject meshes into this game, as models in this game could be just one long strip in theory.
I accept ALL requests. Let me know your requests.

Post Reply