Customizable Equipment

Sslaberk

Member
Feb 15, 2019
5
3
Status:
Prototype code tested, working as intended.

Further development will be halted until i receive a answer from Fenoxo, so i don't break the game's balance...
--------------------------------------------------------------

Hello, i have been playing the game for a while now, and one of the things that i noticed is a lack of Customizable equipment (Hence why i'm creating this thread...) So i've decided to try and do something about it...

I have already figured out how to go about it, but i want to be sure that what i'm doing is viable, and also i'm not very creative so if anyone has ideas for mods description and names i appreciate it...

Anyway, what i want to confirm is if it's ok to use the "hasRandomProperties" (what i'm gona use to make equipments modable), if my code could be improved and to see if people have interest in customizing their equipment.

So if you know the game's code, please take a look here and tell me if you have any suggestion:
Code:
package classes.Items.Mods
{
    import classes.Engine.Interfaces.*;
    import classes.Engine.Utility.rand;
    import classes.ItemSlotClass;
    import classes.GLOBAL;
    import classes.Creature;
    import classes.Items.Miscellaneous.EmptySlot;
    import classes.kGAMECLASS;
    import classes.Characters.PlayerCharacter;
    import classes.GameData.TooltipManager;
    import classes.StringUtil;
   
   public class ArmorShield01 extends ItemSlotClass
   { 
      public function ArmorShield01()
      {
         super();
         _latestVersion = 0;
         
         quantity = Number(Number(1));
         stackSize = 10;
         
         type = GLOBAL.PILL;
         
         shortName = "Mod A.S.MKI";
         longName = "Mod Armor Shield MKI";
         TooltipManager.addFullName(shortName, StringUtil.toTitleCase(longName));
         
         description = "A kit that will modify your armor to make it passively generate some Shield.";
         tooltip = "A small kit containing adaptable nanomachines that will modify your current armor to make it passively generate 10 more Shield Points.\n\n<b>WARNING: Only one mod per Equipment piece, last mod will be Overwriten.</b>";
         TooltipManager.addTooltip(shortName, tooltip);
         attackVerb = "";
         
         basePrice = Number(Number(5000));
         
         version = int(int(_latestVersion));
      }
     
      override public function useFunction(target:Creature, usingCreature:Creature = null) : Boolean
      {
        kGAMECLASS.clearOutput();
         
        //Item used by someone other than player
        if(!(target is PlayerCharacter))  {
            output("Nothing Changed.");
            //return kit to player?
            return false;
        }
        //player is not currently wearing armor
        if (target.armor is EmptySlot) {
           output("You open the kit then then remember you are not wearing any armor to use it on!\n\nYou close the kit and put it away.");
           //return kit to player
           quantity++;
           return false;
        }
       
        //Message to the player
        output("Opening the kit, you throw the nanobots into your armor.\nAlmost immediately you start felling tingles all over the  parts of your body covered in it.");       
       
        //See if this is the first time the item is modified
        if(target.armor.hasFlag(GLOBAL.ITEM_FLAG_MODDED))  {
           
            //Message to the player informing of changes (probably put it on the clearer function to give more details)
            output("\n\nYou can feel the effects of the previous batch of nanobots fading...");
           
            //Remove current tooltip 
            TooltipManager.removeFullName(target.armor.shortName + StringUtil.toTitleCase(target.armor.longName));
            TooltipManager.removeTooltip(target.armor.shortName + target.armor.tooltip);
           
            //TODO: Call clearer function before proceding
           
            //Debug, delete or comment next line before publishing
            output("\n\nFlag Detected, this part is working!\n\n");
        }
        else {
            //Mark item as modded
            target.armor.addFlag(GLOBAL.ITEM_FLAG_MODDED);
            //Mark item to be saved in file
            target.armor.hasRandomProperties = true;
           
            //Debug, delete or comment next line before publishing
            output("\n\nFlag not Detected, this part is working!\n\n");
        }
       
        //Message to the player informing of changes
        output("\n\nYou can see the slight glow of your shield intensify!");
       
        //Modify armor shield stat
        target.armor.shields = target.armor.shields + 10;
       
        //Modify tooltip
        target.armor.tooltip = target.armor.tooltip + "\n\nModded with Armor Shield MKI.";   
       
        //Modify name
        target.armor.shortName = "S. " + target.armor.shortName;
        target.armor.longName = "Shielded " + target.armor.longName;
       
        //Recreate tooltip
        TooltipManager.addFullName(target.armor.shortName, StringUtil.toTitleCase(target.armor.longName));
        TooltipManager.addTooltip(target.armor.shortName, target.armor.tooltip);       
       
        //pass time
        kGAMECLASS.processTime(5 + rand(3));
        return false;
      }
   }
}

