Tactical Combat AI

Started by Keymaster89, March 06, 2015, 05:05:38 AM

Previous topic - Next topic

Keymaster89

When you get raiders at your door in midgame and you still don't have your killbox in place, you have to defend your colony with the flash and teeth of your colonist against 30-40 raiders... What's the problem in this? Nothing, this is Rimworld after all...
But when i look at 40 raiders goes down the straight line of the corridor where u lined up all your colonist and defenses, one thing become immidiatly clear to me: colonist don't give a shit about tactics and target selecting... they go all straight for the closest one, shooting all concurrently at the same target in the worst scenarios... some colonists with long reload time like snipers and miniguns even waste time bouncing from target to target aiming for couple second before 7 or more companions shoot down their targets for them...  so from the 40 raiders at the beginning, 15 are shot down almost immidiatly after targeted and a storm of 25 get to close range unharmed, where my colonists with miniguns start shooting for good...
This makes battle a hell of micromanaging targets every half a seconds, in order to distribute efficiently the firepower along the frontline.

What i suggest are 2 solution to this problem, both good i think:
1) Combat AI improvement: When a colonist have to automatically designate a target, he start searching from the closest one. If this target is already targeted by another colonist, he go for the second closest one, if this also is targeted by another colonist he moves for a farther one and so on. If he didn't find a free target until his effective range, it will start again the search in the same way but now accepting targets already targeted by 1 other colonist, if at the end he still didn't find a fine target, then he start again searching for targets with 2 colonist already on it and so on.
Also if someone start shooting at a colonist, that colonist immidiatly prioritize shoot him back, provided that it's in range and he isn't attacching someone else prioritized in this way. Selfpreservation is a common thought in battles after all...
This improvements, should allow for a more effective distribution of the firepower along all targets, both from attacking and defending side of the battle. Battles will look like actual battles and not launch a wall of bullets to 1 unluky guy at a time.

2) Weapon specific targeting: the idea is simple, the automatic target selection is made upon the type of weapon the colonist are holding in their hands.
Rapid fire (pistols, SMGs, short range thrown weapons) - always closest target available
Mid range (turrets, rifles, short bows, javelins) - already attacking targets, if no one is attacking, closest target available
Long range (sniper rifles, long bows) - always farther target available
Heavy (minigun, rocketlaunchers) - always best armored target available
Explosives (granades) - farther under cover targets
This will allow players to customize their attack force in advance, planning for a distributed fire scheme or focusing on a determinated range of attack.
I can for example take 3 snipers for counter-sniper, 5 mid range people with rifles for interdict fire, 5 with SMG for rapidly stopping people that come too close, couple brawlers and another couple minigunner/granadier to shot down the tough ones.

b0rsuk

I think this is where Tynan Sylvester draws the line and will implement very little of it. Most people consider combat micromanagement fun. You're supposed to do everything manually. You have the pause button and as much time as you like. I think this would be solving the wrong problem, if there is a problem.

Silvador

Quote from: b0rsuk on March 06, 2015, 08:38:25 AM
I think this is where Tynan Sylvester draws the line and will implement very little of it. Most people consider combat micromanagement fun. You're supposed to do everything manually. You have the pause button and as much time as you like. I think this would be solving the wrong problem, if there is a problem.

I agree. I think this is half the point of the pause and targeting commands on colonists. When you draft them, you take direct control. Tell them where to take cover and who to fire at. I, for one, would be very, very annoyed if this was removed from the game as I feel far more comfortable with this method. It gives me more control over the situation and when I fail I don't feel like it's just RNG giving me the finger.

Darth Fool

Never the less, this would be an improvement in the raider's AI which would be welcome and make them a bit smarter and harder to trap with "stupid AI" exploits that take advantage of the current targeting system.

b0rsuk

The OP pretty clearly complains about colonist AI, not raider AI. He's fine with 40 raiders acting as cannon fodder.

Mckee

I'm with the other comments on this - combat AI is fine as is on the colonist side. I think it's the attackers that need some work (I'm sure that'll get done, its WIP after all).

