HELPFUL HINT FOR DEVELOPERS
February 15th, 2022 by brotherhood

I thought this might be a helpful idea for developers who need to track many global values in their games. I refer to global values as a set of values that are used to alter the game state, store quantities, etc.



I have used strings rather than numeric values in a Dictionary in the past, but I have preferred to use numeric references for value stores for the last two games we have made. I found that referencing variables by name enforced lazy coding, and using a numeric reference with a spreadsheet was more efficient.




DEBUGGING GLOBAL VALUES






One thing that helped me tremendously with Beautiful Desolation was storing the reference AS WELL as a note to the code that changed the global value. So, for example, if you look at the code above, I store a string reference to the Script file and the Method that altered this value. It may seem cumbersome now, but it has saved me hours of trying to work out where a value was set from.






I have a singleton that stores the State Array as a List that contains all of the values and the place that set them.







Here is the clever part, I also write this data to the savegame file.







This Save is a dump of the State - what this means is that I can load ANY save from a player, tester, or my code base and review where and when the value was set. This helped out a MASSIVE amount during the playtesting of Desolation, which had 1500 variables in the State.




If a player sends me their save file, I can quickly ascertain why a value is not being set, or where it collided with another puzzle. If the save file only contained the value it would be useless in a debugging context.






My ingame Debug tool also allows me to check the details on any variable quickly.






This only took a few minutes to implement and it has made my life much easier!


STASIS 2: BONE TOTEM - MAY 2021 NEWSLETT...
May 20th, 2021 [brotherhood]
Read More
PART TWO OF MEET THE DEVELOPERS (US!)...
May 5th, 2021 [brotherhood]
Read More
PART ONE OF MEET THE DEVELOPERS (US!)...
May 4th, 2021 [brotherhood]
Read More
CREATING A SCENE # PART 3...
April 23rd, 2021 [brotherhood]
Read More
DESOLATION COMING TO PS4+ & SWITCH!...
April 19th, 2021 [brotherhood]
Read More
CREATING A SCENE # PART 2...
April 7th, 2021 [brotherhood]
Read More
CREATING A SCENE # PART 1...
April 1st, 2021 [brotherhood]
Read More
NEWSLETTER # 4 - CHARACTER ART...
March 8th, 2021 [brotherhood]
Read More
BEAUTIFUL DESOLATION WINS BEST GRAPHICS...
February 22nd, 2021 [brotherhood]
Read More
NEWSLETTER # 3 - MAPS!...
February 2nd, 2021 [brotherhood]
Read More
NEWSLETTER # 2 - OCEAN FLOOR...
January 19th, 2021 [brotherhood]
Read More
LATEST

BONE TOTEM WINS!

February 19th, 2024

The Aggie Awards for 2023 have just been announced, and STASIS: BONE TOTEM won in four categories and was the runner up in five more! We notably won Best Non-Traditional Adventure and Best Adventur...

Read More
BROTHERHOOD NEWSLETTER SIGNUP