Jump to content

Expanding Nationalities


wghost81

Recommended Posts

Here are some thoughts I have after working on Nationalities Probability mod...

 

There are 7 unused countries in EW country list: Turkey, Indonesia, Pakistan, Iran, Venezuela, Columbia and Portugal. It is actually possible to have soldiers with named nationalities:

 

http://i.imgur.com/lOSM41u.jpg

 

http://i.imgur.com/sFwNqCm.jpg

 

Most nationalities even display correct flags in barracks, but soldier pawns have default (USA) flag on their uniform and names are taken from default (USA) list.

 

I think it is quite possible to modify XGCharacterGenerator.GenerateName function to generate names for 7 unused nationalities. For example, it can be done by expanding USA names array in DefaultNameList.ini and modifying GenerateName function to map different parts of the array to different countries.

 

I don't know what to do with flags, though, as I'm not an expert on graphics. Any help/suggestions on this will be greatly appreciated.

Link to comment
Share on other sites

  • Replies 40
  • Created
  • Last Reply

Top Posters In This Topic

I can partially address some of the UI issues here, at least to explain them.

 

The UIFlags are stored as part gfxXComIcons, the active copy of which is stored in UICollection_Common_SF.upk. There are copies of gfxXComIcons in Command1.upk and UICollection_Strategy_SF.upk, but these appear to be inactive, as when I swapped perk icon Texture2D data in them it had no effect.

 

There are UIFlags for all 36 countries defined, although some flag names have typos (e.g. "UIFlag_isreal" (sic)). However these UIFlag elements are only utilized for Flash / GFX interface elements, as you've seen.

 

The pawn texture flags are drawn from somewhere else completely. The reason it defaults to the USA flag is because the ECountry enum is unusual in that there is no "None" value at 0 -- instead it starts with enum value 0 = USA.

 

At first I thought the most likely place to start looking at pawn flag textures is in XComHumanPawn.UpdateFlagMaterial :

 

 

simulated function UpdateFlagMaterial(MaterialInstanceConstant MIC)
{
    local CountryFlag Flag;

    // End:0x129
    if(m_kAppearance.iFlag != -1)
    {
        XComContentManager(class'Engine'.static.GetEngine().GetContentManager()).GetCountryFlag(byte(m_kAppearance.iFlag), Flag);
        MIC.SetScalarParameterValue('UOffset', Flag.U);
        MIC.SetScalarParameterValue('vOffset', Flag.V);
    }
    //return;    
}

 

 

 

However this only appears to be altering the characteristics of the texture, as advertised, since DefaultContent.ini only has :

 

 

Flags=(Country=eCountry_USA, U=0.0, V=0.0)
Flags=(Country=eCountry_Russia, U=0.25, V=0.0)
Flags=(Country=eCountry_China, U=0.5, V=0.0)
Flags=(Country=eCountry_UK, U=0.75, V=0.0)
Flags=(Country=eCountry_Germany, U=0.0, V=0.125)
Flags=(Country=eCountry_France, U=0.25, V=0.125)
Flags=(Country=eCountry_Japan, U=0.5, V=0.125)
Flags=(Country=eCountry_India, U=0.75, V=0.125)
Flags=(Country=eCountry_Australia, U=0.0, V=0.25)
Flags=(Country=eCountry_Italy, U=0.25, V=0.25)
Flags=(Country=eCountry_SouthKorea, U=0.5, V=0.25)
Flags=(Country=eCountry_Ireland, U=0.75, V=0.25)     
Flags=(Country=eCountry_Sweden, U=0.0, V=0.375)  
Flags=(Country=eCountry_Spain, U=0.25, V=0.375)
Flags=(Country=eCountry_Norway, U=0.5, V=0.375)   
Flags=(Country=eCountry_Canada, U=0.75, V=0.375)
Flags=(Country=eCountry_Netherlands, U=0.0, V=0.5)         
Flags=(Country=eCountry_Israel, U=0.25, V=0.5)
Flags=(Country=eCountry_Egypt, U=0.5, V=0.5)
Flags=(Country=eCountry_Egypt, U=0.5, V=0.5)
Flags=(Country=eCountry_Brazil, U=0.75, V=0.5)
Flags=(Country=eCountry_Argentina, U=0.0, V=0.625)
Flags=(Country=eCountry_Mexico, U=0.25, V=0.625)
Flags=(Country=eCountry_SouthAfrica, U=0.5, V=0.625)
Flags=(Country=eCountry_Poland, U=0.75, V=0.625)
Flags=(Country=eCountry_Ukraine, U=0.0, V=0.75)
Flags=(Country=eCountry_Nigeria, U=0.25, V=0.75)
Flags=(Country=eCountry_Scotland, U=0.5, V=0.75)	
Flags=(Country=eCountry_Greece, U=0.75, V=0.75)
Flags=(Country=eCountry_Belgium, U=0.0, V=0.875)	 

 

 

This also includes texture info for all 36 country flags.

 

The nationality is stored as part of the TAppearance structure (in iFlag element) in the TSoldier structure. In the strategy game m_kSoldier in XGStrategySoldier is of type TSoldier, while in the tactical game there is an m_kSoldier member of XGCharacter_Soldier, which is in turn stored in XGUnit.m_kCharacter. XComUnitPawn.SetAppearance copies the entire TAppearance structure into XComUnitPawn.m_kAppearance.

 

