Jump to content

  • Log In with Google      Sign In   
  • Create Account

Calling all IT Pros from Canada and Australia.. we need your help! Support our site by taking a quick sponsored surveyand win a chance at a $50 Amazon gift card. Click here to get started!


lucky6969b

Member Since 06 Apr 2007
Offline Last Active Private

Posts I've Made

In Topic: [Cooperative Pathfinding] Agents get stuck at choke point

24 August 2015 - 09:00 PM

Hi raft,

Thanks for helping me out with this.

I find the reason of slow resolution of the timeastar was because the oscillation of low reachedDepth, in average,

it takes about 50-100 loops to rise one depth for one agent, so all in all, it takes about 1000-2000 loops for

a single agent to successfully find its way out by timeastar. The grid has a size of 19x17 cells.

I take your Java counterpart, even with 30x30 cells, it is really quick. I take some stats off the program, yes

it does oscillate at a low depth and gradually rising, but not as unsteadily as mine.

My C++ counterpart takes a lot of CPU cycles to complete one agent timeastar, which is really a challenging problem for me to solve.

 

 

I profile the timeastar method, and finding that if I allow diagonal movement, it takes 13 seconds to complete in one particular occasion.

If I don't, it still takes 7 seconds to complete. Urgh.... (Depth is 32 and reduced to 16)

 

 

Thanks

Jack


In Topic: How to load a custom d3dx frame?

21 August 2015 - 01:20 AM

Hello,

I was just a bit surprised with this

 

The GUID for frame was changed

Type = {3D82AB4D-62DA-11CF-AB39-0020AF71E433}      << With pDataObj->GetType(&type);

TID_D3DRMFrame = {3D82AB46-62DA-11CF-AB39-0020AF71E433}  << intrinsic GUID for frame...

In Topic: How to load a custom d3dx frame?

21 August 2015 - 01:00 AM

Hello,

I try to embed some custom data in the .x file as they are really speedy to load, I just take advantage of that.

Now I am loading this file.

xof 0303txt 0032
template ColorRGBA {
 <35ff44e0-6c7c-11cf-8f52-0040333594a3>
 FLOAT red;
 FLOAT green;
 FLOAT blue;
 FLOAT alpha;
}

template ColorRGB {
 <d3e16e81-7835-11cf-8f52-0040333594a3>
 FLOAT red;
 FLOAT green;
 FLOAT blue;
}

template Material {
 <3d82ab4d-62da-11cf-ab39-0020af71e433>
 ColorRGBA faceColor;
 FLOAT power;
 ColorRGB specularColor;
 ColorRGB emissiveColor;
 [...]
}

template TextureFilename {
 <a42790e1-7810-11cf-8f52-0040333594a3>
 STRING filename;
}

template Frame {
 <3d82ab46-62da-11cf-ab39-0020af71e433>
 [...]
}

template Matrix4x4 {
 <f6f23f45-7686-11cf-8f52-0040333594a3>
 array FLOAT matrix[16];
}

template FrameTransformMatrix {
 <f6f23f41-7686-11cf-8f52-0040333594a3>
 Matrix4x4 frameMatrix;
}

template Vector {
 <3d82ab5e-62da-11cf-ab39-0020af71e433>
 FLOAT x;
 FLOAT y;
 FLOAT z;
}

template MeshFace {
 <3d82ab5f-62da-11cf-ab39-0020af71e433>
 DWORD nFaceVertexIndices;
 array DWORD faceVertexIndices[nFaceVertexIndices];
}

template Mesh {
 <3d82ab44-62da-11cf-ab39-0020af71e433>
 DWORD nVertices;
 array Vector vertices[nVertices];
 DWORD nFaces;
 array MeshFace faces[nFaces];
 [...]
}

template MeshMaterialList {
 <f6f23f42-7686-11cf-8f52-0040333594a3>
 DWORD nMaterials;
 DWORD nFaceIndexes;
 array DWORD faceIndexes[nFaceIndexes];
 [Material <3d82ab4d-62da-11cf-ab39-0020af71e433>]
}

template VertexElement {
 <f752461c-1e23-48f6-b9f8-8350850f336f>
 DWORD Type;
 DWORD Method;
 DWORD Usage;
 DWORD UsageIndex;
}

template DeclData {
 <bf22e553-292c-4781-9fea-62bd554bdd93>
 DWORD nElements;
 array VertexElement Elements[nElements];
 DWORD nDWords;
 array DWORD data[nDWords];
}


Material Material__1 {
 1.000000;0.643137;0.294118;1.000000;;
 29.999997;
 0.530000;0.530000;0.530000;;
 0.000000;0.000000;0.000000;;
}

Material BLACK_PLASTIC {
 0.180392;0.168627;0.168627;1.000000;;
 42.000000;
 0.690667;0.690667;0.690667;;
 0.000000;0.000000;0.000000;;
}

Material BLACK_METAL {
 0.180392;0.168627;0.168627;1.000000;;
 44.000000;
 0.933333;0.933333;0.933333;;
 0.000000;0.000000;0.000000;;
}

Material BODY_MAPS {
 1.000000;0.643137;0.294118;1.000000;;
 29.999997;
 0.530000;0.530000;0.530000;;
 0.000000;0.000000;0.000000;;
}

