Home » SIRTECH CLASSICS » Jagged Alliance: Unfinished Business » Vanilla Modding » JA2 AI main faults
| JA2 AI main faults[message #101149]
|
Mon, 12 April 2004 22:19
|
|
Yukinio |
 |
Messages:11
Registered:April 2004 Location: Helsinki, Finland |
|
|
What does everyone think of JA2 AI? Which are its main faults? If we make a list here it will be easier to look for the cause of these faults in the code.
The AI code is the most interesting part of JA2 IMHO.It is a bit difficult to make moddable since it is quite elaborate and the AI has many rules to its behaviour. Still it can be done at least partly, because in the end the rules come down to simple integer values.
Report message to a moderator
|
Private
|
|
|
|
| Re: JA2 AI main faults[message #101150]
|
Tue, 13 April 2004 03:13 
|
|
xcorps |
 |
Messages:11
Registered:April 2004 |
|
|
The AI needs better organization in order to operate effectively.
The key concept in a tactical situation is teamwork. The AI does not have this.
If the AI were organized into small fire teams of 4-5, and the troops in a team where tied to one another by a flexible distance, and each team was tied to the next by a flexible distance, or assigned an operational objective to defend/attack, I believe you could do some pretty cool stuff. Setting formations, flanking manuevers, economy of force manuevers, hasty ambushes, frag fests, all manner of stuff.
IMHO, the organization is the key. Each soldier in the sector has a place in a heirarchy, and the units move according to their leaders.
For instance, a single squad sector with 12 guys could be organized into 3 teams of 4. Team 1 Leader 1 would be the controlling soldier. Everyone in his team would remain within a few squares, say 6-9, but always within visual contact. So, Team 1, looks like 1-L, 1-2, 1-3, 1-4. 1-L would be pretty much centered, with the rest of the team to his left and right. Team two might be to the right of team 1, and the guys at the end of the teams would have visual with each other, same with team 3 on the right. Since Team 1 is the Lead team, the decisions on where to move are made by 1L. 2L and 3L move their teams according to his desired path, staggering their movement so that only 1 team at a time is in motion.
For variety, the teams could be operationally independent of one another.
Another flaw in the AI is it's lack of purpose. All it can do is wait for a player to show up, move in response to noise, or wander aimlessly.
By give operational objectives to the AI, for instance, defend the hospital, a list of possible plans can be looked at and decided upon. A decision to defend the interior area, the doors only, aggressively patrol the exterior, or a mixture of these all focused at controlling a specific area of terrain would make the AI seem smarter. The ability to change location objectives while in combat, and have the teams respond accordingly would also make it more challenging.
I don't know if this is very clear, as I've not really organized my thoughts very well, but taking the AI out of the soldiers and putting it into TEAMs using sound tactical methodology to accomplish specific objectives is my point.
Report message to a moderator
|
Private
|
|
|
|
|
|
| Re: JA2 AI main faults[message #101152]
|
Tue, 13 April 2004 08:11 
|
|
Yukinio |
 |
Messages:11
Registered:April 2004 Location: Helsinki, Finland |
|
|
Well, there are some self-preservation mechnisms implemented. Mechanisms like: run away, go to cover, get out from the gas and so on. Also there are certainly different kinds of tactics for the AI like defensive, aggresive and such. They also can find friends so in a sense the AI is slightly aware of the other guys in its team.
Also there are neat things like spotting for long range weapons and stuff.
There are plenty of strange things in the code though. For example take a look at this part:
////////////////////////////////////////////////////////////////////////////
// WHEN LEFT IN GAS, WEAR GAS MASK IF AVAILABLE AND NOT WORN
////////////////////////////////////////////////////////////////////////////
if ( !bInGas && (gWorldSectorX == TIXA_SECTOR_X && gWorldSectorY == TIXA_SECTOR_Y) )
{
// only chance if we happen to be caught with our gas mask off
if ( PreRandom( 10 ) == 0 && WearGasMaskIfAvailable( pSoldier ) )
{
// reevaluate
bInGas = InGasOrSmoke( pSoldier, pSoldier->sGridNo );
}
}
Now this thing applies only when we are in TIXA?!?
So the AI can only use Gas masks in Tixa. I suggest that we remove that Tixa limitation and see what happens.
Anyways, I think the AI code can be worked on once we know the rules. The best thing is that the most boring stuff of AI programming is of course already implemented. And by that I mean stuff like stayin inside borders, watching out for doors and objects and such.
Report message to a moderator
|
Private
|
|
|
|
|
|
| Re: JA2 AI main faults[message #101154]
|
Tue, 13 April 2004 16:46 
|
|
Denwad |
Messages:3
Registered:April 2002 |
|
|
maybe different types of enemy troops could be encountered. Like gas troops, shock troops, security forces.
Report message to a moderator
|
Civilian
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: JA2 AI main faults[message #101161]
|
Tue, 13 April 2004 23:39 
|
|
Kurt |
 |
Messages:423
Registered:March 2004 |
|
|
The big classics have been mentioned (lemming mentality, purposeless (and often counterproductive) actions), for both the enemy and the militia.
There is still something I'd like to see improved: Replace the AI's cheating by some more serious tactics. Specifically:
1.- Right now, if you spot an enemy, the enemy spots you (almost every time). It's very obvious in UC when using the monocular: The enemy shouldn't be aware you're seeing him, since you're still out of "visual range", but some supernatural power makes him turn/take cover. There is no such thing like observing an unsuspecting enemy.
2.- The ever-irritating "single-handed sniper gun": Enemies will shoot (and hit) with their pistols at ranges where your rifles are failing. Make the AI respect weapon ranges and specificities; Right now a pistol is nearly as dangerous as an assault rifle in the AI's hands (low AP makes up for burst fire). Enemies armed with pistols should adopt defensive stances (=try to ambush you). You won't go assaulting troops with your saturday night special...
3.- Make them suffer more from blast or bullets. Right now they don't seem to "feel" anything untill they're down to "critical". And having a mortar shell/grenade explode near them just makes them fall down; The next turn they're standing again, alive and kicking. They should suffer some shock, otherwise it defeats the very purpose of explosive strikes. (BTW, make grenades and mortar shells deadlier, too)
Snap,
I don't agree with your justification for their lemming-like behaviour. How do we increase difficulty and player stress without having to build an elaborate AI (a very difficult task, I agree)? By having countless waves of mindless zombies crashing against his meagre defenses...
No, IMHO it would be much more rewarding to face an enemy who requires a little more than better interrupts and a big rate of fire. Someone who would keep you on alert because you never know what he will do next.
Right now the battle is just: Mop up the initial enemy rush, then spend an hour searching everywhere to find the last 2-3 enemies who're hiding. Every time. The only thing which changes is the scenery and the enemies' equipment.
What about an enemy who faints to retreat, so he can lure you into a trap? What about an enemy who entrenches himself and just keeps waiting? What about enemies only trying to defend a specific building/person, or to delay you so some important person can flee the battlefield? What about enemies fleeing, only to regroup later (or not)?
Report message to a moderator
|
Master Sergeant
|
|
|
|
| Re: JA2 AI main faults[message #101162]
|
Wed, 14 April 2004 03:34 
|
|
KIA |
 |
Messages:92
Registered:November 2002 Location: Virginia (USA) |
|
|
Well, I read a game designer who said something to the effect of "It's easy to create AI which will kill the player every time. It's much harder to create AI which operates with some errors so the player has a chance of winning." So, yes, it would be possible to create enemies who are set at specified locations with big guns who are camoflauged and on "defensive" so they can ambush your mercs and chop them into bits. It requires scripting (like Baldur's Gate, Neverwinter Nights etc.) to make them do more complicated actions. So are we talking about implementing (or standardizing) a scripting language for the enemy or are we talking about upgrading AI for individual enemies? If that's the case, there ought to be an enemy review process along the following lines:
Enemy checks range to mercs
Enemy checks his weaponrange / percenttohit
Enemy checks for other enemies in vicinity / status and weighs same(i.e. critical or fleeing is not worth as much as strong or excellent)
Enemy calculates possible net effectiveness of Enemy attack
Enemy checks for number of mercs in sight
Enemy checks for visible armament of mercs
Enemy checks merc weaponrange / percenttohit
Enemy calculates net effectiveness of Merc attack
Enemy decides whether he can win a firefight with the visible mercs
If nowin situation, Enemy flees to safety and calls for help
If possible win, Enemy checks for cover he can use and moves to cover to improve odds
If probable win or no cover nearby Enemy opens fire
It seems to me it would be difficult to implement "collective action" in squad format for enemies unless they have a way of communicating to each other. So what you need to implement is a set of universal commands, i.e. "Rally Here" "Attack There" "Regroup over there" Question: who can make that decision? Well it needs to be made collectively based upon overall strength and position of forces (and last known positions, too). So the macro command would need to be calculated each round in a fluid fashion - but this isn't terribly realistic unless the enemy all have headsets. One alternative is to develop "characteristics" for enemies, i.e. "Leader" "Dumb Grunt" "Smart Grunt" "Coward" etc. Depending on their basic characteristic, the individual enemies could be more or less responsive to macro directions from a leader-type and more or less prone to seek cover. This also has the potential to make far more interesting patrol encounters. A patrol of "Smarts" with a couple of leaders could be very bad news as they coordinate an effective attack. A patrol of cowards without a leader would be much more prone to flee or hide individually without effective group support. Finally, picking off leader types will have a tactical effect as the enemy gets less and less effective.
One last thing. I agree that waves of enemies won't improve gameplay. But having large sectors where - get this - enemies aren't all alerted every time a pin drops, would allow some stealth missions from necessity. A six-man squad really can't hope to take out a 100-enemy stronghold. But they could, if they were careful and using silent weapons, break into the commander's office and steal some documents... So we must implement better enemy alert status. There should be multiple stages of alert, with different detection radii which drop over specific amounts of time.
Report message to a moderator
|
Corporal 1st Class
|
|
|
|
| Re: JA2 AI main faults[message #101163]
|
Wed, 14 April 2004 05:26 
|
|
Kurt |
 |
Messages:423
Registered:March 2004 |
|
|
Sure. The purpose isn't to kill the player every time. (besides I hate being killed)
My idea is rather to make the enemy react in a semi-realistic way, doing things a human army would do in his situation, like trying to survive, get frightened, retreat, get carried away to make an assault because of an (faked?) opportunity, change his mind and dive for cover if the player offers too much resistance, and so on.
I'd love seeing enemies getting more and more cautious as the player conquers more and more terrain, to a point of refusing contact. I'd like to see flanking manoeuvers, enemies regrouping and trying to put up a defense at strategic points, wounded men fleeing combat or even surrendering, and so on. BTW, implement POW management, and if the player is too successful, he will quickly get swamped. He'll have to spend part of his precious mercs to escort the POWs to some camp on the other side of the map (under militia control). Of course you can't just shoot them, that's a crime of war...
The problem with the actual "mindless" AI is there are only two types of behaviour: Selfless, suicidal rush, or staying on one spot, no matter what happens, waiting for the player to come and get him (because he will, he always does)...
BTW, you can make squads work as such by giving the whole squad an unique AI, but different individual tasks. Something like the infantery in Blitzkrieg, if you know this game.
An idea: To make the game more stressful, you can (easily) implement civil suicide bombers; But if you do it, give the player a means to issue orders to civils, and to search them (so he won't shoot every civil who approaches him too much).
Edited - I forgot one point.
Scripting isn't good for replayability. You're amazed the first time, but after that you know exactly what will happens if you step on that precise pixel, so you can prepare yourself, or even try to avoid it. Not to mention that scripting the defense is nearly impossible in JA, since you never know where the player will come from. Implementing a less-amazing-but-adaptative AI would be much more interesting.
Report message to a moderator
|
Master Sergeant
|
|
|
|
|
|
|
|
| Re: JA2 AI main faults[message #101166]
|
Thu, 15 April 2004 00:03 
|
|
Kurt |
 |
Messages:423
Registered:March 2004 |
|
|
Quote:Originally posted by Tyco:
Kurt, lets stay away from the whole suicide bombers thing, okay? Okay, seeing where you're from, I understand. Sorry.
As I already answered to your other post ("Motivation...") on the same subject, you're right about Arulco, but nothing says the new game will take place in Arulco. Arulco has just been one of three JA settings so far (Metavira, Arulco, Tracona), and nothing prevents the new JA from using yet another setting.
xcorps,
don't get yourself into problems: Armies usually hate to see those documents spreading. IMHO it isn't worth it, we don't need *that* degree of realism. If the AI understands that a living grunt is more dangerous than a dead hero, we've already achieved a big improvement.
Report message to a moderator
|
Master Sergeant
|
|
|
|
|
|
|
|
|
|
|
|
| Re: JA2 AI main faults[message #101171]
|
Thu, 15 April 2004 05:42 
|
|
Snap |
 |
Messages:285
Registered:September 2000 Location: USA (by way of the Old Wo... |
|
|
@Yukinio: I knew that, but what I would prefer to see is that (a) goggles are incompatible with gas mask, both for the player or for the AI, and (b) grunts have a chance to get both mask and goggles. If the unit has both, it should check for the lighting conditions and decide what to wear. But if it finds itself in a gas cloud, then it should put on the mask regardless.
In JA2 goggles were incompatible with gas mask only as far as the player was concerned, but elites "cheated" and wore both at the same time. In UB they removed the restriction from the player, but I think it is actually better the way it was - adds some tactical complexity. Otherwise you just always wear both mask and goggles, as long as you have them, and you don't even have to think about it.
Report message to a moderator
|
Master Sergeant
|
|
|
|
| Re: JA2 AI main faults[message #101172]
|
Thu, 15 April 2004 06:11 
|
|
Snap |
 |
Messages:285
Registered:September 2000 Location: USA (by way of the Old Wo... |
|
|
Quote:Originally posted by KIA:
Well, I read a game designer who said something to the effect of "It's easy to create AI which will kill the player every time. It's much harder to create AI which operates with some errors so the player has a chance of winning." I don't think this was said about JA2. In a shooter, you could easily make AI that sees everything, reacts instantly, and never, ever misses, even when shooting a moving target - that would be hard to beat, indeed. So by "errors" I believe he meant things like built-in inaccuracy of shooting. In JA2 this is already implemented - contrary to what Kurt thinks, AI doesn't "cheat". It has stats that work the same way as the merc stats (unless there are bugs in the code, but that's a separate issue). Making the AI smarter tactically, rather than simply overpowered or cheaty, is not at all easy.
Report message to a moderator
|
Master Sergeant
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: JA2 AI main faults[message #101179]
|
Sun, 18 April 2004 02:51 
|
|
Tyco |
 |
Messages:188
Registered:September 2001 Location: Be'er Sheva, Israel |
|
|
So instead of having them hide till doomsday behind a rock, have them run to the nearest map limit so they can escape the sector. In all my JA2 games, I think this happend only once. When a patrol or garrison looses a certain precentage of its force (between 80 and 90 minimum), the enemy may choose to withdraw, depending on the individual enemy personality (aggresive, defensive, brave solo, etc.). Patrols should be more prone to retreat then a garrison, but slowly degrade (that is, the looses precentage increases) as the game progresses because of fear of retaliation from the queen.
Report message to a moderator
|
Staff Sergeant
|
|
|
|
| Re: JA2 AI main faults[message #101180]
|
Sun, 18 April 2004 13:22
|
|
chanman |
 |
Messages:47
Registered:August 2001 Location: Delta, BC, Canada |
|
|
in the UC SAM site, and in the original JA2, I always thought the rooftop snipers were the deadliest challenges.
Really, if the redshirts in UC are all armed with SMG's pistols, and shotguns, then maybe they shouldn't be running into the open, but hang back in the ample buildings
The reverse goes for blackshirts with rifles hiding in buildings, of course
Report message to a moderator
|
Corporal
|
|
|
|
Goto Forum:
Current Time: Wed Jun 17 17:16:15 GMT+3 2026
Total time taken to generate the page: 3.60184 seconds
|