Forged Alliance Forever Forged Alliance Forever Forums 2018-03-13T06:52:52+02:00 /feed.php?f=53&t=15976 2018-03-13T06:52:52+02:00 2018-03-13T06:52:52+02:00 /viewtopic.php?t=15976&p=161729#p161729 <![CDATA[Re: The AI will find you! (pathfinding video)]]>
I recorded a test game with 2 lakes adressing the "Seton's Clutch" problem.
(naval units try to move over land to reach targets inside the opposite water area)

TKPlakepaths.png

Klick here for the video: (13 min)
https://youtu.be/djeGaH_7x0w

[Edit] The video does not show the original markers from the map. I modified some for testing.

Statistics: Posted by Uveso — 13 Mar 2018, 06:52


]]>
2018-03-07T01:47:30+02:00 2018-03-07T01:47:30+02:00 /viewtopic.php?t=15976&p=161543#p161543 <![CDATA[Re: The AI will find you! (pathfinding video)]]>
Sprouto wrote:
Uveso likely knows this already

Hhhmmm. nope :mrgreen:

Thank's for the Tip :D

Statistics: Posted by Uveso — 07 Mar 2018, 01:47


]]>
2018-03-06T23:52:45+02:00 2018-03-06T23:52:45+02:00 /viewtopic.php?t=15976&p=161540#p161540 <![CDATA[Re: The AI will find you! (pathfinding video)]]>
As a suggestion - for air markers - you can use a very standard 16 x 16 mesh of air markers for every map. Why 16 x 16 you ask ? (Uveso likely knows this already but this is for the general audience). Well - this aligns exactly with the threat map. Other than that, air units will find their own way to a target with little need for fine path markings. That way, you can have a standard grid which you just import to every map - and voila - job done - at least for air markers.

In simple terms, the threat map is like a checkerboard - and the game keeps track of threat on this checkerboard. Therefore, the air markers are simply there to help the AI path around those which have threat levels that might be too high. This checkerboard exists on every map and it's solely there for use of the AI. Now, at 16 x 16, its pretty good for maps up until 20k (where the points are just over 1k apart), but after that, that grid is too coarse to be used for anything but air - and maybe naval - threats.

Statistics: Posted by Sprouto — 06 Mar 2018, 23:52


]]>
2018-03-06T22:18:03+02:00 2018-03-06T22:18:03+02:00 /viewtopic.php?t=15976&p=161534#p161534 <![CDATA[Re: The AI will find you! (pathfinding video)]]> And it's faster to create new markers from the scratch then modify markers that are autogenerated.

At the moment i can only generate amphibious paths by extracting nodes from existing Land and Water markers.
Also AIR paths are autogenerated with a simple 8 way grid.
(note to Map-Authors who don't make AIR markers: We need markers for AIR not to find the destination. We need them to avoid dangerous areas on the way to the destination !!!)

Maybe we can open a new forum section for modders who are interested in making map markers.
(I plan to make the AI pathing like in the video accessable per gameoptions. So the author can test and "see" how(if) the markers work.)

But this will not happen today :)

Let me first finish the AI bugfix and my own AI. Should be done in April.

Statistics: Posted by Uveso — 06 Mar 2018, 22:18


]]>
2018-03-06T16:18:53+02:00 2018-03-06T16:18:53+02:00 /viewtopic.php?t=15976&p=161526#p161526 <![CDATA[Re: The AI will find you! (pathfinding video)]]>
regarding ur slow algorithm... you could run it offline and bake the paths into the map as real markers. then it could be more complicated, higher quality, faster execution. however u would need by-in from Slack gods plus i dont think its worth it. ai sucks :)

Statistics: Posted by nine2 — 06 Mar 2018, 16:18


]]>
2018-03-06T06:58:59+02:00 2018-03-06T06:58:59+02:00 /viewtopic.php?t=15976&p=161521#p161521 <![CDATA[Re: The AI will find you! (pathfinding video)]]>
Code:
DrawCircle(MarkerPosition, 5, markerInfo.color)
DrawLinePop(MarkerPosition1, MarkerPosition2, markerInfo.color)


Basicaly its working with a ForkThread like this:
Code:
    while true do
        DrawPathGraph() -- this function is drawing all lines we need.
        WaitTicks(2)       --if you wait 3 ticks, then the linedrawing will flicker

    end

Sometimes you need to use WaitTicks(1) on fast PCs. (fps over 60)
If the game runs with 60fps, then we have 1 frame every 16.7 milliseconds.
WaitTicks(2) is waiting 20 milliseconds.
Now, if we wait 2 ticks/20 milliseconds, and the game creates a frame every ~17 ms,then we have already a tiny flickering every 7 frames.
(at least for 3,3 milliseconds -> (20 - 16,7))


If the game has no markers it will use the c-engine command CanPathTo(pos).
This will also find a path but it's way slower then using the graph with Markers.

I have already experimented with auto generated waypoints.
Well. hard to say if we get this to an beta state. Maybe possible on 5x5 maps.

- I created a grid for a 20x20 map with about 5000 nodes.
- Checked the path between all adjacent nodes.
(I used GetTerrainHeight() and GetSurfaceHeight() to scan the way on every pixel between 5000 x 6 nodes. (30000 connections)
- Removed all nodes that are near hills.
- Removed all nodes that are connecting the same point twice.
- Genreated paths between all startlocations and massmarkers.
- Removed all nodes that ar not needed for a path.
- After this i had about 150 nodes for pathing.

But the calculation time was on my i7 ~1.2 minutes and there where many pathing errors on different maps.
I don't say its not possible, but we won't get this in the near future.

Statistics: Posted by Uveso — 06 Mar 2018, 06:58


]]>
2018-03-06T05:57:32+02:00 2018-03-06T05:57:32+02:00 /viewtopic.php?t=15976&p=161519#p161519 <![CDATA[Re: The AI will find you! (pathfinding video)]]> Statistics: Posted by nine2 — 06 Mar 2018, 05:57


]]>
2018-03-06T05:55:39+02:00 2018-03-06T05:55:39+02:00 /viewtopic.php?t=15976&p=161518#p161518 <![CDATA[Re: The AI will find you! (pathfinding video)]]> Statistics: Posted by nine2 — 06 Mar 2018, 05:55


]]>
2018-03-13T06:41:12+02:00 2018-03-06T05:19:22+02:00 /viewtopic.php?t=15976&p=161517#p161517 <![CDATA[The AI will find you! (pathfinding video)]]>
Bridgepathfinding.png

If you want to see how the AI is using waypoint markers; here is a small video (5 minutes):
https://youtu.be/PkyWgCWqC8w

Statistics: Posted by Uveso — 06 Mar 2018, 05:19


]]>