Jump to content

Just6669

Supporter
  • Posts

    14
  • Joined

  • Last visited

Nexus Mods Profile

About Just6669

Just6669's Achievements

Apprentice

Apprentice (3/14)

  • First Post
  • Collaborator
  • Conversation Starter
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. Here comes the magic: function int AdjustToHit(int iHitChance) { local int iMissAdjustment, iAdjustment, iAdjustedHitChance; local XGPlayer kPlayer; // End:0x19 if(!DoesDamage()) { return iHitChance; } // End:0x52a if(WorldInfo.NetMode == 0) { // End:0x6c if(m_kUnit.m_aCurrentStats[1] > 199) { return 100; } // End:0xe7 if(XComTacticalCheatManager(GetALocalPlayerController().CheatManager) != none && XComTacticalCheatManager(GetALocalPlayerController().CheatManager).bDebugDisableHitAdjustment) { return iHitChance; } kPlayer = XGBattle_SP(XComTacticalGRI(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kBattle).GetHumanPlayer(); // End:0x1ba if(m_kUnit.IsMine() && kPlayer.m_bCantLose && m_bHasFlank) { return 100; } // End:0x2c2 if(kPlayer.m_bCantLose || XComTacticalGRI(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kBattle.m_kDesc.m_iDifficulty == 0) { iAdjustedHitChance = GraduatedOdds(iHitChance, kPlayer, kPlayer.m_bCantLose); // End:0x2c2 if(iAdjustedHitChance != -1) { return iAdjustedHitChance; } } // End:0x35e if(m_bReactionFire || XComTacticalGRI(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kBattle.m_kDesc.m_iDifficulty >= 2) { return iHitChance; } // End:0x424 if(m_kUnit.IsMine() && !GetPrimaryTarget().IsMine() && iHitChance > 0) { iAdjustment = iHitChance / 5; // End:0x421 if(iHitChance >= 50) { iMissAdjustment = m_kUnit.GetPlayer().m_iMissCounter * 15; } } // End:0x4b2 else { // End:0x4b2 if(!m_kUnit.IsMine() && GetPrimaryTarget().IsMine()) { iAdjustment = -GetPrimaryTarget().GetPlayer().m_iHitCounter * 10; } } // End:0x4f9 if(kPlayer.GetSquad().GetNumAliveAndWell() > 4) { iAdjustment = 0; } iAdjustedHitChance = Clamp(iHitChance + iAdjustment + iMissAdjustment, 1, 95); } // End:0x53d else { iAdjustedHitChance = iHitChance; } return iAdjustedHitChance; } As you can see, there are adjustments that make real life hit chance different, than displayed on UI while checking hit odds. If I read this code correctly on difficulties 2 and above they are not used. I'm trying to inject somewhere inside this function cover bonus value for particular shot, to finally make it possible to increase it, but as I do not have any experience in playing with compiled UE scripts I find it very tiresome. Theoretically I have everything I need. I extracted needed formulas from GetShotSummary: source: kTarget = GetPrimaryTarget(); compiled: 0F 00 1A 7D 00 00 1B 31 34 00 00 00 00 00 00 16 and coverPerks = kTarget.GetTacticalSenseCoverBonus(); 0F 00 21 7D 00 00 19 00 1A 7D 00 00 0A 00 D1 33 00 00 00 1B DC 34 00 00 00 00 00 00 16 So, we know how to get to the cover value used by engine to calculate hit penalty. It will be 0 or 20 or 40. If we just could subtract this value (or its fraction) from int iHitchance, it would practically increase hit penalty (cover bonus). But as I can not find in AdjustToHit function any variables that are set or used in exact manner, it is not as easy at it seemed. Playing with compiled scripts forces us to carefully count length of injected code so it would start and end exactly like replaced one. In another words, there are always too many or too few bytes to inject. I thought about replacing : iAdjustedHitChance = GraduatedOdds(iHitChance, kPlayer, kPlayer.m_bCantLose); 0F 00 A2 7C 00 00 1B D9 35 00 00 00 00 00 00 00 A6 7C 00 00 00 A1 7C 00 00 19 00 A1 7C 00 00 0A 00 B6 93 00 00 00 2D 01 B6 93 00 00 16 with iAdjustment = -GetPrimaryTarget().GetTacticalSenseCoverBonus(); or iAdjustment = -GetPrimaryTarget().GetPlayer().m_iHitCounter * 10; 0F 00 A3 7C 00 00 90 8F 19 19 1B 31 34 00 00 00 00 00 00 16 0A 00 C8 B2 00 00 00 1B 03 34 00 00 00 00 00 00 16 09 00 B9 93 00 00 00 01 B9 93 00 00 16 2C 0A 16 with iAdjustment = int (-GetPrimaryTarget().GetTacticalSenseCoverBonus() * SOMECONSTANT f) the second would be great, if we could replace xxx with some unused float constant from gamecore.mod, we could change how much we want to increase cover bonus using XCOM Meddler or editing .mod file and modpatching upk. The rest would be playing with if ... checks, so our code would be always executed. Is there someone, on this forum, who is able to do this ?
  2. Thanks, I did not really dig into that, just read somewhere similar tip. BTW, here is my Nvidia Inspector profile. I use it with SweetFX, on my GTX 680 and get stable 60 fps with about 50% GPU usage. http://img.techpowerup.org/121202/nvidia_20121203_002730.png I have tested several combinations, what I found optimal for my System (I5-2500K @ 4.4 GHz + GTX 680) is forced 2xMSAA with 2xSGSS. I disable in-game AA, because 2XSGSS seems to work best with 2xMSAA and I did not find a way to choose MSAA level in game config. If your GPU is too weak, run the game with MSI Afterburner, monitor GPU load on OSD, and reduce settings until your GPU load is stable below 99%. I'd start with - reducing Ambient occlusion Quality - reducing / disabling Transparency Supersampling - enabling optimizations not necessarily in this order, I'm just guessing, did not have to hunt for fps ;) What I learned from trying different shaders injectors in some games, is that reducing pre-rendered frames value was best solution, when I had unstable or just too low fps. Never read this suggestion anywhere, so it may be just good for my setup. Profile is attached too, ready to load to Nvidia Inspector, together with (...)\XCom-Enemy-Unknown\Engine\Config\BaseEngine.ini and (...)\My Games\XCOM - Enemy Unknown\XComGame\Config\XComEngine.ini Remember to set both files to read-only after replacing originals. If you do not want to replace whole ini's, i suggest to compare your files with mine, using for example "Total Commander "Compare by Content" option. Then you can find what and how did I change and apply only parts which you feel safe to.
  3. I'm surprised, no one mentioned this, regarding totally failed DOF effect XCOM forces internally. It made my eyes hurt, because picture was so unsharp. While playing I had permanent impression, that I need a new pair of glasses. SweetFX with info is here to download (links are below sample pictures, just before comments): Archive format is 7z which Winrar manages to unpack. Info for unexperienced & lazy : just download SweetFX, unpack to "(...)\XCom-Enemy-Unknown\Binaries\Win32\" and replace "SweetFX_settings.txt" with the one I attached. My settings: /*-----------------------------------------------------------. / Choose effects / '-----------------------------------------------------------*/ // Set to 1 for ON or 0 for OFF #define USE_SMAA_ANTIALIASING 0 //[0 or 1] SMAA Anti-aliasing : Smoothens jagged lines. #define USE_LUMASHARPEN 1 //[0 or 1] LumaSharpen : Also sharpens the antialiased edges which makes them less smooth - I'm working on fixing that. #define USE_BLOOM 0 //[0 or 1] Bloom : Makes bright lights bleed their light into their surroundings (relatively high performance cost) #define USE_HDR 0 //[0 or 1] HDR : Not actual HDR - It just tries to mimic an HDR look (relatively high performance cost) #define USE_TECHNICOLOR 0 //[0 or 1] TECHNICOLOR : Attempts to mimic the look of an old movie using the Technicolor three-strip color process (Techicolor Process 4) #define USE_DPX 0 //[0 or 1] Cineon DPX : Should make the image look like it's been converted to DXP Cineon - basically it's another movie-like look similar to technicolor. #define USE_LIFTGAMMAGAIN 0 //[0 or 1] Lift Gamma Gain : Adjust brightness and color of shadows, midtones and highlights (avoids clipping) #define USE_TONEMAP 1 //[0 or 1] Tonemap : Adjust gamma, exposure, saturation, bleach and defog. (may cause clipping) #define USE_VIBRANCE 1 //[0 or 1] Vibrance : Intelligently saturates (or desaturates if you use negative values) the pixels depending on their original saturation. #define USE_CURVES 0 //[0 or 1] Curves : Contrast adjustments using S-curves. #define USE_SEPIA 0 //[0 or 1] Sepia : Sepia tones the image. #define USE_VIGNETTE 0 //[0 or 1] Vignette : Darkens the edges of the image to make it look more like it was shot with a camera lens. May cause banding artifacts. #define USE_DITHER 0 //[0 or 1] Dither : Applies dithering to simulate more colors than your monitor can display. This lessens banding artifacts (mostly caused by Vignette) #define USE_SPLITSCREEN 0 //[0 or 1] Splitscreen : Enables the before-and-after splitscreen comparison mode. /*-----------------------------------------------------------. / LumaSharpen settings / '-----------------------------------------------------------*/ // -- Sharpening -- #define sharp_strength 1.75 // [0.10 to 3.00] Strength of the sharpening #define sharp_clamp 0.04 // [0.000 to 1.000] Limits maximum amount of sharpening a pixel recieves - Default is 0.035 // -- Advanced sharpening settings -- #define pattern 4 // [1|2|3|4] Choose a sample pattern. 1 = Fast, 2 = Normal, 3 = Wider, 4 = Pyramid shaped. #define offset_bias 1.0 // [0.0 to 6.0] Offset bias adjusts the radius of the sampling pattern. // I designed the pattern for offset_bias 1.0, but feel free to experiment. // -- Debug sharpening settings -- #define show_sharpen 0 // [0 or 1] Visualize the strength of the sharpen (multiplied by 4 to see it better) /*-----------------------------------------------------------. / Vibrance settings / '-----------------------------------------------------------*/ #define Vibrance 0.1 //[-1.0 to 1.0] Intelligently saturates (or desaturates if you use negative values) the pixels depending on their original saturation. /*-----------------------------------------------------------. / HDR settings / '-----------------------------------------------------------*/ #define HDRPower 1.10 //[0.0 to 8.0] Strangely lowering this makes the image brighter #define radius2 0.87 //[0.0 to 8.0] Raising this seems to make the effect stronger and also brighter /*-----------------------------------------------------------. / Bloom settings / '-----------------------------------------------------------*/ #define BloomThreshold 20.25 //[0.00 to 50.00] Threshold for what is a bright light (that causes bloom) and what isn't. #define BloomPower 1.446 //[0.0000 to 8.0000] Strength of the bloom #define BloomWidth 0.0142 //[0.0000 to 1.0000] Width of the bloom /*-----------------------------------------------------------. / Curves settings / '-----------------------------------------------------------*/ #define Curves_contrast 0.30 //[-1.0 to 1.0] The amount of contrast you want // -- Advanced curve settings -- #define Curves_formula 7 //[1|2|3|4|5|6|7] The constrast s-curve you want to use. /*-----------------------------------------------------------. / SMAA Anti-aliasing settings / '-----------------------------------------------------------*/ #define SMAA_THRESHOLD 0.12 // [0.05 to 0.20] Edge detection threshold #define SMAA_MAX_SEARCH_STEPS 16 // [0 to 98] Determines the radius SMAA will search for aliased edges #define SMAA_MAX_SEARCH_STEPS_DIAG 6 // [0 to 16] Determines the radius SMAA will search for diagonal aliased edges #define SMAA_CORNER_ROUNDING 0 // [0 to 100] Determines the percent of antialiasing to apply to corners. // -- Advanced SMAA settings -- #define COLOR_EDGE_DETECTION 1 // [0 or 1] 1 Enables color edge detection (slower but slightly more acurate) - 0 uses luma edge detection (faster) #define SMAA_DIRECTX9_LINEAR_BLEND 0 // [0 or 1] Using DX9 HARDWARE? (software version doesn't matter) if so this needs to be 1 - If not, leave it at 0. /*-----------------------------------------------------------. / TECHNICOLOR settings / '-----------------------------------------------------------*/ #define TechniAmount 0.11 //[0.0 to 1.0] #define TechniPower 2.8 //[0.0 to 8.0] #define redNegativeAmount 0.88 //[0.0 to 1.0] #define greenNegativeAmount 0.88 //[0.0 to 1.0] #define blueNegativeAmount 0.88 //[0.0 to 1.0] /*-----------------------------------------------------------. / Cineon DPX settings / '-----------------------------------------------------------*/ #define Red 8.0 //[1.0 to 15.0] #define Green 8.0 //[1.0 to 15.0] #define Blue 8.0 //[1.0 to 15.0] #define ColorGamma 2.5 //[0.1 to 2.5] Adjusts the colorfulness of the effect in a manner similar to Vibrance. 1.0 is neutral. #define DPXSaturation 3.0 //[0.0 to 8.0] Adjust saturation of the effect. 1.0 is neutral. #define RedC 0.36 //[0.6 to 0.2] #define GreenC 0.36 //[0.6 to 0.2] #define BlueC 0.34 //[0.6 to 0.2] #define Blend 0.2 //[0.0 to 0.1] How strong the effect should be. /*-----------------------------------------------------------. / Lift Gamma Gain settings / '-----------------------------------------------------------*/ #define RGB_Lift float3(1.000, 1.000, 1.000) //[0.000 to 2.000] Adjust shadows for Red, Green and Blue #define RGB_Gamma float3(1.000, 1.000, 1.000) //[0.000 to 2.000] Adjust midtones for Red, Green and Blue #define RGB_Gain float3(1.000, 1.000, 1.000) //[0.000 to 2.000] Adjust highlights for Red, Green and Blue /*-----------------------------------------------------------. / Tonemap settings / '-----------------------------------------------------------*/ #define Gamma 1.0 //[0.00 to 2.00] Adjust midtones #define Exposure 0.05 //[-1.00 to 1.00] Adjust exposure #define Saturation 0.0 //[-1.00 to 1.00] Adjust saturation #define Bleach 0.00 //[0.00 to 1.00] Brightens the shadows and fades the colors #define Defog 0.00 //[0.00 to 1.00] How much of the color tint to remove #define FogColor float3(0.00, 0.00, 1.00) //[0.00 to 1.00, 0.00 to 1.00, 0.00 to 1.00] What color to remove - default is blue /*-----------------------------------------------------------. / Sepia settings / '-----------------------------------------------------------*/ #define ColorTone float3(1.40, 1.10, 0.90) //[0.00 to 1.00, 0.00 to 1.00, 0.00 to 1.00] What color to tint the image #define GreyPower 0.11 //[0.0 to 1.0] How much desaturate the image before tinting it #define SepiaPower 0.58 //[0.0 to 1.0] How much to tint the image /*-----------------------------------------------------------. / Vignette settings / '-----------------------------------------------------------*/ #define VignetteRadius 1.00 //[-1.00 to 3.00] lower values = stronger radial effect from center #define VignetteAmount -1.00 //[-2.00 to 1.00] Strength of black. -2.00 = Max Black, 1.00 = Max White. #define VignetteSlope 8 //[1 to 16] How far away from the center the change should start to really grow strong (odd numbers cause a larger fps drop than even numbers) #define VignetteCenter float2(0.500, 0.500) //[0.00 to 1.00] Center of effect. /*-----------------------------------------------------------. / Dither settings / '-----------------------------------------------------------*/ //No settings yet, beyond switching it on or off in the top section. //Note that the checkerboard pattern used by Dither, makes an image harder to compress. //This can make your screenshots and video recordings take up more space. /*-----------------------------------------------------------. / Splitscreen settings / '-----------------------------------------------------------*/ #define splitscreen_mode 3 //[1|2|3|4|5] 1 = Vertical 50/50 split, 2 = Vertical 25/50/25 split, 3 = Vertical 50/50 angled split, 4 = Horizontal 50/50 split, 5 = Horizontal 25/50/25 split There is a lot of options to play with, but I only wanted to make picture sharper and crispier. If it is too sharp for you, reduce #define sharp_strength 1.75 // [0.10 to 3.00] Strength of the sharpening to 1.2 or as you like. I am an oldschool gamer, I like really sharp picture, even if this causes some Pixelation / aliasing. If mod is too GPU heavy for your GFX card, change sharpening pattern #define pattern 4 // [1|2|3|4] Choose a sample pattern. 1 = Fast, 2 = Normal, 3 = Wider, 4 = Pyramid shaped. To something less then 4. The only other effects I apply is a bit of vibrance #define Vibrance 0.1 //[-1.0 to 1.0] Intelligently saturates (or desaturates if you use negative values) the pixels depending on their original saturation. and exposure #define Exposure 0.05 //[-1.00 to 1.00] Adjust exposure Have fun.
  4. If you are loading a savegame created while in mission started BEFORE changing weapon specs, it will use old values to calculate hit chance. You have to load your last savegame in base before this mission, re-equip soldiers and send Skyranger. Check what the game shows now. EDIT: about rifle damage : just change damage value using Meddler, update with MODPATCHER, then rehash with XSHAPE. Second value shown in game is critical damage, it is calculated by games automatically using base damage.
  5. EDIT: I deleted last post because it was nonsense ;) How can I find I actual native function ? Are these buffers nothing, but some kind of "headers" or "wrappers" ? I have no idea if it is the right word, what I mean is that actual function is somewhere else. Is there a way to find it ? By name, index or something ? // Export UXGTacticalGameCoreNativeBase::execGetLowCoverBonus(FFrame&, void* const) native simulated function int GetLowCoverBonus(); Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 00000000 9F 0F 00 00 47 55 00 00 00 00 00 00 9E 0F 00 00 . . . . G U . . . . . . . . . . 00000010 00 00 00 00 00 00 00 00 9F 0F 00 00 00 00 00 00 . . . . . . . . . . . . . . . . 00000020 99 04 00 00 BF B7 00 00 02 00 00 00 02 00 00 00 . . . . . . . . . . . . . . . . 00000030 0B 53 00 00 00 00 05 02 00 00 33 00 00 00 00 00 . S . . . . . . . . 3 . . . . . 00000040 00 . // Export UXGTacticalGameCoreNativeBase::execGetHighCoverBonus(FFrame&, void* const) native simulated function int GetHighCoverBonus(); Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 00000000 A1 0F 00 00 47 55 00 00 00 00 00 00 A0 0F 00 00 . . . . G U . . . . . . . . . . 00000010 00 00 00 00 00 00 00 00 A1 0F 00 00 00 00 00 00 . . . . . . . . . . . . . . . . 00000020 9A 04 00 00 F3 B7 00 00 02 00 00 00 02 00 00 00 . . . . . . . . . . . . . . . . 00000030 0B 53 00 00 00 00 05 02 00 9C 32 00 00 00 00 00 . S . . . . . . . . 2 . . . . . 00000040 00 . For example 9C 32 00 00 is recognized by UE as Name == GetHighCoverBonus
  6. So, here is the buffer of XComGame.XGUnitNativeBase.SetCoverValue Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F 00000000 D1 33 00 00 47 55 00 00 00 00 00 00 CA 33 00 00 . 3 . . G U . . . . . . . 3 . . 00000010 00 00 00 00 00 00 00 00 CB 33 00 00 00 00 00 00 . . . . . . . . . 3 . . . . . . 00000020 3C 08 00 00 D1 3C 01 00 0B 00 00 00 07 00 00 00 < . . . . < . . . . . . . . . . 00000030 29 CB 33 00 00 0B 53 00 00 00 00 05 02 00 8B 61 ) . 3 . . . S . . . . . . . . a 00000040 00 00 00 00 00 00 . . . . . . After some "random clicking" I realized, that UE seems to recognize some "things".: D1 33 00 00 Obj XGUnitNativeBase.GetTacticalSenseCoverBonus.ReturnValue CA 33 00 00 Obj XGUnitNativeBase.CanUseCover CB 33 00 00 Obj. XGUnitNativeBase.SetCoverValue.iNewCoverValue 8B 61 00 00 Name. SetCoverValue How can I use the unidentified data to continue my hunt ?
  7. Maybe... But only after the game will be so dead, that NO ONE will buy DLC #8374823904 with new hairstyles & pink clothes. MAYBE... then, they will release SDK or at least an updated version, where changing configuration files actually does something, and active players won't have to be reverse-engineering hackers anymore to tune the game, like they want to play it. What is going on with the game market today ? If I wanted to be a passive consumer, I'd buy a console and play original, unchanged games only. Why bother with PC version, if you are trying to make it console-like ?
  8. Default satellite build frenzy is a total game killer for me. Every time I re-start campaign, I promise myself I will try another strategy, but there is no room for it. Fundings from countries with satellites are so exaggerated, that you have actually no other way to keep financial balance. I will try to fix this for myself by reducing satellite's impact on panic management and funding to minimum, and manage penalties for escaped/ignored UFOs and lost battles, and prices for sellable loot. I remember having lot of fun in old Xcom, whenever I came back from battle and sold corpses and artifacts to get money for a new Tank or Facility or Fighter. I like the Idea of alien attacks financing their own doom. The more attacks they try, the merrier money for won battles you should have. Same with troops quality, selling mutons corpses and sectoids should balance bigger squad loses. Now it is the other way around - if They "forget" to attack, you launch satellite in a high funding country and get more credits. If they do abductions, you have to launch it in a country, where you could not react, because there can be only one Skyranger active on whole Earth (!?). I do not want to rely my budget on aliens taking a month off, because they are on massive hangover. Honestly, I do not remember If old games were soooo better, or I modded them. I remember hex-editing exec's. It was much easier, when they were much smaller, and almost every variable was an simple integer.
  9. Code fragments, which I pasted here, with numbers, are not used to calculate hit chance nor cover bonus. They are just used to compare read cover value with hardcoded number, to generate UI (and debug?) text strings. Cover bonus values (probably array of 4 integers, for every direction) are is probably set in: // Export UXGUnitNativeBase::execSetCoverValue(FFrame&, void* const) native simulated function SetCoverValue(int iNewCoverValue); To find which cover value should be used for specified shot, game uses xxx.XComGame.GetTacticalSenseCoverBonus where xxx is any funtion/variable, that can define what actor is the target, for example GetPrimaryTarget().XComGame.GetTacticalSenseCoverBonus There are possibilities of multiple targets, that is why hit modifiers are used with such prefix. So, if I understand you correctly, function SetCoverValue should be in class XGUnitNativeBase, and I can search it by offset given by UE ? When I get home I will give it a try.
  10. I went through classes again. I think I understand cover logic pretty well, unfortunately crucial functions like: // Export UXGUnitNativeBase::execSetCoverValue(FFrame&, void* const) native simulated function SetCoverValue(int iNewCoverValue); // Export UXGUnitNativeBase::execGetTacticalSenseCoverBonus(FFrame&, void* const) native simulated function int GetTacticalSenseCoverBonus(); // Export UXGUnitNativeBase::execGetLowProfileCoverBonus(FFrame&, void* const) native simulated function int GetLowProfileCoverBonus(); are virtual, so unit cover values are set from "outside" of what we can now change. Dead end. But. I think we can adjust hit chance "manually", because function bool RollForHit(float fChance, out TCharacter kShooter, out TCharacter kTarget, out float fRoll) { fRoll = class'XComEngine'.static.SyncFRand(string(Name) @ string(GetStateName()) @ string(GetFuncName())); return fRoll <= fChance; } Is not native and all we have to do is adjust local fChance parameter to increase cover influence somewhere before this call: m_bHit = XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.RollForHit(fChance, m_kUnit.GetCharacter().m_kChar, GetPrimaryTarget().GetCharacter().m_kChar, fRoll); Function returning hit or miss itself is again in not accessible class 'Engine', but parameter fChance is local, and it is adjusted just a few lines above: if(XComTacticalCheatManager(GetALocalPlayerController().CheatManager).bDeadEye) { fChance = 1.0; } // End:0xc31 else { // End:0xbf7 if(XComTacticalCheatManager(GetALocalPlayerController().CheatManager).bNoLuck) { fChance = 0.0; } // End:0xc31 else { iAdjustedChance = AdjustToHit(GetHitChance()); fChance = float(iAdjustedChance) / 100.0; } } m_bHit = XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.RollForHit(fChance, m_kUnit.GetCharacter().m_kChar, GetPrimaryTarget().GetCharacter().m_kChar, fRoll); // End:0x131a You can see two checks, that we could use to make our change. They are normally used to force hit or miss by internal game cheat manager. This also suggests, that locally changing exit value will not crash the game, yes there are several checks in code, but in a local (network == 0) game all they do is activating cheated flag / string (to debug log?). So, is anyone able to change these DeadEye and NoLuck checks to something, that will use GetPrimaryTarget().XComGame.GetTacticalSenseCoverBonus() (will be 20 or 40) to reduce fchance? maybe sth like this: if (GetPrimaryTarget().XComGame.GetTacticalSenseCoverBonus == 20) { fChance = 0.8 * fChance // decreases hit change by another 20% if low cover } else { if (GetPrimaryTarget().XComGame.GetTacticalSenseCoverBonus == 40) { fChance = 0.7 * fChance // decreases hit change by another 30% if high cover } } This adjusting would stack with default bonuses. Is it doable ?
  11. Thanks for tips. It is my first contact with UE, I only wrote some simple software in C++ years ago. Anyway, by looking in code you can easily see, that lot of constants were changed to numbers before retail exe was compiled. Like here: XGAbility_Targeted.h coverPerks = kTarget.GetTacticalSenseCoverBonus(); // End:0x211 if(kTarget.HasBonus(15) && kTarget.HasHeightAdvantageOver(m_kUnit)) { coverPerks += XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.10; //high advantage defense bonus = 10 } // End:0x29e if(kTarget.m_bInSmokeBomb) { coverPerks += XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.20; //smoke bomb defense bonus = 20 } // End:0x32b if(kTarget.m_bInDenseSmoke) { coverPerks += XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.20; //dense smoke defense bonus = 20 } coverBonus = Max(0, kTarget.m_iCurrentCoverValue - coverPerks); // End:0x3ed if(kTarget.HasAirEvadeBonus()) { iEvasionBonus = XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.20; //air evade defense bonus = 20 } coverBonus = Max(0, coverBonus - iEvasionBonus); or here : if(coverBonus != 0 && !m_bHasFlank) { // End:0x817 if(coverBonus == XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.20) // compares cover bonus DIRECTLY to 20 ! { kInfo.arrHitPenaltyStrings.AddItem(m_strPenaltyLowCover); } // End:0x840 else { kInfo.arrHitPenaltyStrings.AddItem(m_strPenaltyHighCover); } kInfo.arrHitPenaltyValues.AddItem(-coverBonus); // End:0x948 if(kTarget.IsAffectedByAbility(38)) { kInfo.arrHitPenaltyStrings.AddItem(m_strHunker); kInfo.arrHitPenaltyValues.AddItem(XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.2 - 1 * -coverBonus); // "1 *" means hunker down cover bonus = base cover bonus. (they stack). } } Not really modding friendly way to compile. BTW I thought about making hunker down check always true to make cover twice effective. Or, sacrifice "Dense smoke" perk to make both cover values +20 by changing it's check to : if(kTarget.IsInCover()) { coverPerks += XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.20; //dense smoke defense bonus is now always applied when in cover } Could anyone try to make such changes ? I'm not sure if I can. EDIT: I think it would not work anyway, this function is probably only to generate values to display on UI target info screen.
  12. I spend several hours looking for functions using cover values to modify hit chances in hope to find where exactly are these values defined. Code was (purposely?) made mess, some crucial functions and classes properties etc have "dynamic" names, that are only uses locally. Then there are replication functions, that I do not fully understand, they seem to propagate some properties (maybe functions too) "outside" of the class, but not always under same name. So, even if you find where cover values are set, or read, there will be NO reference to such variable/function name in any other class. This could be "replicated" under another name, or sometimes there are arrays of variables and code is looking by index number, without referencing to specific name. They are also function names or variables inherited while calling from another class, again makes back-tracing a road through hell. Some examples what we have to deal with: I started looking for for function, that generates hit or miss (true/false) while shooting. Found it in class XGAbility_Targeted function RollForHit() function RollForHit() { local float fRoll, fChance, fDist, fScatter; local int iAdjustedChance, iRoll; local XGAction_Fire kFireAction; local XGParamTag kTag; local Vector VDir, vDest; local Rotator rRotate; local XComUIBroadcastWorldMessage kBroadcastWorldMessage; kTag = XGParamTag(XComEngine(class'Engine'.static.GetEngine()).LocalizeContext.FindTag("XGParam")); m_bHit = false; kFireAction = XGAction_Fire(m_kUnit.GetAction()); (...) Code is long, there are some checks for "special" attacks, like rocket or psi, or debug cheat values (deadeye = always hit, noluck = always miss"). In the end, what this function does for standard shot is: -calculate adjusted shot percentage and converting it to float 0..1: iAdjustedChance = AdjustToHit(GetHitChance()); fChance = float(iAdjustedChance) / 100.00; And now, setting hit to true/false: m_bHit = XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.RollForHit(fChance, m_kUnit.GetCharacter().m_kChar, GetPrimaryTarget().GetCharacter().m_kChar, fRoll); ...??? What is this ? These four parameters are probably (hit chanse, attacker, target, ??? ). OK, did not go so well. so let us check function AdjustToHit. Maybe there are cover adjustments. XGAbility_Targeted function int AdjustToHit(int iHitChance) function int AdjustToHit(int iHitChance) { local int iMissAdjustment, iAdjustment, iAdjustedHitChance; local XGPlayer kPlayer; (...) Again, we have some checks for specials. No cover, perks & abilities only, so I do not paste this function here, if you want more, look at it in UE Explorer. You can for example find, that difficulty leave is directly used to influence hit chances, and that there are friendly fire checks in the code. OK, we go back. We had: "iAdjustedChance = AdjustToHit(GetHitChance()); " GetHitChance() look interesting. It is used as base hit chance parameter, in another function call. Searching... XGAbility_Targeted simulated function int GetHitChance() { return m_iHitChance; } Simulated. Don't really remember what it means, I guess that just returns m_iHitChance as value. So, m_iHitChance must be set somewhere else. The only point where it is calculated is: XGAbilityTree kAbility.m_iHitChance = kAbility.CalcHitChance(); Looking for CalcHitChance in classes... XGAbility_Targeted native function int CalcHitChance(); Function is there, but it is empty. No other definition in other classes, it is being called several times, but no trace of actually calculating its value. That is it. I'm done. Lost many hours of life (what you see is only one of several paths through code I made). They all ended up with some nonsense (empty) function where the was supposed to be a crucial calculation. It was about fifteen years since I did things like this (yes, I'm so old), do not be to harsh if I wrote some nonsense. or made mistakes. I expect someone makes better work then I did.
  13. There is SW_COVER_INCREASE=1.5f in DefaultGameCore. It looks like one of planned Second Wave options was to increase cover. But there is no such option in SW menu. Can you find this constant in any functions? Maybe all we have to do is remove bypasses on this option.
  14. I hate the way game calculates bullet hit probability. Semi-close shots accuracy is way to low for low rank soldiers - how can I NOT hit someone without cover with an automatic from a few meters/yards ?! Far shots accuracy is too high - aim penalty for far shots is applied for assault weapons only, about half of sight range has constant accuracy, for sniper rifles it is even more absurd - 85% of distance to enemy (14 to 100) has constant hit probability. I want to make it more distance - dependent. My first ideas: far shots accuracy (at sight range - 27) could be reduced by 10-15 %, by setting negative OFFENSE for every soldier/alien. It will change base cover to 30-25/90-95 % for shots at sight limit range which will make cover more useful. Then by playing with CLOSE_RANGE value - setting it closer to sight limit (22-25?) - accuracy gain (AIM_CLIMB) will be applied through whole sight range instead of increasing quickly when solders is very close to enemy only (distance less then original CLOSE_RANGE) like it is now. Goal is to make shots at semi range more accurate then on sight limit, and to make semi-close range shots at exposed enemy almost 100% for most of weapons and soldier ranks. High CLOSE_RANGE could cause problems with shotguns (assault weapons) because they use this value as starting point of applying aim penalty for medium-to-far shots. I hope that by playing with OFFENSE, ASSAULT_AIM_CLIMB and ASSAULT_LONG_RANGE_MAX_PENALTY it is possible to have reasonable accuracy course through whole shotgun's range. I would also reduce AIM progression when gaining ranks for soldiers to make accuracy mechanics more stable. Currently rookies are shooting in the stars, and colonels can hit wing of the fly from 30 meters every time. Did anyone tried such changes ? Am I missing anything? (Probably yes) Edit: One fundamental question : would all these changes apply to aliens too, or are hit % of alien's shots calculated using other equations and variables ?
×
×
  • Create New...