Poll time! Click here: Are you interested in the chiptune scene? If so, which?. Let's see what our community thinks of the chiptune scene. :) !

Duke Nukem Manhattan Project GRN

Post questions about game models here, or help out others!
Post Reply
TheZombieKiller
ultra-n00b
Posts: 3
Joined: Thu Dec 11, 2014 2:48 am
Been thanked: 1 time

Duke Nukem Manhattan Project GRN

Post by TheZombieKiller » Thu Dec 11, 2014 2:54 am

Hi,

I'm looking for somebody who may be able to crack Duke Nukem Manhattan Project's GRN model format.
I've searched all over for some sort of importer and exporter for the format, but I haven't found much.

Over here are some files that may aid in understanding the format: https://www.dropbox.com/s/uhwdjrcjpezto ... ystuff.rar

The farthest I've gotten is getting grn models over to the gr2 format, but even then, grnreader doesn't seem to be able to read the animation files,
so I can only really get static models out. Which still doesn't solve the issue of not being able to get them back into grn format.

Thanks in advance to anyone willing to help/contribute

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

Re: Duke Nukem Manhattan Project GRN

Post by shakotay2 » Thu Dec 11, 2014 7:28 pm

how did you convert duke.grn to duke.gr2?

Your readme.txt says:
"grn2gr2.dll - File that can convert grn files to gr2, could possibly be used by a program to convert models"

Guess, I'd need
Granny Standard Exporter from the SDK? (which is not free?)
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."

TheZombieKiller
ultra-n00b
Posts: 3
Joined: Thu Dec 11, 2014 2:48 am
Been thanked: 1 time

Re: Duke Nukem Manhattan Project GRN

Post by TheZombieKiller » Fri Dec 12, 2014 12:00 am

Whoops, forgot to mention how I did that.
I had to use a modified version of the free tool "Granny Viewer" that can read GRN files.
http://forums.duke4.net/index.php?app=c ... ch_id=7683

Just drag the "grn" model of your choice onto the custom version of Granny Viewer, and wait for the model to convert. Then, if you want to convert it to an SMD, close Granny Viewer and open "gr2convert.bat" and type in the original name of the model or any name you want the resulting smd to have, eg, if you're converting "duke.grn", then just type duke and press enter.

Materials don't appear to remain intact.
Last edited by TheZombieKiller on Fri Dec 12, 2014 1:33 am, edited 1 time in total.

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

Re: Duke Nukem Manhattan Project GRN

Post by shakotay2 » Fri Dec 12, 2014 1:33 am

well, thx.
I had to use granny2.dll from your opening post, then duke.smd was created
and could be read into a 3D app.

So to sum up:
o you can read static .grn meshes and convert them to SMD

o For animations like duke_cartwheel.grn (0 meshes, 31 bones) grn_viewer.exe doesn't display
an object but creates a grn.gr2 file.

o The bat file doesn't create an SMD from grn.gr2.
o The grnreader_a.exe creates an empty .ms file
and an SMD like this:
triangles
end

Did I miss something?

Hopefully there are animations in the grn.gr2 file.
Last edited by shakotay2 on Fri Dec 12, 2014 1:36 am, edited 1 time in total.
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."

TheZombieKiller
ultra-n00b
Posts: 3
Joined: Thu Dec 11, 2014 2:48 am
Been thanked: 1 time

Re: Duke Nukem Manhattan Project GRN

Post by TheZombieKiller » Fri Dec 12, 2014 1:36 am

Nope, you haven't missed anything at all. That's basically all I've managed to do so far.
GrannyViewer seems to be able to convert animations to gr2, but grnreader has trouble converting the resulting gr2 files to smd files.

The goal here is to fix this, and to also get an exporter for the grn format, so that models can be added and/or replaced in the game.

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

Re: Duke Nukem Manhattan Project GRN

Post by shakotay2 » Fri Dec 12, 2014 2:02 am

I'll have to sleep now. :)

Don't know whether it will help but I would suggest to add debug lines to the grnreader.cpp
(just logging the addresses processed in the gr2 file.) -> edit: impossible, no access to granny2.dll

Then process duke.gr2 and the cart_wheel.gr2 to get some understanding of their structures.

(It's a static mesh and an animation file, yeah.
But that's the only idea I have atm.)

edit: (log)
duke.gr2
tex_cnt 2
mat_cnt 4
skel_cnt 1
vert_cnt 11
TriTop_cnt 11
msh_cnt 11
mod_cnt 1
TrGrp_cnt 1
ani_cnt 1
--------------------
cardwheel.gr2
tex_cnt 0
mat_cnt 0
skel_cnt 1
vert_cnt 0
TriTop_cnt 0
msh_cnt 0
mod_cnt 1
TrGrp_cnt 1
ani_cnt 1

I logged the members of t_Animations:

ani_Name: (unnamed)
ani_Duration: -1610612736
ani_TimeStep: -1610612736
ani_TrackGrpsCnt: 0

As you can see Duration and TimeStep are not valid.
(Since most things are hidden in granny2.dll which comes without debug info I'll stop my investigations here.)
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."

Post Reply