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

Granny .GR2 Reader plugin for Noesis

Post questions about game models here, or help out others!
Post Reply
jayn23
mega-veteran
mega-veteran
Posts: 250
Joined: Sun Jul 17, 2011 9:30 pm
Has thanked: 61 times
Been thanked: 241 times

Granny .GR2 Reader plugin for Noesis

Post by jayn23 »

Hi,

It all started about 4 months ago when Baldur's Gate 3 was presented, after doing some research i found that Larian Studios have used Granny format for all there latest games, so i took a gamble and started working on this :D
So after months of work I am happy to present my Granny .GR2 Reader plugin for Noesis.
This plugin has been built to be as generic as possible to support most games and existing variations.

Supported:
1.Skinned + Static Meshes ( 2 UV channels , Normals, Skin Weights)
2.Skeleton
3.Animations - Supported animation includes all knows types including old .gr2 versions.
I have tested on multiple games (see complete list below) , 95% of tested animations work.

Script Options:
Script has a few option that can be found at lines 25-28:
SKELETON_LOAD - for loading paired skeleton file change value to 1
ANIMATION_MODE - switch between Animation modes, 1 - load paired animation file, 2 - load animation from main file, 0 - disable animation loading
MERGE_SCENE = when set to 1 means merge is active, 0 merge is disabled, should be used only with animation mode 2, will merge all models + skeleton + animation in chosen file to 1 model/Scene
ANIMATION_TRACK = For files with multiple animation tracks, choose with track to load
MULTIFILE - Multiple option to merge all gr2 files in folder

Material parsing + Auto texturing
Supported for:
Diablo II: Resurrected
Baldur's Gate III - still needs work

Compression and Usage:
Plugin supports all known compression methods.
Please note that in order to read compressed meshes you need to have a granny2.dll in you Noesis main folder - not all granny2.dll versions support BitKnit compression, if you don’t have one please don’t ask me for a copy.

a nice dance from DOS2:
Image

A carrier from Civ6:
Image

A Minotaur from Neverwinter nights 2:
Image

A Demon from DOS
Image

Here is a list of tested games - some like Neverwinter nights and Divinity: Original Sin were heavily tested since I own the games, others were tested with very few samples I found online or this forum.

Tested Games:
1. Divinity: Original Sin
2. Divinity: Original Sin 2
3. Neverwinter Nights 2
4. The Elder Scrolls Online
5. EVE Online
6. Silent Hunter 5
7. Metin2
8. Evil Genius
9. Winter X-Games: Snocross
10. Sid Meier's Civilization V
11. Sid Meier's Civilization VI
12. Sacred 2
13. Generic GR2 files supplied with Granny viewer
14. Demigod
15. Dungeon Lord
15. Dungeon Siege 3
16. Sevencore MMO
17. Söldner - Secret Wars
18. Lionheart
19. Beyond Divinity
20. Medal Of Honor
21. Double Dragon Neon
22. Dragon Commander
23. Mechassault 2: Lone Wolf
24. Amy (PS3)
25. Cars (2006)
26. Stronghold 2
27. CivCity Rome
28. Age of Empires III
29. Age of Empires Online
30. Diablo II: Resurrected
31. Baldur's Gate III

Credits:
Credit to norbyte from DOS fourm - his source code for gr2 to collada was my main reference for Animation phrasing and debugging my own code, can be found at https://github.com/Norbyte/lslib

Version 1.2.1
all details about update can be found here: viewtopic.php?f=16&t=22277&start=33
fmt_GR2reader121.rar

Version 1.35
can be found here: viewtopic.php?f=16&t=22277&start=283
You do not have the required permissions to view the files attached to this post.
Last edited by jayn23 on Tue Jun 15, 2021 7:32 pm, edited 28 times in total.
User avatar
Henchman800
mega-veteran
mega-veteran
Posts: 308
Joined: Fri Nov 16, 2018 5:00 pm
Has thanked: 72 times
Been thanked: 34 times

Re: Granny .GR2 Reader plugin for Noesis

Post by Henchman800 »

I can't wait to Test this with Winter xgames snocross models :keke:
Allanoon
veteran
Posts: 91
Joined: Sat Apr 14, 2012 9:00 pm
Has thanked: 116 times
Been thanked: 25 times

Re: Granny .GR2 Reader plugin for Noesis

