Body part selection for combat targeting system
Posted: Sat Oct 22, 2016 11:19 am
I'm currently working on a text-based combat system, and even though I have told myself the key point at this stage is only to allow killing animals and gain resources from them, I would later want to use the same system for combat between humans, so I wouldn't want to end up in a situation where I have to do a major rewrite just because the original system wasn't flexible enough.
Instead of hitpoints, my system keeps track of how much blood is in the character's (or animal's) body. If you lose enough blood due to external or internal bleeding, you eventually die. It's also possible to become incapacitated due to broken bones or pain, maybe even fear in the future. So if you get hit in the leg, it likely won't kill you, but the hampered movement is giving you a disadvantage.
Here I'm concentrating on the body modeling. I had an idea of numbering the body parts first by major part (1 head/2 neck/3 torso/4,5 arms/6,7 legs) and gradually adding sub-areas (for example 12 face, 122 right eye, 1222 right eyeball). At deepest there are currently four levels. When the game rolls for which area it hits, either if you roll high enough, it will go deeper in the tree, or it will roll repeatedly to define does it stop on this level or go deeper. Some of the areas are bones and some are major arteries. But - I should make it so that some targets are smaller than others and have a smaller chance of being hit. If you or the enemy manages to hit a major artery, it's instant death for the wounded party, so at least when it comes to the player character, that should be rare. I'm thinking of possibly mapping the body as a multidimensional array.
It should also be possible to target certain areas based on intention:
defend self - refrain from attacking, concentrate on protecting yourself
play - use only light force, avoid causing injuries
practice - mainly arms and shoulders, refrain from deep injuries
punish - non-lethal areas, mainly butt and back, back of the thighs, aim to cause pain but no harm
disarm - aim for weapon hand
incapacitate - aim for limbs, aim to cripple
quick kill - aim for head, neck, heart, groin arteries
slow death - aim for stomach, lungs, throat
torture - aim to cause maximum pain, likely to cause non-lethal damage too
blind - aim for eyes
In the case of an aimed shot, there should be a possibility of hitting a neighboring area if you miss the intended target. BUT - that requires knowing which areas are next to each other. My numbering system doesn't take that into account.
One thing I considered briefly was making an image file where each potential target area is in a different color, then picking random x,y and checking the color of the pixel in that spot. If it's the background color, it's a complete miss. The benefit of that system would be that it enables starting with a bias, and that allows aiming. But, the body isn't a still target. If you're standing with your hands by your sides, if someone aims for your fingers, they can accidentally hit your hip instead. But if you have your hands up defensively, then a missed hit should land at your shoulder or chest, not your hip. So if I used this system, should I have multiple pictures for different scenarios? And what to do with three-dimensionality? Should there also be a z axle? Technically it would be possible to have an x,y grid solely written as an if-based set of conditions, but it might be harder to visualize than a picture.
Also, should I take into account if the attacker is approaching from behind, from the front or from the side? In a completely random system you can end up hitting the bottom just as likely as the chest. But it wouldn't make any sense that you could accidentally hit someone in the ass when you were aiming for their face. So a completely random system is out of the question.
Instead of hitpoints, my system keeps track of how much blood is in the character's (or animal's) body. If you lose enough blood due to external or internal bleeding, you eventually die. It's also possible to become incapacitated due to broken bones or pain, maybe even fear in the future. So if you get hit in the leg, it likely won't kill you, but the hampered movement is giving you a disadvantage.
Here I'm concentrating on the body modeling. I had an idea of numbering the body parts first by major part (1 head/2 neck/3 torso/4,5 arms/6,7 legs) and gradually adding sub-areas (for example 12 face, 122 right eye, 1222 right eyeball). At deepest there are currently four levels. When the game rolls for which area it hits, either if you roll high enough, it will go deeper in the tree, or it will roll repeatedly to define does it stop on this level or go deeper. Some of the areas are bones and some are major arteries. But - I should make it so that some targets are smaller than others and have a smaller chance of being hit. If you or the enemy manages to hit a major artery, it's instant death for the wounded party, so at least when it comes to the player character, that should be rare. I'm thinking of possibly mapping the body as a multidimensional array.
It should also be possible to target certain areas based on intention:
defend self - refrain from attacking, concentrate on protecting yourself
play - use only light force, avoid causing injuries
practice - mainly arms and shoulders, refrain from deep injuries
punish - non-lethal areas, mainly butt and back, back of the thighs, aim to cause pain but no harm
disarm - aim for weapon hand
incapacitate - aim for limbs, aim to cripple
quick kill - aim for head, neck, heart, groin arteries
slow death - aim for stomach, lungs, throat
torture - aim to cause maximum pain, likely to cause non-lethal damage too
blind - aim for eyes
In the case of an aimed shot, there should be a possibility of hitting a neighboring area if you miss the intended target. BUT - that requires knowing which areas are next to each other. My numbering system doesn't take that into account.
One thing I considered briefly was making an image file where each potential target area is in a different color, then picking random x,y and checking the color of the pixel in that spot. If it's the background color, it's a complete miss. The benefit of that system would be that it enables starting with a bias, and that allows aiming. But, the body isn't a still target. If you're standing with your hands by your sides, if someone aims for your fingers, they can accidentally hit your hip instead. But if you have your hands up defensively, then a missed hit should land at your shoulder or chest, not your hip. So if I used this system, should I have multiple pictures for different scenarios? And what to do with three-dimensionality? Should there also be a z axle? Technically it would be possible to have an x,y grid solely written as an if-based set of conditions, but it might be harder to visualize than a picture.
Also, should I take into account if the attacker is approaching from behind, from the front or from the side? In a completely random system you can end up hitting the bottom just as likely as the chest. But it wouldn't make any sense that you could accidentally hit someone in the ass when you were aiming for their face. So a completely random system is out of the question.