READ THE RULES: Click here

Follow us on Facebook: https://www.facebook.com/xentax/ :)

PS All-Stars Battle Royale(final version ea05-cskn)

Post questions about game models here, or help out others!
luxox18
mega-veteran
mega-veteran
Posts: 176
Joined: Fri Jul 29, 2011 9:18 pm
Has thanked: 54 times
Been thanked: 41 times

PS All-Stars Battle Royale(final version ea05-cskn)

Post by luxox18 » Thu Oct 09, 2014 6:44 am

I obtained some models from Playstation all stars battle royale dumping the vram from the console.

The IDmagic has changed from the beta version (MODL to EA05) the vertex size is 16 and the uv pos is 12 (I used hex2obj for obtain some meshes but with this method some faces are lost), also I used the decompresed faces from vram dump over the meshes in t-pose but not all faces are in the dump file (the dump file only have the faces that are shown front to the camera, all faces behind are not rendered)

I extracted this mesh with hex2obj (some faces are lost)

Image

here are some models

http://www.mediafire.com/download/wnu9c ... a_ea05.rar

here is a model + the old noesis script by chrrox for import cskn meshes.

http://www.mediafire.com/download/6vkbz ... suit02.rar

the original files use edge indices compression, maybe someone can modify the script for import this files to noesis with all faces :)

thanks

kovalevich007
n00b
Posts: 17
Joined: Fri Nov 12, 2010 4:03 pm
Has thanked: 3 times
Been thanked: 4 times

Re: PS All-Stars Battle Royale(final version ea05-cskn)

Post by kovalevich007 » Thu Oct 09, 2014 11:31 am

You can loaded manually each mesh.
Image

Code: Select all

#sample class
from inc_noesis import *

def registerNoesisTypes():
	handle = noesis.register("Playstation All Stars", ".cskn")
	noesis.setHandlerTypeCheck(handle, binModCheckType)
	noesis.setHandlerLoadModel(handle, binModLoadModel)
	#noesis.logPopup()

	return 1


def binModCheckType(data):
	td = NoeBitStream(data)
	return 1

class binFile: 
         
	def __init__(self, bs):
		self.bs = bs
		rapi.rpgSetOption(noesis.RPGOPT_BIGENDIAN, 1)
		self.texList  = []
		self.matList  = [] 
		self.boneList = []
		self.boneMap  = []
		self.offsetList = []
		self.meshOffsets = []

	def loadAll(self, bs):
		indexCount = 0x8A0
		indexSize = 0x370
		indexOffset = 0x1C00
		bs.seek(indexOffset, NOESEEK_ABS)
		edgeData = bs.readBytes(indexSize)
		edgeDecomp = rapi.decompressEdgeIndices(edgeData, indexCount)
		for i in range(0, indexCount):
			t = edgeDecomp[i*2]
			edgeDecomp[i*2] = edgeDecomp[i*2 + 1]
			edgeDecomp[i*2 + 1] = t

		vertexOffset = 0x1F70
		bs.seek(vertexOffset, NOESEEK_ABS)
		vertCount = 0x1A2
		vSize = 0x10
		vertBuff = bs.readBytes(vSize * vertCount)
		#UVBuff = bs.readBytes(vertCount * 6)
		#rapi.rpgBindUV1BufferOfs(UVBuff, noesis.RPGEODATA_SHORT, 6, 0)
		rapi.rpgBindPositionBufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, vSize, 0)
		#rapi.rpgCommitTriangles(None, noesis.RPGEODATA_USHORT, vertCount, noesis.RPGEO_POINTS, 1)
		rapi.rpgCommitTriangles(edgeDecomp, noesis.RPGEODATA_USHORT, indexCount, noesis.RPGEO_TRIANGLE, 1)

def binModLoadModel(data, mdlList):
	ctx = rapi.rpgCreateContext()
	bin = binFile(NoeBitStream(data, NOE_BIGENDIAN))
	bin.loadAll(bin.bs)
	try:
		mdl = rapi.rpgConstructModel()
	except:
		mdl = NoeModel()
	mdl.setModelMaterials(NoeModelMaterials(bin.texList, bin.matList))
	mdlList.append(mdl); mdl.setBones(bin.boneList)	
	return 1

User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 2800
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 697 times
Been thanked: 1439 times

Re: PS All-Stars Battle Royale(final version ea05-cskn)

Post by shakotay2 » Thu Oct 09, 2014 3:06 pm

thx, kovalevich007. I added some lines to your script if you don't mind:

Code: Select all

#sample class
from inc_noesis import *

indOffArr = [0x1C00, 0x5100, 0x10100, 0x1B280, 0x26800, 0x31B00, 0x3CE80, 0x42280, 0x4DC00]# 4 addresses to be added
matName = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"]

def registerNoesisTypes():
   handle = noesis.register("Playstation All Stars", ".cskn")
   noesis.setHandlerTypeCheck(handle, binModCheckType)
   noesis.setHandlerLoadModel(handle, binModLoadModel)
   #noesis.logPopup()

   return 1


