Working With Data Assets
Author: Christopher Solomon
For this week of our capstone project, my main priority was to implement the remaining tower upgrades that were not yet in the game. Last week I was able to implement around half of them so I was determined to finish up the other half in time for our build. Thankfully I succeeded but it was not without headaches.
The main problem I encountered this week had to do with the data assets we use for our towers' attributes. These data assets contain such as the tower's health and how much damage they do to enemies, among other things. All instances of a certain tower share the same data asset, which makes implementing the upgrades more convenient. The first issue I came across was that the utility towers did not have their own data assets yet, only the attack towers did. I was sure to create new ones to better support our upgrade system. Another issue I ran across was that the updated values in the data asset were persistent even after the game was exited or put on the main menu. this was a problem because it meant that upgrades that players had on one save file would still exist in another save if they were to swap! this problem I fixed by adding an 'End Play' event in our main level blueprint that would activate when the level was changed or the game was exited. in this event I made sure that the contents of the data assets were being cleared to their defaults. When a save is loaded the values in the data assets are then adjusted accordingly, which allows for correct upgrade loading!
![]() |
A data asset with default values |
![]() |
A data asset with upgraded values |
Comments
Post a Comment