Jump to content

Reskinning Step 1 : Duplicating game objects


Amineri

Recommended Posts

Well done guys, you are fast. I'd recommend doing UI flags in exact dimensions, that will be used in the game, because every rescaling takes away some quallity.

 

Yet, i was still incredulous about this whole UI "flaw" for having never really paid any attention to such details. But i just verified the stuff straight into a test gameplay. Took a snapshot of South-Africa (which i feel is the best schema to prove it) rendering and voila... it's actually the "Taller" height which is somehow problematic.


I'll basicly consider that fact as my parametric source from now on. Even then, that specific South-Africa image would NEVER render with the actual true flag proportions for good reasons; Japan has just empty white all-around the central red circle!!! We're simply witnessing an illusion. So... if we'd put two strips of "black" up & down (on most if not all other flags)... it could approximately be Okay, i think.

 

256 x 128 (20%=25.6 pixels)... necessary calibration of pictures then should become... 256x102 for initial image (appearance) to be resized back @ 256x128 for Flags_DIF insertion in their respective UV slots (as they will be defined by Amineri's code).

 

Although my rational comment about this whole need to 'fix' these textures would be; Why even bother? :confused:

I know... while we're at it - might as well go for perfected assets. When & if possible, though. :ninja:

 

I am bad in explaining :sad: but I can see details. Posted about those deformations, because thought it will save us some work later.

 

I'd go with 256x160 as the original and render it to bitmap. Then crop the height to 128 to get UI version. Reload. Rescale the height to 128 to get Flags_DIF version.

 

Crop the width to 208 and rescale it back to 256 is good too, different approach.

 

Speaking of details, every flag in Flags_DIF texture has 2 px border (as Amineri mentioned already). "Perfect" asset would have 252x124 true flag data + 2px border :smile:

 

Man, you rock. You've done so much before I even got any free time. What is left to do?

Edited by Drakous79
Link to comment
Share on other sites

  • Replies 90
  • Created
  • Last Reply

Top Posters In This Topic

 

Well done guys, you are fast. I'd recommend doing UI flags in exact dimensions, that will be used in the game, because every rescaling takes away some quallity.

Unfortunately, I don't think this is possible, because :
  1. Different players play at different resolutions
  2. The flag displayed in the soldier list UI is a different size than that displayed in the soldier info UI

From other projects (notably the interceptor icons in the Hanger UI), we've found that, when possible, using slightly high-res images and then scaling down works best, in particular for players playing at higher resolution. UI elements by default don't use mipmaps.

Link to comment
Share on other sites

Drakous,

 

Still not exactly sure we (or i) should try re-scaling the Flags to somehow fit the real (or nearly enough, since for some images it's absolutely impossible to achieve quality-wise) proportions onto a self-adapting Armor place-holder.

Here's my explanation for that stuff. It's the Zooming factors that count and *IF* and/or *WHEN* anyone happens to get sooooo far IN that it becomes noticeable that some of these flags are "incorrectly" rendered by Firaxis code work.

 

Yep -- a solution could be to clip/crop/edit/resize/resave anything that requires custom calibrations but i doubt the results would be satisfactory for most. Maybe we'd properly address the issue for nearly half-a-dozen of these (Japan being the obvious reference to estimate what other central symbols could react in a well enough manner to such edit steps).

 

I can always create those temporary samples for the Dev team (as shown by the Canadian testing phase above). Although, i'd have to stress on the fact that they might endup screwed and ugly. Nothing an artist can do about source materials with inherent limits and scaling features.

 

... What is left to do?

 

I've started working on the "regular" strategic Flags for conversion to the Armor_with_Cloth files (Which btw, already includes the 2-Pixels wide framing with some level of transparency that lets most colors through just slightly rather than the Firaxis brownish effect). There's 135 items to deal with and almost every layering steps need further tuning for intensity or brightness. Colors DO have a knack for bad shading contrast effects.

It's not an instantaneous process in many cases. Lotsa of key decisions to take. But... i'll eventually complete the entire set for later use if need be.

 

Lemme give you an example with the UK... comparing the Stock EW DIF texture (left) with my version on the right;

 

http://s28.postimg.org/mgv1wrqrx/UK_EWdif.png --- http://s13.postimg.org/vkm9fn9uv/04_United_Kingdom_A.png

 

Slight corrections can go a looooong way towards sharp (and valid) BLUE_vs_Their-LightMarine or CrimsonRED_vs_Their-Orange differences (or authentic representations), agreed? :wink:

 

Next would possibly be the special re-scaling of a few (that *REALLY* matters as explained above) -- if formally requested by JL.

 

Dunno when -- as it all essentially depends on Amineri's success with the code integration phase.

Edited by Zyxpsilon
Link to comment
Share on other sites

The good news is that with more of XMTS's assistance I was able to figure out the scaling/positioning issues with loading the Strategy-side UI Flags, including the flag displays in the SoldierList UI, SoldierInfo UI, and MissionDebrief UI. All are using the new 256x128 textures and loading them dynamically.

 

There's separate coding required to extend the ECountry enum, and allow soldiers from additional countries, but I think JL indicated he was going to work on that, so I'm switching over to the UScript changes for the armor flags.

 

My plan is to always switch to a new MIC (Material Instance Constant), even for the vanilla flags. This will allow for consistency between all country flags, and will hopefully fix the female Titan Armor flag glitch.

 

------------

 

As a side note, in terms of reskinning armor/weapons in general, it might be worthwhile to investigate XComUnitPawn.SetGhostFX and ApplyGhostMaterials. It seems as though the ghosting effect is done by temporarily setting every texture for the entire unit (armor, weapons, head, armorkit, etc) to the appropriate MITV (Material Instance Time Varying), which is either :

        if((m_kXGCharacter != none) && m_kXGCharacter.HasUpgrade(95))
        {
            MITV = materialinstancetimevarying'M_Mimetic_Skin_Enter';
        }
        else
        {
            MITV = materialinstancetimevarying'CHH_GhostArmor_Enter';
        }

This implies that it is possible in some manner to change via script ANY texture on any model in XCOM, although I haven't deciphered it all yet.

Link to comment
Share on other sites

Well, after everything else, it turns out that altering the armor flags wasn't terribly difficult.

 

For testing purposes I added 2 armor flag textures to LongWar.upk >> Flags_Armor :

  • Flags0_DIF -- the vanilla 8x4 armor flag texture (1024x1024)
  • Flags1_DIF -- the vanilla texture rotated 180º

 

I then modded XComHumanPawn.UpdateFlagMaterial to :

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

    if(m_kAppearance.iFlag < 0)
    {
        XComContentManager(class'Engine'.static.GetEngine().GetContentManager()).GetCountryFlag(65, Flag);
    }
    else
    {
        XComContentManager(class'Engine'.static.GetEngine().GetContentManager()).GetCountryFlag(byte(m_kAppearance.iFlag), Flag);
    }
    MIC.SetTextureParameterValue(name("FlagTex"), Texture2D(FindObject(("LongWar.Flags_Armor.Flags" $ string(int(Flag.U))) $ "_DIF", class'Texture2D')));
    MIC.SetScalarParameterValue('UOffset', Flag.U - float(int(Flag.U)));
    MIC.SetScalarParameterValue('vOffset', Flag.V);
    //return;    
}

We've already put together a trial list of "country" enums, and the U.N. flag is at position 65, so I set the default to that if no country flag is specified.

 

The flag texture offset is computed using "string(int(Flag.U))", which discards any fractional part of the U offset value. The integer value is removed prior to setting the uOffset MIC Scalar Parameter.

 

As a test, I changed the DefaultContent.ini config line for the USA to :

Flags=(Country=eCountry_USA, U=1.75, V=0.875)

This changes the USA flag to be drawn from Flags1_DIF (the second texture), the bottom-rightmost flag in the texture. Since I'd rotated it 180º the texture was reflected both vertically and horizontally. I verified that the flag texture was changed in both the strategy and tactical portions of the game.

 

For this test, when I imported the Flag#_DIF textures, I set them as TEXTUREGROUP_Character, but disabled mipmap generation. This eliminates any need to mess with the tfcs, but may result in slower loading on older systems (or systems with slow hard disks).

Link to comment
Share on other sites

Sooooo --- in simple layman's terms, it just works as planned and/or expected, right?

 

Can the "correction" flaw be indirectly addressed too by adding Strategy Flags (with their cloth layers) straight on the Armors via your custom Flag#_DIF file(s) without having to re-scale their general height-ratios for another specific texture??

 

Be darned - i wish i could be THAT smart to perform such code magic.

 

Still, why the 180° trick? Testing purposes only?

 

And... finally, would you care to hand-over the current (and most probably) Trial-near-Final eNum list for all the additional new flags. As a reference while i create each of their files. Better to coordinate our tasks with reliable ID's such as **109-Algeria_A.png** or **04-United_Kingdom_A.png** (A -- being a simple suffix to define "Armor" version), and so on.

Edited by Zyxpsilon
Link to comment
Share on other sites

 

Still, why the 180° trick? Testing purposes only?

Yes, I wanted a quick second flag texture that I could easily verify was working.

 

Can the "correction" flaw be indirectly addressed too by adding Strategy Flags (with their cloth layers) straight on the Armors via your custom Flag#_DIF file(s) without having to re-scale their general height-ratios for another specific texture??

Our current plan is to retain the 'clean' look for the Strategy UI icons, with any texturing applied only to the armor flag textures.

 

 

 

And... finally, would you care to hand-over the current (and most probably) Trial-near-Final eNum list for all the additional new flags.

Here's the list :

Dec	Hex	Country
0	00	United States
1	01	Russia
2	02	China
3	03	United Kingdom
4	04	Germany
5	05	France
6	06	Japan
7	07	India
8	08	Australia
9	09	Italy
10	0A	South Korea
13	0D	Spain
15	0F	Canada
17	11	Israel
18	12	Egypt
19	13	Brazil
20	14	Argentina
21	15	Mexico
22	16	South Africa
23	17	Poland
24	18	Ukraine
25	19	Nigeria
27	1B	Greece
30	1E	Sweden
31	1F	Ireland
32	20	Scotland
33	21	Norway
34	22	Netherlands
35	23	Belgium
36	24	Bosnia and Herzegovina
37	25	Honduras
11	0B	Turkey
12	0C	Indonesia
14	0E	Pakistan
16	10	Iran
26	1A	Venezuela
28	1C	Colombia
29	1D	Portugal
38	26	Algeria
39	27	Ethiopia
40	28	Kenya
41	29	Morocco
42	2A	Tanzania
43	2B	Zimbabwe
44	2C	Bangladesh
45	2D	Kazakhstan
46	2E	Malaysia
47	2F	New Zealand
48	30	Philippines
49	31	Saudi Arabia
50	32	Taiwan
51	33	Thailand
52	34	Vietnam
53	35	Austria
54	36	Czech Republic
55	37	Denmark
56	38	Finland
57	39	Hungary
58	3A	Romania
59	3B	Cuba
60	3C	Guatemala
62	3E	Chile
63	3F	Ecuador
64	40	Peru
65	41	United Nations
66	42	XCOM Specific
67	43	Bolivia
68	44	Nicaragua
69	45	Bulgaria
70	46	Croatia
71	47	Serbia
72	48	Slovakia
73	49	Switzerland
74	4A	Angola
75	4B	Ghana
76	4C	Iraq
77	4D	Jordan
78	4E	Syria
79	4F	Mongolia
61	3D	Panama
80	50	Costa Rica
81	51	El Salvador
82	52	Paraguay
83	53	Uruguay
84	54	Albania
85	55	Belarus
86	56	Estonia
87	57	Iceland
88	58	Kosovo
89	59	Latvia
90	5A	Lithuania
91	5B	Macedonia
92	5C	Moldova
93	5D	Montenegro
94	5E	Slovenia
95	5F	Botswana
96	60	Cameroon
97	61	DR Congo
98	62	Gabon
99	63	Ivory Coast
100	64	Libya
101	65	Mozambique
102	66	Namibia
103	67	Senegal
104	68	Sudan
105	69	Tunisia
106	6A	Zambia
107	6B	Afghanistan
108	6C	Armenia
109	6D	Azerbaijan
110	6E	Georgia
111	6F	Kuwait
112	70	Lebanon
113	71	Oman
114	72	Palestine
115	73	Qatar
116	74	United Arab Emirates
117	75	Yemen
118	76	Cambodia
119	77	Kyrgyzstan
120	78	Laos
121	79	Myanmar
122	7A	Nepal
123	7B	Singapore
124	7C	Sri Lanka
125	7D	Tajikistan
126	7E	Uzbekistan

 

Link to comment
Share on other sites

Thanks on all counts!

 

Some missing numbers on that list (Oooopppss, sorry --- they're located further down)... Copy/Pasting.

Back to editing what Flags still remain in my A_Task folder.

 

When you have the time... take some snapshots for us of whatever tactical UI results you could get even if those textures are just temporary!

 

Great job - as usual.

 

PS; That next Beta-14G (or the others following) really looks to be VERY promising.

Edited by Zyxpsilon
Link to comment
Share on other sites

Amineri, thanks for the explanation.

 

I suspect there's an error in female titan skeleton mesh, because its MIC isn't accepting ini's UV coordinates. There's Lv3MedMale_DIF texture mapped to flag's area and is always positioned at U=0 and V=0. When I compare EW P3 and EU P6 skeletal meshes, EW's has smaller size, like something is missing, not just bHasVertexColors=true.

 

Zyxpsilon, I fear that rescaling issue can't be solved by scripts. In armor's model is defined, what area of texture is used. For flags it is 256x128 px at position xy (UV) 0. We can change U and V with scripts, because it is defined by scalar parameters in material, but width and height is hardcoded in the model. Texture mapping.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...