Material MAP1 {
 1.000000;1.000000;1.000000;1.000000;;
 29.999997;
 0.477000;0.477000;0.477000;;
 0.000000;0.000000;0.000000;;

 TextureFilename {
  "Tex__1.bmp";
 }
}

Material MAP2 {
 1.000000;1.000000;1.000000;1.000000;;
 29.999997;
 0.477000;0.477000;0.477000;;
 0.000000;0.000000;0.000000;;

 TextureFilename {
  "Tex__4.bmp";
 }
}

Material MAP3 {
 1.000000;1.000000;1.000000;1.000000;;
 29.999997;
 0.477000;0.477000;0.477000;;
 0.000000;0.000000;0.000000;;

 TextureFilename {
  "Tex__6.bmp";
 }
}

Material MAP4 {
 1.000000;1.000000;1.000000;1.000000;;
 29.999997;
 0.477000;0.477000;0.477000;;
 0.000000;0.000000;0.000000;;

 TextureFilename {
  "Tex__9.bmp";
 }
}

Material MAP5 {
 1.000000;1.000000;1.000000;1.000000;;
 29.999997;
 0.477000;0.477000;0.477000;;
 0.000000;0.000000;0.000000;;

 TextureFilename {
  "Tex__12.bmp";
 }
}

Material CROMED {
 0.623529;0.623529;0.623529;1.000000;;
 44.000000;
 0.933333;0.933333;0.933333;;
 0.000000;0.000000;0.000000;;
}

Material MAP_VERT {
 1.000000;0.643137;0.294118;1.000000;;
 29.999997;
 0.530000;0.530000;0.530000;;
 0.000000;0.000000;0.000000;;
}

Material Material__83 {
 1.000000;1.000000;1.000000;1.000000;;
 29.999997;
 0.477000;0.477000;0.477000;;
 0.000000;0.000000;0.000000;;

 TextureFilename {
  "Tex__17.bmp";
 }
}

Material Material__84 {
 1.000000;1.000000;1.000000;1.000000;;
 29.999997;
 0.477000;0.477000;0.477000;;
 0.000000;0.000000;0.000000;;

 TextureFilename {
  "Tex__21.bmp";
 }
}

Frame Counter_Balance {
 

 FrameTransformMatrix {
  -0.006293,0.000000,-0.000000,0.000000,0.000000,0.005689,0.000000,0.000000,0.000000,0.000000,-0.005391,0.000000,0.000000,0.000000,0.000000,1.000000;;
 }

 Frame ET_YELL02 {
 

  FrameTransformMatrix {
   -208.245082,-0.000024,3.720288,0.000000,3.720476,-0.000280,208.245005,0.000000,0.000009,208.278131,0.000080,0.000000,1.260498,204.234022,260.463437,1.000000;;
  }
 
....
 
 
 
const GUID *cXParser::GetObjectGUID(                        \
                        ID3DXFileData *pDataObj)
{
  GUID *Type = NULL;

  // Error checking
  if(pDataObj == NULL)
    return NULL;

  // Get the template type
  if(FAILED(pDataObj->GetType((GUID*)Type)))
    return NULL;

  return Type;
}

The pDataObj does contain a ID3DXFileData interface. But When it gets to GetType, the Type variable is corrupted on the stack

Does anyone know why?

Thanks

Jack


In Topic: [Cooperative Pathfinding] Agents get stuck at choke point

18 August 2015 - 01:26 AM

Hello raft,

I'm trying to port your code to C++.

Some interesting wonders come up.

One of which is the speed of Java code is faster than C++ code in a large map with a lot of cells.

like 40x40

I find one of the agents oscillating within a very low depth when

the agent has a current.g + transition.cost >= neighbour.g

The code goes into the empty branch, and cannot rise to a higher depth.

And finally the method grain to a halt because that agent is unable to get out of the loop.

I already use a lot of reference operator in my C++ code to avoid copying.

But still incredibly sluggish.

Is the getActualTimelessCost function just returns the f cost between a node and the final destination

with obstacles being put into consideration?

 

 

 

Thanks

Jack


In Topic: Recast navmesh with horrible building speed

15 August 2015 - 03:56 AM

I find out that I ran out of tiles when building a mesh of dimension of 1800x1600 units.

If I convert this back to meters, it just accounts to about 40x40 meters,

this is quite hairy because when I pop the .obj file into the demo, I find out it actually did run out of tiles

The visible tiles were extremely tiny and covered half of the scene.

Let's assume I had a tileSize of 32 and a cellSize of 0.3

The demo calculated up everything for me

 

Cell Size 0.30

Cell Height 0.20

Voxels 6058 x 5585

 

Agent Height 2.0

Agent Radius 0.6

Max Climb 0.9

Max Slope 45

 

Min Region Size 8

Merged Region Size 20

Monotone Partitioning not used

 

Max Edge Length 12

Max Edge Error 1.3

Verts Per Poly 6

 

Detail Mesh

Sample Distance 6

Max Sample Error 1

 

Tiles 190 x 175

Max Tiles 16384

Max Polys 256

 

Does anyone have any suggestions that might leverage this situation?

 

Thanks

Jack

 


PARTNERS