Most our colonists aren't soldiers - I don't think they need to pick seperate targets or coordinate fire in a complex manner. For a sim/base building game, rimworld already has a fairly well done tactical combat side, with cover and all those other complex mechanics involved. I'm not sure, but a load of AI routines might slow that down. I'm quite happy with the defensive AI of colonists - they don't move, they find a target, and shoot. Given they're mostly sat behind cover engaging large mobs of enemies, it's totally sufficient. Snipers and the like, that maybe need a bit more thought in their aiming, can easily be managed by the player.

My only issues with the AI and combat, on the colonist side, is that non-combat AI likes to path regardless of danger - a typical issue in a lot of games. Honestly, stopping friendly fire while hunting or wandering round the map seems like a greater issue to me.

Silvador

Quote from: Mckee on March 06, 2015, 01:12:06 PMMy only issues with the AI and combat, on the colonist side, is that non-combat AI likes to path regardless of danger - a typical issue in a lot of games. Honestly, stopping friendly fire while hunting or wandering round the map seems like a greater issue to me.

This.

I often find myself having to draft non-combat colonists just so I can move them away from danger and either leave them standing idle/drafted until the fighting is over, or lock them in one of my buildings in order to keep them safe and prevent them from walking through the middle of a fire fight.

b0rsuk

Quote from: Silvador on March 06, 2015, 01:59:06 PM
Quote from: Mckee on March 06, 2015, 01:12:06 PMMy only issues with the AI and combat, on the colonist side, is that non-combat AI likes to path regardless of danger - a typical issue in a lot of games. Honestly, stopping friendly fire while hunting or wandering round the map seems like a greater issue to me.

This.

I often find myself having to draft non-combat colonists just so I can move them away from danger and either leave them standing idle/drafted until the fighting is over, or lock them in one of my buildings in order to keep them safe and prevent them from walking through the middle of a fire fight.

My way of fixing this would be another column on the colonist overview screen. "Avoid combat", enabled by default. This would work for undrafted colonists and make them stay away. If you really wanted, you could equip a colonist with a personal shield and a helmet and make him repair or rescue.

Silvador

Quote from: b0rsuk on March 06, 2015, 04:02:11 PMIf you really wanted, you could equip a colonist with a personal shield and a helmet and make him repair or rescue.

Oh! That's a really good idea. I might just give that a try.

Thanks. :)

Vagabond

Hello,

I've found combat AI quite interesting myself. I've often tossed around the idea ammunition. Instead of specific ammunition types, why not have just four types?

Projectiles: Arrows, Bolts, *javelins, ect.

*In the case of hand thrown weapons, the last one is always kept so they can melee with it if needs arise. But you can order them to "reload" if you'd prefer them to continue throwing.

Light Rounds: Basicially any conventional pistol, rifle, carbine, shotgun, browning turret.

Energy Rounds: Used for energy weapon systems

Heavy Rounds: Ammo for rocket launchers, grenade launchers, and things like mortar turrets.

You would craft these, and they'd have large stacks. You could stock them in resupply caches near engagement zones. Enemies will have these same restrictions; if they come to your base to siege, they will bring extra ammo cans with them, it would take a certain amount of time for them to get more based on how far their base is. If they come to "raid", they leave when they all run out of ammo, but will resupply using your stock if they can safely path to it.

I also think that tactical orders, similar to Dragon Age: Origins would be interesting. Being able to sell your colonist with the sniper rifle to target the farthest enemy (who is most likely a sniper themselves) would be nice. As well as having your guy with the minigun target "groups" of enemies of three or more. Your dudes with pistols could be told to attack the closest enemies.

