Poolers (Part 1 of 4)

After having used my pooling library for awhile I found myself putting similar implementation code all over my scripts. With a bit of thought I realized that I could eliminate a lot of the code by creating another component. Actually I will be creating several, but they all serve the same purpose of helping reduce the amount of code necessary to work with pooled items.

Continue reading

Tactics RPG A.I. Part 2

In A.I. Part 1, we added autonomous agents. Our enemy units could randomly move around the board and pick and use abilities with random targets. Now it is time to make them move and aim with a purpose. We need our enemies to be smart enough to hit multiple targets, attack from the best angles, and avoid friendly fire, etc. They should always act intelligently from the options which are available.

Continue reading

Tactics RPG A.I. Part 1

I’ve decided to split the A.I. implementation into two parts. This first part will cover the “what” as in “what ability do I want to use?”. This is the easier of the two problems. The next portion on “how” as in “how do I know where to move and aim to best use the ability?” is rather complex. Since this bit is easier, I will also include the code that ties the A.I. into the battle states, as well as adding another user interface view which shows the name of the ability that a computer controlled unit has chosen to use.

Continue reading

Tactics RPG Victory Conditions

Now that we have enemies, we can also provide an actual “goal” for the battle. First we must be able to actually defeat the enemies, as well as risk defeat for our own units. There needs to be a consequence for a unit’s hit points dropping to zero, so we will add a “Knock Out” status effect which disables a unit from acting or taking additional turns. Likewise there should be an effect for defeating all enemy units, or allowing all hero units to perish. These are sample “victory conditions” which we will track, and which will allow the battle to end. Continue reading

Tactics RPG Unit Factory

It’s well past time to add some enemies to the board, but by now we’ve made all sorts of modifications to the “Hero” prefab which haven’t been propogated to the “Monster” prefab. We could spend time manually setting up each new character to have the same kind of structure, but I really don’t want to. Instead, we will use this lesson to lay the groundwork on a more flexible system. We will be making a factory to create and configure new units for us, so that introducing new and unique characters in the future will be a much simpler process.

Continue reading

Tactics RPG Magic

We have enough components to make several abilities, and in this lesson will make a few more. Magic based abilities are often the most powerful in an RPG, so they need a way to be regulated. If players could use them freely the game would end up both boring and monotonous. There should be a reason for players to use different abilities at different times. In order to foster this kind of strategy, this lesson covers the use of magic and magic points.

Continue reading