Jump to content

We need more competent AI for singleplayer (and multiplayer)


Recommended Posts

Posted (edited)

Hello,

 

As of now I see many issues with the tank AI, in order of importance:

 

- The AI is more interested in following its predetermined path than to engage in battle. Tanks should at least stop when being shot at, or when they see a vehicule. I think that this is the most important issue with the AI at the moment. 

- They often can't see an enemy tank right next to them, even sometimes bumping straight into said tank. We are not talking at a hidden tank that would flank them or something. These AI tanks are driving in an open field, litterally toward enemy tanks at a distance of 20m , without engaging them.

- They can only follow a predetermined path, so they cannot chase the player or hunt for the player. Mostly because there is no path finding.

- They resist damage more than a player controlled tank (nothing to do with AI though).

- They never let their commander out (that's how you know they're an AI).

- They can see through trees, which is not a big problem if the other problems are addressed.

 

Now I propose how we could very easily implement pathfinding.

Let mission creators place pathing nodes on the map (blue dots):

 

ray1.thumb.png.d12f3a96d2462ad863c18c3d05077407.png

 

 

Like in the game half life 1, the program will then automatically casts rays (either when the map is saved or at the beginning, or periodically), to determine which nodes are connected to eachother (in this case without being blocked by buildings).

Then this creates a graph that the AI can use to go from point A to point B , using a basic A* pathfinding algorithm.

Some vehicules ar smaller than the others, so for each nodes, multiple rays will be casts to test different veicule radius, so each edge in the graph will have a maximum vehicule raidus associated to it.

 

ray2.thumb.png.3091dd389b474f3f19bffa4bd94dab44.png

 

Map makers will be able to define polygonal areas (or rectangles, or lines, or just squares), where the AI cannot pass, to prevent it from going into a river or a slope, or a forest.

 

Pathfinding would allow map makers to have much less complicated setups for AI pathing. Because the AI will decide how to get from point A to point B, based on certain constraints (not bumping into buildings, falling into rivers, going into forest). The graph could be updated periodically to reflect building destruction or vehicules blocking the path. The graph would be limited to a small area of the map hand picked by the map maker, so no performance concern. The AI will be able to react to where the player is rather than chasing a predetermined circuit. I'm guessing the reason the AI doesn't stop when being shot at is that if it doesn't follow its path to the second, it might be too late to be where it needed to be because it can't dynamically adjust to the battle's position.

Edited by ickylevel
  • Upvote 2
Posted

if at least all the roads would be actual roads (most of them are just textures), I think we could already do some custom random pathfinding code before the mission begins. 
@coconut seem to have done something from the roadssystem.ini and roads.ini or railroads.ini in this: https://github.com/deneuxj/SturmovikCampaign
I guess it is possible to extract the positions of all the road segments. We could then generate some random path using some script  outside the mission editor...

  • Upvote 1

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
×
×
  • Create New...