TACTICAL COMBAT
Implementing Real Time Combat in Squad Based Game
As a squad leader, you have yourself up to 6 operatives to control at one time. It can be intimidating to control all these units in real time combat. But don't worry. The game is highly customized to suit your level.
1 ) Instead of controlling all 6 units, there is an option to allow computer to control some units. This computer controlled units can be set to guard a spot or follow a leader. This is implemented through AI routine called behaviour mode.
2 ) There's plenty of automatic actions that will smooth the combat process. For instance, if your operative is outside weapon effective range, he/she will automatically moves closer to target.
3 ) You can pause the game at any time. If you get overwhelved while playing the game in real time combat, just pause the game and relax a bit to think out the tactics.
Line of Sight (LOS)
To give a fair level of playing field, all creatures in the game can only see object/creature in front of them until the view is blocked by something such as wall, closed door, closed window, objects and dark spots. The object is said to be within line of sight(LOS).
This is important because creature can only interact with object/creature within their line of sight (LOS). If the creature can't see the object/creature (outside their LOS), they can't do anything about it. So sneak up behind creature is theoretically possible.
Since the game is run based on your squad perspective, the game will only render creature within your squad LOS. This mean if at least 1 squad member can see certain creature, the game will render the creature. If no squad member can see the creature, it can't be rendered. This is the way the game visualize LOS.
So you might come with the situation of which your squad member see an enemy for a brief amount of time and then magically disappear. The enemy falls within the squad member LOS before the view is blocked by something- door,wall and such. The enemy is still in the area. It's just no one in the squad can see him.
Combat Process
Once squad member sees an enemy and you left-clicked attack cursor on enemy, there are several processes need to be done before the squad member can pull the trigger, swing the knife, starts to punch or any type of attack.
The game will check if there's item on secondary hand slot. If there's item, the squad member will automatically emptied it to their inventory. If the inventory is full, then the attack is aborted.
Once the secondary hand slot is empty, the game will decide what kind of attack mode based on item on primary hand slot:
1) Ranged attack mode for pistol, SMG, shotgun, rifle and rocket launcher.
2) Melee attack mode for all kind of knives except throwing knife.
3) Throwing mode for rock, throwing knife and explosives.
4) Unarmed attack mode for empty hand.
Ranged Attack Process
Take a look at ranged attack flowchart and try to make sense of it. It's easy to get the attack interrupted because you're handling an intricate piece of machine that must be properly maintained for it to work effectively. Knowing certain weapon effective range will give you an edge in combat as you can estimate whether you can fire the weapon from your current position.