Global.as flag:
Code:
public static const ITEM_FLAG_MODDED:int                        = 36; // Marks the item as modified.

The code above creates the item "Armor Shield MKI", that adds 10 shield points to the currently equipped armor when the item is used and change its name and tooltip to differentiate it from it's base (Just a prototype).

Edit:
If the item has already modded, the effects of the previous mod would be lost, so you can only 'add' one mod per equipment.

So , if you are interested and have any suggestions for mods (can be for any equippable item [Shields, Weapon, Accessories ..]), or for the code, please leave it here.

Attached are some images of the prototype test, working as intended so far... (i've 'hijacked' Crazy Carl's first shop slot to add the item to the game...)
 

Attachments

  • Prototype Test.png
    Prototype Test.png
    106.4 KB · Views: 8
Last edited:
  • Like
Reactions: ElBoob and Zavos

Zavos

Well-Known Member
May 7, 2016
2,425
1,302
30
Kudos for figuring out how to get it to work in code. Something you might want to keep in mind is that equipment statistics are limited by a budgeting system. Base capacity is determined by level, regular stats take up capacity (for example, 1 point of defense costs 6, 1 point of evasion costs 3, 1 point of shield costs 0.5), resistances cost a percentage of capacity (example: electric resist costs 1.5% for 1%) and flags cost a flat capacity percentage (example: 15% for airtight).

You can figure out the details for how to integrate your project with the current balancing system later. It's all variables, yes? Food for thought.
 

Sslaberk

Member
Feb 15, 2019
5
3
Kudos for figuring out how to get it to work in code. Something you might want to keep in mind is that equipment statistics are limited by a budgeting system. Base capacity is determined by level, regular stats take up capacity (for example, 1 point of defense costs 6, 1 point of evasion costs 3, 1 point of shield costs 0.5), resistances cost a percentage of capacity (example: electric resist costs 1.5% for 1%) and flags cost a flat capacity percentage (example: 15% for airtight).

You can figure out the details for how to integrate your project with the current balancing system later. It's all variables, yes? Food for thought.

Eh... this system isn't coded, right? Because i just made this monstrosity.. For science.....
 

Attachments

  • Test.png
    Test.png
    52.3 KB · Views: 30
  • Like
Reactions: Natetheman223

Zavos

Well-Known Member
May 7, 2016
2,425
1,302
30
Eh... this system isn't coded, right? Because i just made this monstrosity.. For science.....
It's not in code. Its used in design; regulating how powerful stuff is for where/how it's acquired.