def binModCheckType(data):
   td = NoeBitStream(data)
   return 1

class binFile:
         
   def __init__(self, bs):
      self.bs = bs
      rapi.rpgSetOption(noesis.RPGOPT_BIGENDIAN, 1)
      self.texList  = []
      self.matList  = []
      self.boneList = []
      self.boneMap  = []
      self.offsetList = []
      self.meshOffsets = []
      self.materials = []

   def loadAll(self, bs):
      dataTableOffs = 0x1546
      for j in range(0, 9):
        self.materials.append(j)
        indexOffset = indOffArr[j]
        bs.seek(dataTableOffs, NOESEEK_ABS)
        bs.seek(2, NOESEEK_REL)
        vertCount = bs.readUShort()
        indexCount =  bs.readUShort()
        #print("indCnt: %d vertCnt: %d" %(indexCount, vertCount))
        bs.seek(8, NOESEEK_REL)
        #indexCount = 0x8A0
        #indexSize = 0x370
        indexSize =  bs.readUShort()
        bs.seek(indexOffset, NOESEEK_ABS)
        edgeData = bs.readBytes(indexSize)
        edgeDecomp = rapi.decompressEdgeIndices(edgeData, indexCount)
        for i in range(0, indexCount):
           t = edgeDecomp[i*2]
           edgeDecomp[i*2] = edgeDecomp[i*2 + 1]
           edgeDecomp[i*2 + 1] = t

        #vertexOffset = 0x1F70
        vertexOffset = indexOffset + indexSize
        print("indexOff: 0x%x, cnt: %d, size: 0x%x,  vertOff: 0x%x, cnt: %d" %(indexOffset, indexCount, indexSize, vertexOffset, vertCount))
        bs.seek(vertexOffset, NOESEEK_ABS)
        #vertCount = 0x1A2
        vSize = 0x10
        vertBuff = bs.readBytes(vSize * vertCount)
        #UVBuff = bs.readBytes(vertCount * 6)
        #rapi.rpgBindUV1BufferOfs(UVBuff, noesis.RPGEODATA_SHORT, 6, 0)
        rapi.rpgBindPositionBufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, vSize, 0)
        #rapi.rpgCommitTriangles(None, noesis.RPGEODATA_USHORT, vertCount, noesis.RPGEO_POINTS, 1)
        rapi.rpgSetMaterial(matName[j])
        rapi.rpgCommitTriangles(edgeDecomp, noesis.RPGEODATA_USHORT, indexCount, noesis.RPGEO_TRIANGLE, 1)
        dataTableOffs += 128

def binModLoadModel(data, mdlList):
   ctx = rapi.rpgCreateContext()
   bin = binFile(NoeBitStream(data, NOE_BIGENDIAN))
   bin.loadAll(bin.bs)
   try:
      mdl = rapi.rpgConstructModel()
   except:
      mdl = NoeModel()
   mdl.setModelMaterials(NoeModelMaterials(bin.texList, bin.matList))
   mdlList.append(mdl); mdl.setBones(bin.boneList)   
   return 1
now you'll get 9 submeshes from the radec_suit02.
I'm pretty sure there are 4 more submeshes but I got lost when trying to find the last 4 offsets for the IndOffsArr I introduced.

The max range of for i in range(0, 9) must be set to 13 (or size of IndOffsArr)
or other value for other models.
dataTableOffs = 0x1546 also to be changed for different models.
radec_suit02.jpg
(Maybe someone else will find a method to get the submesh count and the indexOffsets automatically?)
For this suit search for FFFFFFFF22. You'll find it 13 times (== 13 submeshes?).
You do not have the required permissions to view the files attached to this post.
Last edited by shakotay2 on Thu Oct 09, 2014 7:14 pm, edited 2 times in total.
Bigchillghost, Reverse Engineering a Game Model: viewtopic.php?f=29&t=17889
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."

kovalevich007
n00b
Posts: 17
Joined: Fri Nov 12, 2010 4:03 pm
Has thanked: 3 times
Been thanked: 4 times

Re: PS All-Stars Battle Royale(final version ea05-cskn)

Post by kovalevich007 » Thu Oct 09, 2014 4:26 pm

indOffArr = [0x1C00, 0x5100, 0x10100, 0x1B280, 0x26800, 0x31B00, 0x3CE80, 0x42280, 0x4DC00, 0x59800, 0x5D400, 0x69280, 0x74280]
for i in range(0, 13)

Image

User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 2800
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 697 times
Been thanked: 1439 times

Re: PS All-Stars Battle Royale(final version ea05-cskn)

Post by shakotay2 » Thu Oct 09, 2014 7:08 pm

how to build groups (i.e. submeshes) using Noesis script?
(so that exported wavefront models contain lines such as
g mesh0)

I tried it manually for the first 4 submeshes and first I thought I failed
since the left foot wasn't part of the lower body (left part of pic).