Post by Allanoon »

Thanks for the tool, it's nice to know someone's "working" to hopefully make BD3 files readable in the future :P

Yet i'll have to ask:
I've a bunch of games made with granny engine, many openable with Granny viewer but ofc not exportable~
Now i only preserved the game files for some of them so maybe the missing granny2.dll (from the same game) is the problem i'll see tomorrow.
Here's a list of the "working one" they were quick tests, so not everything may be working correctly.

Demigod: meshes/animation loading correctly.

Dungeon Lord - Steam edition: meshes/animations seems to be loading correctly.

Dungeon Siege 3: animations are working correctly but there's no model... now if my memory serves right the models had a different format than granny, that's why i didn't keep them.

Lionheart: some meshes/animation working. Few animations are throwing errors (nothing special anyway).

Sacred 2: Some animations are working correctly, few are broken, some simply throw an error when loaded together with the model.

Sevencore: it's an old mmo from gpotato/webzen it has closed down. Anyway, meshes/animations are loading so it's good. for ppl interested... try searching the client on the net, worst case i'll upload the extracted files.

Söldner - Secret Wars: Animations are working, but not many meshes are loading (not like there're that many...)


Strange one:
Legend - Hand of God: even with the granny2.dll the game is throwing me this error
Detected file type: GR2 Reader
Format not supported
Traceback (most recent call last):
File "C:\Users\LoremIpsum\Downloads\noesisv4417\plugins\python\fmt_GR2reader.py", line 3247, in noepyLoadModel
for model in Models:
TypeError: 'int' object is not iterable

Would you mind giving some of them a look or you prefer to focus on other things? Don't wana press you, really, just asking.
Thank you again for your time and tool~

Extra: Here's a list of granny using games http://www.radgametools.com/granny/customers.html
jayn23
mega-veteran
mega-veteran
Posts: 250
Joined: Sun Jul 17, 2011 9:30 pm
Has thanked: 61 times
Been thanked: 241 times

Re: Granny .GR2 Reader plugin for Noesis

Post by jayn23 »

Allanoon,
Thanks for all the testing, i will update the list of tested games.
Thanks for the tool, it's nice to know someone's "working" to hopefully make BD3 files readable in the future :P
i must admit i dont have a clue what game you are talking about :P
Söldner - Secret Wars: Animations are working, but not many meshes are loading (not like there're that many...)
if meshes are not loading then there is no mesh data in file, if you think that there is a mesh upload a few samples.
Legend - Hand of God: even with the granny2.dll the game is throwing me this error
if you notice you are getting error "Format not supported" these means Magic string of the file isnt recognized its probably an easy fix

Please upload samples for all files that are not working and i will take a look (Sacred 2,Lionheart, etc..)
User avatar
Henchman800
mega-veteran
mega-veteran
Posts: 308
Joined: Fri Nov 16, 2018 5:00 pm
Has thanked: 72 times
Been thanked: 34 times

Re: Granny .GR2 Reader plugin for Noesis

Post by Henchman800 »

So I gave the snocross models a test, and after i select the corresponding animation .gr2 file i get this error:
Image
It continues to ask me if I want to export anyway, but its not able to do so.

Did you test the games files with a different version?

Heres a mesh:
https://cdn.discordapp.com/attachments/ ... Punk_H.GR2

and heres a anim file:
https://cdn.discordapp.com/attachments/ ... t_Idle.GR2

Thanks for you work on this format man! :up:


EDIT:
Guess what dumb Henchman800 forgot! Yeah....putting the granny2.dll in noesis main folder.....
jayn23
mega-veteran
mega-veteran
Posts: 250
Joined: Sun Jul 17, 2011 9:30 pm
Has thanked: 61 times
Been thanked: 241 times

Re: Granny .GR2 Reader plugin for Noesis

Post by jayn23 »

So I gave the snocross models a test, and after i select the corresponding animation .gr2 file i get this error:
just looking at the error, it not finding your granny2.dll file
did you place it in the main Noesis folder?
User avatar
Henchman800
mega-veteran
mega-veteran
Posts: 308
Joined: Fri Nov 16, 2018 5:00 pm
Has thanked: 72 times
Been thanked: 34 times

Re: Granny .GR2 Reader plugin for Noesis

Post by Henchman800 »

jayn23 wrote: Sun Jun 14, 2020 10:30 am just looking at the error, it not finding your granny2.dll file
did you place it in the main Noesis folder?
Haha yeah, I posted this as an edit in my previous post ^^
Thanks for the reply though!

Is there an easier method to extract the textures from gr2 files other than with the granny viewer in combination with a graphics ripper?

One more thing:
since you were so successful with the .gr2 format, i was hoping that you know how to handle granny archives aswell.
all the cool sled model of snocross are in this file:
https://we.tl/t-DgiLqDvxmJ
I'm assuming they contain .gr2 files aswell.
It would be hella awesome if you could have a look at it!
Drawing
mega-veteran
mega-veteran
Posts: 283
Joined: Wed Jan 11, 2012 10:21 pm
Has thanked: 43 times
Been thanked: 17 times

Re: Granny .GR2 Reader plugin for Noesis

Post by Drawing »

jayn23 wrote: Sat Jun 13, 2020 7:59 pm Hi [...]

So after months of work I am happy to present my Granny .GR2 Reader plugin for Noesis.
This plugin has been built to be as generic as possible to support most games and existing variations [...]
I've no words :D

Thanks jayn23 for all the effort you are putting, and to share your works with us 8)

I've read you didn't completely test all the game in the list since for some of them you owned just some sample.
If you need more sample from the game you choosed in order to make your script complete, we will send you what you need.


Greetings,
Drawing
Allanoon
veteran
Posts: 91
Joined: Sat Apr 14, 2012 9:00 pm
Has thanked: 116 times
Been thanked: 25 times

Re: Granny .GR2 Reader plugin for Noesis

Post by Allanoon »

jayn23 wrote: Sun Jun 14, 2020 6:43 am Allanoon,
Thanks for all the testing, i will update the list of tested games.
Thanks for the tool, it's nice to know someone's "working" to hopefully make BD3 files readable in the future :P
i must admit i dont have a clue what game you are talking about :P

Please upload samples for all files that are not working and i will take a look (Sacred 2,Lionheart, etc..)
My pleasure :)
I meant Baldur's Gate 3, BG3, but sleepiness got me and i wrote BD3 lol

