News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Modeling & Skinning

Reply
 
Thread Tools Display Modes
Old 24th Dec 2011, 07:10 AM   #21
VendorX
Registered User
 
VendorX's Avatar
 
Join Date: Aug. 2nd, 2010
Location: BXL/Paris
Posts: 200
Sun, this will be no longer Blender plug-in, because Blender is too limited... I work on C# version - directly dump mesh and animation.

MERRY CHRISTMAS PEOPLES!
VendorX is offline   Reply With Quote
Old 2nd Mar 2012, 03:13 PM   #22
maxdamage
Registered User
 
Join Date: Mar. 2nd, 2012
Posts: 2
Quote:
Originally Posted by VendorX View Post
Sun, this will be no longer Blender plug-in, because Blender is too limited... I work on C# version - directly dump mesh and animation.

MERRY CHRISTMAS PEOPLES!
Any news on it?Would like to get some of the models from Unreal2 but the .gem import plug-in isn't compatible with Blender v2.57b.

Thanks.
maxdamage is offline   Reply With Quote
Old 2nd Mar 2012, 06:15 PM   #23
VendorX
Registered User
 
VendorX's Avatar
 
Join Date: Aug. 2nd, 2010
Location: BXL/Paris
Posts: 200
Well... Still working on animations - only bone rotations was left to do. As to the compatibility, i have somewhere updated version to 2.60 - will update download link.
__________________
Classified SR-2 | 2x Xeon W5580 - 3.20 GHz | 12x 2GB Kingston KHX2000C9D3T1K3/6GX | 2x ROG MARS760-4GD5 | SAMSUNG 830 MZ-7PC512D/AM 2.5" 512GB SATA III MLC | 4x Spinpoint F3EG HD503HI 500GB 5400 16MB SATA 3.0Gb/s |
VendorX is offline   Reply With Quote
Old 5th Mar 2012, 03:25 PM   #24
maxdamage
Registered User
 
Join Date: Mar. 2nd, 2012
Posts: 2
Any word on the C++ app?

Thanks.
maxdamage is offline   Reply With Quote
Old 1st Apr 2012, 05:47 PM   #25
AlCapowned
Registered User
 
AlCapowned's Avatar
 
Join Date: Jan. 20th, 2010
Posts: 203
VendorX, would it help you if you had a few PSK/PSA files and matching Gem files? The Unreal 2 alpha has an animated Aida model and a few weapons with all three file types.
AlCapowned is offline   Reply With Quote
Old 22nd Jun 2012, 07:00 PM   #26
chargrove
Registered User
 
Join Date: Apr. 20th, 2011
Posts: 1
Hi all! My name is Chris Hargrove; I wrote Golem.

(I may have another account on this forum with my full name, but I lost my login info that a long time ago and I know my email address has changed, but whatever).

Anyway, I first noticed this thread last year in passing, but stumbled onto it again today; I'm stunned and impressed that people have done so much work to reverse-engineer the .gem format! I know some parts of it aren't the easiest to work with from the outside looking in.

It being nearly a decade since I wrote that stuff, I'm pretty sure nobody would care if I gave people format information (that was one of the things we originally intended to do back when I was at Legend)... however "pretty sure" doesn't hold up legally, and the problem is ever since Legend was closed down by Infogrames, I have absolutely no idea who I would have to talk to in order to release information like that. So I apologize profusely for that.

That said, I'm not sure if this exporter project is still happening, but if it is: one thing I *can* tell you is how those 5-byte rotations work, because it's something I wrote long before Golem, and which I've used both before and since then, so it's not tied to that specific implementation and hence no legal concerns there. Since it's something you folks indicated was a bit of a blocking point, I figured I could elucidate it here.

The basic idea is that it's a packed axis & angle, which you can use to put into a quaternion. 5 bytes was enough to encode them both with sufficient precision; I did experiments with 4 bytes but it just looked too jittery. I probably could have gotten into 4 bytes most of the time if I allowed some kind of VBR scheme for the edge cases, but having a fixed-size structure was extremely helpful at runtime (despite the odd size).

Anyway, here's some code for it. I've sanitized it a bit so hopefully I didn't break anything in the process, but hopefully you can figure out what's going on.

BTW, when you see typecasts in there, note that the code is based on a little-endian CPU (such as x86). If you're operating on a big-endian CPU, adjust accordingly.

Code:
enum
{
	PACKED_AXIS_SIGNMASK = 0xE00000,
	PACKED_AXIS_XSIGNMASK = 0x800000,
	PACKED_AXIS_YSIGNMASK = 0x400000,
	PACKED_AXIS_ZSIGNMASK = 0x200000,
	PACKED_AXIS_XMASK = 0x1FF800,
	PACKED_AXIS_YMASK = 0x0007FF
};

VECTOR3 UnpackAxis(unsigned long p)
{
	// get the x and y bits
	signed long xBits = (p & PACKED_AXIS_XMASK) >> 11;
	signed long yBits = p & PACKED_AXIS_YMASK;

	// map the numbers into the projection triangle
	if ((xBits + yBits) >= 2047)
	{
		xBits = 2047 - xBits;
		yBits = 2047 - yBits;
	}

	// build vector
	VECTOR3 result;
	result.x = (float)xBits;
	result.y = (float)yBits;
	result.z = (float)(2046 - xBits - yBits);

	// restore sign bits
	if (p & PACKED_AXIS_XSIGNMASK) result.x = -result.x;
	if (p & PACKED_AXIS_YSIGNMASK) result.y = -result.y;
	if (p & PACKED_AXIS_ZSIGNMASK) result.z = -result.z;
	
	// need to post-normalize since there's no normalization table
	float s = 1.f / (float)sqrt(result.x*result.x + result.y*result.y + result.z*result.z);
	result.x *= s;
	result.y *= s;
	result.z *= s;
	return result;
}

