Page 1 of 2

S.W.A.T. Target Liberty (*.dob) models.

Posted: Wed Nov 04, 2015 7:08 pm
by Sleepy
Hello guys,

About the game:
develoled by 3G Studios and published by Sierra.
Release date: October 26, 2007.
Special thanks: CarLuver69, shakotay2, Nick W and of course for everybody in XeNTaX forum.

As you know with CarLuver69, shakotay2, Nick W 's help we can export files from the game's archive, so I've exported some .dob files
I think these files are models.

Here is some sample file of it:

http://www.mediafire.com/download/2m81x ... models.rar

Thank you for help.

Re: S.W.A.T. Target Liberty (*.dob) models.

Posted: Wed Jan 06, 2016 8:36 pm
by shakotay2
point cloud of swatvan looks like this: (don't have the time to care for face indices)
swatvan_dob.jpg

Re: S.W.A.T. Target Liberty (*.dob) models.

Posted: Wed Jan 06, 2016 9:53 pm
by Sleepy
No problem thanks for help :)

shakotay2 wrote:point cloud of swatvan looks like this: (don't have the time to care for face indices)
swatvan_dob.jpg

Re: S.W.A.T. Target Liberty (*.dob) models.

Posted: Thu Jan 07, 2016 6:52 am
by Acewell
shakotay2 wrote:point cloud of swatvan looks like this: (don't have the time to care for face indices)
-snip-
I would love to see how the face data is stored in this dob format, i have seen samples before where i could get a good point cloud but there was no clear face data shown.

The 22 byte vertex pattern goes the entire length of the file so i guess the face data is inline with the vertex data but i have no idea how to set this in Hex2obj. :(

Re: S.W.A.T. Target Liberty (*.dob) models.

Posted: Thu Jan 07, 2016 12:52 pm
by shakotay2
You'll need a fake tristripped face indices list:
fakeFIs-Tris.jpg
(It's on my todo list.)

Re: S.W.A.T. Target Liberty (*.dob) models.

Posted: Fri Jan 08, 2016 9:58 am
by Sleepy
I just made a test with hr_nypd.dob model :)

Image

the vertex data started from: 490 and I used 8000 for count :D

update: right count for verts is: 8247

Re: S.W.A.T. Target Liberty (*.dob) models.

Posted: Fri Jan 08, 2016 8:39 pm
by shakotay2
Try adding tristripped face indices such like these:
f 1 2 3
f 2 4 3
f 3 4 5
f 4 6 5
f 5 6 7
f 6 8 7
f 7 8 9
[...]
f 8240 8242 8241
f 8241 8242 8243
f 8242 8244 8243
f 8243 8244 8245
f 8244 8246 8245
f 8245 8246 8247

to a test.obj file created when pressing the 'mesh' button in point cloud mode. (edit: new pic: Fake mode)
hr_nypd-dob.jpg
There's different implementations of the tristripped algo thus it may come that we've some superfluous faces here because I used a very simple scheme:
a b c
b c+1 c

c c+1 c+2 (where you could substitue c:=a, c+1:=b, c+2:=c to gain the next line b c+1 c as above)

didn't check for all faces but seems to work:
8241 8242 8243
8242 8244 8243

8243 8244 8245 (a b c -> next face b c+1 c is 8244 8246 8245)

edit: I've updated hex2obj to version 0.24d to have those tristripped face indices autogenerated.
Since it's scarcely tested find it in a subpost as of 12th of June in the Extracting simple models thread.

Re: S.W.A.T. Target Liberty (*.dob) models.

Posted: Mon Aug 15, 2016 2:55 pm
by Sleepy
shakotay2 wrote: edit: I've updated hex2obj to version 0.24d to have those tristripped face indices autogenerated.
Since it's scarcely tested find it in a subpost as of 12th of June in the Extracting simple models thread.
Nice work with it ;)
I tested it and worked well, there are same faces messed up but it's working :)

Re: S.W.A.T. Target Liberty (*.dob) models.

Posted: Sat Jun 24, 2017 9:51 pm
by Sleepy
Hello all,

For this project I opened a Github repo and uploaded the existing code.

https://github.com/Sleepy93/swat-tl-editor

Today I've updated the code with added 3D model exporting support.
It's not the best so every help will be useful and I'll be really glad to get some help about it.

For more information please read the Github Readme.md.

Thanks,

Sleepy

Re: S.W.A.T. Target Liberty (*.dob) models.

Posted: Thu Jun 29, 2017 12:05 pm
by shakotay2
Hi Sleepy,
nice to see your progress. :)
After drive selection your program expects the path "PSP_GAME" to be present.
If not, nothing happens. (Maybe you should check for the folder to exist?)

I created that folder, then copied swatvan.dob to it which could be loaded and exported to obj.

Checking the obj I found vertices for the wheels only, and no face indices.
Am I missing something?

Re: S.W.A.T. Target Liberty (*.dob) models.

Posted: Thu Jun 29, 2017 12:58 pm
by Sleepy
shakotay2 wrote:Hi Sleepy,
nice to see your progress. :)
After drive selection your program expects the path "PSP_GAME" to be present.
If not, nothing happens. (Maybe you should check for the folder to exist?)

I created that folder, then copied swatvan.dob to it which could be loaded and exported to obj.

Checking the obj I found vertices for the wheels only, and no face indices.
Am I missing something?
Thanks for your reply :)

On the next weekend I'll work on the tool.
Nowadays I'm a bit busy.

Carluver69 helped on re-search so now I understand where and how the data stored.
Now I can calculate the number of verts etc.

Thanks again.

Re: S.W.A.T. Target Liberty (*.dob) models.

Posted: Thu Jun 29, 2017 2:32 pm
by shakotay2
Sleepy wrote:Nowadays I'm a bit busy.
no problem. :)