Here're the files:
http://www.mediafire.com/file/5aglxehpj ... le.7z/file

There're also Beyond Divinity and Medal of Honor Pacific Assault whose files are giving errors.
Sacred 2 have plenty of model/anims so i only put a few.
User avatar
Henchman800
mega-veteran
mega-veteran
Posts: 308
Joined: Fri Nov 16, 2018 5:00 pm
Has thanked: 72 times
Been thanked: 34 times

Re: Granny .GR2 Reader plugin for Noesis

Post by Henchman800 »

Henchman800 wrote: Sun Jun 14, 2020 11:14 am all the cool sled model of snocross are in this file:
https://we.tl/t-DgiLqDvxmJ
I'm assuming they contain .gr2 files aswell.
It would be hella awesome if you could have a look at it!
I Think i Found a solution...
https://www.softpedia.com/get/System/Fi ... ctor.shtml
Imma Test it tonight!
jayn23
mega-veteran
mega-veteran
Posts: 250
Joined: Sun Jul 17, 2011 9:30 pm
Has thanked: 61 times
Been thanked: 241 times

Re: Granny .GR2 Reader plugin for Noesis

Post by jayn23 »

Here're the files:
http://www.mediafire.com/file/5aglxehpj ... le.7z/file

There're also Beyond Divinity and Medal of Honor Pacific Assault whose files are giving errors.
Sacred 2 have plenty of model/anims so i only put a few.

Beyond Divinity - fixed.
Scared 2 - i have identified main issue and working on a fix should be done in a day or 2.
Medal of Honor - has an annoying issue where 1 model has 2 skeleton, while building the script i assumed 1 skeleton per model (model could have multiple mesh of course), ill see if i can do an easy fix for it, but if i have to rewrite to much code i will skip this for now at least.
ESO - i was conntacted via PM about some static meshes not working, i have looked at them and my output is identical to what granny viewer is getting but some data is not working correctly (for me and granny viewer), i can get vertex + faces working but normals and uv are corrupted or in weird format.
Legend - Hand of God - i only took a 1 minute look but it dosent look like a granny file , maybe they just have extra header and granny data is somewhere inside, i will take a better look once i am done with sacred 2.

