• We are currently performing site maintenance, parts of civfanatics are currently offline, but will come back online in the coming days (this includes any time you see the message "account suspended"). For more updates please see here.

Initial look at Nexus, 3D Unit Art and reskinning

Deliverator

Graphical Hackificator
Joined
Feb 12, 2008
Messages
4,813
Location
London, UK
This isn't really a tutorial or anything, just a walk-through of what I've done and discovered so far in the hope it might be useful to people.

1. Install Sid Meier's Civilization V SDK via Steam.

2. Using Regedit set HKEY_CURRENT_USER/Software/FIRAXIS/Tools/ToolAssetPath to C:\Program Files (x86)\Steam\steamapps\common\sid meier's civilization v (if using Vista/Windows 7) or C:\Program Files\Steam\steamapps\common\sid meier's civilization v if using XP.

3. Open Nexus - set the asset directory to be C:\Program Files (x86)\Steam\steamapps\common\sid meier's civilization as well.

4. In the top menu select Nexus > Script Browser > Extract PAK Files. This will unpack all the assets to the directories ...sid meier's civilization v\resource. There are 3 directories Common, DX9 and dx9_low. The 3d art for units, leaders, terrain and buildings is all in together with no subdivision so you'll have to hunt through to find what you are interested in.

5. Some of the DDS files seem to use an unknown compression format that cannot be opened, but unit textures from the DX9 directory can be opened in Paint.NET. This is u_japanese_samurai_diff.dds:

attachment.php


Terrain and Cityset DDS files seem to open fine as well.

