Quick Links >> Home - Forum Home - Maps & Replays - StarCraft Wiki - Gallery - Forum Rules - Become a PAL

Quick Nav
Forums
News
Articles
Gallery
Wiki
Replays - (Upload)
Maps - (Upload)
Videos

Tournaments
Site Rules



Forums
All Forums
Community
Strategy
Mapmaking Help
Map Tutorials
Map Projects
Lore Discussion
Wiki Support
Technical Support
Suggestions
Off-Topic
Tournament Forum
The Clan
Contributor


Tools
PM Inbox
Send PM
Control Panel

Go Back   StarCraft: IncGamers - The Unofficial Starcraft 2 Forums > Mapmaker Forums > Mapmaking & Modding Help and Chat
Reload this Page SC2 Models
Connect with Facebook
Register Tournaments FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

Mapmaking & Modding Help and Chat If you have questions or answers on how to do things while making maps or modding StarCraft II, WarCraft III and StarCraft.

Reply
Page 1 of 32 1 2341121 > Last »
 
Thread Tools Display Modes
Old 21-02-2010, 01:36 AM   #1
Teal
StarCraft: IncGamers Member
 
Teal's Avatar
 
Join Date: May 2007
Location: Toronto
Posts: 464
Tournaments Joined: 1
Tournaments Won: 0
Send a message via AIM to Teal Send a message via MSN to Teal
SC2 Models

The model files in SC2 use a .m3 extension, which unfortunantly like the .mdx in Warcraft 3 are not human readable... well almost. Looking at some of the simpler models with a hex editor, you can clearly identify where all the verticies and faces of the models are defined. This file doesn't seem to be compressed like .mdx, so it probably is in the native format that the engine reads.

The textures don't use Blizzard's proprietary .blp format, but rather .dds: a known format with plugins readily available (photoshop) to import/convert.

It shouldn't be too much work to come up with an importer. If someone with more skill wants to help me work on a way to import UV data or to write an importer/converter (exporter might take more time...), PM me.
Teal is offline   Reply With Quote
Teal
View Public Profile
Send a private message to Teal
Find More Posts by Teal
Old 21-02-2010, 11:34 AM   #2
Klear
StarCraft Contributor
 
Klear's Avatar
 
