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

Mafia 2 models [pc]

Post questions about game models here, or help out others!
Dean
n00b
Posts: 10
Joined: Thu Jul 08, 2010 11:09 pm
Has thanked: 4 times

Re: Mafia 2 models [pc]

Post by Dean »

I'm having the same problem as the other people who aren't getting anything when they import it. Blender 2.49b, extracted the VertexBufferPool and IndexBufferPool, placed the .blend in the same folder, ran it and executed the script. Sometimes it acts like it's loading a model, but then when I check back a minute later nothing has actually loaded.
Szkaradek123
mega-veteran
mega-veteran
Posts: 292
Joined: Wed May 05, 2010 8:21 pm
Location: Poland Głogów
Has thanked: 21 times
Been thanked: 742 times

Re: Mafia 2 models [pc]

Post by Szkaradek123 »

The contents of this post was deleted because of possible forum rules violation.
shakotay
ultra-n00b
Posts: 8
Joined: Thu Oct 28, 2010 10:43 pm

Re: Mafia 2 models [pc]

Post by shakotay »

For all those of you who "did not get anything in blender":

I suppose it's an extractor version problem (which tool did you use for extracting the VertexBufferPool?).

(I used ExSDS v0.3 by CJay.)

I have the mafia2 demo only but I tested it with Lassiter_69.sds and it works:

http://www.pic-upload.de/view-7568802/m ... h.jpg.html

You'll have to right click on the block at the left and delete the selection several times.
At the end you'll see the car.

(Might occcur that nothing is left - then you'll have to repeat the procedure;-)

PS: Thank you so much, Szkaradek123, for your python script!
DerPlaya
n00b
Posts: 13
Joined: Sun Mar 21, 2010 10:41 pm
Been thanked: 4 times

Re: Mafia 2 models [pc]

Post by DerPlaya »

here's my try to write an exporter:

Mafia2ModelDumper:

- works on sds files (not just vertexbuffer/indexbuffer files, the real info is in the FrameResource data...)
- exports Models with Skeleton (if one exists) to Collada DAE format.

see Readme.txt
perhaps somebody can make a more useful tool with the source (I won't make any updates...)

source is c# (vc#2010, .net 4)

uses Gibbed's tools for sds access (thanks Rick!)

edit: updated the tool (fixed matrix stuff, cause softimage to mess up joint transforms)
You do not have the required permissions to view the files attached to this post.
Last edited by DerPlaya on Sat Nov 13, 2010 10:57 pm, edited 1 time in total.
User avatar
Tosyk
double-veteran
double-veteran
Posts: 1027
Joined: Thu Oct 22, 2009 10:24 am
Location: Russia, Siberia
Has thanked: 269 times
Been thanked: 154 times
Contact:

Re: Mafia 2 models [pc]

Post by Tosyk »

The contents of this post was deleted because of possible forum rules violation.
You do not have the required permissions to view the files attached to this post.
Thank you for all you do here
my blog | my forum
CityPoke912
beginner
Posts: 30
Joined: Sat Sep 18, 2010 8:20 pm
Has thanked: 1 time

Re: Mafia 2 models [pc]

Post by CityPoke912 »

Can anyone say how use it? I completly don't know how.
DerPlaya
n00b
Posts: 13
Joined: Sun Mar 21, 2010 10:41 pm
Been thanked: 4 times

Re: Mafia 2 models [pc]

Post by DerPlaya »

bin\Release\Mafia2ModelDumper <sdsfile>

where sdsfile is the path to a sdsfile (preferably one which contains models...)

...should be already be mentioned in the readme.txt
shakotay
ultra-n00b
Posts: 8
Joined: Thu Oct 28, 2010 10:43 pm

Re: Mafia 2 models [pc]

Post by shakotay »

Copy sds file to release\bin\Release where Mafia2ModelDumper.exe resides.
In a DOS command window type Mafia2ModelDumper lassiter_69.sds for example.
3 dae files should be created (one is lassiter_69.Lassiter_69.Root.L0.dae).

I used 'Collada 1.4.1 Importer (.dae)' (author: teraapi) with blender 2.49 for dae import.

@DerPlaya: very impressive work! Thanks a lot. :)

@all: from city\distillery.sds (Mafia2 demo) you'll get 3000 dae files.
Here are two of them:

http://www.pic-upload.de/view-7751484/d ... e.jpg.html
http://www.pic-upload.de/view-7751499/d ... e.jpg.html

edit: upps, DerPlaya was schnella, ehm faster

greenfield villa:
http://www.pic-upload.de/view-7756712/g ... e.jpg.html
Last edited by shakotay on Sun Nov 14, 2010 1:52 pm, edited 1 time in total.
CityPoke912
beginner
Posts: 30
Joined: Sat Sep 18, 2010 8:20 pm
Has thanked: 1 time

Re: Mafia 2 models [pc]

Post by CityPoke912 »

My DOS window after a moment close and I can't do anything.
shakotay
ultra-n00b
Posts: 8
Joined: Thu Oct 28, 2010 10:43 pm

Re: Mafia 2 models [pc]

Post by shakotay »

CityPoke912 wrote:My DOS window after a moment close and I can't do anything.
Which OS?

You'll have to open a DOS-Window:

for Win7: http://www.sevenforums.com/tutorials/94 ... rompt.html

Should be similar for Vista.

Then the window stays open after execution of Mafia2ModelDumper and you can read the output
(whatever it may be).
DerPlaya
n00b
Posts: 13
Joined: Sun Mar 21, 2010 10:41 pm
Been thanked: 4 times

Re: Mafia 2 models [pc]

Post by DerPlaya »

...drag & drop should also work (the exe just tries to read the first command line argument as an sds file...)

i could have made it more user friendly but it's just a proof of concept thing... i encourage everyone who has c# knowledge (and can understand the poorly commented mess which is my code :wink:) to do something useful with it.

i originally started to write a model viewer but i don't have enough enough time and lack knowledge of mdx, xna, etc. + it would be neccessary to use the games shaders for optimal results (the game does some strange stuff like building dynamic normal maps for damaged cars, dirt, snow etc.). there is some code for reading *.mtl files and shadercache files in the source but it's incomplete and probably all wrong...

@shakotay: question: do the character models work with blender? i thought the collada import plugin for blender can't cope with vertex weights (for skeletal animation).
I'm still searching for a modelling tool to test stuff (i use softimage mod tool at the moment but it likes to crash a lot; gmax doesn't read dae files and all other stuff like maya, 3dsmax cost money...)

