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

Yoru no nai Kuni - .g1m file extraction

Post questions about game models here, or help out others!
XxYarnRulerxX
ultra-n00b
Posts: 5
Joined: Tue Jun 09, 2015 6:50 pm

Yoru no nai Kuni - .g1m file extraction

Post by XxYarnRulerxX »

How do I go about extracting the 3d model files from the .g1m files of the game? I've been able to extract the .g1t files pretty easily, but I can't find any tools that work for g1m except a max script, but I don't have max. How do I convert .g1m to obj or another usable format??

http://www.mediafire.com/download/umfj1 ... _MODEL.rar
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: Yoru no nai Kuni - .g1m file extraction

Post by shakotay2 »

XxYarnRulerxX wrote:[...] but I can't find any tools that work for g1m except a max script
then what is the name of that wonderful script? :D

using hex2obj (view link in my sig):
PC00F_MODEL_P_M_Body1ALL_BK_xScAlphaTest_g1m.jpg
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?"
XxYarnRulerxX
ultra-n00b
Posts: 5
Joined: Tue Jun 09, 2015 6:50 pm

Re: Yoru no nai Kuni - .g1m file extraction

Post by XxYarnRulerxX »

The script is a .ms script meant for a game called dynaster warriors 7, but is supposed to import .g1m files.
http://www.mediafire.com/download/beaau ... /dw7-1.rar

atm, I'm trying to figure out how to work your mesh extractor. Thank you btw for replying! c:
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: Yoru no nai Kuni - .g1m file extraction

Post by shakotay2 »

yeah, it's one of chrrox' scripts.
Add this

Code: Select all

if VSizeA[(ElemArr[b].FaceID)] == 0x5C Do (
	vx = ReadBEfloat f
	vy = ReadBEfloat f
	vz = ReadBEfloat f
	tu = 0
	tv = 0
	fseek f (VSizeA[(ElemArr[b].FaceID)] - 12)#seek_cur
)
to make it work with Yoru no nai Kuni g1m files if you have 3dsmax.

