Search the Community
Showing results for tags 'pathfinding'.
Found 8 results
-
Hi everyone, I'm trying to make my AI-flown helicopter to fly in a straight line. I've scoured some forums and some suggested the use the command disableAI "PATHPLAN". However, not only that the "PATHPLAN" feature is not listed on the arma scripting wiki's entry for disableAI (https://community.bistudio.com/wiki/disableAI). It also doesn't seem to work in-game. The only official mention of the "PATHPLAN" feature is on another wiki on VBS scripting reference which also made by BI (https://sqf.bisimulations.com/display/SQF/disableAI). The question is, why is the command not working? Is it obsolete/deprecated? If so, is there any other alternative to force the AI pilot to fly in a straight line without using unnecessary pathfinding?
- 4 replies
-
- pathfinding
- scripting
-
(and 1 more)
Tagged with:
-
To sum it up, I am trying to get an AI unit inside a 3 floor building, to do so I am using unit1 doMove (hotel buildingPos 153); as a sidenote, hotel buildingPos 153; returns the coordinates : [7063.92,2619.78,7.28142] Now the issue is that unit1 doesn't go to the 3rd floor, where buildingPos 153 is located, but goes "under" the designated location while staying on the ground floor (coordinates [7063.92,2619.78, 0.00143909]). The most surprising, is that if I issue the command to unit1 through the in-game command menu, it gets to the right position (that is on the 3rd floor) ! So gentlemen, any guesses for a way to get unit1 where I want ? (No, setPos is not a viable option :p)
-
Navigation System featuring Dijkstra-Algorithm
Spiderswine posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hey Folks, recently i was playing a bit with setting up the dijkstra algorithm in arma. With the following code you will be able to navigate from your position to a marker on the map. Have Fun! Video Tutorial: Tutorial on YouTube Parts of the Algorithm: Create Road Map, Gets all connected roads on the map and save them in an array Run the Dijkstra Algorithm, Defines the graph for the RoadMap with recent starting point Finding the Path, Gets the position of the destination marker on the map and finds the shortest path Create Local Markers, Create markers for every path node Delete Markers on Passing, When passing the navigation markers they will be deleted from the gui Create Road Map // Create Road Map _roadMap = []; _nextRoads = []; _finishedRoads = []; _startRoads = player nearRoads 10; _firstRoad = _startRoads select 0; _nextRoads pushBack _firstRoad; _iterationCounter = 0; while {_iterationCounter < 1000} do { _nextRoad = _nextRoads deleteAt 0; _connectedRoads = roadsConnectedTo _nextRoad; { _distance = _x distance _nextRoad; _roadMap pushBack [_nextRoad, _x, _distance]; if((_finishedRoads find _x) == -1) then { _nextRoads pushBack _x; }; } foreach _connectedRoads; _finishedRoads pushBack _nextRoad; _iterationCounter = _iterationCounter +1; }; Run the Dijkstra Algorithm // Run the Dijkstra Algorithm _startRoads = player nearRoads 10; _startRoad = _startRoads select 0; // Init Distances _distanceArray = []; _workQueue = []; _distanceArray pushBack [_startRoad, 0, null]; _visitedRoads = []; _visitedRoads pushBack _startRoad; _workQueue pushBack [0, _startRoad]; while { count _workQueue > 0} do { _workItem = _workQueue deleteAt 0; _actualRoad = _workItem select 1; // Get the connected Roads out the RoadMap { _road = _x select 0; _connRoad = _x select 1; _connDistance = _x select 2; if ((_road == _actualRoad) && !(_connRoad in _visitedRoads)) then // Find Connected Roads, not yet visited { _visitedRoads pushBack _connRoad; // Save connected road as visited // Calculate Distance between the Roads _roadDistance = _connDistance; // Search for Parent in Distance Array and get his Distance { _parentRoad = _x select 0; _parentDistance = _x select 1; _parentParent = _x select 2; if(_parentRoad == _road) then { _roadDistance = _roadDistance + _parentDistance; // Add distance of parent to new distance }; } foreach _distanceArray; // Save new Road in Distance Array _distanceArray pushBack [_connRoad, _roadDistance, _road]; // Add connected road to Distance Array _workQueue pushBack [_roadDistance, _connRoad]; // Add connected road to queue }; } forEach _roadMap; if(count _workQueue > 0) then {_workQueue sort true;}; }; Finding the Path // Now Finding the Shortest Path to Destination _destinationPath = []; _destinationLength = 0; _startNode = _distanceArray select 0; // Get the Destination Node from Marker _destinationMarker = allMapMarkers select ((count allMapMarkers) -1); _nearestDestinationRoad = (getMarkerPos(_destinationMarker) nearRoads 10) select 0; _selectedNode = []; // Find DestinationRoad in Array { _nodeRoadx = _x select 0; if(_nodeRoadx == _nearestDestinationRoad) then { _selectedNode = _x; } } foreach _distanceArray; // Get the Distance to Destination _destinationLength = _selectedNode select 1; diag_log format ["StartNode: %1, SelectNode: %2, DestinationLength: %3", _startNode, _selectedNode, _destinationLength]; // Get the Path to Destination while{!(_selectedNode isEqualTo _startNode)} do { _nodeRoad = _selectedNode select 0; // Select the Road in the Node _destinationPath pushBack _nodeRoad; // Save the Road in the Path _nodeParent = _selectedNode select 2; // Node Parent to find // Find Node Parent in Distance Array { _nodeRoadx = _x select 0; if(_nodeRoadx == _nodeParent) then { _selectedNode = _x; } } foreach _distanceArray; }; _destinationPath pushBack (_startNode select 0); Create Local Markers // Create Local Markers to navigate to the path { _streetMarker = "VR_3DSelector_01_exit_F" createVehicleLocal getPos(_x); // _mapMarker = createMarkerLocal ["markername",[getPos(_x select 0) select 0,getPos(_x select 0) select 1]]; // _mapMarker setMarkerShapeLocal "ICON"; // _mapMarker setMarkerTypeLocal "DOT"; } foreach _destinationPath; Delete Markers on Passing // Delete Local Markers when passing them [] spawn { while{true} do { _nearestObjects = nearestObjects [player, [], 10]; { if(typeOf _x == "VR_3DSelector_01_exit_F") then { deleteVehicle _x; } } foreach _nearestObjects; sleep 0.1; } }- 2 replies
-
- 6
-
- gps
- navigation
-
(and 1 more)
Tagged with:
-
OO_PATHFINDING - shortest route between two positions
code34 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
OO_PATHFINDING - shortest route between two positions Lastest version : 0.4 by Code34 Download from : Dropbox Download from : Armaholic Like to donate ? with Paypal GitHub : https://github.com/code34/oo_pathfinding.altis Pathfinding or pathing is the plotting, by a computer application, of the shortest route between two points. It is a more practical variant on solving mazes. This field of research is based heavily on Dijkstra's algorithm for finding a shortest path on a weighted graph (Source wikipedia) OO_PATH gives the opportunity to recover a set of positions that form a path between point A and point B. Several algorithm are avalaible to check the path.OO_PATH uses a virtual grid which replaces the map, and allows you to improve the precision on a well-defined area. The A* algorithm can use a weight function call back that permits to give weight depending of obstacles, objects, etc found on the sector. You must know that the condition of pathfinding is not optimized (it is not part of the object), that's why it takes time. Here the goal is to deliver an object ready for use for all types of use and not specifically for GPS. If you want to improve performance, precalculate prerequisites. Applications Pathfinding for units/vehicles AI improvements GPS Features GreedyBestFirst Algorithm Dijkstra Algorithm A* Algorithm, with dynamic call back weight function entrie Use a virtual Grid (OO_GRID) Licence Under Gpl, you can share, modify, distribute this script but don't remove the licence and the name of the original author Documentation Example with A* Algorithm Readme- 15 replies
-
- 1
-
- path
- pathfinding
-
(and 1 more)
Tagged with:
-
Hi guys, I'd like to make a defense mission in Lindhaven, where the AI attacks the central peninsula via the connecting land and the various bridges leading to it. However the I cannot make the AI cross the bridges, nor will they near the edges of ground near the waterways. is there any way to make them move across the bridges? Thanks, Zippy
-
AI Pathfinding in Custom Compound
lawman_actual posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I've built a compound that is required as part of the mission to have a narrow entrance coridoor. It's probably a little over 2m in width, maybe 2.5m - and should be perfectly navigable by an infantryman. However, the AI can't seem to make sense of how to use the route to get into the deeper pats of the compound. Is there any way of specifying a 'safe route' that AI will automatically follow? In the same sort of way that when driving the AI recognise a road and follow it in most cases. Thanks. Law -
Stopping the AI from the Lemming Effect
oddballsix posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
So I am in the midst of creating a fun mission. Fly small heli, low altitude terminal flight, quiet insertion of a covert team on the end of a pier. Infil accross a cargo yard, through a street, take down a target, and get out safely before the reaction force a couple towns away pins you down... Except 3 seconds after we land, my AI teammates are walking off the pier like freakin' lemmings. Anyone have any ideas? Seems to be a pathfinding awfulness, and not even "natural" "barriers" that I had hoped would stop them - like rope fence objects - stop them from doing that because rope fence is not a barrier...- 5 replies
-
- pier
- pathfinding
-
(and 1 more)
Tagged with:
-
Boats in a group set to 'Careless' barely move
colonelmolerat posted a topic in ARMA 3 - TROUBLESHOOTING
If you set a group of Assault boats to move to a waypoint, it works fine.... UNLESS their behaviour is set to 'careless'. If it's set to careless, they either move very very slowly, or not at all. This is on Windows 10, 64-bit, latest version of normal-branch Arma (Eden-update), as of 19/02/2016.