Zyxpsilon Posted September 1, 2014 Share Posted September 1, 2014 (edited) Just being misunderstood, it's okay.What i actually meant is that the most important values for me to find are the exact RGB. I've cleaned up your results code to put them all in better focus somehow. If anything, it could be used by Dubious when he makes the Wiki Article. But it's much clearer to me that way; FROM: wghost81's extract CODE Summary... (* Please note that the HEX & Float values below are actually ordered as BGRA rather than what is written -(R,G,B,A)- at the beginning of each fields.) REF; 0x00000115 (277): XComLinearColorPalette'UnitPalettes.ArmorTint' NumElements = 0x00000020 = 32 ************ Entries[0]: -> Primary (R, G, B, A) = (0x3D17AB36, 0x3E116348, 0x3E9CFF3B, 0x3F800000) = (0.0370285, 0.14198, 0.306635, 1) -> Secondary (R, G, B, A) = (0x3BB4EFC1, 0x3D367CD1, 0x3D5F9C27, 0x3F800000) = (0.00552174, 0.0445526, 0.0545923, 1) Entries[1]: -> Primary (R, G, B, A) = (0x3E59222B, 0x3E59222B, 0x3E0B5D6B, 0x3F800000) = (0.212044, 0.212044, 0.136099, 1) -> Secondary (R, G, B, A) = (0x3D0C34F9, 0x3DD43E1D, 0x3E3F79EA, 0x3F800000) = (0.0342302, 0.103634, 0.186989, 1) Entries[2]: -> Primary (R, G, B, A) = (0x3C78A190, 0x3D86A9F8, 0x3D587076, 0x3F800000) = (0.0151752, 0.0657539, 0.0528416, 1) -> Secondary (R, G, B, A) = (0x3E190953, 0x3EC3846E, 0x3ECBA938, 0x3F800000) = (0.14945, 0.38187, 0.397775, 1) Entries[3]: -> Primary (R, G, B, A) = (0x3C42A9EE, 0x3E0B5D6B, 0x3EC1E1DB, 0x3F800000) = (0.0118813, 0.136099, 0.378676, 1) -> Secondary (R, G, B, A) = (0x3D1D9599, 0x3D17AB36, 0x3D0C34F9, 0x3F800000) = (0.0384727, 0.0370285, 0.0342302, 1) Entries[4]: -> Primary (R, G, B, A) = (0x3EDFA5EC, 0x3EE54F54, 0x3EEB0C85, 0x3F800000) = (0.436813, 0.447871, 0.45908, 1) -> Secondary (R, G, B, A) = (0x3C350832, 0x3C2F240F, 0x3C258ED8, 0x3F800000) = (0.0110493, 0.0106897, 0.0101049, 1) Entries[5]: -> Primary (R, G, B, A) = (0x3BB4EFC1, 0x3B9569FF, 0x3E59222B, 0x3F800000) = (0.00552174, 0.00455975, 0.212044, 1) -> Secondary (R, G, B, A) = (0x3D1D9599, 0x3D0C34F9, 0x3D06A8E6, 0x3F800000) = (0.0384727, 0.0342302, 0.0328759, 1) Entries[6]: -> Primary (R, G, B, A) = (0x3D1D9599, 0x3EAB3E0E, 0x3EF0DD8B, 0x3F800000) = (0.0384727, 0.334458, 0.47044, 1) -> Secondary (R, G, B, A) = (0x3D1D9599, 0x3CABA1B5, 0x3D013C08, 0x3F800000) = (0.0384727, 0.0209511, 0.0315514, 1) Entries[7]: -> Primary (R, G, B, A) = (0x3E849F3B, 0x3E4A41BF, 0x3D301326, 0x3F800000) = (0.259027, 0.197516, 0.042987, 1) -> Secondary (R, G, B, A) = (0x3BD7C6A0, 0x3D367CD1, 0x3DCA1D90, 0x3F800000) = (0.00658496, 0.0445526, 0.0986892, 1) Entries[8]: -> Primary (R, G, B, A) = (0x3CD97CA0, 0x3D4A7ABD, 0x3D43B082, 0x3F800000) = (0.0265487, 0.0494335, 0.0477758, 1) -> Secondary (R, G, B, A) = (0x3E358EF3, 0x3E5CE197, 0x3E67F27F, 0x3F800000) = (0.177303, 0.215704, 0.226511, 1) Entries[9]: -> Primary (R, G, B, A) = (0x3C2A5B8B, 0x3C1EDD5A, 0x3C2A5B8B, 0x3F800000) = (0.0103978, 0.00969633, 0.0103978, 1) -> Secondary (R, G, B, A) = (0x3F4F1B7D, 0x3F581052, 0x3F5B37EC, 0x3F800000) = (0.809013, 0.843999, 0.856322, 1) Entries[10]: -> Primary (R, G, B, A) = (0x3CE24A3E, 0x3C6AB35A, 0x3BC30F86, 0x3F800000) = (0.0276233, 0.014325, 0.00595278, 1) -> Secondary (R, G, B, A) = (0x3F60E02E, 0x3F515523, 0x3F4A8361, 0x3F800000) = (0.878421, 0.817705, 0.791067, 1) Entries[11]: -> Primary (R, G, B, A) = (0x3DF440B1, 0x3D013C08, 0x3D013C08, 0x3F800000) = (0.119264, 0.0315514, 0.0315514, 1) -> Secondary (R, G, B, A) = (0x3CCA8964, 0x3CCA8964, 0x3CE24A3E, 0x3F800000) = (0.0247237, 0.0247237, 0.0276233, 1) Entries[12]: -> Primary (R, G, B, A) = (0x3E828455, 0x3D06A8E6, 0x3E1DDA17, 0x3F800000) = (0.254916, 0.0328759, 0.154152, 1) -> Secondary (R, G, B, A) = (0x3F25431C, 0x3F25431C, 0x3F25431C, 0x3F800000) = (0.645555, 0.645555, 0.645555, 1) Entries[13]: -> Primary (R, G, B, A) = (0x3E4DEC0A, 0x3D82B15F, 0x3F2FE140, 0x3F800000) = (0.201096, 0.0638149, 0.687031, 1) -> Secondary (R, G, B, A) = (0x3F25431C, 0x3F25431C, 0x3F25431C, 0x3F800000) = (0.645555, 0.645555, 0.645555, 1) Entries[14]: -> Primary (R, G, B, A) = (0x3CABA1B5, 0x3CABA1B5, 0x3CB45499, 0x3F800000) = (0.0209511, 0.0209511, 0.022013, 1) -> Secondary (R, G, B, A) = (0x3CBD43AB, 0x3F0DE1D4, 0x3F57E714, 0x3F800000) = (0.0231036, 0.554227, 0.84337, 1) Entries[15]: -> Primary (R, G, B, A) = (0x3CBD43AB, 0x3F0DE1D4, 0x3F57E714, 0x3F800000) = (0.0231036, 0.554227, 0.84337, 1) -> Secondary (R, G, B, A) = (0x3CABA1B5, 0x3CABA1B5, 0x3CB45499, 0x3F800000) = (0.0209511, 0.0209511, 0.022013, 1) Entries[16]: -> Primary (R, G, B, A) = (0x3D4A7ABD, 0x3CC66F31, 0x3C6A76AB, 0x3F800000) = (0.0494335, 0.0242229, 0.0143105, 1) -> Secondary (R, G, B, A) = (0x3E8B0C32, 0x3E93DFB0, 0x3E9CFF3B, 0x3F800000) = (0.271577, 0.288816, 0.306635, 1) Entries[17]: -> Primary (R, G, B, A) = (0x3B00ACA8, 0x3A82128E, 0x3EB29E69, 0x3F800000) = (0.00196342, 0.000992374, 0.348865, 1) -> Secondary (R, G, B, A) = (0x00000000, 0x3F4C02B9, 0x3F796BBD, 0x3F800000) = (0, 0.796917, 0.9743, 1) Entries[18]: -> Primary (R, G, B, A) = (0x3EDA1042, 0x3CA32ABC, 0x3C5CBF86, 0x3F800000) = (0.425905, 0.0199178, 0.0134734, 1) -> Secondary (R, G, B, A) = (0x00000000, 0x3EDA1042, 0x3F800000, 0x3F800000) = (0, 0.425905, 1, 1) Entries[19]: -> Primary (R, G, B, A) = (0x3D17AB36, 0x3D75E3B4, 0x3ECF1FFA, 0x3F800000) = (0.0370285, 0.0600316, 0.404541, 1) -> Secondary (R, G, B, A) = (0x3DE94F61, 0x3E147393, 0x3C5CBF86, 0x3F800000) = (0.113921, 0.144972, 0.0134734, 1) Entries[20]: -> Primary (R, G, B, A) = (0x3DFF782E, 0x3CBD43AB, 0x3BA4C3A1, 0x3F800000) = (0.124741, 0.0231036, 0.0050282, 1) -> Secondary (R, G, B, A) = (0x3B58722A, 0x3D367CD1, 0x3E96206D, 0x3F800000) = (0.0033027, 0.0445526, 0.293216, 1) Entries[21]: -> Primary (R, G, B, A) = (0x3C9AEF67, 0x3C9AEF67, 0x3BC5F02C, 0x3F800000) = (0.018913, 0.018913, 0.00604059, 1) -> Secondary (R, G, B, A) = (0x3C42A9EE, 0x3C9AEF67, 0x3D5F9C27, 0x3F800000) = (0.0118813, 0.018913, 0.0545923, 1) Entries[22]: -> Primary (R, G, B, A) = (0x3DB6AB16, 0x3EAB3E0E, 0x3EF9BC5C, 0x3F800000) = (0.0891935, 0.334458, 0.487765, 1) -> Secondary (R, G, B, A) = (0x3D8ECD13, 0x3DC5272C, 0x3DEEBF48, 0x3F800000) = (0.0697271, 0.0962661, 0.116576, 1) Entries[23]: -> Primary (R, G, B, A) = (0x3DA8C8C7, 0x3ADD1B7C, 0x3DE94F61, 0x3F800000) = (0.0824142, 0.00168692, 0.113921, 1) -> Secondary (R, G, B, A) = (0x3B58722A, 0x3E8F6C76, 0x3E60C9C7, 0x3F800000) = (0.0033027, 0.280124, 0.21952, 1) Entries[24]: -> Primary (R, G, B, A) = (0x3E88E328, 0x00000000, 0x3F59EBA1, 0x3F800000) = (0.267358, 0, 0.851252, 1) -> Secondary (R, G, B, A) = (0x3F600904, 0x3EDCD8A0, 0x00000000, 0x3F800000) = (0.875138, 0.43134, 0, 1) Entries[25]: -> Primary (R, G, B, A) = (0x00000000, 0x3EA66B3F, 0x3F800000, 0x3F800000) = (0, 0.325037, 1, 1) -> Secondary (R, G, B, A) = (0x3F800000, 0x00000000, 0x3EA4090D, 0x3F800000) = (1, 0, 0.320382, 1) Entries[26]: -> Primary (R, G, B, A) = (0x00000000, 0x3E0867D0, 0x3E0867D0, 0x3F800000) = (0, 0.133209, 0.133209, 1) -> Secondary (R, G, B, A) = (0x00000000, 0x3CED7EED, 0x3E0867D0, 0x3F800000) = (0, 0.0289912, 0.133209, 1) Entries[27]: -> Primary (R, G, B, A) = (0x3EA4090D, 0x3E9AB031, 0x3E60C9C7, 0x3F800000) = (0.320382, 0.302125, 0.21952, 1) -> Secondary (R, G, B, A) = (0x3F091FCF, 0x3F160253, 0x3F111A71, 0x3F800000) = (0.535642, 0.585973, 0.56681, 1) Entries[28]: -> Primary (R, G, B, A) = (0x3E9AB031, 0x3ED1D4AE, 0x3EF3CD82, 0x3F800000) = (0.302125, 0.409826, 0.476177, 1) -> Secondary (R, G, B, A) = (0x3F51E924, 0x3F685503, 0x3F796BBD, 0x3F800000) = (0.819964, 0.907547, 0.9743, 1) Entries[29]: -> Primary (R, G, B, A) = (0x3D8ECD13, 0x3E27916C, 0x3E806E22, 0x3F800000) = (0.0697271, 0.163641, 0.25084, 1) -> Secondary (R, G, B, A) = (0x3E806E22, 0x3EE54F54, 0x3F201697, 0x3F800000) = (0.25084, 0.447871, 0.625345, 1) Entries[30]: -> Primary (R, G, B, A) = (0x3D86A9F8, 0x3E789F9B, 0x3DD43E1D, 0x3F800000) = (0.0657539, 0.242796, 0.103634, 1) -> Secondary (R, G, B, A) = (0x3E555C3C, 0x3EDCD8A0, 0x3E806E22, 0x3F800000) = (0.20836, 0.43134, 0.25084, 1) Entries[31]: -> Primary (R, G, B, A) = (0x3CB50832, 0x3CB50832, 0x3CB50832, 0x3F800000) = (0.0220986, 0.0220986, 0.0220986, 1) -> Secondary (R, G, B, A) = (0x3DE24A3E, 0x3DE24A3E, 0x3DE24A3E, 0x3F800000) = (0.110493, 0.110493, 0.110493, 1) ************ Strangely, in the game the real number of Tints go from 0 (Standard) to 32. Which is 33, right? Where and what is the extra?? :smile: Edited September 2, 2014 by Zyxpsilon Link to comment Share on other sites More sharing options...
Zyxpsilon Posted September 1, 2014 Share Posted September 1, 2014 .... And here is Orchid without the math- DA70D6** ** 1C 3F ** ** A0 3C ** ** 04 3FThis is all nice and fun Math stuff to look at..BUT - how exactly does someone grabs the (RGBA) fields in the edited list above and determines the actual true RGB formula for these colors?Without the calculation acrobatics.Somebody has got to design some custom tiny "program" that simply would perform such equations juggling automatically. Don't get me wrong, i can certainly go through the entire 32 tints and find the mystery numbers -- with patience. It's just weird. :sick: Link to comment Share on other sites More sharing options...
Drakous79 Posted September 1, 2014 Share Posted September 1, 2014 (edited) Very very nice! I've always wanted to know, where are colors stored. Touched this four months ago, found UnitPalettes in Startup.upk and used FindObjectEntry to see what is in the object. I'm sorry there was no time for posting, but happy you guys took care of it :smile: Damn time, wtb more of it or time compression please. Out of words, it is great to see the community rocks on! What is correct formula for float to RGB conversion in this case? round(float * 255) // float to RGB RGB / 255 // RGB to floatI am getting expected results with it, assuming 0.0 = RGB 0 and 1.0 = RGB 255. ---Where is the primary or the secondary color tint used is determined by model's material and texture. The primary color tint is used on weapons, bigger armor parts (chest / back plate, protective pads, partly belt, partly pants), MEC suit, hats and helmets. This is major color. The secondary color tint is used on smaller armor parts (usually covered with bigger parts, sometimes belt, partly pants) and hat / helmet parts (hat logos). It is not used on Titan, Ghost, Archangel, PSI, Gene Mod armor and MEC suit. This is minor color. ---XCOM uses SPC textures for a simulation of light's reflection and for armor/weapon color tinting. There are MaterialExpressionStaticSwitchParameter "Tinted?" and "2 Color Tinted?" entries within Master_Materials / CHH_Soldiers, but I am not sure, if these are needed to activate the color tint or not. There are also MaterialExpressionVectorParameter's descriptions:CMODA - Uses Alpha of SPC MapCMODB - Uses Blue Channel of SPC Map when Reflection is not activeMy initial observation is, that SPC texture's:Red channel contains a specular map.Green channel needs clarification. It may contain other special effects such as a glow.Blue channel contains Color Mod B data, the secondary color tint.Alpha channel contains Color Mod A data, the primary color tint.I've here an image of a lady wearing pink Kevlar armor with grey/black pants (changed by wghost's mod file). <%f 0.99> <%f 0.5> <%f 0.99> <%f 1.0> // (R, G, B, A) // R252 G127 B252As you can see, the alpha channel contains the primary color's opacity mask (how much of the color is seen ... white 100%, black 0%). http://i.imgur.com/IjYFdyV.jpg ---Btw there is something wrong with float values in the mod file. For an example Tint 4 should be yellow orange with grey pants, but it is blue with grey pants after applying new values. No idea what is wrong, but my 4 months old FindObjectEntry notes contain the same float values as you posted ghost girl. Edited September 1, 2014 by Drakous79 Link to comment Share on other sites More sharing options...
Drakous79 Posted September 1, 2014 Share Posted September 1, 2014 (edited) Strangely, in the game the real number of Tints go from 0 (Standard) to 32. Which is 33, right? Where and what is the extra?? :smile: Well, it is no mystery. Standard = colors in model's texture (DIF texture) defined in model's material instance constant as CMOD and CMODB.32 options = 32 entries in an array, but the first entry in the array is marked 0. So you have 0, 1, 2, 3 ... 31 and it makes a total of 32 entries. Edited September 22, 2014 by Drakous79 Link to comment Share on other sites More sharing options...
wghost81 Posted September 1, 2014 Share Posted September 1, 2014 (edited) Zyxpsilon, Primary (R, G, B, A) = (0x3D17AB36, 0x3E116348, 0x3E9CFF3B, 0x3F800000) = (0.0370285, 0.14198, 0.306635, 1) 0x3D17AB36 = 0.0370285, it's just a standard IEEE-754 floating-point representation. As far as I know, LinearColor uses values from 0.0 to 1.0 and Color — from 0 to 255, so, as Drakous79 wrote,0.0 = RGB 0 and 1.0 = RGB 255Interesting though, AsianSkin palette has some entries with LinearColor values(R, G, B, A) = (0xCCCCCCCC, 0xCCCCCCCC, 0xCCCCCCCC, 0xCCCCCCCC) It doesn't look like color to me (-107374176.0), but rather some special value. Default Tint has number 0 in game and additional Tints occupy 1-32 range. Drakous79, UE has color correction instruments, which can be affecting the final result. LUT tables could help, if we find the right ones. Edited September 1, 2014 by wghost81 Link to comment Share on other sites More sharing options...
Drakous79 Posted September 1, 2014 Share Posted September 1, 2014 0xCCCCCCCC is defintely special. But also listed as Secondary color tint value, so it can mean "Hey engine, don't use this value". Or "Do something fantastic.". Link to comment Share on other sites More sharing options...
Zyxpsilon Posted September 1, 2014 Share Posted September 1, 2014 (edited) What is correct formula for float to RGB conversion in this case? round(float * 255) // float to RGB RGB / 255 // RGB to floatGosh, i now feel soooo silly for asking precisions. It's never been more obvious after seeing such a direct formula.Strangely... rngmickey, speaks of third & fourth bytes to explain the complex maths required while a resulting float_value is simply appended to the description lines with wghost81 translator-parser code. Oh well, i'm sooooo sorry for such overly bothers. At least i can (now) just convert already available datasets to some precious RGB facts. All that's missing is a way to have another set of 32 tints that people would certainly love to have. Customizing soldiers with Armor_Tint #57(++, etc) could be fun. I'd really want a very dark Charcoal mean-lean machine on my tactical UI. :smile: PS; Oh, i'd also would want a specific channel or texturing function for the Weapons, btw. That should require an extra slot on the "Customization screen" though. Silver Armor & Red Plasma Rifle -- imagine that! ;) Edited September 1, 2014 by Zyxpsilon Link to comment Share on other sites More sharing options...
zeppelin1717 Posted September 1, 2014 Share Posted September 1, 2014 (edited) Ok I'm a pretty big newbie with hex editing. I've got the decompressor and HxD, ive found a lot of the entries talked about in the first post. What I want is to change the super ugly armor tints to slightly more reasonable ones (or completely absurd ones as jokes). How do i go about doing that? I don't have the numbers right now but they are the ones somewhere around 20, the hideous yellow/red one, the pink one, and i think there's a blue/orange one too. I'm seeing a lot of text in these codes, and I have no idea how to see that text. do I need another program that converts the numbers in the .upk into code somehow? for example these lines: REF; 0x00000115 (277): XComLinearColorPalette'UnitPalettes.ArmorTint' NumElements = 0x00000020 = 32well that's awkward the colors are backwards. Edited September 1, 2014 by zeppelin1717 Link to comment Share on other sites More sharing options...
wghost81 Posted September 1, 2014 Share Posted September 1, 2014 Copy a code under spoiler section of this post into text file. Change colors to whatever you like. Save. Apply with PatcherGUI. Have fun. :smile: Link to comment Share on other sites More sharing options...
zeppelin1717 Posted September 1, 2014 Share Posted September 1, 2014 (edited) uh, where do i put all that code? into the .upk? like i don't see text code anywhere in any of the .upk files ok i used the patcher and applied the hex, if i wanted to change some of the armor tints i would just alter than .txt file I made and repatch, right? i assume those decimals are like percentages, and A is saturation? I should google things more, before i ask. How do i do saturation values? similar to the effects that rdngmikey got in the first post? ok so the example that I applied changed all of the colors, so i uninstalled that. I want to change only specific armor tints. For example I want to change armor tint 25. Should I just patch the file like this: UPK_FILE=Startup.upk OBJECT=UnitPalettes.ArmorTintREL_OFFSET=25 (or is it 26? or 24?)[MODDED_CODE]<Primary><StructProperty><%u 0x00000010><%u 0x00000000><LinearColor><%f #####> <%f #####> <%f ########> <%f 1.0><Secondary><StructProperty><%u 0x00000010><%u 0x00000000><LinearColor><%f #####> <%f ########> <%f ########> <%f 1.0><None> and then replace #### with the numbers I want?OR do i have to keep the file as is and manually change every entry to be like the default, because all 32 armor tints are different and that would be a disaster. Edited September 1, 2014 by zeppelin1717 Link to comment Share on other sites More sharing options...
Recommended Posts