I think cover should be way more powerful. The chance to hit someone peeking around a corner should be very high. At the same time, weapons should be way more accurate. The first time my dad took me to a shooting range (first time using a gun; he's military so he felt it important I learned) I hit the target seven out of ten times. Four of the shots were kill shots. My brother (20) and I put bows into my seven year old son's and ten year brother's hands and had them shoot. By the end of the day, they were hitting the target reliably at ten yards. I won't get into bullseyes with them, because a lot of their 'hits' didn't penetrate the target (due to their strength, and the practice points).

A target standing still, or moving towards you can be reliably hit by even people new at shooting. Though I understand the difficulty of hitting laterally moving targets. A year later, my son took a fat rabbit down at about nine yards as it fled. With a bow. Good soup.

So...there we are. I think cover should mean a lot more. Increased accuracy against open targets. Make it so characters won't fire at an enemy if a friendly is between them and the enemy. Tactical options would be nice too.

There could be tactical presets based on weapon for AI controlled pawns. . .

Cheers,
Michael

b0rsuk

Vagabond, what would adding ammo accomplish besides increasing micromanagement ? Look, people are up in arms against clothing deterioration. I imagine ammo would run out much faster than that.

As for cover, first of all I'd like to see any cover/field of view indication. Who benefits from cover, which targets are obscured for this character. Do sandbags surrounding a turret mess up its accuracy ? Do they shield it from fire ? Does a bush grant cover ? Less or more than a tree ?

Silvador

Quote from: b0rsuk on March 07, 2015, 05:04:48 AM
Vagabond, what would adding ammo accomplish besides increasing micromanagement ? Look, people are up in arms against clothing deterioration. I imagine ammo would run out much faster than that.

As for cover, first of all I'd like to see any cover/field of view indication. Who benefits from cover, which targets are obscured for this character. Do sandbags surrounding a turret mess up its accuracy ? Do they shield it from fire ? Does a bush grant cover ? Less or more than a tree ?

I agree with some of this. A readout of cover effects can be found, by selecting a drafted colonists with a gun and hovering the cursor over a target within the weapon's range, but the readout is obscure at best and doesn't clearly explain what is effecting what and who or how. Even the cover section on the wiki does little to alleviate the confusion. But, since this is still in early development, I'm sure it is on Tynan's list of things to improve.

Vagabond

Quote from: b0rsuk on March 07, 2015, 05:04:48 AM
Vagabond, what would adding ammo accomplish besides increasing micromanagement ? Look, people are up in arms against clothing deterioration. I imagine ammo would run out much faster than that.

Think I pretty clearly stated the benefits here:

QuoteYou would craft these, and they'd have large stacks. You could stock them in resupply caches near engagement zones. Enemies will have these same restrictions; if they come to your base to siege, they will bring extra ammo cans with them, it would take a certain amount of time for them to get more based on how far their base is. If they come to "raid", they leave when they all run out of ammo, but will resupply using your stock if they can safely path to it.

I'm not saying that it should be implemented. I was just throwing another idea into the pot for the purpose of adding to the topic. Besides, it's just more of what we already do. More crafting. More stocking. At least it offers concrete benefits, and it doesn't really have to be something that a colonist has to be there to make, at least not after more "advanced" methods are unlocked (for example: a machine with a hopper that once loaded, pops out ammo over of a certain type automatically.).

I don't know if it is just me, but I find it rather frustrating when the arguments against an idea boils down to "Won't work", "to much work", "it'll be a disaster!", or "This has been mentioned before". Don't get me wrong, I have no issue with someone disagreeing with mine or anyone elses idea, but what happened to constructive criticism?

"THIS is why I don't think the idea work"
"I don't know if that will work, but maybe this might work"
"What if you changed A to B, added C, and removed D?"

Like I said though, I'm not particularly attached to the idea, It was just written as something to contemplate, to perhaps jog other people's creativity. Not sure if it'd work or not on it's own, but It doesn't sound so bad if it were fleshed out in a balanced manner.

As for:

Quote from: b0rsuk on March 07, 2015, 05:04:48 AMAs for cover, first of all I'd like to see any cover/field of view indication. Who benefits from cover, which targets are obscured for this character. Do sandbags surrounding a turret mess up its accuracy ? Do they shield it from fire ? Does a bush grant cover ? Less or more than a tree ?

I could see like...firing 'cones' when you select a pawn or object that fires. The length and width of the cone would show you where and how far they could fire. They could interact with objects so that the cone's path will "break" when it hits a solid object. In the same situation of a combative unit/object being selected, any enemy units can have a specific highlight color.

Ie: a green to red spectrum in which the brighter the green, the easier they are to hit. Then you'd have yellows/oranges and then finally reds which would be the lowest chance of hitting.

These points from my last post are ones I do stand behind:
-Cover should make it incredibly hard to be hit; obviously influenced by how 'good' the cover is.
-Pawns should elect to fire at another enemy if there is an ally in the line of fire; or not shoot at all.
-Enemies moving towards a pawn should be easier to hit
-pawns moving laterally, in relation to an attacking enemy, should be harder to hit.
-Generally improving the accuracy of attacks against pawns not in cover.

Cheers,
Michael

b0rsuk

No, I mean beside extra micromanagement. You could say "additional time limit", but there are already limits in the form of pawn exhaustion and hunger.

Keymaster89

Quote from: Silvador on March 06, 2015, 12:08:56 PM
Quote from: b0rsuk on March 06, 2015, 08:38:25 AM
I think this is where Tynan Sylvester draws the line and will implement very little of it. Most people consider combat micromanagement fun. You're supposed to do everything manually. You have the pause button and as much time as you like. I think this would be solving the wrong problem, if there is a problem.

I agree. I think this is half the point of the pause and targeting commands on colonists. When you draft them, you take direct control. Tell them where to take cover and who to fire at. I, for one, would be very, very annoyed if this was removed from the game as I feel far more comfortable with this method. It gives me more control over the situation and when I fail I don't feel like it's just RNG giving me the finger.

Hey i didn't say that i want to remove the micromanageing of combat at all... i'm perfectly fine with what we already have...
I don't want to touch a thing about moving, cover, targeting either...
I just want to improve the dumb autotargeting system a little by making colonist (AND raiders) a little more smarter in their target selection...
This is not an autowin-movie-mode-draft-combat-button... micromanageing is and will be necessary even with the improvements that i suggest.
I'm sorry if you understand that i wanted to remove that aspect, i didn't mean that. Maybe use the scenario to start the topic was a bad choice to start the OP, but was only for help understand to what i want to improve...
I don't want to make the game easier, i want to make it more fluid, requiring less harsh micromanaging and pause in order to improve life quality, but not taking out the player responsability of a good fight.
I don't want a movie... but i don't want a final fantasy either...

Quote from: Darth Fool on March 06, 2015, 12:44:52 PM
Never the less, this would be an improvement in the raider's AI which would be welcome and make them a bit smarter and harder to trap with "stupid AI" exploits that take advantage of the current targeting system.
Quote from: b0rsuk on March 06, 2015, 01:10:56 PM
The OP pretty clearly complains about colonist AI, not raider AI. He's fine with 40 raiders acting as cannon fodder.

This improvement will improve both colonist AND raiders.
Raiders will choose positioning, covers and targeting by the pourpose of their weapons, using them (hopefully) more effectively.
Obviously if there are no cover behind them and you, they have no other choice beside run at you...
But if there is, they will choose the more effective one based on the effective range of their weapons.
Or they will try to focus more people at ones, distributing fire (and with that wounds and recover time) on all the colonists.
I'll also like if raiders will prioritize colonist instead of auto turrets if they can.
Maybe brawlers will attack powerlines if they pass over to can shut down turrets, that will be cool. They definetly need some way to break easily trough that monster killboxes... they should start use EMPs too...

Quote from: Mckee on March 06, 2015, 01:12:06 PM
Most our colonists aren't soldiers - I don't think they need to pick seperate targets or coordinate fire in a complex manner. For a sim/base building game, rimworld already has a fairly well done tactical combat side, with cover and all those other complex mechanics involved. I'm not sure, but a load of AI routines might slow that down. I'm quite happy with the defensive AI of colonists - they don't move, they find a target, and shoot. Given they're mostly sat behind cover engaging large mobs of enemies, it's totally sufficient. Snipers and the like, that maybe need a bit more thought in their aiming, can easily be managed by the player.

I think at Rimworld as a survival/sim game. Not a building one. The juice of this game is the event system that try to put on knees your colony.
Battles with raiders should be the most spettacular thing in the game... The improvements i thought are aimed to help the player enjoy battles, more like correcting colonist and issuing them direct orders, rather that act as a ant queen that tell every one what to do.
Also, this autoselection, occur only when a new target must be selected, so will not impact that much the game speed.
In the end, i want to make you notice that battles don't always occur behind your lines of turrets.
The games trow at you seigers and mind braking ships that in mid game must be taken care of sooner rather then later.