Important information: this site is currently scheduled to go offline indefinitely by end of the year.

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

Post questions about game models here, or help out others!
Sleepy
beginner
Posts: 20
Joined: Mon Jun 22, 2015 6:59 pm
Location: Budapest/ Hungary
Has thanked: 8 times
Been thanked: 3 times

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

Post 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.
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4291
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1150 times
Been thanked: 2243 times

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

Post by shakotay2 »

point cloud of swatvan looks like this: (don't have the time to care for face indices)
swatvan_dob.jpg
You do not have the required permissions to view the files attached to this post.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
Sleepy
beginner
Posts: 20
Joined: Mon Jun 22, 2015 6:59 pm
Location: Budapest/ Hungary
Has thanked: 8 times
Been thanked: 3 times

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

Post 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
Acewell
VIP member
VIP member
Posts: 1330
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2710 times
Been thanked: 884 times

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

Post 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. :(
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4291
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1150 times
Been thanked: 2243 times

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

Post by shakotay2 »

You'll need a fake tristripped face indices list:
fakeFIs-Tris.jpg
(It's on my todo list.)
You do not have the required permissions to view the files attached to this post.
Last edited by shakotay2 on Fri Jan 08, 2016 10:12 am, edited 1 time in total.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
Sleepy
beginner
Posts: 20
Joined: Mon Jun 22, 2015 6:59 pm
Location: Budapest/ Hungary
Has thanked: 8 times
Been thanked: 3 times

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

Post 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
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4291
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1150 times
Been thanked: 2243 times

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

Post 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.
You do not have the required permissions to view the files attached to this post.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
Sleepy
beginner
Posts: 20
Joined: Mon Jun 22, 2015 6:59 pm
Location: Budapest/ Hungary
Has thanked: 8 times
Been thanked: 3 times

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

Post 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 :)
Sleepy
beginner
Posts: 20
Joined: Mon Jun 22, 2015 6:59 pm
Location: Budapest/ Hungary
Has thanked: 8 times
Been thanked: 3 times

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

Post 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
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4291
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1150 times
Been thanked: 2243 times

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

Post 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?
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
Sleepy
beginner
Posts: 20
Joined: Mon Jun 22, 2015 6:59 pm
Location: Budapest/ Hungary
Has thanked: 8 times
Been thanked: 3 times

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

Post 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.
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4291
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1150 times
Been thanked: 2243 times

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

Post 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.
You do not have the required permissions to view the files attached to this post.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
Sleepy
beginner
Posts: 20
Joined: Mon Jun 22, 2015 6:59 pm
Location: Budapest/ Hungary
Has thanked: 8 times
Been thanked: 3 times

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

Post 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.
Sleepy
beginner
Posts: 20
Joined: Mon Jun 22, 2015 6:59 pm
Location: Budapest/ Hungary
Has thanked: 8 times
Been thanked: 3 times

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

Post 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
User avatar
Durik256
ultra-veteran
ultra-veteran
Posts: 428
Joined: Wed Nov 21, 2018 7:26 pm
Has thanked: 45 times
Been thanked: 429 times

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

Post 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
You do not have the required permissions to view the files attached to this post.
Post Reply