Offtopic: Into Commodore 64 (6502) coding, pixeling or music?
Xentax is looking for new members for the C64 activities!
Just drop us a message at forum@xentax.com and join the Scene Team!

Forum rules: Click here

S4L Model Exporting

Post questions about game models here, or help out others!
User avatar
Seyren
advanced
Posts: 58
Joined: Sat Oct 30, 2010 1:39 pm
Has thanked: 18 times
Been thanked: 9 times

S4L Model Exporting

Post by Seyren » Tue Feb 11, 2014 5:55 pm

Hi, i have seen this forums a lot of times, but i didn't post anything until now, the main reason was because this forum is full of experienced people, making rips of tons of games, and well, i just started C++ like 3 months ago and i feel pretty much useless right now, and i can't do more things than fors, whiles and writing in binary files, i just don't know how to start in this world, and i don't feel like i can actually do something for this community at all.


But well, i would like to ask the help of some experienced Jack the Ripper in this forum, I asked in somewhere else and he told me that this was the best place to ask for it, he also told me that the files were pretty much straight foward and they were very easy, however i am noob enough to not to know how to handle them. Even if they are easy, i don't want to pressure anyone about this.


The game itself is S4L, you can find the official game here:[WEBSITE DOESN'T ExIST ANYMORE (pretty much straight foward also)
It's a F2P Game released by Pentavision in 2008 (More like p2win, that's why i don't enjoy playing it anymore).

Read more before downloading the game if you are interested on this. (Also the game it's not that huge, 2GB, not that big at all)

The files, aside with the configuration and all stuff people uses for hacking the game are in a folder called: resources.

There are actually 20.872 files in that folder, all of them named with names like "1a5e09f2c13ccd56"

If you want to start from that point, you can download the game and extract the files from those resources, i will provide a tool that will get the files out of there.

However i am not interested in hacking the game or anything...

Inside the resources, there are mainly (aside Txt, and format of the code called x7, which i am not interested at the moment, but they seem unreadable, they have the same characters i have when i write files in binary like black nulls and stuff, if someone can confirm me this i would be happy to know it, so i can recognize binary files when i see them, and makes me feel useful at some points,):


.DDS files, which are the textures for the objects, i can actually see and edit them since they are Direct Draw files (correct me if wrong)
.SCN Files, which i SUPPOSE they are the models of the objects, but since i can't manage to open them in any way i don't know what they are, and this is mainly the point of this post, open them in programs like 3DS MAX, or blender, or whatever.

They also have animations and bones which would be great to get them :P

.SEQ files which apparently they are effects that render into the game.

The main point of asking help here is being able to open the models in a program, and apply the DDS textures on them, and if i can learn something else from this Game i would love to know it (how you did it would be great to learn it by myself)

In order to not to make you take the files from the resources or download the whole game (it's not that big tho, 2GB) i will provide a DDS, SCN and SEQ File.
.

If you are curious about why i am doing this, i want to be a game developer in a future (really long future, it's my first year studying C++, not even a year, but 3/4 months), and i want to modify this game for myself and do stuff like my own weapons and such (There is a emulator to make your own server, if you are more interested on this game, i can provide more information)

I am thinking also doing this not from the game itself, but getting a free 3D game software (Unity3D was a good one isn't it), take the models from this game and make my "own" rework of this game. But since i am too far away from this, i will probably just look at the models, and change the textures and recolor clothes and that kind of things,i love modding anyway.

Also the game looks a bit horrible and i think their models can be improved in other Engines (to look better i mean)

I hope this doesn't sound bad to anyone, i mean, making games from other games, seems kind of evil :s

I would also thank you for answering this post even if it's a no, but at least to know if it's impossible to do, or you are just not into this because you don't like my intentions, but it's not like i want to decieve anyone asking for something and lying about my purposes.

In the link i will provide:

1 - A sword and it's texture (I am not sure if the model is the sword, but you know, it's called sword.scn, i don't thik there is another one)
2 - Another model (asteroid), with it's SEQ (unknown), 2 additional textures
3 - The resource editor in case someone downloads the game
(Warning, there are some files the editor can't extract, according to it the file is not there

File: http://puu.sh/6SbLT.rar

(Password attached to the post)

This is all the help i can provide you to make it as easy as possible.

I know it won't seem legit since it's my first post, so help me if you feel confident about it, it's in a RAR, so you should notice a virus before it does anything (or however this works).
Thanks in advance:

-Seyren.

TL;DR: I would like to know how to use open those models in a model editor, could you help me please?
You do not have the required permissions to view the files attached to this post.
Last edited by Seyren on Wed Jul 02, 2014 5:19 pm, edited 5 times in total.

barti
veteran
Posts: 148
Joined: Sun Apr 01, 2012 12:44 pm
Has thanked: 51 times
Been thanked: 101 times

Re: A request from a not very well known game...

Post by barti » Tue Feb 11, 2014 8:30 pm

I've had a quick look at the files, and I wrote a quick and dirty MAXScript to import the sword.scn file. I've tried parsing asteroid.scn too but it's made up of multiple objects and the model data doesn't have enough info (for example, the texture names have a long array of null-bytes and the array's length is nowhere to be found). I've only parsed the geometry data so far, no UVs or normals yet (well I found a block which might contain them but they don't look right at all).

Image

Without further ado, here's the script:
EDIT: Updated to import UVs properly, thanks shakotay!

Code: Select all

fSCN = getOpenFileName caption:"Choose Model File:" \
types:"S4League Models (*.scn)|*.scn|"

if fSCN != undefined then
(
	f = fopen fSCN "rb"
	clearlistener()

	Face_array=#()
	Vert_array=#()
	UV_array=#()

	fseek f 2438 #seek_set
	
	-- vertex data
	
	count = readlong f #unsigned
	for x = 1 to count do
	(
		vx = readfloat f
		vy = readfloat f
		vz = readfloat f
		append Vert_array[vx,vy,vz]
	)
	
	-- face data
	
	count = readlong f #unsigned
	for i = 1 to count do
	(
		fa = readshort f #unsigned
		fb = readshort f #unsigned
		fc = readshort f #unsigned
		append Face_array[fa+1,fb+1,fc+1]
	)
	
	-- normals data

	count = readlong f #unsigned
	for i = 1 to count do
	(
		nx = readfloat f
		ny = readfloat f
		nz = readfloat f
	}

	-- UV data

	count = readlong f #unsigned
	for i = 1 to count do
	{
		tu = readfloat f
		tv = readfloat f
		append UV_array[tu,1-tv,0]
	)

	msh = mesh vertices:Vert_array faces:Face_array name:(getFilenameFile fSCN)
	msh.numTVerts = UV_array.count
	buildTVFaces msh
	for j = 1 to UV_array.count do setTVert msh j UV_array[j]
	for j = 1 to Face_array.count do setTVFace msh j Face_array[j]

	Print ("Last Read @ 0x"+((bit.intAsHex(ftell f))as string))
	gc()
	fclose f 
)
Hopefully it'll come in handy somehow.
Last edited by barti on Thu Feb 13, 2014 5:10 pm, edited 1 time in total.

User avatar
Seyren
advanced
Posts: 58
Joined: Sat Oct 30, 2010 1:39 pm
Has thanked: 18 times
Been thanked: 9 times

Re: A request from a not very well known game...

Post by Seyren » Tue Feb 11, 2014 9:34 pm

I searched in the resource files all of them who had "asteroid" in their name, and there are 20 files concerning the asteroid, 5 of them are scn (4 if we count the one we have right now) and the rest are SEQ which i suppose they are animations

If this helps you i zipped all the files of the asteroid here: http://puu.sh/6SpKJ.rar (Same password as the older files) in case you want to complete the monster , or at least, i hope you can complete it with that.

I tested your script and works perfectly with the sword, however, i couldn't manage to make it work on any other model, it pops me this error everytime:

Image

I would try to fix it myself but at the moment i don't know anything about MAXScripting, i should learn soon if i am able to do this kind of things.

Even if you can't /won't fix it thank you a lot for making me able to get at least the sword into the editor, really thanks a lot, i will look foward for your progress if you are still helping me :)

Again, thanks a lot.

barti
veteran
Posts: 148
Joined: Sun Apr 01, 2012 12:44 pm
Has thanked: 51 times
Been thanked: 101 times

Re: A request from a not very well known game...

Post by barti » Tue Feb 11, 2014 10:08 pm

Unfortunately the problem isn't lack of files, but my lack of knowledge about the SCN format. I've tried guessing what I can, but I just can't figure some stuff out :( . But if I discover anything new I'll let you know.

I know nothing about animations so I'm afraid I can't help you with that.

On the other hand, since it's a PC game, you might be able to extract the models using a program like NinjaRipper.

Good luck :)

User avatar
Seyren
advanced
Posts: 58
Joined: Sat Oct 30, 2010 1:39 pm
Has thanked: 18 times
Been thanked: 9 times

Re: A request from a not very well known game...

Post by Seyren » Tue Feb 11, 2014 11:07 pm

Well, thank you so much :), i will do what i can and i will try the NinjaRipper (if i manage to run the game without the updater, which is the main problem i can't use it), if i manage to do something i will post it here if someone is interested :D

EDIT: I tried and the injections failed, so i guess i can't use it,i will keep looking at the program if i manage to inject it.

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

Re: [Request] S4 League Model Exporting

Post by shakotay2 » Wed Feb 12, 2014 12:55 pm

sword.scn: offset 0x2056 0x159= 345
-> 345 normals at 0x205A

0x3086 0x159= 345
then uvs follow (2 floats)

Image

Asteroid.scn, first submesh:
Image

uvs looking a little bit weird, although the block should be from 0x1C4AF to 0x1D216
(429x 2 floats)
Image

edit: again, use of a script like barti did might be useful for the submeshes.

for the sword it get's the uvs with a small change:

Code: Select all

   count = readlong f #unsigned
   for i = 1 to count do
   (
      nx = readfloat f
      ny = readfloat f
      nz = readfloat f
   )

   count = readlong f #unsigned
   for i = 1 to count do
   (
      tu = readfloat f
      tv = readfloat f
      append UV_array[tu,1-tv,0]
   )
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."

User avatar
Seyren
advanced
Posts: 58
Joined: Sat Oct 30, 2010 1:39 pm
Has thanked: 18 times
Been thanked: 9 times

Re: [Request] S4 League Model Exporting

Post by Seyren » Wed Feb 12, 2014 2:47 pm

Thank you all for your help :), we are closer to get it

Cra0kalo helped me also to get the models.

He started this script and he told me to post it here if someone can finish it.

Code: Select all

// S4 League
// DataFormat little ENDIAN (x86)
struct SCNHeader
{
uint32 unknownIdentifier
uint32 ??IDK
string ModelName
 
 
 
 
}
 
 
 
 
//Vert Count unit32 before structure
uint32 VertexCount
 
struct VBufStruc1
{
float vd x
float vd y
float vd z
 
}
 
 
//FaceCount before structure
uint32 FaceCount
 
struct FaceList
{
uint16 faceA
uint16 faceB
uint16 faceC
}
 
 
struct VBufStruc2
{
hfloat vn_x
hfloat vn_y
hfloat vn_z
hfloat vn_w
}
Thank you all for helping me ^^

Edit: I got the shader dump from intel GPA, however i don't know how to use it, but i heard it helps a lot. so i will attach it in this post.

(i don't know why it's so messed up, it came up all in a single line, so i made a program that made an end of the line every time it saw at ";", "{" (not } because structs can get screwed) . so it looks weird at some points.)

HLSL

http://puu.sh/6U2Ye.txt

IL Assembly:

http://puu.sh/6UpBK.txt
I will also attach the GPa where i got it in case you want it too

http://puu.sh/6U2Ue.gpa_frame

User avatar
cra0
ultra-veteran
ultra-veteran
Posts: 432
Joined: Fri Apr 27, 2012 9:37 am
Has thanked: 29 times
Been thanked: 184 times
Contact:

Re: [Request] S4 League Model Exporting

Post by cra0 » Thu Feb 13, 2014 1:32 pm

most likely the cpu handles boneblends I don't see anything in the shader code

barti
veteran
Posts: 148
Joined: Sun Apr 01, 2012 12:44 pm
Has thanked: 51 times
Been thanked: 101 times

Re: [Request] S4 League Model Exporting

Post by barti » Thu Feb 13, 2014 4:56 pm

shakotay2 wrote:sword.scn: offset 0x2056 0x159= 345
-> 345 normals at 0x205A
...
then uvs follow (2 floats)
*facepalm* can't believe I overlooked that :D Thanks

I'm trying to parse the submeshes in asteroid.scn now, I managed to find the length of some data but one block changes in size and I'm still looking for a count value.

Image

Here's what I figured out by now (note that this script is broken and is meant to work only with asteroid.scn)

Code: Select all

fSCN = getOpenFileName caption:"Choose Model File:" \
types:"S4League Models (*.scn)|*.scn|"

if fSCN != undefined then
(
	f = fopen fSCN "rb"
	clearlistener()

	Face_array=#()
	Vert_array=#()
	UV_array=#()
	
	fseek f 8 #seek_set
	modelName = readstring f
	fseek f 81 #seek_cur
	
	for i = 1 to 4 do
	(
		submeshName = readstring f
		modelName = readstring f
		fseek f 88 #seek_cur
		fseek f 2052 #seek_cur
		print ("Mesh: " + submeshName)
		someint = readlong f #unsigned
		print ("\tSomeint: " + someint as string)
		count = readlong f #unsigned
		print("\tVertices: " + count as string)
		for x = 1 to count do
		(
			vx = readfloat f
			vy = readfloat f
			vz = readfloat f
			append Vert_array[vx,vy,vz]
		)
		
		count = readlong f #unsigned
		print("\tFaces: " + count as string)
		for i = 1 to count do
		(
			fa = readshort f #unsigned
			fb = readshort f #unsigned
			fc = readshort f #unsigned
			append Face_array[fa+1,fb+1,fc+1]
		)
			
		count = readlong f #unsigned
		print("\tNormals: " + count as string)
		for i = 1 to count do
		(
			nx = readfloat f
			ny = readfloat f
			nz = readfloat f
		)

		count = readlong f #unsigned
		print("\tUVs: " + count as string)
		for i = 1 to count do
		(
		  tu = readfloat f
		  tv = readfloat f
		  append UV_array[tu,1-tv,0]
	   )

		fseek f 12 #seek_cur
		str = readstring f
		fseek f 73 #seek_cur
		str = readstring f
		b = readbyte f
		fseek f 1420 #seek_cur -- I need to find the size of this block, it seems to change between submeshes
		fseek f 48 #seek_cur


		msh = mesh vertices:Vert_array faces:Face_array name:submeshName
		msh.numTVerts = UV_array.count
		buildTVFaces msh
		for j = 1 to UV_array.count do setTVert msh j UV_array[j]
		for j = 1 to Face_array.count do setTVFace msh j Face_array[j]
		free Face_array
		free Vert_array
		free UV_array
	)
	gc()
	fclose f 
)

User avatar
Seyren
advanced
Posts: 58
Joined: Sat Oct 30, 2010 1:39 pm
Has thanked: 18 times
Been thanked: 9 times

Re: [Request] S4 League Model Exporting

Post by Seyren » Fri Feb 14, 2014 2:52 pm

Tested Barti's script and works great for the asteroid.

As you told me i tried the Ninja Ripper and i managed to Rip the models from the game.

Image
most of the textures get reverted and mirrored, so i have to mirror the whole model and revert the texture.

Also, there is something i don't understand.

Image

The hole of the of the chains should be transparent, and something is wrong that is making not to use the alpha color.

Image

Does someone know why does this happen and how can i fix it? Thanks in advance :)

Although i am able to see and edit the models, it's not a great progress since i am not able to conver the model back to scn, so the only thing i can actually mod is the textures (Which is an actual progress :)).

There must be a way to do this, i would like to contribute with scripts, but i don't know yet, i am so sorry, that's why i keep asking you guys for help

Thanks in advance, i will help all i can for this extractions

barti
veteran
Posts: 148
Joined: Sun Apr 01, 2012 12:44 pm
Has thanked: 51 times
Been thanked: 101 times

Re: [Request] S4 League Model Exporting

Post by barti » Fri Feb 14, 2014 4:53 pm

3DS Max doesn't display alpha channels in textures by default. You'll need to use this method to get the alpha channel to show up :)

User avatar
Seyren
advanced
Posts: 58
Joined: Sat Oct 30, 2010 1:39 pm
Has thanked: 18 times
Been thanked: 9 times

Re: [Request] S4 League Model Exporting

Post by Seyren » Wed Feb 26, 2014 11:29 pm

Thank you for tell me that on 3DS Max :)

I would like to revive this thread since it's been a while i don't get answers at all and i would like to let you know if you could help me converting the scn to obj and viceversa for testing them in-game, (or any other format for editing)

I posted all the help i could provide and if there is something more you need i will do my best to help you

I will be waiting, Thanks in advance :)