QUAT UnpackQuat(unsigned char* fiveBytes)
{
	// extract packed axis and angle from byte buffer
	unsigned long packAxis = *((unsigned long*)fiveBytes);
	packAxis &= 0x00FFFFFF; // only uses low 24 bits
	fiveBytes += 3;
	unsigned long packAngle = *((unsigned short*)fiveBytes);

	// unpack axis and angle
	VECTOR3 axis = UnpackAxis(packAxis);
	float angle = ((float)packAngle)*PI/32768.f;

	// generate result quaternion from axis and angle
	float s = (float)sin(angle*0.5f);
	QUAT result;
	result.v.x = axis.x * s;
	result.v.y = axis.y * s;
	result.v.z = axis.z * s;
	result.s = (float)cos(angle*0.5f);
	return result;
}
Hope that helps!

- Chris
chargrove is offline   Reply With Quote
Old 23rd Jun 2012, 04:38 PM   #27
AlCapowned
Registered User
 
AlCapowned's Avatar
 
Join Date: Jan. 20th, 2010
Posts: 203
Even though I'm not the one who's working on the plugin, thank you for posting that information. It would be great if VendorX finishes this!
AlCapowned is offline   Reply With Quote
Old 30th Jun 2012, 05:28 PM   #28
VendorX
Registered User
 
VendorX's Avatar
 
Join Date: Aug. 2nd, 2010
Location: BXL/Paris
Posts: 200
I was about to close this project, but with new info maybe i can finally finish this project. Anyway, i'm surprised that still someone is interested - this is very old game and almost all models are already in the net.

@chargrove: I know almost everything about .gem file format - only Ragdoll part left to do - but year ago I've stopped working on this project. Those 5 bites was too much... Now thanks to you maybe there is still hope.
...and thank you for help.
__________________
Classified SR-2 | 2x Xeon W5580 - 3.20 GHz | 12x 2GB Kingston KHX2000C9D3T1K3/6GX | 2x ROG MARS760-4GD5 | SAMSUNG 830 MZ-7PC512D/AM 2.5" 512GB SATA III MLC | 4x Spinpoint F3EG HD503HI 500GB 5400 16MB SATA 3.0Gb/s |
VendorX is offline   Reply With Quote
Old 1st Jul 2012, 12:54 AM   #29
GreatEmerald
Khnumhotep
 
GreatEmerald's Avatar
 
Join Date: Jan. 20th, 2008
Location: Lithuania
Posts: 4,042
There are still a lot of weapon models that have never been exported. Your work is highly appreciated!
GreatEmerald is offline   Reply With Quote
Old 9th Jul 2012, 12:34 PM   #30
Wail of Suicide
Registered User
 
Join Date: Apr. 11th, 2006
Posts: 740
Great news. I know I'd love to see some of those great looking Unreal 2 models elsewhere.
__________________
Portfolio
Wail of Suicide is offline   Reply With Quote
Old 19th Jan 2013, 04:04 PM   #31
AlCapowned
Registered User
 
AlCapowned's Avatar
 
Join Date: Jan. 20th, 2010
Posts: 203
Could you upload the script somewhere else, VendorX? The link in the first post is broken.
AlCapowned is offline   Reply With Quote
Old 20th Jan 2013, 06:47 AM   #32
VendorX
Registered User
 
VendorX's Avatar
 
Join Date: Aug. 2nd, 2010
Location: BXL/Paris
Posts: 200
Blender is changing too fast/too much, I will no longer update this plugin. Sorry...
CSharp version of this exporter is almost finished (still I have some problem with animation...) - just wait a little...
__________________
Classified SR-2 | 2x Xeon W5580 - 3.20 GHz | 12x 2GB Kingston KHX2000C9D3T1K3/6GX | 2x ROG MARS760-4GD5 | SAMSUNG 830 MZ-7PC512D/AM 2.5" 512GB SATA III MLC | 4x Spinpoint F3EG HD503HI 500GB 5400 16MB SATA 3.0Gb/s |
VendorX is offline   Reply With Quote
Old 10th Feb 2013, 07:32 AM   #33
VendorX
Registered User
 
VendorX's Avatar
 
Join Date: Aug. 2nd, 2010
Location: BXL/Paris
Posts: 200
GemExporter - update

Small update for those who waiting for release of new GemExporter:
Aidawalklookfrwd - test animation.
__________________
Classified SR-2 | 2x Xeon W5580 - 3.20 GHz | 12x 2GB Kingston KHX2000C9D3T1K3/6GX | 2x ROG MARS760-4GD5 | SAMSUNG 830 MZ-7PC512D/AM 2.5" 512GB SATA III MLC | 4x Spinpoint F3EG HD503HI 500GB 5400 16MB SATA 3.0Gb/s |

Last edited by VendorX; 10th Feb 2013 at 07:37 AM.
VendorX is offline   Reply With Quote
Old 10th Feb 2013, 07:40 AM   #34
AlCapowned
Registered User
 
AlCapowned's Avatar
 
Join Date: Jan. 20th, 2010
Posts: 203
That's awesome! Thanks again for all of your hard work.
AlCapowned is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 01:17 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer