Jump to content

Photo

UI Mod - Bigger Perk Tree


  • Please log in to reply
193 replies to this topic

#1
Amineri

Amineri

    Resident poster

  • Premium Member
  • 3,927 posts

EDIT-- The initial version of this mod is complete and posted up to the wiki. This currently requires 23 separate hex edits (in 3 different files) to add to a game, but those of you that are brave may wish to push forward and install it now.

 

wiki link : http://wiki.tesnexus..._-_XCOMEU:_2012

 

Those of you less adventurous may want to wait until the next version of ToolBoks is released (the mod requires edits to Command1.upk, which ToolBoks does not yet support), after which I will release a single "Custom Mod" package with the entire mod.

 

I have tested this mod as extensively as I can, but it should be considered in "beta" until I get more feedback from others as to its stability on other systems.

 

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

 

 

So here it is: my most ambitious UI mod so far.

 

I've enlarged the Perk tree selection UI so that every level can have two choices. Additionally, level 1 and 4 (counting from 0 to 6) have THREE choices.

 

Most of the changes are to the ActionScript in Command1.upk (including my first successful attempt to edit a sprite by adding new objects).

 

There are a couple of small changes to UISoldierPromotion in XcomStrategyGame.upk. Also, I haven't done anything about updating the code in the GetPerkInTree<class> functions. This code will have to be squeezed  a bit in order to be able to return up to 16 perks (compared to the 12 possible now).

 

I don't know if this is really all that amazing, but I did learn quite a bit about actionscript sprite editing.

 

Below is an example screen showing the layout of the enlarge perk UI:

 

Bigger_Perk_Tree_Screenshot.jpg


Edited by Amineri, 06 May 2013 - 11:43 PM.


#2
Amineri

Amineri

    Resident poster

  • Premium Member
  • 3,927 posts

Unfortunately, the Psi Tree code and the normal Perk Tree share some sprites, so this messes up the Psi perk tree. It will likely be a bit before I release this mod, but I thought I'd post it up and see what sort of thoughts / feedback people had.



#3
dubiousintent

dubiousintent

    Resident poster

  • Premium Member
  • 7,977 posts

Oh, wow. :blush:   Now we have the opportunity to pick among three difficult choices?  Talk about your double-edged blades!

 

Hopefully you plan to put your (really excellent) development notes up on the Wiki, to help the next intrepid soul investigating ActionScripts and sprite editing?

 

-Dubious-



#4
anUser

anUser

    Fan

  • Members
  • PipPipPip
  • 261 posts

With those perks that I've deprecated cause I didn't like them and those that I plan to handle via items I'm already having difficulties filling regular perk trees with meaningful choices... now 16 perks per soldier!? :P Nah, the more choices the better. Keep up the good work man! Any specific ideas you've got in mind when planning this mod?



#5
Amineri

Amineri

    Resident poster

  • Premium Member
  • 3,927 posts

I will definitely post some info up about editing actionscript and sprites.

 

Unfortunately my notes a big mess due to lots of flailing about and dead-ends. Sprites are bit-packed with variable-length fields -- it's a real mess to figure out.

 

For example, the translation matrix used to define offset when placing the icon positions had 12, 13, or 14 bit signed integers -- and the first integer does not start on an even byte boundary.

 

Unfortunately this seriously messed up the Psi Tree UI -- there are now 10 icons, and they are all over the place. I'm still not even sure how the Psi Tree icons are defined. They appear to be based on the normal ability tree, but I can't figure out the details.

 

As an option, it's possible to use the normal tree FOR the Psi tree. This would make the Psi tree have 7 levels and 16 perk options just like the standard tree (or 7 level and 12 options with the standard tree).

 

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

 

Unfortunately the perk tree is defined in the actionscript as a single sprite -- it's not possible to adjust the number of displayed icons very easily. However, AS_SetAbilityIcon is not called from the upk file then the icon will not be made visible, so it might be possibly to cook up a little magic that way.

 

My first test (with serious confidence) with the new sprite displayed only some of the icons, because the upk code was only looping over the first two at each level. It's  also possible to restrict to a single choice still at a level, even if there were three icons defined (just call AS_SetAbilityIcon once for that column).

 

However the POSITIONING of the icons is absolutely non-adjustable without modifying the sprite.



#6
Amineri

Amineri

    Resident poster

  • Premium Member
  • 3,927 posts

With those perks that I've deprecated cause I didn't like them and those that I plan to handle via items I'm already having difficulties filling regular perk trees with meaningful choices... now 16 perks per soldier!? :P Nah, the more choices the better. Keep up the good work man! Any specific ideas you've got in mind when planning this mod?

 

Well, I'm thinking of combining this with the rework of perk selection, so that each XGStrategySoldier remembers specifically when each level's perk has been chosen (rather than using the array of perks).

 