@CityPoke912: ...make sure you've got .net framework 4.0.
shakotay
ultra-n00b
Posts: 8
Joined: Thu Oct 28, 2010 10:43 pm

Re: Mafia 2 models [pc]

Post by shakotay »

DerPlaya wrote: @shakotay: question: do the character models work with blender? i thought the collada import plugin for blender can't cope with vertex weights (for skeletal animation).
Vito looks like this:
http://www.pic-upload.de/view-7761219/v ... e.jpg.html

(There are warnings in the blender console:
Warning: The DOM was unable to create an element named float at line 46. Probably a schema violation.
Warning: The DOM was unable to create an element named color at line 64. Probably a schema violation.

Probably from Dom4Blender.pyd (COLLADA DOM API?) used by the blender dae-import script.)
CityPoke912
beginner
Posts: 30
Joined: Sat Sep 18, 2010 8:20 pm
Has thanked: 1 time

Re: Mafia 2 models [pc]

Post by CityPoke912 »

I've got Framework 4.0, but it doesn't help. After a parts of second, window disappear and I can't do anything with extracting models. I'm use Win 7.
DerPlaya
n00b
Posts: 13
Joined: Sun Mar 21, 2010 10:41 pm
Been thanked: 4 times

Re: Mafia 2 models [pc]

Post by DerPlaya »

@shakotay: the warnings should be ok... those lines should be in the material/effects declaration which are dummy anyway.

...tested it myself (in blender). i thought those lines where offset vertices but it seems blender displays the bones like this (haven't used blender before) and it seems to be ok...

@CityPoke912: maybe you should read some of the hints about opening a command window (if you did that it would stay open and not close automatically)
here's a little trick:
- copy the Mafia2ModelDumper.exe to a folder containing sds files.
- in an explorer window hold shift -> right click the folder (containing the exe) -> choose 'command prompt here' from the context menu -> type "Mafia2ModelDumper <sdsfile>" where sdsfile is an existing file and press enter...
CityPoke912
beginner
Posts: 30
Joined: Sat Sep 18, 2010 8:20 pm
Has thanked: 1 time

Re: Mafia 2 models [pc]

Post by CityPoke912 »

OK, it work, but now I can't import that. They are few errors in the Blender's console.
Post Reply