Join Date: Jul 2008
Location: Prague, heart of Europe
Posts: 2,147
Tournaments Joined: 0
Tournaments Won: 0
Send a message via ICQ to Klear
Nice work! I was planning to go thorugh the archives myself, but I jsut skimmed them and went back to playing =(
__________________
Map of StarCraftWire's Members.
Klear View
Monorail Mayhem
Klear is offline   Reply With Quote
Klear
View Public Profile
Send a private message to Klear
Find More Posts by Klear
Old 21-02-2010, 09:38 PM   #3
Teal
StarCraft: IncGamers Member
 
Teal's Avatar
 
Join Date: May 2007
Location: Toronto
Posts: 464
Tournaments Joined: 1
Tournaments Won: 0
Send a message via AIM to Teal Send a message via MSN to Teal
Well I seemed to have hit a block. This format doesn't nicely isolate all the verticies, UV, and normals into separate sections like it did in .mdx. In fact, I can't even find where the verticies are... On the bright side, the face data is very cleanly defined.

The section that defines the verts,tv,normals comes in blocks like these

Code:
1E C5 50 3D DD DB A5 3E 09 A1 C2 3E FF 00 00 00 00 00 00 00 37 B6 D9 00 7E 00 EA 01 C0 58 E6 FF
47 E1 B0 BB DD BF B6 3E 52 A8 61 3E FF 00 00 00 00 00 00 00 17 C9 7F 00 41 00 EA 01 71 8C FE FF
B8 02 A3 BE 5C 9A B6 BD 75 F5 6A 3E FF 00 00 00 00 00 00 00 17 C9 7F 00 41 00 CB 02 8E 79 FE FF
The pattern is [12] FF 7*00 [3] 00 [7] FF. This is true for all models. (and the fourth offset in [7], the one that is 01, 01, 02, seems to serve a special purpose too).

There are exactly 3x as many of these blocks as there are verticies (inferred from the face data), so I'm guessing each one defines one spacial coordinate. The issue I'm having is that not a single float gives a value in the typical range of a vert ~[-1000,-1][1,1000]. The values in [12] resolve to 3 floats that are strictly <|0|, but never too small (probably normals).

No float, taken at any offset gives you a reasonable number for a vert coordinate and there is no other place in the model (looking at the simplest models here) that can contain this information, so it has to be here. In fact the only values that always resolve to floats within a reasonable range (no insane exponents) are the ones in the first 12 bytes of each block.
Teal is offline   Reply With Quote
Teal
View Public Profile
Send a private message to Teal
Find More Posts by Teal
Old 22-02-2010, 12:31 AM   #4
Teal
StarCraft: IncGamers Member
 
Teal's Avatar
 
Join Date: May 2007
Location: Toronto
Posts: 464
Tournaments Joined: 1
Tournaments Won: 0
Send a message via AIM to Teal Send a message via MSN to Teal
Scratch that, each block is one vertex (# of blocks actually equalled the number of verticies), although the values still don't make any sense. For different models, the values in the first 12 bytes do exceed |1| as floats, and there is just not enough space to store them as doubles.
Teal is offline   Reply With Quote
Teal
View Public Profile
Send a private message to Teal
Find More Posts by Teal
Old 22-02-2010, 02:25 AM   #5
Teal
StarCraft: IncGamers Member
 
Teal's Avatar
 
Join Date: May 2007
Location: Toronto
Posts: 464
Tournaments Joined: 1
Tournaments Won: 0
Send a message via AIM to Teal Send a message via MSN to Teal
hehehe...

Teal is offline   Reply With Quote
Teal
View Public Profile
Send a private message to Teal
Find More Posts by Teal
Old 22-02-2010, 03:22 AM   #6
CHUNK
Mapmaking Community Manager
 
CHUNK's Avatar
 
Join Date: May 2007
Location: Lincoln
Posts: 513
Tournaments Joined: 0
Tournaments Won: 0
Send a message via AIM to CHUNK Send a message via MSN to CHUNK
Nice, Teal. Those aren't animated or anything, are they?
__________________
Try out Zerg Herders! on Battlenet.
CHUNK is offline   Reply With Quote
Sponsored Links
StarCraft IncGamers Sponsor
CHUNK
View Public Profile
Send a private message to CHUNK
Visit CHUNK's homepage!
Find More Posts by CHUNK
Old 22-02-2010, 05:49 AM   #7
Teal
StarCraft: IncGamers Member
 
Teal's Avatar
 
Join Date: May 2007
Location: Toronto
Posts: 464
Tournaments Joined: 1
Tournaments Won: 0
Send a message via AIM to Teal Send a message via MSN to Teal
Quote:
Originally Posted by CHUNK View Post
Nice, Teal. Those aren't animated or anything, are they?
No, only the mesh. Animations would take the longest time to decipher. Heck I'm struggling trying to find where the UV coordinates are (anyone know if they are allowed to be negative?).
Teal is offline   Reply With Quote
Teal
View Public Profile
Send a private message to Teal
Find More Posts by Teal
Old 22-02-2010, 06:53 AM   #8
Arkham
StarCraft Beta Tester
 
Arkham's Avatar
 
Join Date: Nov 2008
Location: Seattle
Posts: 281
Tournaments Joined: 0
Tournaments Won: 0
Quote:
Originally Posted by Teal View Post
No, only the mesh. Animations would take the longest time to decipher. Heck I'm struggling trying to find where the UV coordinates are (anyone know if they are allowed to be negative?).
Depends on the game engine. For some it's fine, for others bad shit happens if they try to do that. (Obviously I have no idea which kind the SC2 engine is.) But yes, it is possible in a general sense for mesh UVs to go into negative numbered coordinates.
Arkham is offline   Reply With Quote
Arkham
View Public Profile
Send a private message to Arkham
Find More Posts by Arkham
Old 22-02-2010, 12:04 PM   #9
Rao Dao Zao
StarCraft: IncGamers Member
 
Rao Dao Zao's Avatar
 
Join Date: May 2009
Location: Scotland
Posts: 116
Tournaments Joined: 0
Tournaments Won: 0
Send a message via MSN to Rao Dao Zao
Probably are allowed to be negative, I know WC3 let it happen.

I thought that with the advent of normal mapping, the actual model didn't need to store normals at all any more?
Rao Dao Zao is offline   Reply With Quote
Rao Dao Zao
View Public Profile
Send a private message to Rao Dao Zao
Visit Rao Dao Zao's homepage!
Find More Posts by Rao Dao Zao
Old 23-02-2010, 08:07 AM   #10
Arkham
StarCraft Beta Tester
 
Arkham's Avatar
 
Join Date: Nov 2008
Location: Seattle
Posts: 281
Tournaments Joined: 0
Tournaments Won: 0
Quote:
Originally Posted by Rao Dao Zao View Post
I thought that with the advent of normal mapping, the actual model didn't need to store normals at all any more?
That's an interesting point. I don't know for certain, but I suspect you may be correct.
Arkham is offline   Reply With Quote
Arkham
View Public Profile
Send a private message to Arkham
Find More Posts by Arkham
Reply
Page 1 of 32 1 2341121 > Last »

« Previous Thread | Next Thread »
Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes
Linear Mode Linear Mode
Hybrid Mode Switch to Hybrid Mode
Threaded Mode Switch to Threaded Mode

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 Rules
Forum Jump


All times are GMT. The time now is 06:40 AM.

Contact Us - StarCraft: IncGamers - Archive - Top

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Advertisement System V2.5 By   Branden