6
« on: March 11, 2016, 05:52:49 pm »
I have the following idea;
1) The player controls an enemy who uses different weapons such as shotguns and smgs, etc.
2) Enemies further away obviously take damage
3) The way I have it set up at the moment is as thus. There is a certain chance of hitting an enemy at max range, with the difference closer on a linear scale. This means if the chance at 800 units is 50%, 400 units will be 75% and so forth. Then the game runs a random float between 0.0 and 1.0. If the float is greater than the chance, it's a miss, otherwise it's a hit.
4) There are a few problems with this. First enemy size does not account for damage dealt. an elephant-sized enemy is just as hard to hit as a rat-sized one
5) Second, it doesn't account for whether you get a direct hit, or just skim an enemy. Worse, if you slightly miss, you do nothing instead of slight damage
6) Third, any enemies next to the target take no damage, even it they should be close enough to be hit.
Is there a way to tell if an actor/enemy exists at a point, or as an alternative, is there a way to tell how much percent of an actor is in an area?