I had a deeper look at your project, introduced a vertex count and found that it was ok: 1136 (well, 1135 is better)
(dunno why blender showed the wheels only in a point cloud :cry: )

I added/copypasted tristripped face indices (from hex2obj) and realized a scaling problem (upper part of picture).

did some adaptions to your function void Export_OBJ()

br.BaseStream.Position = 0xCA-1;
(since I didn't understand why you read this byte: br.ReadByte();
and wanted to leave it unchanged, so had to start one byte earlier)

In the while loop while (br.PeekChar() > -1)
I adapted this:

Code: Select all

		ushort x, y, z;
		float fx, fy, fz ;

		br.ReadByte();
		x = br.ReadUInt16(); fx = (float)(x / 256.0); if (fx >= 128.0) fx -= (float) 256.0;
		y = br.ReadUInt16(); fy = (float)(y / 256.0); if (fy >= 128.0) fy -= (float) 256.0;
		z = br.ReadUInt16(); fz = (float)(z / 256.0); if (fz >= 128.0) fz -= (float) 256.0;
		sw.WriteLine("v {0} {1} {2}", fx.ToString(System.Globalization.CultureInfo.InvariantCulture), fy.ToString(System.Globalization.CultureInfo.InvariantCulture), fz.ToString(System.Globalization.CultureInfo.InvariantCulture));
which resulted in the lower part of the picture.
swatvan-dob-scaling.jpg
edit: introduced code for the uvs but as you can see from the picture there's too many connections :cry:

remark: you might replace "(System.Globalization.CultureInfo.InvariantCulture)" by "()"
I had to use it to avoid commas to be logged to the obj file instead of points.

Re: S.W.A.T. Target Liberty (*.dob) models.

Posted: Thu Jun 29, 2017 9:38 pm
by Sleepy
shakotay2 wrote:
Sleepy wrote:Nowadays I'm a bit busy.
no problem. :)

I had a deeper look at your project, introduced a vertex count and found that it was ok: 1136 (well, 1135 is better)
(dunno why blender showed the wheels only in a point cloud :cry: )

I added/copypasted tristripped face indices (from hex2obj) and realized a scaling problem (upper part of picture).

did some adaptions to your function void Export_OBJ()

br.BaseStream.Position = 0xCA-1;
(since I didn't understand why you read this byte: br.ReadByte();
and wanted to leave it unchanged, so had to start one byte earlier)

In the while loop while (br.PeekChar() > -1)
I adapted this:

Code: Select all

		ushort x, y, z;
		float fx, fy, fz ;

		br.ReadByte();
		x = br.ReadUInt16(); fx = (float)(x / 256.0); if (fx >= 128.0) fx -= (float) 256.0;
		y = br.ReadUInt16(); fy = (float)(y / 256.0); if (fy >= 128.0) fy -= (float) 256.0;
		z = br.ReadUInt16(); fz = (float)(z / 256.0); if (fz >= 128.0) fz -= (float) 256.0;
		sw.WriteLine("v {0} {1} {2}", fx.ToString(System.Globalization.CultureInfo.InvariantCulture), fy.ToString(System.Globalization.CultureInfo.InvariantCulture), fz.ToString(System.Globalization.CultureInfo.InvariantCulture));
which resulted in the lower part of the picture.
swatvan-dob-scaling.jpg
edit: introduced code for the uvs but as you can see from the picture there's too many connections :cry:

remark: you might replace "(System.Globalization.CultureInfo.InvariantCulture)" by "()"
I had to use it to avoid commas to be logged to the obj file instead of points.
Thanks I replaced in the code the verts coords convertion.
I'll do the next updates at the weekend :)

By the way I hope the face generating once will be well.

Re: S.W.A.T. Target Liberty (*.dob) models.

Posted: Tue Jan 03, 2023 2:18 pm
by Sleepy
Dear all :)

Github repo is updated.
summarizes the change of the code:

As shakotay2 advised:
PSP_GAME folder check is added - if it can't find than program throws InvalidDataException("PSP_GAME Folder Does not exists").

Based on my re-search I've added support different type of models (01 - SingleModel, 24 - MAP object, 25 - Character)
Which model has zeros as the number of animation but has animation offset it means that there is .anm file next to the dob model in the LMP archive.

Carluver69 made some improvements on the code and regarding to it I've done some additional research of the dob files.
Currently working on fixing the export obj function because using the vertex pointer it reads wrong verts coords...
The old exporter is commented out and tried to use that one which carluver69 re-wrote.

https://github.com/Sleepy93/swat-tl-edi ... xporter.cs

As I could see in case of swatvan.dob:

The offset of verts regarding to the reading of file is: 0xD0...
however regarding to what works in (hex2obj) the start of the vertex block is 0xCA

If we read the model from 0xCA than there is a flying vertex and it is connected to the chassis maybe it would be siren.. just not in right position :?:

:oops:

If i check hr_nypd.dob than:
The verts offset is: 0x480
however in hex2obj we can only read the model well if the offset is 0x490

with hr_nypd.dob checked some options with uv mapping and it is flipped maybe it could caused by the scaling problem which is already mentioned
hex2obj settings:
Image

UV mapping:
Image

Texture:
Image

I've checked a map level with hex2obj but I didn't find yet how it should show well.
I've uploaded a sample file of it:
https://www.mediafire.com/file/oi0qngz2 ... a.dob/file

Re: S.W.A.T. Target Liberty (*.dob) models.

Posted: Wed Jan 04, 2023 4:09 am
by Durik256
Sleepy wrote: Tue Jan 03, 2023 2:18 pm Dear all :) I've uploaded a sample file
I quickly made a plugin for Noesis:
Image
there are "zero" invisible faces:
Image