Advertisement

Reaction fire problem (turnbased tactical game)

Started by November 29, 2013 04:39 PM
10 comments, last by Iron Chef Carnage 11 years, 1 month ago

Hi

Im designing a turn-based tactical game with squads of around 6vs6 soldiers with modern day firearms (think old xcom or fallout tactics). Player vs AI.

My reaction fire work like this:

1. You save timeunits (TU) so you can use reaction fire for a soldier

2. He will fire if enemy comes within line of fire at reduced accuracy and increased TU-cost. Normal damage.

But how to avoid a player from setting up all his soldiers in a good (and concentrated) position, activate RF for everyone and simply wait until enemy comes into the trap, one by one. It seems very hard to code AI that would not be weak to such a "tactic".

I know setting a timelimit against the player would force a more active (agressive) gameplay but it doesnt suit well with my theme.

Thanks for your input

Erik

That kind of depends if you are going to have an initiative score tied with your timeunits. In the old X-COM (UFO: Enemy Unknown), the two character's initiative score was compared to each other when it was triggered. Then again, UFO had problems with the slow pace of the combat and this might be something that you want to avoid.

Co-Founder & Creative Director @ Brimstone Interactive

Currently working on Eden Falls: A Science Fiction RPG

Advertisement
In the original X-Com, the equation used for Initiative comparisons was:

Initiative = (Reactions * TUs / MaxTUs)

Whenever an enemy performed an action within your line of sight, the game would find the unit with the highest Initiative, and if it was higher than the enemy's own initiative, you'd make a snap shot if you had enough TUs left.

This would decrease the firing unit's TUs by a large number (typically around 30% of their max TUs), which would result in their Initiative value dropping for the rest of the turn. This means that if they missed, the enemy could continue moving several squares without triggering a second opportunity shot from the same unit.

The programmers gave the aliens some rudimentary handicaps and tactics to overcome getting killed by campers:

- Aliens can see the maximum distance (20 squares) no matter what lighting conditions exist.
- Aliens gain +6% Reaction, +4% TUs, and +6% FiringAccuracy per difficulty level.

- If they spot you on their turn, aliens would typically make sure that they could always back up to a safe distance away from your units (to "kite" you). In outdoor areas, this typically resulted in them firing from beyond your sight radius. In indoor areas, this would result in them forming "ambushes" as they would retreat around corners and wait for you to come to them (your movement = your consumed TUs = your lowered initiative value = the alien shooting you first).
- They would ALWAYS use explosives (grenades and blaster bombs) against you if your units were clustered together.
- The pathfinding nodes inside UFOs were set up so that the aliens would typically wander around inside the UFO randomly with a really low chance of coming out the front door. Inevitably you'd have to walk in with your soldiers with the best reactions, "nuke the site from orbit" with blaster bombs, or use mind-control scouting.



In X-Com Apocalypse, the AI was much more blindly aggressive, had many types of Aliens that could not use ranged explosives (even many of their ranged weapons were much shorter range than your weapons), and was generally much easier to kill with firing squads than in the first two games. In the endgame, aliens started using personal cloaking fields and teleporters to make it much harder to apply firing squad tactics.

Just spitballing here - not sure if it fits with your game, but wouldn't grenades be the ideal weapon for the AI to use if the player tried concentrating their troops and not moving them?

Yes grenades can be used if you are lumped together (or long burst from machineguns etc)

But i want RF to only be good sometimes. If you have all your guys on overwatch and not close together what about that? Since units move one by one, those AI looking for a target will be very vulnerable. (if AI just camps that is also not fun, but it helps against firing squads of course).

Maybe RF can be sluggish and not trigger (always) as soon as an enemy shows up. So sometimes the enemy going round a corner will shoot before you! (like 40 % trigger on each tile moved, so sometimes you shoot directly, sometimes after one or two tiles moves from the enemy giving him a chance to fire first)

In the original X-Com, the downside of reaction fire is that you will probably miss. The soldier making the reaction shot never says "oh, I have a 13% chance to hit, I think I'll save my shot until he gets a little bit closer". The soldier will see the alien and *immediately* try to shoot regardless of chance-to-hit.

Heavy plasma shots that hit someone are almost always fatal - the best bet was to use 3-round burst in an attempt to maximize your chances to score a hit. Opportunity fire in the original game only used "snap shot" (single shot, medium accuracy). This meant that opportunity fire was not as effective in overall (Number of Hits/TUs spent) statistics as attacking manually using 3-round burst mode.

In practice, what typically happens is:
- An alien moves into your line of sight.
- You take an opportunity shot and miss.
- The alien fires off a three-round burst (if they have a gun capable of doing so) which probably kills you.
- One of your rookies panics, drops his gun and starts running around like a madman.
- On your turn you unleash unholy wrath upon the alien with a rocket from your HWP (which misses, of course, but vaporizes the lower floor of the farmhouse in the distance revealing a second, terrified alien) and three-round bursts from all your guys within line of sight, which eventually hits the alien and kills it.
- Your rookie that panicked gets shot by the alien in the smouldering farmhouse and the process continues.
Advertisement

First of all, camping is actually a really valuable strategy in real conflict. Especially in modern conflict, where your greatest defense is being elusive.

A few things though if you want to maybe curb the value of camping:

1- "Reaction fire" requires specifying an area to watch. You get competent firing accuracy at that area, and diminished or entirely absent firing at other areas. For example, if you've got a sniper rifle, and you're watching a corner somewhere, but your enemy pokes their head out of a window 20 feet away, you may not even see them at all, and thus won't react. Maybe you'd see them if you had a pistol instead of your rifle, but you'd at least lose some accuracy to abandon your aim at the corner you were looking at.

2-Long-term benefit to knowing where your enemy is. If you know your enemy is just holed up somewhere camping your objective, then maybe it's time to get on the radio and call in a mortar strike. It'll take 3 rounds to get to it's target, because math is hard and thus aiming a mortar is time consuming, but a camping spot is then only safe for as long as you can keep it a secret.

3-Smoke

4-Multi-objective maps, If each team has a variety of objectives that would satisfy a victory condition, an attacking team can opt to leave the defending team to camp to their hearts delight around an objective the attacker will then proceed to ignore.

What about flanking or encirclement? If the AI noticed you were camping and then came at you from the sides instead it'd force you into action pretty quickly.

[size="2"]Currently working on an open world survival RPG - For info check out my Development blog:[size="2"] ByteWrangler

Ok some good points here guys

Imperialism II had the same mechanic, it used units with different defensive-, offensive- and range-stats,
often this meant one unit got send in first in to draw fire(this unit had to come close enough to attack an enemy unit as well) then the real damage-dealers were send in.

The mechanic slowed the game down a bit on moments a new generation of defensive technologie had just become available/researched but the offensive (counter-) technologies weren't researched yet.
Having technologies become available in reverse order would most likely 've screwed up the balance(it was a slow-paced game)

Also defenders usually had an advantage, and many attacks were aborted if plenty of defenders were present.

Succeeded attacks against low/not defended territories usually meant units had to heal a few turns as well.

Imperialism II was, btw, a turn based conquer&develop(industry)-game which zoomed in to turn-based combats at end-of-turn,

focus was on development.
so it worked out quite well, if your game wants to focus more on combat it may get difficult.

This topic is closed to new replies.

Advertisement