User avatar
Seyren
advanced
Posts: 58
Joined: Sat Oct 30, 2010 1:39 pm
Has thanked: 18 times
Been thanked: 9 times

Re: [Request] Model Exporting

Post by Seyren » Mon Apr 21, 2014 3:44 pm

I would like to bump this thread again in case someone can get anything else from this game, thank you so much in advance <:, i'm trying to learn how this was done so i can do it on my own and not bother anyone with this game :c

fatduck
mega-veteran
mega-veteran
Posts: 315
Joined: Wed Aug 02, 2006 10:07 pm
Has thanked: 10 times
Been thanked: 93 times

Re: [Request] Model Exporting

Post by fatduck » Tue Apr 22, 2014 5:57 pm

What actually are you up to now?
.scn is not a difficult format but mixed with mesh, dummy, animation in there!
eg: 0x081098F8 is mesh ID, 0x6D411AD1 is dummy ID and 0x6278D57A is Header ID (I think).
Clipboard02.jpg
Since there is only 1 samples(asteroid) I got here, so there is no point for me to say the format structure.
Some more different samples!

I also want to ask if you can actually unpack/encrypt the latest S4L Cyborgs resources!?
Can you share it with me. Thanks!
You do not have the required permissions to view the files attached to this post.
No more Fatduck, no more FatImporter, Byebye everyone!

User avatar
Seyren
advanced
Posts: 58
Joined: Sat Oct 30, 2010 1:39 pm
Has thanked: 18 times
Been thanked: 9 times

Re: [Request] Model Exporting

Post by Seyren » Fri Apr 25, 2014 3:43 pm

There are different types of scns, but They ones from the cyborgs and the ones from the seasons i have (mines are from Season 3) share the same encryption, so if you decrypt these scn's you wil lbe able to get the cyborg ones easily.

If you are interested i can pack for you every kind of different SCN this game has :)

The game is online so everything that i'm intersted about the SCN has nothing to do with the actual game, i want to explore the format, see the animations, use them in my own game projects because i love the assets from those games :P

Post Reply