Jump to content

Official AI Testing Suggestion Thread


Recommended Posts

Hi guys - I'm still only working part time (although I'm getting more work done than I anticipated) but I thought I'd post up this thread so the community have some time to post their thoughts before we start work on the AI.

AI Testing Theory:
Getting the AI working properly is a very difficult task because it's tricky to code and even more tricky to test. When the AI does something "dumb" in a mission, it's difficult to know if that represents a bug in the AI code, an incorrect AI value on that AI combatant, or the AI working properly but the overall design of the AI being incorrect.

For instance: it makes sense for an alien shooting through a doorway to close the door at the end of their turn, because that protects the alien from human return fire. If that doesn't happen, it might be because the AI doesn't understand that it can close doors, or it might be because that specific alien is marked as being unable to use doors (e.g. an Andron) or having very low self-preservation, or it might be because the AI incorrectly thinks maintaining good sight lines for the alien is more important than preventing the human player from being able to attack the alien. All of those things are problems, but they require entirely different fixes.

As these situations are difficult to understand when they occur mid-mission, we're planning to set up a large number of AI test scenes. Each of these scenes contains one or more aliens set up in a particular situation to check that the AI does the correct thing in that situation. This should hopefully expose most of the AI bugs, making the AI much more competent than it currently is and giving us a good foundation for experimenting with more advanced squad behaviours.

How you can help:
What I want from the community is suggestions for what these scenarios should be. These should be relatively simple scenarios with a clearly "correct" outcome, and I'd like you to explain what outcome you are looking for. Here's a few examples:

  • An alien and a Xenonaut are placed near each other, and the alien has a weapon that can fire two shots at 50% accuracy or one shot at 75% accuracy for the same TU cost. The alien should attempt the two 50% accuracy shots, as this has a higher overall chance of hitting the Xenonaut.
  • An alien moving between two waypoints opens a door and sees a Xenonaut soldier. The alien should immediately stop moving and attack the Xenonaut.
  • An alien starts with an unloaded weapon and an ammo clip, and a Xenonaut in shooting range. The alien should reload the weapon and attack the Xenonaut.

Basically, we want as many situations as possible that test whether the AI properly understands the rules of the game and knows how to use its equipment - any bugs in that sort of thing could cause the AI to do stupid immersion-breaking things.

Advanced Scenarios:
Not every alien will act exactly the same. Some aliens may be more intelligent than others, and others may favour aggressiveness over self preservation. Once we have the basic scenarios working, it'd be interesting to experiment with other behaviours that can be tied to specific scores on an alien. Feel free to make suggestions about these too, for example:

  • Self Preservation: an alien with low self-preservation is more likely to spend its TU shooting at visible enemies, rather than moving into cover.
  •  Self Preservation: an alien with low self-preservation would be willing to throw a grenade even if it would be caught in the blast area, whereas an alien with high self-preservation would not.
  • Intelligence: an alien with high intelligence would prioritise attacking a Xenonaut soldier over a civilian, even if they have more chance of successfully hitting the civilian.
  • Intelligence: an alien with high intelligence would prioritise attacking the Xenonaut they have more chance of killing (taking armour and current HP into account), even if they have a higher chance of hitting a different Xenonaut with a non-killing shot.

However, all of these situations are a sliding scale rather than absolutes. Even the most cowardly alien might spend all their TU shooting if the nearest cover was a long way away and there's a lot of easy shots against nearby enemies, and even the most intelligent alien would not attempt a killshot against an enemy if it had a 10% hit chance when there was a 80% chance of hitting another enemy.

The purpose of these scenarios is just to identify behaviours that we want to have in the game and then test them in isolation so we know they affect the AI decision-making without causing it to do things that look totally crazy.

Looking forward to hearing your suggestions!

Link to comment
Share on other sites

So, something like this?

Scenario: Find the best path for alien with a range 1 (e.g. close combat) weapon to approach a target.

Rationale: If an alien has a range 1 weapon, it must be next to a target to use that weapon and have enough AP to use the weapon. Therefore, an alien must find the best path to approach a target which maximises the chance to use the range 1 weapon. If an alien is not seen, it cannot be shot at. Not being shot at is better than being shot at, so the best path an alien can take is a path where it cannot be seen by the target. If an alien cannot take a path where it cannot be seen, then if it does not have the AP to move directly to the target and use the weapon in the same turn, it should move as close as posible to the target while being able to hide behind cover, as hiding behind cover is better than being in the open. Take the following worked example:

 