Then I realized that it's a matter of material to be introduced (simply used the loop index for generating name and index).
btw: I changed the loop var i to j in the script of my previous post
radec_suit02_SM0to3.png
really don't know why they separated the foot and the arm. :D (prefer playing RPGs where NPCs may lose their life but never separate body parts...)
You do not have the required permissions to view the files attached to this post.
Bigchillghost, Reverse Engineering a Game Model: viewtopic.php?f=29&t=17889
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."

kovalevich007
n00b
Posts: 17
Joined: Fri Nov 12, 2010 4:03 pm
Has thanked: 3 times
Been thanked: 4 times

Re: PS All-Stars Battle Royale(final version ea05-cskn)

Post by kovalevich007 » Thu Oct 09, 2014 7:36 pm

Code: Select all

rapi.rpgSetMaterial(str(indexOffset))
Image
Another would be to understand how to get the UV... :[

luxox18
mega-veteran
mega-veteran
Posts: 176
Joined: Fri Jul 29, 2011 9:18 pm
Has thanked: 54 times
Been thanked: 41 times

Re: PS All-Stars Battle Royale(final version ea05-cskn)

Post by luxox18 » Thu Oct 09, 2014 10:37 pm

thanks kovalevich007 and shakotay2 for the help!!
The only thing I know about uvs, they are in half float. I don't know much about noesis script and his structure but the script posted here is easy to understand for import other meshes from other characters :)

User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 2800
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 697 times
Been thanked: 1439 times

Re: PS All-Stars Battle Royale(final version ea05-cskn)

Post by shakotay2 » Fri Oct 10, 2014 7:11 am

thx.
UVBuff = rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_HALFFLOAT, vSize, 12)
radec_suit02_uvs.jpg
You do not have the required permissions to view the files attached to this post.
Bigchillghost, Reverse Engineering a Game Model: viewtopic.php?f=29&t=17889
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."

luxox18
mega-veteran
mega-veteran
Posts: 176
Joined: Fri Jul 29, 2011 9:18 pm
Has thanked: 54 times
Been thanked: 41 times

Re: PS All-Stars Battle Royale(final version ea05-cskn)

Post by luxox18 » Fri Oct 10, 2014 9:30 am

shakotay2 wrote:UVBuff = rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_HALFFLOAT, vSize, 12)
Thanks! works fine in all meshes ;)

kovalevich007
n00b
Posts: 17
Joined: Fri Nov 12, 2010 4:03 pm
Has thanked: 3 times
Been thanked: 4 times

Re: PS All-Stars Battle Royale(final version ea05-cskn)

Post by kovalevich007 » Fri Oct 10, 2014 11:09 am

thx shakotay2.
Image

WareWolff
ultra-n00b
Posts: 2
Joined: Tue Aug 26, 2014 11:53 am

Re: PS All-Stars Battle Royale(final version ea05-cskn)

Post by WareWolff » Mon Oct 13, 2014 3:40 pm

awesome! i thought most people had just quit on ps all-stars models a while back, nice to see more recent progress, hopefully we will eventually see Drake, Cole, Emmett (if possible, because he's dlc), or Polygon Man's models

o0DemonBoy0o
veteran
Posts: 106
Joined: Tue Apr 03, 2012 6:02 am
Has thanked: 11 times
Been thanked: 12 times

Re: PS All-Stars Battle Royale(final version ea05-cskn)

Post by o0DemonBoy0o » Wed Oct 29, 2014 11:30 pm

Can this script be used to get the UVs from the cskn models from the PSA-S beta?

lemurboy12
veteran
Posts: 117
Joined: Fri Mar 30, 2012 4:56 pm
Has thanked: 12 times
Been thanked: 2 times

Re: PS All-Stars Battle Royale(final version ea05-cskn)

Post by lemurboy12 » Sat Mar 19, 2016 7:40 pm

Sorry for the gigantic bump, but I have a memory dump which I've been extracting things from, but the script hasn't been working on anything. It's either been crashing or getting this error:
Image

Here's what I'm trying to load:
http://puu.sh/nMmVX.cskn

User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 2800
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 697 times
Been thanked: 1439 times

Re: PS All-Stars Battle Royale(final version ea05-cskn)

Post by shakotay2 » Sat Mar 19, 2016 8:54 pm

lemurboy12 wrote:, but the script hasn't been working on anything. It's either been crashing or getting this error:
guess, you didn't read this thread, did you? :D
(looks like you were using chrrox' original script)

Using the script from this thread we were talking about 17 months ago gives this:
Lemurboy-test1out.zip
indOffsArr = [0xCF80, ...]
dataTableOffs = 0xCEC6

hehehe, 3 downloads within 5 minutes?
sry, it's just a sphere, nothing more :)
You do not have the required permissions to view the files attached to this post.
Bigchillghost, Reverse Engineering a Game Model: viewtopic.php?f=29&t=17889
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."

lemurboy12
veteran
Posts: 117
Joined: Fri Mar 30, 2012 4:56 pm
Has thanked: 12 times
Been thanked: 2 times

Re: PS All-Stars Battle Royale(final version ea05-cskn)

Post by lemurboy12 » Sun Mar 20, 2016 4:18 am

I was using the script from this thread.

Post Reply