This would allow placing the same perk in the tree multiple times, giving the player multiple chances to get access to a particular perk. Something like covering fire could be a 3rd perk option in both 3-perk choices, for example.

 

Alternatively, I've thought about letting players choose the same perk more than once. So then maybe Grenadier grants one freely equipped frag grenade, and each  time its selected again grants another one. Similar for Smoke Grenade perk, and Battlescanners perk. So then rather than having to use a second perk (i.e. Smoke and Mirrors) to get a second charge, the player would simply select Smoke Grenade again. Smoke and Mirrors could then be renamed and re-purposed to serve some other function.

 

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

 

My original plan was going to enable six additional perks (instead of four), but some of the space I tried to free up cause the perks to not display, and the selector icon to break, so I had to scale back down to four.

 

Now that I know a bit more what I'm doing, I might be able to expand the area from which I am grabbing bytes in order to add more icons. It would be the most flexible if three icons were defined at each level.

 

The upk coder could then select:

1 icon in the center

2 icons on the left/right

3 icons -- left/right/center

in order to customize the perks and still have a reasonably pretty looking display. Each icon placement takes 26 bytes, though, so this would require around 234 bytes to be freed up. So far I'd found 105 bytes, that would have to be slight better than doubled.

 

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

 

Just had a thought about the Psi tree. What if the second button (Psi Abilities) was repurposed into handling both "Permanent Equipment" and psi abilities. The psi abilities button would link to a second copy of the general perk tree, with its seven levels.

 

The bottom 3 (or 4, if people want to be able to unlock Rift earlier) levels would be reserved for the psi ability selection, and the top 4 (or 3) could be dedicated for specific "item-related" perks. Then the regular perk tree would only have actual abilities



#7
Amineri

Amineri

    Resident poster

  • Premium Member
  • 3,927 posts

Here is an first-cut rough example of using the Ability Tree sprite in place of the Psi Tree sprite.

 

Psi abilities function as normal. Psi levels don't have named defined (hence the generic "Rank Label" text) and it broke the Psionic Abilities icon at the upper left, but functionally it works. All of the icons are in the correct places, and you can even level up Psi-soldiers using this UI. (I confirmed it with a save game in which a soldier was waiting to level up Psi abilities).

 

Ability_tree_as_psi_tree.jpg



#8
anUser

anUser

    Fan

  • Members
  • PipPipPip
  • 261 posts

I've just got this crazy idea... could it be possible to turn the psi class into a 5th class, and use a regular perk tree or this psi tree faking a regular one, and then script somewhere else the gain of the psi skills, maybe as a result of gaiing psi xp, or as a scripted event on some other case... ? Even if this made that psi-skills don't display properly, I don't care much about that

 

ps: btw, even if the perks are displayed in the psi tree they're all in the aUpgrades array, right? Wouldn't this still prevent players from picking perks in that tree or that is in addition to the tweak to make perks selectable multiple times?


Edited by anUser, 29 April 2013 - 03:12 AM.


#9
Amineri

Amineri

    Resident poster

  • Premium Member
  • 3,927 posts

Psi perks are managed in exactly the same way as any other perk, and the abilities don't function in any significantly different way either.

 

The only difference is that every psi-class is given an eItem_PsiAmp during loadout -- both XCOM soldiers and Psionic aliens (this includes even basic sectoids).

 

It might be possible to create a dedicated psi-class, that would gain perks based on normal xp. Those perks would have to include some regular perks in addition to the psionic perks, I'd think. There are a few unused perks floating about that might be re-used (although image graphics would be a problem). 

 

The problem with making psionics a full-on class is less technical and more balance. It entirely circumvents the whole psionic research and psionic testing  portion of the game. How do you decide when a soldier can be promoted from rookie to the psionic class? Or do existing soldier that test psionic positive lose all of their existing perks and switch to the psionic class, starting over?

 

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

 

I think for now I'll plan on using the regular perk UI sprite in place of the psi tree UI sprite. Yzaxtol had asked for some psionic UI rebalancing, as he'd wanted to make the choice progression go 2, 2, 1 instead of 1, 2, 2.

 

I think the idea was to choose between Psi Panic and MindFray at rank 1, then between Psi Inspiration and Telekinetic Field at rank 2, with Mind Control being the only choice at rank 3.

 

Rift could be an option, traded against mind control at rank 3, too.

 

It might be possible to add in some of the alien psionic abilities for soldiers, also:

Mind Merge

Greater Mind Merge

Psi Lance

 

Also, the reflection ability that ethereals have might be grantable to soldiers via a perk ... not entirely sure.



#10
FlyingHigh10000000

FlyingHigh10000000

    Faithful poster

  • Members
  • PipPipPipPip
  • 1,021 posts

Wow, this is some amazing work, Amineri. Every time I see something new that you've come up with, it's more amazing than the last one.






Page loaded in: 1.082 seconds