once i am done with all fixes i will upload a new version
Last edited by jayn23 on Mon Jun 15, 2020 7:45 pm, edited 2 times in total.
MarioSonicU
advanced
Posts: 75
Joined: Thu Jun 25, 2015 11:26 pm
Has thanked: 9 times
Been thanked: 2 times

Re: Granny .GR2 Reader plugin for Noesis

Post by MarioSonicU »

I was trying out your plugin on a WayForward game (Double Dragon Neon), and I get this error.
Image
Any Ideas?

http://www.mediafire.com/file/vepmp92r4 ... er.7z/file - links to gr2 files
jayn23
mega-veteran
mega-veteran
Posts: 250
Joined: Sun Jul 17, 2011 9:30 pm
Has thanked: 61 times
Been thanked: 241 times

Re: Granny .GR2 Reader plugin for Noesis

Post by jayn23 »

I was trying out your plugin on a WayForward game (Double Dragon Neon), and I get this error.
try disabling animation mode, and see if it loads mesh and skeleton, i see error is occurring in animation data process stage.

anyway it seems i have a big backlog of errors to go over and will take some time :cry:
So I gave the snocross models a test,
HI Henchman800

can you confirm if games works with aniamtion?
id like to update tested games list if yes, Thanks
jayn23
mega-veteran
mega-veteran
Posts: 250
Joined: Sun Jul 17, 2011 9:30 pm
Has thanked: 61 times
Been thanked: 241 times

Re: Granny .GR2 Reader plugin for Noesis

Post by jayn23 »

Small update:

Beyond Divinity - fixed.
Scared 2 - fixed
Lionheart - fixed
Söldner - Secret Wars - all meshes are loading for me, and i didnt do anything, maybe it was one of the other fixes?? :lol:
Strange one:
Legend - Hand of God: even with the granny2.dll the game is throwing me this error
Legend - Hand of God - is a Granny file, just missing the header, but in this post viewtopic.php?t=3045 its stated that this files contain the header and magic i am looking for..so why isnt it in your sample files? without the header i can identify this as granny file

still working on other games will see what i can do..
Allanoon
veteran
Posts: 91
Joined: Sat Apr 14, 2012 9:00 pm
Has thanked: 116 times
Been thanked: 25 times

Re: Granny .GR2 Reader plugin for Noesis

Post by Allanoon »

jayn23 wrote: Mon Jun 15, 2020 7:45 pm
Strange one:
Legend - Hand of God: even with the granny2.dll the game is throwing me this error
Legend - Hand of God - is a Granny file, just missing the header, but in this post viewtopic.php?t=3045 its stated that this files contain the header and magic i am looking for..so why isnt it in your sample files? without the header i can identify this as granny file

still working on other games will see what i can do..
What's funny is that i've a bms script but can't remember where i got it, i didn't make a thread either... anyway here it is:
get NAME basename
string NAME += ".pak.dat"

Open FDSE NAME 1

get FILES long 1

for i = 0 < FILES
getct NAME string 0x0d 1
get TRAIL byte 1
get SIZE long 1
get OFFSET long 1
get DUMMY long 1

log NAME OFFSET SIZE
next i
I made some "i hardly know what i'm doing experiments" :D :
Following that link i checked bot model and animations pak but the Hexes he's mentioning are only in the model.pak ... well, no problem, i tried with VGMtoolbox and got some files... interesting enough they only seems to be armor pieces (so static meshes?) also same meshes had different sizes meaning things are lost inside them.

Then i looked at the model (gargoyle one) looked how his Hex ended and from Model.pak tried cutting from the supposed header "B867 B0CA F86D B10F 8472" to the gargyole hex end, the resulting file would load but only showed a white rectangle~

Dunno what infos you can get from that ^ anyway... I also found this
that should be able to extract the files, unfortunately it only works with 32 bit system.

Here:
Are Legend models/animations .pak and .dat if you want to directly check them + In the ESO folders the first files loads and are armor pieces and such, other files throw... yep, errors.
Apologize for the useless blabbing and thank you.

Edit: Another header that's commonly used is "29 DE 6C C0 BA A4 53 2B 25 F5 B7 A5 F6 66 E2 EE" and too is present into the model.pak, animations still got nothing... on a better "view" i noticed that the armor/weapons loaded do load the skeletons.
Post Reply