2
\$\begingroup\$

I am wondering what a common way for actually dealing damage to different units is. Imagine a game like starcraft for example, should damage be done like this:

1) zealot attacks zergling, deal damage to zergling

or

2) zealot attacks zergling, create an attack effect on zergling. When this effect collides with the zergling deal damage to said zergling.

The advantage of 2 is for projectiles (like a dragoon attack) will deal damage when the attack collides with the target unit.

What are your thoughts about this in general? Are there other ways of doing this?

\$\endgroup\$
4
  • \$\begingroup\$ This is way too game-dependent to give an answer to. \$\endgroup\$ Commented Nov 8, 2017 at 1:46
  • 4
    \$\begingroup\$ There are usually a million ways to do anything. ;) To help narrow the field to the methods that will work well in your game, it's useful to include more details about the game you're building and what kinds of damage scenarios you need to handle. Do you have any particular cases that either style 1 or style 2 does not handle well? If so, please edit your question to tell us about those, and we can suggest ways to solve those specific issues. \$\endgroup\$
    – DMGregory
    Commented Nov 8, 2017 at 2:19
  • \$\begingroup\$ Not saying this is a duplicate, as this seems to be more related to RTS than FPS, but understanding hitscan versus physics simulated bullets might help frame the question better: gamedev.stackexchange.com/questions/13650/… \$\endgroup\$
    – CLo
    Commented Nov 13, 2017 at 16:25
  • \$\begingroup\$ Possible duplicate of How are bullets simulated in video games? \$\endgroup\$
    – Jimmy
    Commented Nov 14, 2017 at 2:57

1 Answer 1

1
\$\begingroup\$

I would recommend not to use particles or any FX related element to check collisions, as these can be very unreliable. I would recommend to either check the collision using hotboxes on the characters themselves, or define a basic mesh in the general shape of the attack animation to check the collsion with the attack effect. Hopefully that helps :)

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged .