UNDER CONSTRUCTION! How to make AI path marker.

Moderator: Uveso

UNDER CONSTRUCTION! How to make AI path marker.

Postby Uveso » 20 Aug 2018, 18:46

This post is under construction!
This can take several weeks month!

1. Why we need AI path markers ?
2. How does the AI use markers ?
3. How do we create markers ?
4. Where are the differences between AI's using those markers ?


1. Why we need AI path markers ?

First of all we need them for faster sim speed.
For every movement the AI need to know if the unit/platoon can reach it's destination, and we have two ways to get this information:

The first and only way for maps without markers is the c-engine command "unit:CanPathTo(Destination)".
If we call this from LUA, the c-engine is reading every map pixel from the unit position to it's destination to see if the way is pathable for the unit.
Those map scanns are consuming a huge amount of simspeed.

The second way is with makers.
If the map has 400 markers, we need to check about 600 path combinations to get a way across the whole map.
So markers are basically a precalculated map of "CanPathTo(Destination)". That's why they are so fast.


We also need markers to lead the way of our AI units.
Units will always move the direct way between each marker like on railways.
So we can lead units around hills to prevent disarranged formations or stucked units and uneven terrain for faster movement.

Last but not lest we can use markers to handle tough maps like "Seton's clutch" with 2 lakes/oceans,
or maps with high plateaus that are only reachable with air units/transporters.


Without markers the ACU/unit will move straight to the target:
Image

If we have an enemy between us and the target, then we will move directly into the enemy:
Image

With AI markers we can avoid the enemy, if we avoid markers with high threat (white numbers):
Image

But markers are not only used for avoiding the enemy, they are also good for flank attacks.
Without markers the AI can only send it's units on the shortest way to the enemy.


2. How does the AI use markers ?


As example a map part with good and bad markers:
Image


Here we have an ACU and an enemy on a higher plateau:

1.In the first pathing step we search for the closest marker near the enemy. (Marker 1)
2.The second step is finding a path way from the ACU to the enemy. (blue arrows)
3.Then we move the path, heading from marker to marker.
4.Last step after reaching "Marker1" is the attack move to the enemy.
Image


Same situation with bad placed markers:

1.The first step is again finding the closest marker to the enemy. (Marker 1)
2.The second step is finding a way from the ACU to Maker1.
3.Step 3, moving the path makes no sense here, because the start and end marker is the same (Marker1)
4.So we start with step 4 and start an attack move to the enemy.

Moving from Marker1 to the enemy will use the pathing from the c-engine (blue arrows)
And this should not happen with AI markers.
Image
If we need the help of the c-engine to avoid hills etc then we need more markers^^.


3. How do we create markers ?
User avatar
Uveso
Supreme Commander
 
Posts: 1600
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 60 times
Been liked: 253 times
FAF User Name: Uveso

Re: UNDER CONSTRUCTION! How to make AI path marker.

Postby Georodin » 13 Oct 2018, 19:15

What software do you use to edit and display the markers like this?
Is it already provided with the FAF Map Editor?
And how can I link path nodes like this?
Georodin
 
Posts: 4
Joined: 13 Oct 2018, 16:37
Has liked: 2 times
Been liked: 0 time
FAF User Name: Georodin

Re: UNDER CONSTRUCTION! How to make AI path marker.

Postby Uveso » 14 Oct 2018, 03:31

I am using Ozonex's Map editor:
http://forums.faforever.com/viewtopic.php?f=45&t=10647

Linking 2 path markers is simple. Select both markers and press the key "c".
To disconnect both markers you only need to press "d".

Here is a link to Ozonex's Map editor Wiki:
https://wiki.faforever.com/index.php?title=FA_Forever_Map_Editor#AI
User avatar
Uveso
Supreme Commander
 
Posts: 1600
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 60 times
Been liked: 253 times
FAF User Name: Uveso


Return to AI modifications

Who is online

Users browsing this forum: No registered users and 1 guest