Dmap->Grid

09/26/2011 02:53 _DreadNought_#1
Hey,

Does anyone know how to convert a dmap into a grid?

I have it loaded in the standard black/white like Korvacs DMap loader but am struggling to convert it into a grid so I can use the A* algorithm to create a path finding system.

I dont know if this is how it should be done but I plan to create a path finding system for a proxy, So for now it just gets the path from 400, 400 to 405, 395 while avoiding invalid X\Y's.
09/26/2011 06:12 pro4never#2
Sorry but what is the grid being used for itself?

The only thing it would alter is display on a user interface. The code itself still operates based on a X/Y value with accessibility information for 'tiles' inbetween.

Is this a display thing you're trying to work on or am I just missing the point?

If it's display you're talking about then I might recommend XNA framework. It's designed as a game engine so has quite a large amount of options when it comes to drawing in either 2d or 3d planes.

You could set up a simple grid system that way by basically saying this is where my 'camera' exists in game space and these are the coords near me and their access information.

Then clicking tiles would allow you to trigger the proxy to go to that tile location using a A* algo.
09/26/2011 14:14 Korvacs#3
Not sure you really understand, the loader i created returns access values for x/y cordinates.....so essentially you query the loaded dmap and get a true/false for access, the nodes you need to create would be similar to that which is already in the loader, and store the same information so as your performing A* you could create the nodes and populate the access value of them from the loader.

As for creating a grid, the data is what it is, you dont format data in memory as a grid, you create a graphical representation of the data in the form of a grid.

So i dont really understand what you want/need.
09/26/2011 17:40 _DreadNought_#4
blahblahblahabalh was 2am when I wrote that.

I think i've got it though ill just use 2d arrays, thaks anyway though. Feel free to close