Overhaulin’

Over the past week/weekend, much time has been spent implementing character class switching and code refactoring. A lot of code in UnityScript has been converted to C# for performance reasons, and also to help become accustom to C# programming in Unity. Though progress may not be readily visible at run-time, much has changed behind closed doors. These changes include:

  • A complete restructuring of the Character script which includes separating class  function (character classes, not classes in the programming sense) into its own class (in the programming sense). An individual character class is now contained within its own object, making it much easier to manipulate and switch character classes in code.
  • A single Stat class that applies to both Item classes and CharacterClass classes alike. The Stat class includes many different functions that will come in quite handy and allow for more advanced manipulation of stats be done on the fly and require relatively little code. Things such as character stat calculation or implementing additional stats will be a breeze.
  • Implementation of class-specific items.
  • Proper updates to character graphics when an item is equipped or removed. This still needs to be handled on a network level, but works well locally.
  • Exposure of many different aspects of initial character class data in the inspector. This will make toying with particular classes and their stats relatively easy.
Initial character stats and item stats

These are some of the fun things that can be played with in the inspector now.

A tool that came in extremely handy and saved a bit of daylight was the Javascript to C# converter by M2H Game Studio. Though far from perfect, it tackled most all syntax conversion that otherwise would’ve consumed time. They have a much more polished version available in the Unity Asset Store. Kudos to them for hosting their free version. I wonder if they have the source to that free script available?

Somewhat off topic, but I would recommend to any developer or anyone working with a developer, is reading the article about why software engineers are grumpy by Nicholas C. Zakas. You’d think he was a carpenter with the many different nails he hits on the head.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s