How to replace leaderhead 3D animations with 2D still images (& then add 2D leaders)

Pazyryk

Deity
Joined
Jun 13, 2008
Messages
3,584
I figured this out in another thread with some kind help from others.

As an example, here's a screenshot from a game where I've modmodded Queen of the Iceni to use Boudica as a leaderhead image (rather than Elizabeth as is currently the case in version 3):
Spoiler :
Two points to start with. First, this is really just a "workaround." I think there will be a more elegant solution in some patch or after modders get into the dll. Second, it's all or nothing, at least for now. You can have all 2D still images for all leaderheads, or all 3D animations, but not both in the same game.

Short version:
  1. To see 2D leaderheads (and only 2D leaderheads), you have to set UseScreenShots = 1 in GraphicsSettingsDX11.ini. If your mod uses 2D leaderheads, then you are just going to have to tell the mod-user to do this. (Yes, that sucks. But that is the case unless someone tells me that a mod can alter graphic settings.) [Edit: from Kruelgor below, if the player uses DX9 then there is no need for this change.]
  2. Add your leaderhead 2D art (as a leader.dds image; see note on image stretching at the bottom of this post).
  3. Set ArtDefineTag for your leader to "leader_scene.xml".
  4. Create "leader_scene.xml" in your mod by copying an existing one or my code block below (copied from Elizabeth_scene.xml). Change FallbackImage in this file to point to your leader's .dds image.
  5. That's it. You don't need to add leader_scene.xml or leader.dds to Actions, but you might want to check that they get listed in "files" in your modinfo file after you build.
For long version, read on...

I'll use my modmoding of the Queen of the Iceni mod to illustrate the process. If you want to follow all the details, download that mod. Note that my walkthrough is based on Queen of Iceni (v 3), which uses Elizabeth for both 3D animation and 2D "fallback" art. If Kael fixes this to to use Boudica art, then some of the details will be wrong even though the walkthrough should still make sense.

Step 1. Go into your GraphicsSettingsDX11.ini (should be somewhere like ...\Documents\My Games\Sid Meier's Civilization 5) and make and save this change:
Code:
; Whether or not to use static screenshots of leaders (this is the default for min-spec machines)
UseScreenShots = 1
Now I'm not sure whether a mod can change graphic settings. (If someone knows, please post.) For now, unfortunately, if your mod uses 2D leaderheads then you will have to instruct the mod user to do the step above.

If you just want to change 3D animations to 2D stills for base Civ5 leaders, you're done.

If you want to make Queen of Iceni use the Boudica image, then you need to make some changes.

Open up Leader_Boudica.xml (in MODS/Queen of Iceni (v 3)/XML/Leaders/). You'll see that ArtDefineTag is currently set to Elizabeth_scene.xml. This tells the game where to get both the 3D animation (when UseScreenShots = 1) and the 2D still image (when UseScreenShots = 1). If you search for Elizabeth_scene.xml, however, you won't find it unless you've "unpacked the PAK." Here's how to unpack the PAK (note: this will take a while and you don't need to do for our present purposes):
Spoiler :
Start Nexus
Click Nexus tab
Click Script Browser
Select Extract PAK, then Run Script
Go get some coffee, read the newspaper for a while...
If you do this, you can now find Elizabeth_scene.xml (on my machine it's at C:\Program Files\Steam\steamapps\common\sid meier's civilization v\resource\Common). If you didn't, it doesn't matter because here are it's contents in full:
Code:
<LeaderScene lights ="Elizabeth_Lights.gr2" camera="Elizabeth_Camera.fxsxml" MatteShadowTint="1.00" ColorKey="Elizabeth_COLORKEY.tga"  cubemap_prefix ="Elizabeth" FallbackImage="Elizabeth.dds">

<HackLightSettings color="255,255,255" direction="-0.2,-0.99,-0.2" intensity="0.7" />

<BloomSettings max_width="9.07" scale="2.12" min="1.00" ></BloomSettings>
  
  <LeaderObject  model="English_Elizabeth.fxsxml"> </LeaderObject>
  <BackgroundObject model="Elizabeth_Scene.fxsxml" ></BackgroundObject>
  <BackgroundObject model="Elizabeth_Scene_VFX.fxsxml" ></BackgroundObject>

</LeaderScene>
The important piece for our purposes is FallbackImage="Elizabeth.dds". This is telling the base game where to get the 2D still image when UseScreenShots = 1. In Queen of Iceni (v 3), ArtDefineTag (in Leader_Boudica.xml) points to Elizabeth_scene.xml, which points to both Elizabeth 3D animation and Elizabeth 2D still image. So here's how to fix this situation...

First, go into Leader_Boudica.xml and change ArtDefineTag to Boudica_scene.xml.

Second, you need a functioning Boudica_scene.xml file. You will notice that the mod already has a Boudica_scene.xml file that has a single line in it. As far as I can tell, the mod as it is (version 3) doesn't use this file at all (I don't think anything references it) and it won't work anyway (as it is). What I did is copy the entire contents of Elizabeth_scene.xml (you can copy from my code block above) into Boudica_scene.xml. Then make one change: make FallbackImage="Boudica.dds".

That's all you need to change. The mod already "knows about" Boudica_scene.xml and Boudica.dds. You can see this if you look in Queen of the Iceni (v 3).modinfo. So if you are adding a new leader, you will need to create a new leader_scene.xml file and a new leader.dds image (use GIMP and instructions found in other threads). You don't need to add them to "Actions" or "Contents" but, after you build your mod, you might want to check to see that they are listed under files in your mod's .modinfo file.

Image Stretching issue

One thing that I've noticed after playing with this is that the game engine will stretch (or shrink, I think) the .dds image to the max available space (your screen X or Y limit, whichever it hit first) filling in the side or top-bottom gaps with black. That can look pretty bad if you start with a 600x600 image. The best you can do in this situation is embed the image in a big black frame. It's still annoying to me, however, because it's going to get re-sized for each user (depending on screen size) and I can't stop that. Maybe that's only annoying to me because I'm a stickler about image quality. I'm sure the dll will get modded eventually to give full control to the modder (so, for example, you could have more modest size leader images that don't fill up the whole screen as in civ4).
 