(You've probably seen something like
Code:
//Level 6 (Common). Balance 2.0
in code, its a comment relating to it's balance design)

I would recommend speaking with Fenoxo directly for figuring out the nitty-gritty details for how powerful upgrades can/should be (quantitatively). Or write the upgrades and let him decide how powerful the boosts are during review.
 
Last edited:

Sslaberk

Member
Feb 15, 2019
5
3
Ok, i'll send a pm to Fenoxo to figure it out, meanwhile my idea was something like that:
MK I - Boost a stats and reduce another by the same amount
MK II - Boost a stats and reduce another by the amount - 1
MK III - Boost a stats and reduce another by the amount - 2
...
MK X? - Boost a stats without penalty

With increased Boost for each Mark...

It's actually simple to create the items, the only thing that will take some time is balancing, and specially creating all the descriptions and such...
As i've said before, i'm not very creative, so i'll probably name stuff like "Armor Shield Booster Heavy" for a mod that adds shield and reduce evasion...

Also, i've figured out a way to make mods 'switchable', just change the item description, add something like "Modded with Armor Shield MK I" to the end, then use description.indexOf("Modded with Armor Shield MK I") to see what mod was used last and revert the changes before applying the new ones.
 

Fenoxo

Corrupter of Tainted Space
Staff member
Aug 26, 2015
2,023
649
Mareth
www.fenoxo.com
I'm not opposed to this sort of stuff in practice, though adding it to the game in almost any form is a net buff to player character ability. For this reason, I think we'd need to be extremely careful about introducing mods, and do so at the start of a new level on a new plot progression planet.
 

Sslaberk

Member
Feb 15, 2019
5
3
Hello, thanks for answering!

Isn't it possible to start with mods that simply shift stats around? Like + 5 Attack, - 5 Defense? Or + 10 Electric Resistance, - 10 Burning Resistance? This way it's not a net buff, and it enables the player to create different 'builds' for the character.

Other way is to make the mods somewhat expensive, so the player can't buy to many early on...

Also, as i've said in the first post (not sure if it's clear, might need to clarify it..) only one mod per item, so if you use a second mod the effects of the first would be removed, and only from Mark II or so (This is one thing i'd like to discuss with you, 'Potency' of mods and so on...) there would be a net buff, like +5 Attack for -4 Defense.

Anyway, i'd still would like a reference to work on if possible, like how high the changes the mod could make, specific things for item type (Armor mods can alter resistances, weapon mods can't add shied, accessories can't alter X, ..., this kind of thing).

Whatever the case may be, Let me know if you plan on adding mods to the game and i probably can make them (currently on vacations, so i'll have less free time soon...).
 

Evil

Well-Known Member
Jul 18, 2017
2,539
4,242
39
Okay, you're starting to make this more complicated than it needs to be. Straight away, I would say just one mod can be used on a weapon. Period. Think of it as modding the weapon more than once makes it dangerous to use, wires get frayed or charge packs get loose from repeated removals and so on.

You're running the risk of making things overpowered, in spite of the drawbacks. Say for example you install a weapon mod that boosts power but lowers defence, might be a dampener for Mercenaries, but I bet Techs would just be laughing behind their shields. Instead, I would say consider mods that aren't +Offence/-Defence or vice versa, and maybe something that boosts one defensive aspect but lowers another. For example, let's say Steele installs a mod onto an assault rifle that raises their shields, but lowers their evasion. Or, a mod that greatly boosts the power of energy weapons adds the "Gets Hot" effect onto the weapon and randomly causes minor damage.

Modding any piece of equipment should be a conscious decision where the player weighs the bonus they're getting versus the drawbacks. The drawbacks should be substantial enough that they can't be easily covered by other items or perks.
 

Evil

Well-Known Member
Jul 18, 2017
2,539
4,242
39
lol good luck with that, you'd have to make them cost hundreds of millions of credits
I bought a planet yesterday, what did you buy?
 

Zavos

Well-Known Member
May 7, 2016
2,425
1,302
30
I've been thinking on similar things myself, my conclusion is that one way this could be balanced is to limit power by main story progress. Alternatively, by Player level. There should be a balance 2.0 level in the code comments, turning it into a variable should provide a measure for when and how much a item can be improved within the current overarching balance.
 

Sslaberk

Member
Feb 15, 2019
5
3
Yeah... like i said before, what's going to take time to figure out is how to keep the game balanced...

Okay, you're starting to make this more complicated than it needs to be. Straight away, I would say just one mod can be used on a weapon. Period. Think of it as modding the weapon more than once makes it dangerous to use, wires get frayed or charge packs get loose from repeated removals and so on.

You're running the risk of making things overpowered, in spite of the drawbacks. Say for example you install a weapon mod that boosts power but lowers defence, might be a dampener for Mercenaries, but I bet Techs would just be laughing behind their shields. Instead, I would say consider mods that aren't +Offence/-Defence or vice versa, and maybe something that boosts one defensive aspect but lowers another. For example, let's say Steele installs a mod onto an assault rifle that raises their shields, but lowers their evasion. Or, a mod that greatly boosts the power of energy weapons adds the "Gets Hot" effect onto the weapon and randomly causes minor damage.

Modding any piece of equipment should be a conscious decision where the player weighs the bonus they're getting versus the drawbacks. The drawbacks should be substantial enough that they can't be easily covered by other items or perks.

I think it's better to make mods switchable, otherwise the player won't be using mod most of the times in order to wait and see if there is a better mod later on... specially because of unique items.

Also, what i suggested were only examples, a mod could change any stats:
Accuracy, Evasion, Defense, Sexiness, Shield Defense, Shields, Physical Damage [Burning, Corrosive...], Lust Damage [Tease, Psionic, ...], Damage Resistances, Lust Resistances and even Flags.
So there could be mods that increases defense but reduces evasion, or one that increases shields but reduces shield defences, another that increases burning resistance but reduces kinetic damage and so on...

And if you put to much drawbacks, there won't even be a reason to use a mod, save for very specific builds...