AICloseCombatMovement.png

 

Assume the target (red square) cannot move. To the left is a wall (black line) which blocks line of sight. To the right is a large object (blue square) which does not block line of sight but counts as cover. The alien (yellow square) does not have enough AP to move next to the target and use the weapon in the same turn.

 

If the alien moves directly towards the target: FAIL. The alien has picked the worst path and will be shot at next turn.

If the alien moves behind the large object (blue square): PASS. The alien has not picked the best path, as it stil can be seen, but has a chance to be protected.

If the alien moves around the wall: A+. The alien has picked the best path to move towards the target, as it now cannot be seen by the target. 

Note this is very simple:  it doesn't take into account such things as using the strategy of double-backing, however it emphasises the use of cover, and the importance of not being seen. 

Link to comment
Share on other sites

Let Aliens make an defense Post with Cover (like they do in the UFOs) and let them shoot at medium range. They try to get back to an other new Defense Post with Cover. Not only 1 there are 3 or 4 in Action.

Let 4 Aliens make Patrols and let them work togehter as a team. They use cover and fast Fire for the Comrades which get nearer to the Enemy

All above examples are only with 1 Alien. But they don´t work alone, they are an UFO-, Terror-, Base-, or Raid-Team atm. More is comming. And not only the Aliens are meant with that AI-Upgrade-Testing from Chris, there are the not announced special Missions too.

