Saturday, July 20, 2013

Targeting System

Boy... Building a targeting system wasn't as cut and dry as I thought it would be.

This is going to be a background system that abilities use to define viable targets for attacking.

  • It allows for selecting of both players and/or enemies (so I can re-purpose it for players, enemies, pvp, whatever)
  • Allows for any number of targets to be selected (test scene only has 460... I can't imagine ever needing more)
  • Has "Frontal" capabilities. (not sure if there's a real term here..)
  • Allows you to define the cone of the frontal selection (up to a full 360)
    • this allows you go from a full 360 degree area attack, down to a focused cone attack, or even a beam type attack.
  • Can specify minimum and maximum ranges. Allows for rings to be selected.
  • Able to specify the number of targets returned, from 0 to 460. 
  • Lets you randomize your target selection 
    • if you have a very large range, with a wide cone (or no cone) the system will pick targets within that range at random until it reaches your required number of targets. 
    • if random is NOT selected, it will always prefer closer targets over far ones. 
Overall, I'm pretty thrilled with how well it turned out. This can easily fit itself from anything to a single target melee, to a long range AOE or even a room-wide boss ability that picks random spots to attack or random people to target. 

Check it out here, play with the options, use the T button to perform the targeting function and highlight viable targets.

(I know it can kind of be a pain to move around in this room due to all the boxes, and that the fact that the options box on the left does NOT block clicks, so your character runs to the corner while messing with the options... but it's a test... so live with it. :D)

Unity Web Player | Targeting Test
Unity Web Player | Targeting Test
« created with Unity »
-->

No comments:

Post a Comment