Amineri Posted March 9, 2013 Share Posted March 9, 2013 To get my feet wet with the XCOM upk code I decided to delve into the mechanics of how interceptions are handled. Johnnylump suggested I post up my results here, so here goes! First off, the engagement time is defined in XGInterceptionEngagement with return 30.00 * fInterceptorSpeed / fUFOSpeed; For example (modded) Raven combat speed of 10 and Small Scout combat speed of 40 yieldsTotalBattleLength = 30.0 * 10.0 / 40.0 = 7.5 sec The Track Boost works by applying a +50% modifier to the interceptor speed: iBoostSpeedIncrease = int(float(iSlowestInterceptorSpeed) * 0.50);fInterceptorSpeed = float(iSlowestInterceptorSpeed + iBoostSpeedIncrease * GetNumConsumableInEffect(134)); Barring round-off errors, that is a 50% increase in engagement time. The code applies the time increase retroactively (although it may not display it correctly in the timer). Damage:The game rolls up all of the hits, misses and damage into an array prior to the the interception playback UI coming up. If you don't use any boosts, you are just watching how it turns out. Also, the seed for these rolls is NOT saved. Save-scumming will generate different interception results (it was an easy way to get some data, though!). Using an aim boost causes the Interception UI to ignore the hit/miss value that was pre-rolled and instead causes the player's next two attacks to hit with 100% certainty. Similarly, the defense boost causes the Interception UI to ignore the UFO hit/miss values and instead forces the next two UFO attacks to miss. Because the effects of the boosts happen in the UI code, it would be very difficult to mod the aim boost to cause an increase in accuracy, or conversely to lower the hit chance of the UFO. Damage is available, so they could be changed to cause increase/decrease in damage, instead. Damage itself is drawn from the weapon damage table, and is then modified by shipDmg = int(float(SHIPWEAPON.iDamage) * (float(1) - mitigation));mitigation = FClamp(armorMitigation * (Defense - Offense), 0.00, 0.95); ((side note, UE explorer did not correctly add the parentheses when reverse compiling, so it looked incorrect, but looking at the hex code and testing confirms it works correctly)) Each point of defense above the attackers offense gives a 5% reduction in damage, capped at 95%. For those of you interested in modding the 5% number, it is coded directly into the function GetDamageMitigation() in XGInterceptionEngagement in XComStrategyGame.upk directly with local variable assignment:armorMitigation = 0.05; Enjoy! Link to comment Share on other sites More sharing options...
anUser Posted March 9, 2013 Share Posted March 9, 2013 That's interesting, thanks for sharing it.May I ask what's your favorite setup, concerning this and weapon damage, ufo hp, speed, etc? Or if you could share as well your impressions on gameplay tweaking this and that? For me it looks weird when my firestorms are immune to small ufo wepons, but maybe with increased repair time it's not so, etc Anyway, thanks again for that bit of knowledge. You guys rock, you're decoding the entire game Link to comment Share on other sites More sharing options...
Amineri Posted March 9, 2013 Author Share Posted March 9, 2013 I couldn't really say that I had a "preferred" set-up in terms of weapon damage and craft speed. I started this Foray checking up on some things for johnnylump's Long War mod (which I really like, by the way). The Long War mod has much more punishing values compared to vanilla. It's quite common for two interceptors to fail to shoot down a small scout at the beginning. I think he has some of the details over in the Long War mod talk and upk changes threads. I definitely feel like the Interception game lacks much difficulty in the vanilla game. Unfortunately there aren't as many "tactical" choices to be made to let the player affect the interception outcome, as in the primary squad-tactical play. At the very beginning, all you can do is choose to abort or finish the engagement, and decide how many interceptors to throw at the UFO (which is really more of a strategic choice, I guess). The small ufo scout and the ufo cannon 1 really don't have any armor penetration, which is what makes the firestorm take so little damage. Unfortunately if you just mod the values up, then the early game becomes impossible. The newest Long War mod now has UFOs upgrading weapons at different points in the game to address this, so the small scout has two small ufo cannon in later parts of the game. I might also keep poking around to see what I can do to make the three boost options more interesting. One option would be to make the combats last longer but with damage scaled down, if the boosts could be used multiple times in one combat, and did things that weren't quite as overpowering as auto-miss / auto-hit. The idea would be to give the player more sense of involvement in the air combats, as opposed to simply watching what is happening. Link to comment Share on other sites More sharing options...
anUser Posted March 9, 2013 Share Posted March 9, 2013 (edited) If the aim boost could boost damage as well as you suggested I see some nice interactions with the damage threeshold that make ufos blow up instead of crashing. As for the tactical aspect of ufo combat I'm testing giving escaped ufos 1 panic, but not ignored ones, but it's very dependant on ufo stats, num of abductions, etc. Maybe there's some scenario involving panic and mission rewards where choosing to spend an aim boost to blow up an ufo or not doing so and firing it down could be a tactical choice. That'd be sweet... Edit: typo, grammar Edited March 9, 2013 by anUser Link to comment Share on other sites More sharing options...
Amineri Posted March 9, 2013 Author Share Posted March 9, 2013 Yes -- The first thing will be to unlock the boosts so that they can be used more than once per engagement (doable, I think)The next would be to modify the way the boosts work to make it make sense to use them more than once. The track boost gives a straight +50% to total engagement time, so it wouldn't make sense to use more than one.Aim and Dodge would be a bit overpowered, I feel. Regarding the panic ... In XGInterception.uc there is:enum EUFOResult{eUR_NONE,eUR_Crash,eUR_Destroyed,eUR_Escape,eUR_Disengaged,eUR_MAX}; also in UIInterceptionEngagement.uc there is :enum eGameResult{eUFO_Escaped,eUFO_Destroyed,ePlayer_Aborted,ePlayer_Destroyed,eGameResult_MAX}; The first case distinguishes between "escape" and "disengage" -- the second between "ufo escaped" and "player aborted". I _think_ that this is the difference of whether the timer ran out or the player hit the abort button. This means you could discriminate three UFO results :1) UFO Ignored -- never sent an interceptor at all2) Player Aborted -- Player engaged but ran away (for whatever reason)3) UFO Escaped -- Player engaged but UFO ran away First definitely seems worthy of panic. The second probably does too, because otherwise players can avoid the panic by engaging and immediately aborting to avoid taking any damage. The third case is when the player stuck it out (and probably has a damaged interceptor). Link to comment Share on other sites More sharing options...
anUser Posted March 9, 2013 Share Posted March 9, 2013 (edited) I know what I'll suggest may sound crazy, but the way I see it panic comes when common people realize of the alien presence, so as ignoring an ufo will bring later cosequences, like abduction spots, satellites hunter, etc (if game modded), no panic a priori, but when people sees fireworks in the sky and they hear no report on successful ufo interception then panic spreads. If the ufo falls down there's some aliens on the loose there so it should incur in panic as well, since crashed ufos won't trigger any further mission and they can be a great source of income. The issue I see it would be rather discriminating when an ufo is blown up or rather crashed, for panic purpouses, but penalyzing retreat sounds coool too edit: typo, grammar Edited March 10, 2013 by anUser Link to comment Share on other sites More sharing options...
Recommended Posts