Jump to content

Display Soldiers' XP and Mobility in Character Card View


johnnylump

Recommended Posts

Here are some upk_mod files to update this for the latest EW patch (patch 1). It now includes display of Psi XP if you have at least one Psi XP, and the advanced servomotors foundry project now modifies the mobility stat. However, the +4 mobility for hte kinetic strike module is not working at this time.

 

SoldierStats_UpdateData@UIStrategyComponent@XcomStrategyGame

 

 

  Reveal hidden contents

 

 

UpdateHeader@XGSoldierUI@XComStrategyGame

 

  Reveal hidden contents

 

 

GetXPRequired@XGTacticalGameCore@XcomGame

 

  Reveal hidden contents

 

 

GetInventoryStatModifiers@XGTacticalGameCore@XComGame.upk

 

  Reveal hidden contents

 

Edited by johnnylump
Link to comment
Share on other sites

  • Replies 53
  • Created
  • Last Reply

Top Posters In This Topic

I can confirm that these work, and that the KSM mobility increase show up when the above is paired with my MEC loadout mod.

 

However, the KSM and Advanced Servomotors mobility increases are being added twice. Their mobility increases are directly added in XGUnitNativeBase.GetMaxPathLength. The GetInventoryStatModifiers function is used by the tactical game to get the modifiers for both the strategy and tactical games, so those stats would be getting added twice.

 

The following change will prevent the KSM and Advanced Servomotor mobility bonuses from being applied in GetMaxPathLength (so they will only be applied via GetInventoryStatModifiers, which I verified do actually apply to the tactical game).

 

GetMaxPathLength@XGUnitNativeBase@XComGame.upk

 

  Reveal hidden contents

 

Edited by Amineri
Link to comment
Share on other sites

  • 3 weeks later...

I tested this with vanilla EW patch 1, both johnnylump and Amineri changes. Used AFTER_HEX to apply it via PatchUPK.

 

Results are following:

1. Psi XP is not displayed not for regular, nor for gifted soldiers.

2. MEC +3 Advanced Servomotors displayed correctly.

3. Support with Sprinter shows +4 Mobility.

4. Support with Sprinter in Psi Armor shows +6 mobility.

5. Hover SHIV shows 14+6 mobility.

 

I tested it in tactical game:

1. Regular soldier with 12 mobility is able to cover 7 tiles in one move and 15 tiles while dashing.

2. MEC with KSM moves for 7 + 5 tiles (15 + 10 while dashing).

3. MEC without KSM moves for 7 + 2 (15 + 4).

4. Support with Sprinter: 7 + 3 (15 + 6).

5. Support with Sprinter in Psi Armor: 7 + 4 (15 + 8 ).

6. Hover SHIV: 7 + 6 (15 + 11).

 

Looks strange to me.

Edited by wghost81
Link to comment
Share on other sites

Psi XP is a separate stat from regular XP, and so required a further change (which JL has put in and we're testing, but hasn't been released yet).

 

Mobility is shown using the same metric as it is defined in the DefaultGameCore.ini (and how the stat is stored internally to the game), which is measured in meters. Apparently 64 Unreal Units = 1 meter is the correct conversion. However each displayed tile in the game is 1.5m x 1.5m. So 12 mobility = 12 meters => 24 meters when dashing. 12 meters = ~8 tiles, while 24 meters = ~16 tiles. There may be some odd rounding going on in the game engine, as the actual mechanic converts mobility from meters to unreal units, and uses the Unreal pathfinding algorithm, and limits allowed distances to that.

 

I've noticed that sometimes the preview is not perfectly in sync with the actual movement. I've had soldier moves were I moved 1 tile into the displayed dashing zone, but the actual move only consumed a single move.

 

I'm not totally sure if I still have the vanilla settings in my file, but I think the vanilla settings are:

soldier mobility = 12

visibility for all units but battlescanner = 27

battlescanner visibility = 18

skeleton and ghost mobility bonus = +3

psi mobility bonus = +2

Alloy SHIV mobility bonus = +1

Hover SHIV mobility bonus = +3

 

KSM and Advanced Servomotors are hard-coded in the upk in GetMaxPathLength (and advanced servomotors applies to SHIVs as well as MECs)

KSM mobility bonus = +4

Advanced Servomotors bonus = +3

 

Sprinter bonus is hard-coded into XGTacticalGameCore.GetInventoryStatModifiers as a +4 mobility bonus:

            case 3:
                if(kCharacter.aUpgrades[31] > 0)
                {
                    aModifiers[iStat] += 4;
                }

Tanks are separate characters and so have a separate Characters= statline in the DGC.ini with Mobility=14. So yes, Hover SHIVs have a ridiculously overpowered 20 mobility (compared to 27 visibility) once advanced servomotors is complete.

 

