Page 2 of 4

Re: Star Wars: Clone Wars Adventures (*.dme)

Posted: Wed Dec 21, 2016 1:14 am
by lyutor1945
AceWell wrote:i have all game files, but i only research dme files because i am only interested in the models and textures :D
One more question. In the game files, I found only Ventress in the mask. In the game has only this model or unmasked version too? And where if it so?

Re: Star Wars: Clone Wars Adventures (*.dme)

Posted: Wed Dec 21, 2016 2:27 am
by Acewell
i only see a partial face for the Dathomir outfit like the one seen in the first picture
http://cwa.wikia.com/wiki/Asajj_Ventress

Char_AsajjHead_LOD0.dme extracted from AssetsW_001 and
goes with Char_AsajjBody_LOD0.dme from AssetsW_002

Re: Star Wars: Clone Wars Adventures (*.dme)

Posted: Thu May 25, 2017 11:31 pm
by lyutor1945
Guys, maybe someone knows, is it possible to download somewhere the game or pack archives?

Re: Star Wars: Clone Wars Adventures (*.dme)

Posted: Mon Oct 23, 2017 2:40 am
by ARAJediMaster
Excuse me, but I am looking for the sound effects to this game. Does anybody have access to the original sound archives, and if so, how can I access them?

Re: Star Wars: Clone Wars Adventures (*.dme)

Posted: Fri Sep 21, 2018 11:08 am
by TRDaz
So I've recently been attempting to add bone support to this (I hope this is okay with you AceWell) and have gotten somewhere but still haven't managed to get proper positions on bones, any chance someone could look? This is the part of the script I added in:

Code: Select all

	if (rapi.checkFileExists(skelFile)):
		sk = rapi.loadIntoByteArray(skelFile)
		sk = NoeBitStream(sk)
		nameList = []
		parentList = []
		boneList = []
		mtxList = []
		sk.seek(0x08, NOESEEK_ABS)
		skipCount = sk.readUInt()
		currentPos = sk.tell()
		skip = sk.readBytes(skipCount)
		boneCount = sk.readUInt()
		print(boneCount)
		sk.seek(currentPos)
		for i in range(boneCount):
			boneName = sk.readString()
			#print(boneName)
			nameList.append(boneName)
		skip = sk.readBytes(4)
		for i in range(boneCount):
			skip = sk.readBytes(4)
			parent = sk.readUByte()
			skip = sk.readBytes(3)
			parentList.append(parent)
		for i in range(boneCount):
			unk = sk.readFloat()
			rot = NoeQuat(sk.read("4f"))
			scale = sk.read("3f")
			unk2 = sk.readFloat()
			posX, posY, posZ = sk.read("3f")
			#print(pos)
			boneMtx = rot.toMat43().inverse()
			boneMtx[0] *= scale[0]
			boneMtx[1] *= scale[1]
			boneMtx[2] *= scale[2]
			boneMtx[3] = NoeVec3((posX, posY, posZ))
			#print(posY)
			print(sk.tell())
			mtxList.append(boneMtx)
			newBone = NoeBone(i, nameList[i], mtxList[i], None, parentList[i])
			boneList.append(newBone)
It overall looks like it gets good positioning on heads although not at the position of the mesh, but it is very wrong on bodies. I could just be reading the data for bones completely wrong because I'm not familiar with how to read them properly, but any help is appreciated on how to do that. I've attached both bone files for the characters shown in the images.

Image Image

Re: Star Wars: Clone Wars Adventures (*.dme)

Posted: Fri Sep 21, 2018 1:31 pm
by episoder
ugh. ehh... how do i get noesis to see the skelly file? i tried the local and absolute path, but it doesn't work, damnit.

Code: Select all

    if (rapi.checkFileExists(str("D:\starwars\models\cwa_xtr_wip\ahsokaV2\Char_HumanFemaleBody.dsk"))):
        print("skelly found")
        sk = rapi.loadIntoByteArray(str("D:\starwars\models\cwa_xtr_wip\ahsokaV2\Char_HumanFemaleBody.dsk"))
btw. tab indents pls. your space code differs from ace's spaces. :D and tabs are easier to track and manage/count for the parser to interpret. plus the current script doesn't read the boneweights and indices anymore. i have another (the older) version of the script tho.

Re: Star Wars: Clone Wars Adventures (*.dme)

Posted: Fri Sep 21, 2018 2:02 pm
by TRDaz

Code: Select all

def noepyLoadModel(data, mdlList):
	ctx = rapi.rpgCreateContext()
	#skelloading
	baseName = rapi.getExtensionlessName(rapi.getLocalFileName(rapi.getLastCheckedName()))
	print(baseName)
	skelFile = rapi.getDirForFilePath(rapi.getInputName()) + baseName + ".dsk"
That is before the other code I posted, obviously will need the .dme file to make this work, and I had to remove the LOD0 from the name of the .dme file to make it work too.

It also needs this at the end instead of just mdlList.append(mdl)

Code: Select all

	mdlList.append(mdl); mdl.setBones(boneList)
They are tabbed, pasting the code makes it have spaces and not tabs, and I only have skeleton loading right now, still no weights.

Re: Star Wars: Clone Wars Adventures (*.dme)

