Home       Imprint / Impressum Select Color Scheme 
 
 
My Other Sites
myrotacol.net
mail-erinnerung.de
pdadmin-forum.de
wohnzimmerhosting.de
mydxs.de
Fischerseiten  german text
Fischerprüfungen
Angeln in den USA
Oak Island  german text
Wo liegt Oak Island?
Geschichte
Das Geldloch
Fotos
Links
Kombucha  german text
Was ist Kombucha?
Eigenschaften
Herstellung
Bezug
Häufige Fragen (FAQ)
Links
Proxy-Dll Concept
Introduction
The Concept
Realisation
HowTo 1
HowTo 2
References
Users' Contributions
Downloads
 
DXSPather - A Pathfinding DLL for DXStudio Documents
-- Section: DXStudio Goodies --

DXSPather is a C++ A* pathfinding DLL that can be used with DXStudio documents (and hopefully gives some speed advantages over doing all the calculation in JS script). It comes with a javascript include file that you would add to your project. This script then provides "proxy functions" that in turn interact with the dll and handle path setup and calculation.


The DLL utilizes a ready-made C-class for A* handling, done by Lee Thomason (www.grinninglizard.com). It is named "micropather", and fast and rather easy to use. If you'd ever need some C-code for pathfinding, that thing is the way to go, imho.

Features

This implementation of the DLL executes the calculation of a certain path request within one call. For rather large maps (waypoint numbers), this may cause a single "hickup" condition in the DXStudio doc.
The waypoint attribute buffer (not the waypoints themselves) is dynamic, so you can make single waypoints "valid" or "inaccessible" by calling functions, and these conditions will be considered at the very next waypoint calculation request.
Allowed movement directions are adjustable, too. So, you could e.g. choose to have a path calculated only by moving "diagonal" (X+/-1 AND Y+/-1) and "left-right" (X+/-1 ONLY), but not "up-down" (Y+/-1 ONLY), which could be useful for hexagon maps.


Exposed Wrapper Functions

DXStudio users would not call DLL functions directly, but use "wrappers" provided in DXSPather.js. Note that waypoints (that you need to submit to the DLL once) need to be in regular grid order (e.g., in a regular [X,Y] indices format). Not necessarily do the waypoints' distances need to be evenly spaced.
Functions and variables provided in the js include file are:

DXSP_SetDllLocation(string sPathToDll)
(added with v1.3) Set the path to the dll inside the wrapper script. Usually, this would be something like system.folders.document. No return value.

function DXSP_SetDiagonalMovements(bool bMoveDiagonal)
(name changed with v1.2) Tells the path calculator if it should consider diagonal movements (X and Y index both change). Switching is possible by this function (changes will be valid on the very next path calculation). Returns always true.

function DXSP_SetUpDownMovements(bool bMoveUpDown)
(added with v1.2) Tells the path calculator if it should consider vertical movements (Y index changes only). This could be useful when processing paths on hexagon grid maps. Switching is possible by using this function (changes will be valid on the very next path calculation). Returns always true.

function DXSP_SetLeftRightMovements(bool bMoveLeftRight)
(added with v1.2) Tells the path calculator if it should consider horizontal movements (X index changes only). This could be useful when processing paths on hexagon grid maps. Switching is possible by using this function (changes will be valid on the very next path calculation). Returns always true.

function DXSP_SetMapSize(int iX, iY)
This call resets the DLL data and prepares a (yet empty) X*Y waypoint grid to be filled later on. Returns false on error, true on success.

function DXSP_SetMapNodeData(int iIndexX, iIndexY, float fPosX, fPosY, fPosZ)
Sets the basic data of one waypoint "node". Submit its indices in the (regular grid's) waypoint array (iIndexX, iIndexY), as well as its positions in 3D space (fPosX, fPosY, fPosZ). This data has to be submitted once before any path calculation requests, and remains stored inside the DLL. Returns false on error, true on success.

DXSP_SetMapNodeCostModifier(int iIndexX, iIndexY, float fCostModifier)
(added with v1.3, EXPERIMENTAL) Sets an optional factor for a waypoint that will be considered when calculating paths. Use this to make certain waypoints more or less "desireable" for a path. E.g., a fCostModifier of 2.0 would make a waypoint more "uneasy", while a modifier of "0.5" would make this waypoint being prefered. By default, the cost modifier for each waypoint is "1.0f" (which is a neutral factor). Experimental feature. Setting values here might cause weird paths to be created.

function DXSP_SetMapNodeWalkable(int iIndexX, iIndexY, bool bWalkable)
Makes a certain waypoint "walkable" (being considered in path calculations) - or disables it. Data can be dynamically changed (read: whenever you need), and will be consided at the very next path calculation. Returns false on error, true on success.

function DXSP_SolvePath(int iIndexXFrom, iIndexYFrom, iIndexXTo, iIndexYTo)
This routine initiates a path calculation, taking the "from" and "to" waypoint indices as arguments. As soon as this call returns, the calculated path is available in (global) variables inside the include js script (see below).

Array DXSP_WaypointsX
Array DXSP_WaypointsY
As soon as a call to DXSP_SolvePath succeeded, these two array variables contain the (X,Y) indices of the waypoints to travel (including start/end waypoint). Access would be possible by e.g. system.script.DXSP_WaypointsX[0] or system.script.DXSP_WaypointsX.length

Screenshots

The download comes with a DXStudio demo doc, where you can select a path of an object. The available waypoints are shown as boxes.


History

Version 1.1 10/9/2009 First release (v 1.1) with "single call calculation" (no threading).
Version 1.2 10/10/2009 Added ability to enable/disable vertical/horizontal movement. Improved memory handling a bit.
Version 1.3 10/10/2009 Added ability to set a path to the dll and use "movement cost modifiers" (experimental feature).

Downloads

Description File Filedate Size Remarks
DXPather Package 1.1 DXPather_1.1.zip 10/9/2009 253 KB The DXPather_DLL.dll, DXSPather.js and DXSPatherDemo.dxstudio. Just for reference. Please use v1.2
DXPather Package 1.2 DXPather_1.2.zip 10/10/2009 254 KB The DXPather_DLL.dll, DXSPather.js and DXSPatherDemo_1.2.dxstudio
DXPather Package 1.3 DXPather_1.3.zip 10/10/2009 255 KB The DXPather_DLL.dll, DXSPather.js and DXSPatherDemo_1.3.dxstudio



 
Computer
ChartLinkCreator
TokenBuilder (3DGS)
HexMapCreator
Well-o-Mat  german text
Building a Webserver
Game Tools List
DXStudio Goodies
GetKeyState Plugin
Cryptor Plugin
Particles2D Plugin
Utility Plugin
DXSTwitterListener
DXSPather DLL
Summer'09 Competition
DXSCheckMem DLL
pnpTC DXMesh plugin
Turnipmaster Online
L3DT DXMesh plugin
Embedding and Enet
Multiplayer Test App
Tokenbuilder Redux
CannonModule
Models/Renders
Robot Model
Winebarrel Model
Cigarette Box Model
Remote Control Model
Irrlicht3D Goodies
CGUIexScrollWindow
CGUIexChatWindow
ChaseMe: Demo Game
My Project Skeleton
MikoChess: Test Game
 
 

miko-cms v5/2009  |  http://validator.w3.org/check/referer  |  admin