(The tex coords are at offset 44 of the FVFblock but I'm too lazy to apply this to the script.)
or wait, try this (untested):

Code: Select all

if VSizeA[(ElemArr[b].FaceID)] == 0x5C Do (
	vx = ReadBEfloat f
	vy = ReadBEfloat f
	vz = ReadBEfloat f
	fseek f (32)#seek_cur
	tu = ReadBEfloat f
	tv = ReadBEfloat f
	fseek f (VSizeA[(ElemArr[b].FaceID)] - 52)#seek_cur
)
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?"
XxYarnRulerxX
ultra-n00b
Posts: 5
Joined: Tue Jun 09, 2015 6:50 pm

Re: Yoru no nai Kuni - .g1m file extraction

Post by XxYarnRulerxX »

Thanks so much!, but the problem is I don't have max, I have blender 2.7. Is it possible to convert the script to work for blender??
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: Yoru no nai Kuni - .g1m file extraction

Post by shakotay2 »

XxYarnRulerxX wrote:Is it possible to convert the script to work for blender??
It surely is but I prefer using 'C' instead of python. And it's much easier to create a simple concept like searching for the string "G1M" in the concerning files than just converting other authors' work.
(I don't mean it's better because there's nothing better than chrrox' scripts :D but it would be easier for me.)

Maybe I can start a small MakeH2O project as soon as I've more spare time.

here's another result (search for g_shadowColor to find the start of the vertices):
PC00F_MODEL_P_M_BodyALL_FR_xScAlphaTest.jpg
H2O file:
0x91320 10658
Vb1
84 44
0x1E34 4918
121000
0x0 255
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?"
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: Yoru no nai Kuni - .g1m file extraction

Post by Szkaradek123 »

Hi
Here is a blend importer for this model .
It requires installed Blender249 and Python 266 (all 32 bits).
How use:
-doubleclick Blender249.blend or copy all files to folder where is blender.exe and doubleclick Blender249.blend
-in Blender Text Window press alt+p and select g1t to unpack images
-press alt+p and select g1m
-PC00F_MODEL.g1m select last (skeleton)

Don't all meshes have vertex with weights.

I don't know if it works with others models.

http://www.mediafire.com/download/38byl ... -24%5D.zip
You do not have the required permissions to view the files attached to this post.
Last edited by Szkaradek123 on Tue Nov 24, 2015 6:55 pm, edited 1 time in total.
XxYarnRulerxX
ultra-n00b
Posts: 5
Joined: Tue Jun 09, 2015 6:50 pm

Re: Yoru no nai Kuni - .g1m file extraction

Post by XxYarnRulerxX »

So I tried the blender import script but then I press alt-p, and get the error:

Python script error: Check console.
I checked and it said the problem is the first line: "import newGameLib"

So I installed python 2.6.6 and still got the error. You mentioned 32-bit. I have 64-bit windows. Would that cause error?
Darko
double-veteran
double-veteran
Posts: 723
Joined: Mon Jul 13, 2009 6:16 pm
Has thanked: 72 times
Been thanked: 138 times

Re: Yoru no nai Kuni - .g1m file extraction

Post by Darko »

XxYarnRulerxX wrote:So I tried the blender import script but then I press alt-p, and get the error:

Python script error: Check console.
I checked and it said the problem is the first line: "import newGameLib"

So I installed python 2.6.6 and still got the error. You mentioned 32-bit. I have 64-bit windows. Would that cause error?
Place the gamelib folder in your blender folder.
Image
dian333
beginner
Posts: 36
Joined: Mon Sep 15, 2014 11:59 pm
Has thanked: 1 time
Been thanked: 9 times

Re: Yoru no nai Kuni - .g1m file extraction

Post by dian333 »

Darko wrote:
XxYarnRulerxX wrote:So I tried the blender import script but then I press alt-p, and get the error:

Python script error: Check console.
I checked and it said the problem is the first line: "import newGameLib"

So I installed python 2.6.6 and still got the error. You mentioned 32-bit. I have 64-bit windows. Would that cause error?
Place the gamelib folder in your blender folder.
compiled with python version 2.6.2
checking for installed python........................................got it!
...
file"starter.py",line 1, in <module>
import newgamelib
............._init_.py"
.................
..............bump_to_normal.py",line 3 ,in <module>
import PIL
ImportError: no module named PIL
======================================
2.49 2.49b and python 2.52 2.66
show the same
You do not have the required permissions to view the files attached to this post.
dian333
beginner
Posts: 36
Joined: Mon Sep 15, 2014 11:59 pm
Has thanked: 1 time
Been thanked: 9 times

Re: Yoru no nai Kuni - .g1m file extraction

Post by dian333 »

XxYarnRulerxX wrote:How do I go about extracting the 3d model files from the .g1m files of the game? I've been able to extract the .g1t files pretty easily, but I can't find any tools that work for g1m except a max script, but I don't have max. How do I convert .g1m to obj or another usable format??

http://www.mediafire.com/download/umfj1 ... _MODEL.rar
===============================================
fmt_YoruNoNaiKuni_g1m.py work at noesis ,but noesis crash easily...
You do not have the required permissions to view the files attached to this post.
XxYarnRulerxX
ultra-n00b
Posts: 5
Joined: Tue Jun 09, 2015 6:50 pm

Re: Yoru no nai Kuni - .g1m file extraction

Post by XxYarnRulerxX »

@dian333
Oh wow, noesis works fine thank you!!!!
destrator
beginner
Posts: 28
Joined: Tue Aug 30, 2011 4:25 am
Has thanked: 3 times
Been thanked: 5 times

Re: Yoru no nai Kuni - .g1m file extraction

Post by destrator »

Szkaradek123 wrote:Hi
Here is a blend importer for this model .
It requires installed Blender249 and Python 266 (all 32 bits).
Hello. I write a converter from G1M to FBX. I have problem with index buffers. They look so:
Image

If it is a tri strip then where is the delimiters?
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: Yoru no nai Kuni - .g1m file extraction

Post by shakotay2 »

destrator wrote:If it is a tri strip then where is the delimiters?
be informed that there's tristrip formats which don't use a delimiter (0xFFFF) in face indices blocks.

Looking at PC00F_MODEL_P_M_BodyALL_FR_xScAlphaTest.g1m there's no delimiter - but it's tristripped face indices. (You could easily check it using hex2obj).

You could try to export as fbx from Noesis - didn't check it but should work.

Also it would be helpful if you uploaded the model file in question.

(I always wonder how you guys think anyone could help you out while having nothing as reference but a picture with some numbers, really. :D )
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?"
destrator
beginner
Posts: 28
Joined: Tue Aug 30, 2011 4:25 am
Has thanked: 3 times
Been thanked: 5 times

Re: Yoru no nai Kuni - .g1m file extraction

Post by destrator »

shakotay2 wrote:
destrator wrote:If it is a tri strip then where is the delimiters?
be informed that there's tristrip formats which don't use a delimiter (0xFFFF) in face indices blocks.

Looking at PC00F_MODEL_P_M_BodyALL_FR_xScAlphaTest.g1m there's no delimiter - but it's tristripped face indices. (You could easily check it using hex2obj).

You could try to export as fbx from Noesis - didn't check it but should work.

Also it would be helpful if you uploaded the model file in question.

(I always wonder how you guys think anyone could help you out while having nothing as reference but a picture with some numbers, really. :D )
Thank you, I understand.

It is a tristrip with a set of degenerated triangles. I parsed it:

Code: Select all

struct Triangle
{
	short v0;
	short v1;
	short v2;
};
std::vector<Triangle> triList;

for (int i = 2; i < indices.size(); i++)
{
	  Triangle tri;
	  bool isEven = (i % 2 == 0);

	  tri.v0 = indices[i - 2];
	  tri.v1 = isEven ? indices[i] : indices[i - 1];
	  tri.v2 = isEven ? indices[i - 1] : indices[i];

	  if (tri.v0 != tri.v1 && tri.v1 != tri.v2 && tri.v2 != tri.v0)
		   triList.push_back(tri);
}
Right now I have the following:
Image

Part of this waste triangles was placed in to the mesh but it is no problem. They will be excluded by material's based sampling, I think so.
Post Reply