Join also our Discord channel! Click here.

Granny .GR2 Reader plugin for Noesis

Post questions about game models here, or help out others!
jayn23
veteran
Posts: 119
Joined: Sun Jul 17, 2011 9:30 pm
Has thanked: 31 times
Been thanked: 107 times

Granny .GR2 Reader plugin for Noesis

Post by jayn23 » Sat Jun 13, 2020 7:59 pm

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) , only current known issue is for DOS/DOS2 animations about 10% of animation showed some jittering.

Animation Usage:
I have include 2 options to load animation.
In line 22 of the code you will find Variable AnimMode set value per your need.
1. AnimMode = 1 is the default Mode and is set to load a paired animation file with your mesh/skeleton file.
2. AnimMode = 2 will search for animation data in you main file and load it if its there.
3. AnimMode = 0 will disable loading of animation data.

Partially Supported:
1.Material parsing + Auto texturing - Since most Games (all but 2 that I looked at) don’t seem to store any Material/Texture Data in .GR2 files I have decided to drop this feature.
Instead for games that I am interested in I will create "Texture Modules" like i used to create all these pretty pictures :P .
Please don’t Ask me to support games, I will only support games that I choose on my own.

Compression and Usage:
Plugin supports all known compression methods including:
0 - Granny No Compression
1 - Granny Oodle0 Compression
2 - Granny Oodle1 Compression
3 - Granny BitKnit Compression
4 - Granny BitKnit2 Compression

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 - animation tested
2. Divinity: Original Sin 2 - animation tested
3. Neverwinter Nights 2 - animation tested
4. The Elder Scrolls Online - animation tested, some meshes have corrupted UV
5. EVE Online - - animation tested
6. Silent Hunter 5
7. Metin2
8. Evil Genius
9. Winter X-Games: Snocross - animation tested
10. Sid Meier's Civilization V - animation tested
11. Sid Meier's Civilization VI - animation tested
12. Sacred 2 - animation tested
13. Generic GR2 files supplied with Granny viewer - animation tested
14. Demigod - animation tested
15. Dungeon Lord - animation tested
15. Dungeon Siege 3 - animation tested
16. Sevencore MMO - animation tested
17. Söldner - Secret Wars - animation tested
18. Lionheart - animation tested
19. Beyond Divinity - animation tested

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


Get the script here:
fmt_GR2reader.rar
You do not have the required permissions to view the files attached to this post.
Last edited by jayn23 on Tue Jun 16, 2020 9:16 pm, edited 3 times in total.

User avatar
Henchman800
mega-veteran
mega-veteran
Posts: 201
Joined: Fri Nov 16, 2018 5:00 pm
Has thanked: 41 times
Been thanked: 10 times

Re: Granny .GR2 Reader plugin for Noesis

Post by Henchman800 » Sat Jun 13, 2020 8:40 pm

I can't wait to Test this with Winter xgames snocross models :keke:

Allanoon
advanced
Posts: 52
Joined: Sat Apr 14, 2012 9:00 pm
Has thanked: 45 times
Been thanked: 12 times

Re: Granny .GR2 Reader plugin for Noesis

Post by Allanoon » Sun Jun 14, 2020 1:42 am

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
veteran
Posts: 119
Joined: Sun Jul 17, 2011 9:30 pm
Has thanked: 31 times
Been thanked: 107 times

Re: Granny .GR2 Reader plugin for Noesis

Post by jayn23 » 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
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: 201
Joined: Fri Nov 16, 2018 5:00 pm
Has thanked: 41 times
Been thanked: 10 times

Re: Granny .GR2 Reader plugin for Noesis

Post by Henchman800 » Sun Jun 14, 2020 10:09 am

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
veteran
Posts: 119
Joined: Sun Jul 17, 2011 9:30 pm
Has thanked: 31 times
Been thanked: 107 times

Re: Granny .GR2 Reader plugin for Noesis

Post by jayn23 » Sun Jun 14, 2020 10:30 am

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: 201
Joined: Fri Nov 16, 2018 5:00 pm
Has thanked: 41 times
Been thanked: 10 times

Re: Granny .GR2 Reader plugin for Noesis

Post by Henchman800 » Sun Jun 14, 2020 11:14 am

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: 185
Joined: Wed Jan 11, 2012 10:21 pm
Has thanked: 28 times
Been thanked: 3 times

Re: Granny .GR2 Reader plugin for Noesis

Post by Drawing » Sun Jun 14, 2020 4:30 pm

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
advanced
Posts: 52
Joined: Sat Apr 14, 2012 9:00 pm
Has thanked: 45 times
Been thanked: 12 times

Re: Granny .GR2 Reader plugin for Noesis

Post by Allanoon » Sun Jun 14, 2020 5:46 pm

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: 201
Joined: Fri Nov 16, 2018 5:00 pm
Has thanked: 41 times
Been thanked: 10 times

Re: Granny .GR2 Reader plugin for Noesis

Post by Henchman800 » Sun Jun 14, 2020 7:18 pm

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
veteran
Posts: 119
Joined: Sun Jul 17, 2011 9:30 pm
Has thanked: 31 times
Been thanked: 107 times

Re: Granny .GR2 Reader plugin for Noesis

Post by jayn23 » Sun Jun 14, 2020 10:43 pm

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: 66
Joined: Thu Jun 25, 2015 11:26 pm
Has thanked: 7 times

Re: Granny .GR2 Reader plugin for Noesis

Post by MarioSonicU » Mon Jun 15, 2020 4:59 am

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
veteran
Posts: 119
Joined: Sun Jul 17, 2011 9:30 pm
Has thanked: 31 times
Been thanked: 107 times

Re: Granny .GR2 Reader plugin for Noesis

Post by jayn23 » Mon Jun 15, 2020 10:14 am

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
veteran
Posts: 119
Joined: Sun Jul 17, 2011 9:30 pm
Has thanked: 31 times
Been thanked: 107 times

Re: Granny .GR2 Reader plugin for Noesis

Post by jayn23 » Mon Jun 15, 2020 7:45 pm

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
advanced
Posts: 52
Joined: Sat Apr 14, 2012 9:00 pm
Has thanked: 45 times
Been thanked: 12 times

Re: Granny .GR2 Reader plugin for Noesis

Post by Allanoon » Mon Jun 15, 2020 10:22 pm

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