6. To look at the 3D assets in Nexus go to Assets/Asset Viewer. Open any *.fxsxml file. The fxsxml is an XML containing the details of the mesh, texture and animation files:
Spoiler :
Code:
<Asset>
	<Mesh file="U_Songhai_MuslimCavalry.gr2"/>
	<Animation file="U_Songhai_MuslimCavalry_IdleA.gr2" ec="1000"/>
	<Animation file="U_Songhai_MuslimCavalry_FidgetA.gr2" ec="1040"/>
	<Animation file="U_Songhai_MuslimCavalry_IdleA_Trans_IdleB.gr2" ec="1020"/>
	<Animation file="U_Songhai_MuslimCavalry_IdleB.gr2" ec="2000"/>
	<Animation file="U_Songhai_MuslimCavalry_FidgetB.gr2" ec="2040"/>
	<Animation file="U_Songhai_MuslimCavalry_IdleB_Trans_IdleA.gr2" ec="2020"/>
	<Animation file="U_Songhai_MuslimCavalry_Fortify.gr2" ec="1500"/>
	<Animation file="U_Songhai_MuslimCavalry_Fortify_Idle_Trans_IdleA.gr2" ec="1580"/>
	<Animation file="U_Songhai_MuslimCavalry_Fortify_Idle.gr2" ec="1520"/>
	<Animation file="U_Songhai_MuslimCavalry_Fortify_Idle_Fidget.gr2" ec="1540"/>
	<Animation file="U_Songhai_MuslimCavalry_Fortify_Idle_Trans_Combat_Ready_Idle.gr2" ec="1560"/>
	<Animation file="U_Songhai_MuslimCavalry_Combat_Ready.gr2" ec="1600"/>
	<Animation file="U_Songhai_MuslimCavalry_Shuffle.gr2" ec="1450"/>
	<Animation file="U_Songhai_MuslimCavalry_Combat_Ready_Idle.gr2" ec="1620"/>
	<Animation file="U_Songhai_MuslimCavalry_Combat_Ready_Idle_Trans_IdleA.gr2" ec="1640"/>
	<Animation file="U_Songhai_MuslimCavalry_Run_Turn_Left.gr2" ec="1480"/>
	<Animation file="U_Songhai_MuslimCavalry_Run_Turn_Right.gr2" ec="1460"/>
	<Animation file="U_Songhai_MuslimCavalry_Run.gr2" ec="1400"/>
	<Animation file="U_Songhai_MuslimCavalry_Stop_Run.gr2" ec="1440"/>
	<Animation file="U_Songhai_MuslimCavalry_Stop_Run_IdleB.gr2" ec="2440"/>
	<Animation file="U_Songhai_MuslimCavalry_Charge_Run.gr2" ec="1120"/>
	<Animation file="U_Songhai_MuslimCavalry_Charge_Attack.gr2" ec="1140"/>
	<Animation file="U_Songhai_MuslimCavalry_AttackA.gr2" ec="1100"/>
	<Animation file="U_Songhai_MuslimCavalry_AttackB.gr2" ec="2100"/>
	<Animation file="U_Songhai_MuslimCavalry_AttackCity.gr2" ec="1160, 1180"/>
	<Animation file="U_Songhai_MuslimCavalry_Victory.gr2" ec="1800"/>
	<Animation file="U_Songhai_MuslimCavalry_Bombard_Defense.gr2" ec="1280"/>
	<Animation file="U_Songhai_MuslimCavalry_Bombard_Defense_Idle.gr2" ec="1285"/>
	<Animation file="U_Songhai_MuslimCavalry_Bombard_Defense_Trans_IdleA.gr2" ec="1290"/>
	<Animation file="U_Songhai_MuslimCavalry_DeathB.gr2" ec="2200"/>
	<Animation file="U_Songhai_MuslimCavalry_DeathB_Idle.gr2" ec="2220"/>
	<Animation file="U_Songhai_MuslimCavalry_DeathA.gr2" ec="1200"/>
	<Animation file="U_Songhai_MuslimCavalry_DeathA_Idle.gr2" ec="1220"/>
	<Texture file="Unit_Environment_Dull.dds"/>
	<Texture file="Unit_Environment_Sharp.dds"/>
	<Texture file="Unit_Irradiance.dds"/>
	<Texture file="U_Songhai_MuslimCavalry_SREF.dds"/>
	<Texture file="U_Songhai_MuslimCavalry_DIFF.dds"/>
	<TimedTrigger file="FX_Triggers_U_Songhai_MuslimCavalry.ftsxml"/>
	<StateMachine file="1_OMNI_MOUNTED_STATE_01.fsmxml"/>
	<AnimGraph file="START_RUN_CHARGE_SHUFFLE.dge"/>
	<AnimGraph file="ATTACK_TO_RUN_CHARGE_SHUFFLE.dge"/>
	<AnimGraph file="ATTACK_CITY_TO_RUN_CHARGE_SHUFFLE.dge"/>
	<AnimGraph file="RUN_CHARGE_SHUFFLE_TO_SHUFFLE_RUN_CHARGE.dge"/>
	<AnimGraph file="RUN_CHARGE_SHUFFLE_LOOP.dge"/>
	<AnimGraph file="FIDGETS_GRAPH.dge"/>
	<AnimGraph file="IDLE_GRAPH.dge"/>
	<AnimGraph file="STOP_RUNNING.dge"/>
	<AnimGraph file="TRANSITIONS_FOR_IDLES.dge"/>
	<AnimGraph file="FORTIFY_GRAPH.dge"/>
	<AnimGraph file="COMBAT_READY_GRAPH.dge"/>
	<AnimGraph file="FORTIFY_LEAVE_GRAPH.dge"/>
	<AnimGraph file="ENTER_COMBAT_READY_GRAPH.dge"/>
	<AnimGraph file="LEAVE_COMBAT_READY.dge"/>
	<AnimGraph file="DEATH_GRAPH.dge"/>
	<AnimGraph file="ENTER_BOMBARD_DEFEND_GRAPH.dge"/>
	<AnimGraph file="BOMBARD_DEFEND_LOOP_GRAPH.dge"/>
	<AnimGraph file="DEATH_FINAL_GRAPH.dge"/>
	<AnimGraph file="LEAVE_BOMBARD_DEFEND_TRANS_IDLE_A_GRAPH.dge"/>
	<AnimGraph file="ENTER_FORTIFY.dge"/>
	<AnimGraph file="MOUNTED_RUNNING_LOOP.dge"/>
	<AnimGraph file="MELEE_ATTACKS.dge"/>
	<AnimGraph file="FORTIFY_FIDGET_GRAPH.dge"/>
	<AnimGraph file="SHUFFLE_STOP_GRAPH.dge"/>
	<AnimGraph file="IDLE_OFFSET_CONTINUE_TRUE_GRAPH.dge"/>
	<BoneUsage>
		<Bone name="Horse"/>
		<Bone name="Base HumanRPalm"/>
		<Bone name="Base HumanRibcage"/>
		<Bone name="Base HumanLPalm"/>
		<Bone name="Sword"/>
	</BoneUsage>