This info is set in XGCharacterGenerator.CreateTSoldier :

    if(iCountry == -1)
    {
        iCountry = PickOriginCountry();
    }
    kSoldier.iCountry = iCountry;
    kSoldier.kAppearance.iFlag = kSoldier.iCountry;

The pawn flags themselves appear to be defined in as a part of each individual soldier model. After decompressing Soldier_MaleKevlar_SF.upk and opening it in uemodel, I found there is a the textures CHH_Flags, MINST_Flags, Flags_DIF defined there that contains 8 x 4 "array" for flags. This means that the model itself is limited to containing only 32 flags from the 36 total countries. (as opposed to the UIFlags which have all 36 flags). The USA flag is in the upper left corner of the texture and appears to be the default displayed.

 

Based on visual appearance, the flags appear to be:

  • USA, Russia, China, Great Britain
  • Germany, France, Japan, India
  • Australia, Italy, South Korea, Ireland
  • Sweden, Spain, Norway, Canada
  • Netherlands, Israel, Egypt, Brazil
  • Argentina, Mexico, South Africa, Poland
  • Ukraine, Nigeria, Scotland, Greece
  • Belgium, Unknown, Blank, Unknown

So only 29 of the actual slots are filled, meaning that 7 country flags available as UIFlags are not available in this texture:

  • Zimbabwe
  • Venezuala
  • Turkey
  • Saudi Arabia
  • Portugal
  • Kenya
  • Columbia

These 7 UIFlags also don't match up with the 7 "extra" countries for the ECountry enum list : Turkey, Indonesia, Pakistan, Iran, Venezuela, Columbia and Portugal.

 

Portugal, Columbia, Venezuela, and Turkey have UI flags and are in the ECountry enum list (but have no Pawn texture flags).

 

Indonesia, Pakistan, and Iran are defined in the ECountry enum list but don't have either UI flags or pawn texture flags.

 

Saudi Arabia, Zimbabwe, and Kenya have UIFlags but no Pawn flags and aren't on the ECountry enum list.

 

The actual flag textures are almost certainly stored in one of the tfc files, probably in CharTextures.tfc. Unfortunately I haven't made much progress towards being able to add/alter new 3D models/textures into the game.

Edited by Amineri
Link to comment
Share on other sites

Uh, I hate to stick my oar in here, but presume since you are both coder divers that you are looking for mechanisms within the existing code. Just wanted to be sure you were aware that people have been using TexMod to insert replacement textures for 'unit pawn flags' (including a generic XCOM symbol 'flag') for quite a while, directly into game memory via a shell wrapper. There are at least 8 such 'flag' and 2 'head' mods on Nexus. (There are another 8 that provide different ethnic soldier names and/or nicknames via DefaultNameList.ini edits.) Since the 'Modifying Textures' article lists TexMod guideline resources from GuildWars and Mass Effect, these appear to have been viable approaches for Unreal Engine games for quite a while.

 

My point is: unless you are trying to figure out how we can get the game engine to read our own art asset files (which is theoretically do-able with the UDK), for wghost81's stated purpose, TexMod would seem to be an immediately available mechanism.

 

(Just trying to avoid re-inventing the wheel simply to see you go 'Duh' :facepalm: .)

 

-Dubious-

Edited by dubiousintent
Link to comment
Share on other sites

@wghost

 

It could be changed via TexMod, as dubious pointed out, quite easily. Otherwise there is a pure black spot in the 31st position which it may be possible to set via setting iFlag to -1 or -2 perhaps. Although there there would be the problem of separately specifying the UI flag vs the Pawn flag.

 

@dubious

 

I'm definitely aware of the various TexMod changes (and fully approve). More recently I've been trying to explore how to add additional textures/models, or being able to swap textures in a way that could be installed with Long War (and not require a secondary / more complicated install process).

 

The trick is that there still only appears to be room to have 32 flags (of which 29 are present) in each pawn's flag textures. They are also defined separately within each armor model.

Link to comment
Share on other sites

And here i thought this thread was going to announce some spectacular progress for a new functional way to enhance the Council Nations.

If there is something i'd REALLY enjoy, it's an expanded pool of actual nations beyond the basic 29 limit (Flags files and Barracks) while offering gameplay solutions for proper integration of any supplemental countries.

 

Total being 16. It never occured to me why (example) Scotland is there and Italy is out! Plenty more weirdness if one considers how "small" in scope the Continents feel.

This gameplay could use Regional concepts and sub-components for the Council core assets. Cuba in North-America, Chile in SA, Middle-East, Pacific Rim... heck, even Greenland and Antarctica!! :wink:

 

Oh - well - anybody can always dream of a real whole world on our XCom planet where total invasion happens even in remote regions - right?

 

(PS; Hobbes, isn't it the HongKong flag at the bottom? EDIT; never mind - it is Honduras, indeed!)

Edited by Zyxpsilon
Link to comment
Share on other sites

Currently countries are divided into Council countries and non-Council countries. There are 16 Council countries out of the 36 countries defined in ECountry enum.

 

In theory it's possible to simply change the booleans to turn some of the non-Council countries into Council. However, this would require some significant UI rework :

1) The Situation Room UI is designed around 16 slots for countries, and would need substantial rework to accomodate more countries

2) Geoscape and Situation room has country sprites only for the 16 Council countries, so additional country shape sprite artwork would have to be developed and integrated into the game.

 

Needless to say this is a lot of work.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...