Posted: Fri Sep 21, 2018 3:25 pm
by episoder
got it. manual debug right now. the whole thing should be done using the adr files and all files dumped in a single folder to be able to load all files directly. i only got the bone relationships sorta figured. there're possibly a bone_id -1 (FFFF) and a parent_id -1 (FFFF) too, potentially unparented bones. the other offset is directly into the bonename table. i still got no clue howto assemble the matrices. i'm a noob when it comes to this. i could math that there are 12 floats per bone tho. could be a 4x3 or 3x4 matrix, depending how you get the translation vector in there. using a quaternion you have 7, 3 for translation and maybe 1 for the scale, so... this doesn't make alot of sense to me. :? anyway... the bonetable code

Code: Select all

def noepyLoadModel(data, mdlList):
    ctx = rapi.rpgCreateContext()
    if (rapi.checkFileExists(skellyfile)):
        print("skelly found")
        sk = rapi.loadIntoByteArray(skellyfile)
        sk = NoeBitStream(sk)
        nameList = []
        parentList = []
        boneList = []
        mtxList = []
        sk.seek(0x08, NOESEEK_ABS)
        ofsrel_bonestruct = sk.readUInt()
        BNametable = sk.tell()
        sk.seek(ofsrel_bonestruct, NOESEEK_REL)
        boneCount = sk.readUInt()
        print(boneCount)
        currentbone = sk.tell()
        for i in range(boneCount):
            sk.seek(currentbone, NOESEEK_ABS)
            ofsrel_BName = sk.readUInt()
            boneId = sk.readUShort()
            parent = sk.readUShort()
            parentList.append(parent)
            currentbone = sk.tell()
            sk.seek(BNametable)
            sk.seek(ofsrel_BName, NOESEEK_REL)
            boneName = sk.readString()
            print(boneName)
            nameList.append(boneName)
        for i in range(boneCount):
            unk = sk.readFloat()
...

Re: Star Wars: Clone Wars Adventures (*.dme)

Posted: Fri Sep 21, 2018 4:02 pm
by TRDaz
Yeah my issue is the bone reading, I knew there were 12 floats per bone but I don't know which would be the rotation, position etc. I've tried various options aswell as just reading the matrix with Mat43 but it still results in the same thing I have right now.

Re: Star Wars: Clone Wars Adventures (*.dme)

Posted: Fri Sep 21, 2018 5:42 pm
by episoder
yo. same here. but i got somewhere removing all the matrix stuff. using an identity mat to pin the locations. your script did output weird stuff. and i forgot to save the offset after the bone array. :mrgreen: the head bones were sorta pinned by the L and R X values. for sure the array location without all the matrix crap. still gotta figure where the delta or 'local translation' is. some parent child relations seem wrong too. i pretty much don't care about the rotation.

Image

i'm not sure if this dislocation may be intentional even. i'm not sure about the math invloved but if the original pose is not stored and just uses the animation files this may still work without the tpose skelly. kinda protection. i'll try to figure it out anyway tho.

Re: Star Wars: Clone Wars Adventures (*.dme)

Posted: Fri Sep 21, 2018 5:49 pm
by TRDaz
Yeah that result is what I got with mine, the root and neck bones seem to be accurate in positioning, the X axis on the other bones seem accurate but everything else for those doesn't, which makes me confused.

Looks like the face positions are stored in the .dme file actually, but doesn't work for body. This is manual seeking in the file atm, gotta code in getting to it properly.
Image

Re: Star Wars: Clone Wars Adventures (*.dme)

Posted: Fri Sep 21, 2018 9:15 pm
by episoder
i got the head looking good. and a nice start at the body. parent recursion. i guess the rotation matters.

Image

wip script if you wanna mess with it. :]

Re: Star Wars: Clone Wars Adventures (*.dme)

Posted: Fri Sep 21, 2018 10:06 pm
by TRDaz
I'm not entirely sure how the parent recursion stuff works but nice work so far :)

Re: Star Wars: Clone Wars Adventures (*.dme)

Posted: Fri Sep 21, 2018 11:37 pm
by episoder
yo. it was a weird thing to find anyway. i figured it out when i messed with the boneids. i added those and the head added to the neck was at the right place. but it didn't work any further. i had to try to recurse it. basicly what it does is adding what seems local bone transforms based on their parent bones.

recursion itself explained

Code: Select all

def recursion(i)
    parent = parentList[i]
    if parent >= 0:
        recursion(parent)
1) i = toe -> search parent -> finds foot -> function calls itself with i paremeter foot
2) i = foot -> search parent -> finds calf -> function calls itself with i parameter calf
3) i = calf -> searhc parent -> finds thigh -> function calls itself with i parameter thigh
...

until there's no parent in the chain, which is the root bone. it's maybe just stupid code. now that i think about it could potentially be done with a while loop too. i just didn't think about that i guess. :mrgreen:

Re: Star Wars: Clone Wars Adventures (*.dme)

Posted: Sat Sep 22, 2018 12:38 pm
by akderebur
9 floats for 3x3 local rotation matrix, 3 floats for local position vector.
sw_skel.png
@episoder Your approach is correct, as you need to reach the world space coordinates, but it can be achieved more easily using matrices. Load 12 floats as NoeMat43. Multiply bone matrix with the parent in recursion until, you reach the top. You need the rotation to load the skeleton properly anyway.