Skip to main content

Sandbox RPG Week #3 - Adding Stats to Units


[Stat Spreadsheet]

To add stats to my project I could add a variable for each "stat" a character would need then manually set all the differences between character class type such as "Mage" or "Barbarian", however there's a better way to do this, In unreal engine you can have a data table asset which contains as large amount of numerical data and you can separate specific cells from that data table using blueprints. This means you can have the data table decide how much HP a character has and then when the character levels up the local HP variable will change from level 2 HP to level 10 HP rather then setting up a function that increases the value of the variable each time they level up. Doing the levelling system this way allows for more freedom as it means the player can add upgrades on top of default values protecting them from mistakes such as forgetting to spend their acquired upgrades since they'll always be strong enough to take part in a fight just not necessary strong enough to win it (or win it with ease).

This data table system also works great for enemy units as you can set the values for each level then adjust the levels of the enemies on a instance basis without having to double check or manually set that a level 5 Goblin has 960 HP verses a level 12 Goblin having 1744 HP. On top of using the data table for deciding enemy stat values this is really helpful to me as the designer/developer since you can import the specific numerical information stored in a data table from a spreadsheet document, meaning I can do all the balancing inside a spreadsheet that changes the individual per level increments and writes out level 78 stats for me as I'm editing the level 1 values. Once the spreadsheet of values has been saved you can just import information to the data table asset and it will update all the blueprints in the project that reference the "Unit Base" class and pull any variables such as HP/MP across the entire project.


[Unit Base Parent Class]

In this project I am using a Parent & Child class system so that I can make large changes by editing the data within the "Parent" blueprint as they will be inherited by the Child class blueprint but this also means I can make character specific changes such as making a mage better at magic, simply by editing the "Child" blueprint and none of the other characters/Units will be affected by the changes made to the mage character.

Class Structure

  • Unit Base Changes
    • Base Stats = 
      • Flat HP, Flat MP.
    • Character Animations = 
      • Hit React, Cast Anim, Item Anim (*intended to be inherited leave blank or all characters will have the same animations).
  • Party Base Changes = Only affects characters that the player CAN use in battle.
  • Techniques & Abilities such as "Summon" & "Libra" that should be available across all playable characters.
  • Enemy Base Changes = Only affects characters that the player will be fighting against but affects ALL of the enemies making Goblins behave the same as Wolves.
  • Individual Changes
    • Role Stats = 
      • HP multiplier,
      • MP multiplier,
    • Character Anims = 
      • Hit React Anim,
      • Cast Spell Anim,
      • Use Item Anim,
      • Main Anim BP,
    • Character Mesh
      • Character Materials & Textures,
  • Additional Tweaks = these variables are inherited and can be overwritten here but will default to the same values as the Unit Base HP/MP
    • Unit Name,
    • Max HP,
    • Max MP,
    • Base ATK DMG,
    • Base DMG Resistance,
    • Base Action Speed,

[Combat Component]

A large portion of the battle system code is split between the HUD widgets that the player interacts with and the "Combat Component" blueprint (*with the "Battle Game Mode" keeping track of the units involved and the turns queue). A component blueprint in unreal engine is a chunk of code that can later be attached to any other blueprint and have that secondary blueprint inherit all of the variables and functions of the Combat Component much like a parent and class system structure however the other blueprint does not need to be of the same class as any other parent. In my case I have used the combat component to contain all the functions that both the player controlled party characters and enemy characters will need to complete their actions such as attacking other units or playing animations when getting hit. Since the component is sub-component of the child at the end of the parent & child structure tree it enables me to make small changes such as changing the HP/MP/DMG values of a specific character to more suit a specific role like "Black Mage" without having to change the base stat values inside the "Unit Base" or "Party Base" blueprints and keeping my "Role Focused" changes localised to 1 character unit.

Comments

Popular posts from this blog

Guest Lecture #1 - 21/09/2022 - Secret Mode

Guest - Joshua Garrity, Head Game Scout at Secret Mode Guest Bio Joshua started as a product Manager in the marketing department. Joshua was in charge of digital publishing for Fireshine. Attending public events like Gamescom not only allowed him to network his way into the position as Head Scout at Secret Mode but is also a method he uses to accomplish his job by seeing new indie projects in beta stages at these events. Takeaway #1 – How to Pitch my projects Scouts and Studio CEOs will be travelling often and walking around both Hotels and event centers, so  you  need to be able to pitch your project anywhere at any time. This means your presentation needs to be smooth, quick, and confident, when talking with scouts, CEO, or other representatives you need to answer their questions (without checking notes) and speak honestly about what your team has done and what it will cost for your studio team to do more. Takeaway #2 – What Do Game Scouts Get Up to Game Scouts in their day-...

Guest Lecture #4 - 19/10/2022 - 10:10 Games

  1st Guest Bio - Bart Kosciolek, Junior Animator @ 10:10 Games Jfjdiejdjd 2nd Guest Bio - Reece Hewitson, Junior Games Developer @ 10:10 Games skdjalskjdlkasjd Takeaway #1 - Determination As an applicant trying to get into the industry I will be rejected many times due not being the correct fit for studios I am applying for, be it not enough experience or not the correct style of work for how the studio does things. I need to not let this deter me.  Takeaway #2 - Networking The video games industry is still very young (in business terms/years) and still very small (in one sense), while a single title is a product of many peoples work all put together those people often split after projects have been finished and they will end up working on other projects at other studios and this results in "everyone knows everybody" where you can say a name in conversation with a new co-worker and they'll reply with "oh yeah I know (name) I've worked with them on this project. ...

Guest Lecture #2 - 05/10/2022 - Rebellion Games

  Guest - Peter Dimitrov, Environment Artist @ Rebellion Games Guest Bio Peter enlightened us and told us his day-to-day while he worked on the 1st DLC project for Sniper Elite 5, as a environment artist Peter worked with another level designer to develop and refine the flooded map level that the 2 of them had been assigned to.  Takeaway #1 - Working with limitations      Both Peter and his co-worker had to stick to a schedule where sections of the map needed to be                   done to a specific deadline, the white box version needed to be done within a certain time limit,                   changes could not be made once the art pass had started, the map needed to include certain features like      ditches and a spot for a supply train to run through. The map itself went under many changes before         ...