Looking at your specific examples, using the (I think correct vanilla values)

  • Support with Sprinter shows +4 Mobility. - sprinter grants +4 mobility as defined in the hex code
  • Support with Sprinter in Psi Armor shows +6 mobility - sprinter grants +4 and psi armor grants +2
  • Hover SHIV shows 14+6 mobility - Tank base mobility is 14, +3 for Hover SHIV, +3 for advanced servomotors
1. Regular soldier with 12 mobility is able to cover 7 tiles in one move and 15 tiles while dashing. -- this is 1 tile short of theoretical (probably a rounding error)
2. MEC with KSM moves for 7 + 5 tiles (15 + 10 while dashing). -- KSM + adv servos is +4 +3 = +7 = 4.67 tiles, which together with the leftover bit from not quite getting to 8, leads to +5
3. MEC without KSM moves for 7 + 2 (15 + 4). -- this is with the Advanced Servomotors, yes? So +3 mobility = ~2 tiles extra
4. Support with Sprinter: 7 + 3 (15 + 6). -- +4 mobility = ~2.67, combined with the leftover bit from not getting to 8, leads to effectively +3
5. Support with Sprinter in Psi Armor: 7 + 4 (15 + 8 ). -- +4 for sprinter +2 for psi = +6 total = ~4.0 tiles
6. Hover SHIV: 7 + 6 (15 + 11). -- SHIVs have inherent 14 mobility, so should have at least 9 tiles (not 7) inherent. Then +3 adv servos and +3 Hover SHIV should be 20 mobility = ~13.33 tiles, and observed is 13, but it should be 9 + 4. Hover SHIVs without adv servos should be at 14 + 3 = 17 = ~11.33, so 9 + 2
Displaying fractional tiles is problematic, plus I'm not sure but what the game counts some vertical travel. In addition the pathfinding is sometimes a little goofy so a soldier doesn't move in quite the way you'd expect (I've noticed problems with curbs in EU). Given all of this the simplest thing to do was to display the base mobility stat, which is at least comparatively accurate.
Link to comment
Share on other sites

This all is very confusing. :sad: Especially since Sprinter description says +3 (tiles), I see +4 (meters, but I don't know they are meters) displayed and immediately get crazy. :smile:

 

Everything seems to work well, except SHIV, which somehow "lost" 2 tiles, as with servos it was only able to move for 7 + 3 + 3 tiles.

Link to comment
Share on other sites

  On 2/18/2014 at 5:25 PM, wghost81 said:

This all is very confusing. :sad: Especially since Sprinter description says +3 (tiles), I see +4 (meters, but I don't know they are meters) displayed and immediately get crazy. :smile:

 

Everything seems to work well, except SHIV, which somehow "lost" 2 tiles, as with servos it was only able to move for 7 + 3 + 3 tiles.

 

The original code actually had some stuff in there to display mobility which Firaxis removed, presumably because of similar confusion from the QA testers. Mobility stat doesn't act as an easy predictor of the number of tiles a unit can move, but it is at least comparatively useful. Especially on the skews/diagonals.

 

Note that +3 (tiles) is also potentially misleading if the unit doesn't start with 12 mobility (if NCE is turned on).

 

As to the SHIV, I'm not seeing how it lost 2 tiles. A Hover SHIV with adv servomotors should have mobility 20 = 13.33 tiles, so should be able to move 13 tiles, and 7 + 3 + 3 = 13, as expected. The issue is that base mobility for all tanks is actually 14 = 9.33 = 9 tiles. So a basic SHIV without adv servomotors. A Hover SHIV should be at 14 + 3 = 17 = 11.33, so 11 tiles.

 

The part that is the most confusing (and what is never explained) is that each tile is 1.5m x 1.5m.

Link to comment
Share on other sites

Sorry, SHIV is OK. As I said, I'm already crazy with all the conversions. :smile: "7 + 6" because I've compared all units to soldier with base 12 mobility and no modifiers.

 

BTW, you can display summary value divided to 1.5 in brackets to give at least an estimate of how many tiles a unit will be able to move.

Link to comment
Share on other sites

  On 2/18/2014 at 5:47 PM, wghost81 said:

Sorry, SHIV is OK. As I said, I'm already crazy with all the conversions. :smile: "7 + 6" because I've compared all units to soldier with base 12 mobility and no modifiers.

 

BTW, you can display summary value divided to 1.5 in brackets to give at least an estimate of how many tiles a unit will be able to move.

 

That's a good idea. Although then I'm sure we'll get all sorts of bug reports because 12 / 1.5 = 8 tiles, but such soldiers can only move 7 ~_~.

Link to comment
Share on other sites

May be an engine counts a tile soldier standing at as a first tile? This corresponds with 8 tiles. And everything else seems to be rounded up. This will explain 7 + 7 = 14 tiles while moving and 15 tiles while dashing: 7 + 1 = 8 and 15 + 1 = 16, which corresponds with 12/1.5 = 8 and 8 * 2 = 16.
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...