Four months and several patches after, I just wonder if 2D custom leaders and 3D CiV official leaders run together or still are 2D vs 3D mutually exclusive. Thanks
 
Hi, I want to have this picture 2D still leaderhead for my civ: Kingdom of Kongo
Spoiler :

(The image is a .dds, DXT3, white alpha channel, 1600 x 900 px)

But then I include the Kongo civ as a AI opponent and tries to start the game, the game crashes!

Why?

I have changed the <ArtDefineTag>Nzinga_scene.xml</ArtDefineTag>, created the Nzinga_scene.xml (pasted the elizabeth_scene.xml code and changed the FallbackImage to "Nzinga.dds") and included in actions the XML/Leader/Nzinga_scene.xml, but it dosen't work.

Then I play as Kongo it works fine and it also work to play against Kongo if I change the ArtDefineTag to a existing vanilla one. I play with dx9, and have manually double checked that the UseScreenShots is set on = 1.

Here is the code and the mod is attached as a .rar

Please help, it would be so awesome if it would work!

Nzinga_scene.xml
Spoiler :
<LeaderScene lights ="Elizabeth_Lights.gr2" camera="Elizabeth_Camera.fxsxml" MatteShadowTint="1.00" ColorKey="Elizabeth_COLORKEY.tga" cubemap_prefix ="Elizabeth" FallbackImage="Nzinga.dds">

<HackLightSettings color="255,255,255" direction="-0.2,-0.99,-0.2" intensity="0.7" />

<BloomSettings max_width="9.07" scale="2.12" min="1.00" ></BloomSettings>

<LeaderObject model="English_Elizabeth.fxsxml"> </LeaderObject>
<BackgroundObject model="Elizabeth_Scene.fxsxml" ></BackgroundObject>
<BackgroundObject model="Elizabeth_Scene_VFX.fxsxml" ></BackgroundObject>

</LeaderScene>


CIV5Leader_Nzinga.xml:
Spoiler :
<?xml version="1.0" encoding="utf-8"?>

<GameData>
<Leaders>
<Row>
<Type>LEADER_NZINGA</Type>
<Description>TXT_KEY_LEADER_NZINGA</Description>
<Civilopedia>TXT_KEY_LEADER_NZINGA_PEDIA</Civilopedia>
<CivilopediaTag>TXT_KEY_CIVILOPEDIA_LEADERS_NZINGA</CivilopediaTag>
<ArtDefineTag>Nzinga_scene.xml</ArtDefineTag>
<VictoryCompetitiveness>7</VictoryCompetitiveness>
<WonderCompetitiveness>6</WonderCompetitiveness>
<MinorCivCompetitiveness>9</MinorCivCompetitiveness>
<Boldness>7</Boldness>
<DiploBalance>8</DiploBalance>
<WarmongerHate>6</WarmongerHate>
<DenounceWillingness>6</DenounceWillingness>
<DoFWillingness>8</DoFWillingness>
<Loyalty>8</Loyalty>
<Neediness>5</Neediness>
<Forgiveness>6</Forgiveness>
<Chattiness>6</Chattiness>
<Meanness>4</Meanness>
<PortraitIndex>0</PortraitIndex>
<IconAtlas>CIV_COLOR_ATLAS_LEGENDS</IconAtlas>
</Row>
</Leaders>

