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

Max Payne .ldb Level Models

Post questions about game models here, or help out others!
Post Reply
screenracer
beginner
Posts: 26
Joined: Sat Sep 29, 2018 5:48 pm
Has thanked: 19 times
Been thanked: 5 times

Max Payne .ldb Level Models

Post by screenracer »

Hey all, been trying to rip levels from the original Max Payne. The atmosphere of this game is something special, and I thought it would be really cool to port some of these maps to other games or do renders of them in modern graphics engines. Unfortunately, the .ldb format is I think the only thing that hasn't been cracked from the original Max Payne, and I couldn't find much of anything about the format online. These files contain pretty much all the level data from what I can tell, including the meshes and textures.

The textures can be ripped using this program https://www.moddb.com/games/max-payne/downloads/ldbrip
However, there is currently no way to rip the actual level mesh from these files. I'm pretty certain they're split up into several submeshes, so far I haven't had much luck. Only able to get some point clouds (probably with junk data)

Car verts from Tutorial.ldb
Image

Verts from end_combat.ldb
Image
Could be wrong, but it kinda resembles this part of the map. If you look on the right side of the above image, that block of verts kinda resembles the desks where the computers are set on.
Image

Any point clouds i'm able to grab are always near the top of the file, but if you look at the bottom of the file, you can see various strings, probably related to the levels scripting but some of these I think are mesh/texture names.
Image

I've also tried the game's modding SDK, which does include a level editor. However, it doesn't include anything for these .ldb files. Ninja ripper also didn't take kindly to this game.

Here's some sample files if you'd like to take a look.
https://mega.nz/file/Y74QSDjL#YT_Zy8eto ... aVmATG9WCo

Hope someone with more experience than me can shed some light on this, any help would be appreciated.
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4291
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1151 times
Been thanked: 2244 times

Re: Max Payne .ldb Level Models

Post by shakotay2 »

Funny format, some small point clouds, yeah. In Tutorial.ldb 30..80 vertices per submesh, but FVFsize is varying from 35 to 36, then 37 bytes. Crazy.
I assume this is worthless as long you don't know where or how to get the face indices.
Maybe a "point cloud skinner" is an option?
.
MP_Tutorial-ldb.png
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?"
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4291
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1151 times
Been thanked: 2244 times

Re: Max Payne .ldb Level Models

Post by shakotay2 »

funny_tut.png
edit: meanwhile I checked some of the face indices "candidates" - always gives me a mess. There must be some trick...
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?"
Nostritius
ultra-n00b
Posts: 9
Joined: Mon Nov 11, 2019 11:18 am
Has thanked: 1 time
Been thanked: 4 times

Re: Max Payne .ldb Level Models

Post by Nostritius »

I have researched the ldb format and can share what I found out. The thing is, that they use a weird serialization format which compresses numbers into up to 3 bytes. Every element is prefixed with a byte determining its type. From what I have read, you probably already know 0x16 for a 3d float vector. I have appended a python script which unpacks the ldb files geometry as obj files. There are still plenty of things to do, for example, the level is build up from multiple sub meshes. While I found an id to separate them they all lay on each other, so they need a kind of offset. Furthermore the extracted stuff is currently only bare geometry, while textures can be extracted I am missing some information where they get attached.
You do not have the required permissions to view the files attached to this post.
Nostritius
ultra-n00b
Posts: 9
Joined: Mon Nov 11, 2019 11:18 am
Has thanked: 1 time
Been thanked: 4 times

Re: Max Payne .ldb Level Models

Post by Nostritius »

Just a small example of the end combat room as geometry. That thing hanging in the middle is one of those mentioned submeshes
You do not have the required permissions to view the files attached to this post.
User avatar
Reddance
advanced
Posts: 64
Joined: Sat Dec 05, 2015 6:03 pm
Has thanked: 2 times
Been thanked: 4 times

Re: Max Payne .ldb Level Models

Post by Reddance »

how's this comin along? looks like you're makin good progress mango jango! :D
Nostritius
ultra-n00b
Posts: 9
Joined: Mon Nov 11, 2019 11:18 am
Has thanked: 1 time
Been thanked: 4 times

Re: Max Payne .ldb Level Models

Post by Nostritius »

Reddance wrote: Tue May 03, 2022 12:54 am how's this comin along? looks like you're makin good progress mango jango! :D
I made some progress and found a table, describing the material properties. Still, I cannot assign them to a particular face. I should mention that this has a lower priority for me, since I am more interested in the Remedy Games starting from Alan Wake which have a different Engine. I wanted to know, how much these games have in common with the Max Payne Games, that is the reason, why I started reversing them.
You do not have the required permissions to view the files attached to this post.
m0nstr0
ultra-n00b
Posts: 3
Joined: Sun Jun 12, 2022 1:41 pm
Been thanked: 1 time

Re: Max Payne .ldb Level Models

Post by m0nstr0 »

I want to port Max Payne to UE5. So I've spent like a week trying to decompile this file format. I've even used IDA to disassemble all the DLLs and the EXE files to figure out how it is processed by the game. I've parsed like 80 percent of file format. The file format is a totally weird. It is the kind of memory dump. The level geometry is duplicated lots of times. I think, it's possible to write Decompiler from LDB to MaxED's LVL format, because LDB contains almost all information that LVL file contains. They use polygons to render geometry not triangles. I'm currently writing Maya script to visualize all of this mess from the LDB.
m0nstr0
ultra-n00b
Posts: 3
Joined: Sun Jun 12, 2022 1:41 pm
Been thanked: 1 time

Re: Max Payne .ldb Level Models

Post by m0nstr0 »

I wrote the script for Maya. It allows import Max Payne's levels.
Screenshot_3.jpg
You do not have the required permissions to view the files attached to this post.
Nostritius
ultra-n00b
Posts: 9
Joined: Mon Nov 11, 2019 11:18 am
Has thanked: 1 time
Been thanked: 4 times

Re: Max Payne .ldb Level Models

Post by Nostritius »

m0nstr0 wrote: Wed Jun 15, 2022 2:31 am I wrote the script for Maya. It allows import Max Payne's levels.
Screenshot_3.jpg
Nice work, would you be willing to share the code? I would be interested what I missed.
m0nstr0
ultra-n00b
Posts: 3
Joined: Sun Jun 12, 2022 1:41 pm
Been thanked: 1 time

Re: Max Payne .ldb Level Models

Post by m0nstr0 »

Nostritius wrote: Thu Jun 16, 2022 8:55 am
m0nstr0 wrote: Wed Jun 15, 2022 2:31 am I wrote the script for Maya. It allows import Max Payne's levels.
Screenshot_3.jpg
Nice work, would you be willing to share the code? I would be interested what I missed.
Sure, https://github.com/m0nstr0/max_payne_ldb_importer

But I'm still working on it. There are some issues with the dynamic mesh transformations in the scene
Post Reply