In many scenarios, the collection of “Poolable” items itself is relevant to their use. If you want to think of the collection as having an “order” then the collection should probably be implemented as a “List”. Follow along and I will show another pooler based on a list along with a demo scene showing how to use it.
C#
Poolers (Part 2 of 4)
In some scenarios, the collection of “Poolable” items itself isn’t relevant to how you are using them. If you have no need of iterating over and applying logic to the entire group then you might be satisfied with using a simple “Set” to contain them. For example, an explosion might be pooled after its animation has completed and a bullet might be pooled after it hits an object or leaves a game zone. Scenario’s with event-based pooling might be a perfect fit for our first Pooler subclass.
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.
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.
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.
Tactics RPG Intro To A.I.
I’m currently hard at work preparing A.I. for this project. I was hoping to have it ready to share today – it works, but I am still polishing the code and working on writing the accompanying tutorial. While you wait, I decided I could share the decision making process I followed while architecting this portion of the project to help whet your appetite.
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.
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.
Tactics RPG Ability Effects
Over the past several lessons we have implemented tempory implementations for the effect of an ability, such as manually implementing an attack damage estimation and application of the damage itself. In this lesson we will be providing a much more complete implementation which allows for very different effects ranging from applying damage to inflicting status ailments and which supports just about anything you would want to do.