By default, a lot of automatic actions in ranged combat is activated. These actions gives the feel of smooth gameplay without annoying interruption.
For a smooth ranged attack process:
1) Keep automatic actions activated.
2) Keep an eye on bullet status. Find a safe place and manually reload ammunition.
3) Use weapon in excellent/good condition.
4) Try to approach enemy as close as possible so you wont have to worry about weapon's effective range.
Chance to Hit for Ranged Attack
Chance to hit for ranged attack = ((( marksmanship skill + gun status ) X 0.4 ) + aim + rifle scope + laser guide - (( stance modifier + body spot ) X distance )) X light
Several factors that will improve your chance to hit are your marksmanship skill, gun current status, your aim and additional gun accessories that improve your aim. Several factors that degrades your chance to hit are stance modifier, body spot and distance between you and target. All of these factors are combined and modified by light status on target spot. It represent your chance to hit. Based on chance to hit number, the game will decide if your attack is successful or not.
Weapon you use in ranged attack is very important because it'll affect your chance to hit asides from your marksmanship skill. Since there is nothing you can do about your marksmanship skill, pay attention to the current status of your weapon. If you carry multiple ranged weapon, choose the one with highest current status even if there are better weapon in term of damage and such. This is because chance to hit take into consideration roughly the average of both your marksmanship skill and the weapon's current status.
Aim
If you aim your attack, you'll improve 5% chance to hit. In addition, if rifle scope and laser guide are installed, you'll be given another 5% and 10% while you're aiming. So you'll gain up to 20% chance to hit just by aiming your attack.
Unfortunately, aiming your attack takes precious 2 seconds before you can pull the trigger. In real time world, this takes too much time especially if the enemy is around the corner pointing his/her gun towards you. So aiming your attack is suitable if you want to snipe enemy from afar.
Distance, Stance Modifier and Body Spot
The big factor that degrades your chance to hit is distance. If you're far away from enemy, then your chance to hit is lower. Get closer and your chance to hit will improve. The distance will then be modified by stance modifier and body spot.
Stance modifier refer to the combination of your stance and enemy stance. Lower number is better.
1) If you lie prone while enemy stands, it's 0.1.
2) If you lie prone while enemy in crouch stance, it's 0.2.
3) If you lie prone while enemy lies prone, it's 0.3.
4) If you're in crouch stance while enemy stands, it's 0.2.
5) If you're in crouch stance while enemy in crouch stance, it's 0.3.
6) If you're in crouch stance while enemy lies prone, it's 0.4.
7) If you stand while enemy stands, it's 0.3.
8) If you stand while enemy in crouch stance, it's 0.4.
9) If you stand while enemy lies prone, it's 0.5.
Body spot refer to specific body area you target on enemy. Lower number is better.
1) If you target torso, it's 0.2.
2) If you target leg, it's 0.4.
3) If you target head, it's 0.5.
Light
The biggest factor that affect chance to hit is light status on target spot. It ranges from 0.1(darkest) to 1.0(brightest). During daylight, outdoor area is the brightest (1.0) while indoor area light can range from 0.9 to 0.7. During night or in underground level, the light can range from 0.3 (dark) to 0.6(bright). The bright area is area illuminated by any light source such as lamp or street light.
If any enemy stands on a dark spot (0.3), he/she can't be seen. The enemy holds the advantage if he/she can see you instead. Night vision goggle can solve this problem. It can help you see anything on dark spot. It adds 0.2 to any dark or lightly lit spot (0.1 to 0.4). For instance, for a dark spot of 0.3, night vision goggle will add 0.2 to produce 0.5 so you can see any enemy on the spot.
Chance to Hit Example
For instance, you lie prone as enemy stands on a bright spot, targeting his torso 20 metres from him and you don't aim your attack. Here is the chance to hit calculation:
Marksmanship skill - 50 Gun status - 80 Aim bonus - 0 Rifle scope bonus - 0 Laser guide bonus - 0 Stance modifier - 0.1 Body spot - 0.2 Distance - 20 Light - 1.0 Chance to hit - ((( 50 + 80 ) X 0.4 ) + 0 + 0 + 0 - (( 0.1 + 0.2 ) X 20 )) X 1.0 = 46
If you take the initiative to aim and your weapon has rifle scope and laser guide on it, the chance to hit will significantly improve:
Marksmanship skill - 50 Gun status - 80 Aim bonus - 5 Rifle scope bonus - 5 Laser guide bonus - 10 Stance modifier - 0.1 Body spot - 0.2 Distance - 20 Light - 1.0 Chance to hit = ((( 50 + 80 ) X 0.4 ) + 5 + 5 + 10 - (( 0.1 + 0.2 ) X 20 )) X 1.0 = 66
However if enemy moves to indoor area, he stands on normally lit spot(0.7). Suddenly your final chance to hit doesn't look so good.
Marksmanship skill - 50 Gun status - 80 Aim bonus - 5 Rifle scope bonus - 5 Laser guide bonus - 10 Stance modifier - 0.1 Body spot - 0.2 Distance - 20 Light - 0.5 Chance to hit = ((( 50 + 80 ) X 0.4 ) + 5 + 5 + 10 - (( 0.1 + 0.2 ) X 20 )) X 0.7 = 46
Chance to Hit for Throwing
Chance to hit for throwing = ( throwing skill - (( stance modifier + body spot ) X distance X 2 )) X light
The only factor that will improve your chance to hit is your throwing skill. The item to be thrown doesn't affect chance to hit. Aiming doesn't work with throwing. Several factors that degrade your chance to hit are stance modifier, body spot and distance between you and target. All of these factors are combined and modified by light status on target spot. It represent your chance to hit. Based on chance to hit number, the game will decide if your attack is successful or not.
Calculating chance to hit for throwing is just the same as ranged attack. The difference is distance need to be multiplied by 2. As throwing requires you to stand, stance modifier will be limited between 0.3 to 0.5.
Chance to Hit Example
For instance, you stand as enemy stands on a bright spot, targeting his torso 10 metres from him. Here is the chance to hit calculation:
Throwing skill - 50 Stance modifier - 0.3 Body spot - 0.2 Distance - 10 Light - 1.0 Chance to hit = 50 - (( 0.3 + 0.2 ) X 10 X 2 )) X 1.0 = 40
Chance to Hit for Unarmed/Melee Attack
Chance to hit for unarmed/melee attack = ( unarmed/melee attack skill - (( stance modifier + body spot ) X opponent skill )) X light
The only factor that will improve your chance to hit is your unarmed or melee skill. If any weapon is used, it doesn't affect chance to hit. Aiming doesn't work for unarmed/melee attack. Several factors that degrade your chance to hit are stance modifier, body spot and opponent's unarmed/melee skill. All of these factors are combined and modified by light status on target spot. It represent your chance to hit. Based on chance to hit number, the game will decide if your attack is successful or not.
Calculating chance to hit for unarmed/melee attack is just the same as ranged attack. The difference lies in stance modifier and body spot. As the attack requires you to stand and target can't be in prone stance, stance modifier could 0.3 or 0.4. For some attack, not all body spot are valid. The target stance could also affect which body spot is valid. If certain body spot is invalid in some situation, the nearest body spot is automatically chosen instead.
Chance to Hit Example
For instance, you stand as enemy stands on a bright spot, targeting his torso next to him. Here is the chance to hit calculation:
Unarmed skill - 75 Stance modifier - 0.3 Body spot - 0.2 Enemy unarmed skill - 50 Light - 1.0 Chance to hit = 75 - (( 0.3 + 0.2 ) X 50 )) X 1.0 = 50
Damage
If the attack is successful, then damage can be calculated. For ranged attack and throwing, damage comes from the the weapon itself. For melee attack, damage comes from both the weapon and attacker strength. For unarmed attack, damage comes from attacker strength.
There's 4 type of damage - point, blast, stun and nerve damage.
1 ) For point damage, it'll affect specific body spot ( head, torso or leg ). Point damage comes from ranged, melee or unarmed attack.
2 ) For blast damage, it'll affect all body spot. Blast damage comes from most explosive excluding stun grenade.
3 ) For stun damage, it will temporarily paralyse target for 10 to 20 seconds. It comes from stun grenade.
4 ) For nerve damage, the effect is the same as blast damage. It comes from nerve gas canister.
Before damage can create injury, target body armour will suppress or resist the damage. This is only applies to point or blast damage. Stun or nerve damage will go straight to body bypassing any body armour.
Body armour consist of cloth on specific body spot and skin. If damage is more powerful than body armour, then target will suffer body damage. Health points will degrade and he/she bleeds. Your ops will suffer shock damage that degrades a little bit of energy and morale.
Any point or blast damage can tear or damage cloth on specific body spot. Don't be surprised to find many jacket or pant that you can't use and beyond repair. If you badly want that jacket worn by the enemy, you shoot him at the head or leg instead. If you shoot at the torso, the jacket might be useless to you when you retrieve it.