Jump to content
Chris

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!

Share this post


Link to post
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. 

Share this post


Link to post
Share on other sites

If we want to talk about AI programming in general, should we take that to another thread ?

Share this post


Link to post
Share on other sites
47 minutes ago, Charon said:

If we want to talk about AI programming in general, should we take that to another thread ?

Probably best as that can be a lengthy discussion :)

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

Ladies and gentlebeings. I have opened up a thread where people can discuss AI in general. I shall draw a line now under the previous discussion and ask that people only discuss or submit what Chris would like discussed and submitted, i.e. A.I. test scenarios. 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×