</Asset>

You can also explore the contents of the fxsxml in the Asset Viewer. You can see it has a list of the bones which is interesting.

attachment.php


7. A few windows open when you open an fxsxml file. The only ones I've played with so far are the 3D View and Animation Triggers windows. You'll want to have them both side-by-side (widescreen monitors useful here):

attachment.php


The only hotkeys I've figured out for the 3D View are:
T - Top View
B - Bottom View
F or Z - Front View
L - Some strange sideways view ?
ALT + SHIFT + LMB-Drag can be used to rotate the camera

Switch the drop-down in the top left of the 3D View to EventCode rather than default. Now you can trigger the different animations in the left hand pane of the Animation Triggers view and you should see the unit in the 3D View moving. Sound FX are also triggered as well (this should make syncing sound fx much easier than in Civ4 where you had to edit the KF file in NifSkope and then test in game). You can also set the animation to loop using the Loop button at the top. That's about all I've figured out for now on that.

8. I wanted to see if it was possible to get a reskin showing up in the 3D View so I quickly edited the DDS file to make the rider's clothing blue in Paint.NET.

attachment.php


9. If I overwrite the unpacked DDS file in the resource/DX9 folder with my reskinned version and reopen the fxsxml in Nexus I can see that the change is picked up:

attachment.php



See here for a guide on creating a reskinning copy of a vanilla unit and getting it into the game.


.
 

Attachments

  • u_songhai_muslimcavalry_diff_dds.jpg
    u_songhai_muslimcavalry_diff_dds.jpg
    45.5 KB · Views: 19,117
  • dds_options.jpg
    dds_options.jpg
    47 KB · Views: 18,919
  • fxsxml_struct.jpg
    fxsxml_struct.jpg
    29.4 KB · Views: 18,856
  • nexus2.jpg
    nexus2.jpg
    79.5 KB · Views: 18,982
  • nexus11.jpg
    nexus11.jpg
    112.4 KB · Views: 19,093
That looks promising, Coyote. Might try out his method soon.
 
Wish you luck, beside looking for tutorials/tools in the net i can´t really help you.
 
attachment.php


This densely packed collection of blue-coated riders shows that I have managed to get my reskinned unit into the game.

Will write up how it's done shortly. I'll also try and create a demo reskinned unit mod so that more talented reskinners than myself can go to work on the vanilla units and get the results into the game.
 

Attachments

  • blueriders.jpg
    blueriders.jpg
    97.9 KB · Views: 18,750
Unfortunately I made a mistake. I overwrote the file in civ5/resource/DX9 so the blue jackets riders were not the result of my mod after all.
 
This isn't really a tutorial or anything, just a walk-through of what I've done and discovered so far in the hope it might be useful to people.

At the current stage, this is probably one of the most useful threads around :thumbsup:.
I've moved it now to the tutorials. If you disagree with me, or the thread becomes obsolete, then please report it or PM a mod (not sure if i'll look again in here).
 
Thanks, the J.

I'm not sure its going to be possible to create reskinned versions of units without opening up the gr2 mesh file. I can get reskins in game by overwriting the files in resource/DX9 but that is not what we want. Still, here's some leopardskin warriors I did for a test for entertainment:

attachment.php
 

Attachments

  • leopardskin_warriors.jpg
    leopardskin_warriors.jpg
    45.7 KB · Views: 18,414