<Leader_MajorCivApproachBiases>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<MajorCivApproachType>MAJOR_CIV_APPROACH_WAR</MajorCivApproachType>
<Bias>7</Bias>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<MajorCivApproachType>MAJOR_CIV_APPROACH_HOSTILE</MajorCivApproachType>
<Bias>4</Bias>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<MajorCivApproachType>MAJOR_CIV_APPROACH_DECEPTIVE</MajorCivApproachType>
<Bias>9</Bias>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<MajorCivApproachType>MAJOR_CIV_APPROACH_GUARDED</MajorCivApproachType>
<Bias>7</Bias>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<MajorCivApproachType>MAJOR_CIV_APPROACH_AFRAID</MajorCivApproachType>
<Bias>4</Bias>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<MajorCivApproachType>MAJOR_CIV_APPROACH_FRIENDLY</MajorCivApproachType>
<Bias>7</Bias>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<MajorCivApproachType>MAJOR_CIV_APPROACH_NEUTRAL</MajorCivApproachType>
<Bias>4</Bias>
</Row>
</Leader_MajorCivApproachBiases>
<Leader_MinorCivApproachBiases>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<MinorCivApproachType>MINOR_CIV_APPROACH_IGNORE</MinorCivApproachType>
<Bias>4</Bias>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<MinorCivApproachType>MINOR_CIV_APPROACH_FRIENDLY</MinorCivApproachType>
<Bias>5</Bias>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<MinorCivApproachType>MINOR_CIV_APPROACH_PROTECTIVE</MinorCivApproachType>
<Bias>7</Bias>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<MinorCivApproachType>MINOR_CIV_APPROACH_CONQUEST</MinorCivApproachType>
<Bias>7</Bias>
</Row>
</Leader_MinorCivApproachBiases>
<Leader_Flavors>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_OFFENSE</FlavorType>
<Flavor>5</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_DEFENSE</FlavorType>
<Flavor>6</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_CITY_DEFENSE</FlavorType>
<Flavor>5</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_MILITARY_TRAINING</FlavorType>
<Flavor>8</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_RECON</FlavorType>
<Flavor>9</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_RANGED</FlavorType>
<Flavor>9</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_MOBILE</FlavorType>
<Flavor>7</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_NAVAL</FlavorType>
<Flavor>3</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_NAVAL_RECON</FlavorType>
<Flavor>3</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_NAVAL_GROWTH</FlavorType>
<Flavor>4</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_NAVAL_TILE_IMPROVEMENT</FlavorType>
<Flavor>4</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_AIR</FlavorType>
<Flavor>8</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_EXPANSION</FlavorType>
<Flavor>9</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_GROWTH</FlavorType>
<Flavor>8</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_TILE_IMPROVEMENT</FlavorType>
<Flavor>7</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_INFRASTRUCTURE</FlavorType>
<Flavor>6</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_PRODUCTION</FlavorType>
<Flavor>8</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_GOLD</FlavorType>
<Flavor>5</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_SCIENCE</FlavorType>
<Flavor>7</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_CULTURE</FlavorType>
<Flavor>6</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_HAPPINESS</FlavorType>
<Flavor>5</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_GREAT_PEOPLE</FlavorType>
<Flavor>5</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_WONDER</FlavorType>
<Flavor>4</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_RELIGION</FlavorType>
<Flavor>5</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_DIPLOMACY</FlavorType>
<Flavor>7</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_SPACESHIP</FlavorType>
<Flavor>8</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_WATER_CONNECTION</FlavorType>
<Flavor>4</Flavor>
</Row>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<FlavorType>FLAVOR_NUKE</FlavorType>
<Flavor>5</Flavor>
</Row>
</Leader_Flavors>
<Leader_Traits>
<Row>
<LeaderType>LEADER_NZINGA</LeaderType>
<TraitType>TRAIT_GLORY_OF_THE_MANIKONGO</TraitType>
</Row>
</Leader_Traits>
</GameData>
 

Attachments

  • Kingdom of Kongo (v 2).rar
    1 MB · Views: 347
Please help, it would be so awesome if it would work!

After lots of test, I've found a reasonable compromise that I used in my latest mod

