Social Scripting Part 2

In Part 1 of this series we discussed several means by which Unity allows you to get your scripts talking back and forth between each other. That included direct references, their legacy and new message system, and their new event system as well.

In this post we will examine the options available to you as a language feature of C#, just in case you don’t want to rely on the options Unity provided. Although their event system is quite powerful and easy to use, keeping your events native will allow your code to be more easily reused in other projects or ported to other engines. I consider this part of the series intermediate level, and will expect you to have a working knowledge of C#. Continue reading

Social Scripting Part 1

It doesn’t take long before even the most basic of programmers realize there is only so much that can be done in a single script.  You really need to craft a system where different objects know about each other and disconnected scripts can talk to each other.  The goal of Part 1 is to introduce several options which Unity has built in to the engine to facilitate these needs. Continue reading

Random Encounters and Polymorphism

I was looking through Final Fantasy guides to get ideas for architecture.  In particular I looked at a Final Fantasy 1 handbook by Ben Siron.  I was intrigued by his simple presentation of the Enemy Domain Mapping system – showing what monsters appear in random encounters at each location of a map.  Put simply, there were several “recipes”, each referred to by a single letter, and those letters were arrayed in a grid according to the layout of a map.  It was a simple way to store a complex amount of information in an efficient way.  Here is an example recipe: Continue reading