(Edit: I've shortened this post just down to your ideas to keep the thread readable! - Chris)

Link to comment
Share on other sites

On 4/19/2021 at 4:31 AM, Max_Caine said:

So, something like this?

Scenario: Find the best path for alien with a range 1 (e.g. close combat) weapon to approach a target.

Rationale: If an alien has a range 1 weapon, it must be next to a target to use that weapon and have enough AP to use the weapon. Therefore, an alien must find the best path to approach a target which maximises the chance to use the range 1 weapon. If an alien is not seen, it cannot be shot at. Not being shot at is better than being shot at, so the best path an alien can take is a path where it cannot be seen by the target. If an alien cannot take a path where it cannot be seen, then if it does not have the AP to move directly to the target and use the weapon in the same turn, it should move as close as posible to the target while being able to hide behind cover, as hiding behind cover is better than being in the open. Take the following worked example:

 

AICloseCombatMovement.png

Assume the target (red square) cannot move. To the left is a wall (black line) which blocks line of sight. To the right is a large object (blue square) which does not block line of sight but counts as cover. The alien (yellow square) does not have enough AP to move next to the target and use the weapon in the same turn.

If the alien moves directly towards the target: FAIL. The alien has picked the worst path and will be shot at next turn.

If the alien moves behind the large object (blue square): PASS. The alien has not picked the best path, as it stil can be seen, but has a chance to be protected.

If the alien moves around the wall: A+. The alien has picked the best path to move towards the target, as it now cannot be seen by the target. 

Note this is very simple:  it doesn't take into account such things as using the strategy of double-backing, however it emphasises the use of cover, and the importance of not being seen. 

Yeah, this is indeed the sort of thing I'm talking about. I don't think there's necessarily one correct answer in this setup (it depends on the aggressiveness of the alien in question) but it's still a useful scenario and would expose any weird behaviour.

You might find, for example, that the alien running behind the wall on the A+ route forgets where the red square target is the following turn (because it can no longer see it) and returns to its previous patrol behaviour - which is exactly the sort of thing that would be easy to identify in these tests, but much harder in standard gameplay.

Link to comment
Share on other sites

  • 1 month later...

According to Alenkiller, the aliens should not act individually, but be one team. Even if each alien chooses the most effective solution from his point of view, it will not be effective enough from the point of view of the team. 

Let's say we have a very smart AI.
Here are some examples:
1-2 Each unit act separately like diffenets AI in some order.
1. In the wrong order (as now, rappers go first)
2. In the correct order (andron sirst)
3. AI manages the entire team, not each unit individually

Test.jpg

Edited by MrAlex
Link to comment
Share on other sites

There are many possible examples, but they all lead to a few basic rules:

- AI look for the unit that currently has the most advantageous position to attack.

- AI should not use units in wrong order.

- AI should not always spend all TU by each unit

- AI should avoid an attack from the front (try escape reaction fire), if possible.

- AI try to create alternative pathways for movement (eg for androns)

 

Example 1 shows how AI works now that the player predicted (the direction of his soldiers).
Example 2 shows that it is enough to create the correct order of the aliens moving and this will greatly complicate the battle for the player.
Example 3 is very difficult to implement, but it will be the most effective (this is how a living person would act).

Edited by MrAlex
Link to comment
Share on other sites

On 6/3/2021 at 7:28 AM, MrAlex said:

According to Alenkiller, the aliens should not act individually, but be one team. Even if each alien chooses the most effective solution from his point of view, it will not be effective enough from the point of view of the team. 

Let's say we have a very smart AI.
Here are some examples:
1-2 Each unit act separately like diffenets AI in some order.
1. In the wrong order (as now, rappers go first)
2. In the correct order (andron sirst)
3. AI manages the entire team, not each unit individually

Test.jpg

I definitely agree with alienkiller and mralex here, the aliens should act as a team to feel like a more sophisticated threat. If the aliens know generally where the xenonauts are, then they should start trying to head over there as a group, making pathways like in example 2 wherever they go. 

I've watched several of silencer's videos (they are beta 17 btw) and most of the aliens are acting on their own accord instead of acting together as a team. Each alien seems to attempt to attack the target that they think is best for them, but they would find more success if they all attacked a single target. 

My senario would be a couple aliens are in a standoff with 2 or 3 xenonauts, and every combatant is under cover and has full hp. One alien sits in the corner while the other alien should be placed on the opposite side of the map. The first xenonaut should be completely open to the first alien but should be under high cover so the other alien has a really low chance of hitting him. Another xenonaut should sit right in the middle of the map but is behind cover to both aliens. The aliens would pass the test with flying colors if both aliens attacked the xenonaut in the middle. They would pass the test if they both attacked the first xenonauts even though one of the aliens had an extremely low chance of hitting him. They would completely fail if they attacked separate targets or did not attack at all. 

The visual was hastily made so it is not the most pretty visual, but ti should help to get my point across. 

 

Xenonauts 2 AI testing Scetch .png

Link to comment
Share on other sites

  • 10 months later...

I just watched a gameplay video of the latest version and the AI made so unbelievably stupid moves I just had to come here and ask, what's happening here: (@16:57 forward) 

Youtube video

 

The Andron south of the Chinook and two Sebillians north of it, all make completely mindless moves on their turn and failed to shoot even a single shot where the situation should have ended in at least one or two Xenonaut casaulties . @Chris @Gijs-Jan 

Edited by Skitso
Link to comment
Share on other sites

I have been following along this thread and have read many interesting ideas. The thing to remember is that the mission always determines the posture. As I see it during ground combat the AI has two types of missions (offensive and defensive ). Then the Commanders intent, terrain, troops, equipment and time are going to drive the tactics used  

Example: AIs Defensive posture mission : Defend vital tech in a downed UFO until recovery ship arrives.

              AIs tactics : Use covering terrain around downed UFO to offer best defensive odds. Make the Xenonauts  move to contact. Ambush from cover. Only move to fall back while maintaining perimeter.  Short range weapons used inside the UFO.

Example: AIs Offensive posture missions : Terror or Abduction missions.

              AIs tactics : Use highest rate of fire along with best ranged weapons to support the assault  All others close with and kill (assault fire) or capture the enemy Little attention is paid to terrain. This may sound stupid but its about shock and awe. 

I guess there is a third type mission : Base defense. Being that this is the alien's turf I think the way the AI is now set works reasonably well.  

Any trained military should perform per it's current mission posture. The problem that arises in a game is it becomes predictable and then redundant. So my question is -  Is what we have now though maybe not tactically correct, the most enjoyable (because of unpredictability) way to go?

 I am not sure if any of this applies, makes any sense from a game play point of view or is even possible from the coders side. But speaking as a 30 year combat vet "sometimes its the makes no sense actions ( if it works that's how hero's are born) that work the best. 

This game has come a long way and I'm sure whatever is decided it will only enhance what is an already good game

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...