Basically I set two options for players:
1) play with default settings (i.e. UseScreenShots = 0) that means animated vanilla leaders and mute placeholder screen for custom ones
or
2) manually set UseScreenShots = 1 to have all 2D still screenshots for leaders

The latter option is already known; I explain the first.

1) In the leader_xxx_xml you must set:

<ArtDefineTag>briton_scene.xml</ArtDefineTag>

where "briton" is the name of your civ

2) briton_scene.xml contains:

<LeaderScene camera="default_camera.fxsxml" cubemap_prefix ="Napoleon" FallbackImage="briton_diplo.dds">
<BackgroundObject model="default_bg.fxsxml" ></BackgroundObject>
</LeaderScene>

Replace "briton_diplo.dds" with the name of your dds used for diplo background, and consider all the rest as a fixed template for every your custom civs

cubemap_prefix ="Napoleon" is required to avoid CTD when you play against your custom civ

3) default_camera.fxsxml

<Asset>
<Mesh file="Napoleon_Camera_Placeholder.gr2"/>
</Asset>

and default_bg.fxsxml

<Asset>
<Mesh file="Napoleon_Scene_Placeholder.gr2"/>
</Asset>

are fixed template for every your custom civs

4) Place into your art folder and set "import into VFS=true" the following:
briton_scene.xml
default_camera.fxsxml
default_bg.fxsxml


Done!!! :)


Further considerations:
a) you may replace "Napoleon" with another vanilla leader to see a different background
b) removing one or both default_xxx.fxsxml results in a full white screen during the diplo actions
c)
Last but not least consideration...

I'm not the right man, but it would be great if a gr2 wizard would create a gr2 containing a vertical plane 1600x900 pixel showing an external dds to set in the asset file.
In other words a default_bg.fxsxml with

<Asset>
<Mesh file="plane1600x900.gr2"/>
<Texture file="custom1600x900image_for_plane_above.dds"/>
</Asset>

If doable, it means to have 2D and 3D leaders working togheter with UseScreenShots = 0 !!!
 
It works splendid, thanks a lot! I tried to fix it myself for hours without success and now you solved it for me! Ambrox62 you rock! :clap:
 
Last but not least consideration...

I'm not the right man, but it would be great if a gr2 wizard would create a gr2 containing a vertical plane 1600x900 pixel showing an external dds to set in the asset file.
In other words a default_bg.fxsxml with

<Asset>
<Mesh file="plane1600x900.gr2"/>
<Texture file="custom1600x900image_for_plane_above.dds"/>
</Asset>

If doable, it means to have 2D and 3D leaders working togheter with UseScreenShots = 0 !!!

is that because the 2D option is still broken?
 
In Civ4 you may assign a dds as artdefine instead of a kfm; the game will show your still 2D dds image.
In Civ5 you must assign a gr2. No chances.
And may be only a 2K one. I'm not skilled in gr2, but I've assigned a custom gr2 with no results. May be I did a wrong test, may be is intended. Who knows?
 
GRAPHICS
&#8226;If a 3D leaderhead scene cannot be created, fallback to 2D.


Despite the official 2K announcement above, nothing has changed compared to previous version, i.e. you still can't have 2D and 3D leader together with UseScreenShots = 0

Does anyone could say that I'm wrong?
 
GRAPHICS
&#8226;If a 3D leaderhead scene cannot be created, fallback to 2D.


Despite the official 2K announcement above, nothing has changed compared to previous version, i.e. you still can't have 2D and 3D leader together with UseScreenShots = 0

Can anyone say that I'm wrong?

Nope, not wrong,
Spoiler :


Pre-patch

PS small grammatical error, still checking for that;)
 
GRAPHICS
•If a 3D leaderhead scene cannot be created, fallback to 2D.


Despite the official 2K announcement above, nothing has changed compared to previous version, i.e. you still can't have 2D and 3D leader together with UseScreenShots = 0

Does anyone could say that I'm wrong?

try to make your ****_scene.xml very basic, with no ref to camera, 3d scene, etc...

like that :

Code:
<LeaderScene FallbackImage="briton_diplo.dds"></LeaderScene>
 
I have made a program which should ease UseScreenShots value changing for users.

Very nice. It works for me (on win XP SP3). :goodjob:
It's really useful for users who aren't familiar with SO low management.

However I don't see a way to run it through a mod. I might include a link to it in the civ DL threads.
 
well ambrox62, I can confirm that the simple code above works well, I've tested it with your Ancient Mediterranean Civilizations... 3D / 2D does work together now :D
 
Top Bottom