hilarious. :lol:

nice thread, is interesting indeed. Hope you figure it out
 
Thanks, the J.

I'm not sure its going to be possible to create reskinned versions of units without opening up the gr2 mesh file. I can get reskins in game by overwriting the files in resource/DX9 but that is not what we want. Still, here's some leopardskin warriors I did for a test for entertainment:

attachment.php


yabba dabba doo!
 
I'm not sure its going to be possible to create reskinned versions of units without opening up the gr2 mesh file. I can get reskins in game by overwriting the files in resource/DX9 but that is not what we want. Still, here's some leopardskin warriors I did for a test for entertainment

only a guessing tip: Can you add a new instance of an existing mesh (means adding an exact copy of a unit) to a mod and edit this new instance via the mod tools? If yes, it could be a workaround til a better solution is found (you still override the texture - but the one of the instance).
 
There is no way to edit the mesh gr2 files in the mod tools as far as I can see.

When I created a mod with a copy of the warrior unit it still picks up the warrior_diff.dds from the resource/DX9 folder rather than anything I put locally in the mod. I tried editing the fxsxml file to point to my new texture but that had no effect either.

The unpacked gr2 files crash Granny Viewer when you try and open them, so they appear to be non-standard. I think that modding existing 3D assets is probably at a dead-end until Firaxis providing some additional tools or scripts for working with their version of the gr2 format.
 
Deliverator, I'd be very interested to see you change the terrain, something simple like green grassland to red grassland. Just so that I know it's possible.
 
I dont think fraxis are going to give us the tools we need to edit gr2 files. I think they plan on making their money by selling units and civs and leaders. Thats the way things are going I think. They got rid of 20 staff who worked on previous versions and civ 5 is really dumbed down... I don't think we will see a proper release of civilization, just a cut down arcade style game. costs them less to make.

look at the AI... it's the worst Ai I have ever played against. Civ5 is an arcade game :(

sad times RIP CIV
 
Granny is a proprietary format, isn't it? So I can't just use Maya or 3dMax (at the computer labs at the school I go to) to edit them, can I? :(

Edit: potentially some useful stuff here:

http://gr2decode.altervista.org/download.html

particularly the GR2 model pack, which might save us time by giving us an archive of GR2 models that we can use without having to somehow make our own.
 
Merakspielman I have spent the last two days trying every plugin and 3d software and I can tell you that it's a waste of time. it's not the standard gr2, fraxis have made it so we cant do anything with it :(

From what I have read from other gaming mod forums, it's not going to happen. Granny 3d is a very expensive package which us modders wont be buying. Lots of other games use that format and I even tried using there tools with no luck.

as you can see fraxis released special edition or something which comes with an extra leader, which you have to pay extra, my take is that they don't want us to create our own leaders and units.

maybe I'm wrong.... but why did they block that part of modding. Also if anyone knows where the sound files for the leaders are please do tell me, it seems it's the only one's I cant find.
 
Also if anyone knows where the sound files for the leaders are please do tell me, it seems it's the only one's I cant find.

If you mean their speech, then that's located in:

Civilization V\Assets\Sounds\Speech\Shared

Also there is:

Assets\Sounds\Streamed\LeaderAmbience Looping\LeaderAmbience Looping
 
I agree with santino6 - I remember one of the interviews where Shafer said that they don't know if they'll release plugins for making 3dgraphics. And if they'll release it it would be near impossible to create own leader due to complexity of graphics (shaders, animations, etc.). So for moders will be left reskining.

They should try to reskin Tiger into Sherman, - it would be an answer to theire thinking if they should give us plugins or not.

The'll earn bucks on new models. It could not be problem if there would be abundant number of DLCs, but I'm sure I won't see Polish civilization in civ5 since there's Warsaw City State. This way they did Civilization V least modable game from the serries. No new units and leaders - that's crap.

I hope the plugins will apear tough soon, or at least some workarounds found by modders.
 
Back
Top Bottom