Skip to main content
Person asking changed question (again)
Source Link
War
  • 1.7k
  • 1
  • 18
  • 33

This depends largely on the construction of your mapEDIT: Ok apparently this is totally different question now so here's my factored answer .(v3) .. the best recommmendation I can give you is to break your map in to chunks then you can use some form of "paging" to load in the portions of interest with inverse of the same "query" being the non drawn portions.

For example ...Marching Squares

Most people like to use the camera as a point of reference for their world so i might say something like:http://www.emanueleferonato.com/2013/03/01/using-marching-squares-algorithm-to-trace-the-contour-of-an-image/

Map.chunks.Where(c => Vector.Distance(Camera.Position, c.Start) < drawDistance);

By that definitionTaking this approach will allow you to get allcrawl your map and determine areas on the non drawn chunks I can simply dooutside of ../ inside of something.

Map.chunks.Where(c => Vector.Distance(Camera.Position, c.Start) >= drawDistance);

This method would be both fast and accurate.

As per discusion belowassumes you could add a boolean property to determine if a chunk is drawn or not then do simple querying oncan easily represent your map like so ..as an image and then "march" the pixels.

Map.chunks.Where(c => c.IsBeingDrawn);
Map.chunks.Where(c => !c.IsBeingDrawn);

This depends largely on the construction of your map ... the best recommmendation I can give you is to break your map in to chunks then you can use some form of "paging" to load in the portions of interest with inverse of the same "query" being the non drawn portions.

For example ...

Most people like to use the camera as a point of reference for their world so i might say something like:

Map.chunks.Where(c => Vector.Distance(Camera.Position, c.Start) < drawDistance);

By that definition to get all the non drawn chunks I can simply do ...

Map.chunks.Where(c => Vector.Distance(Camera.Position, c.Start) >= drawDistance);

This method would be both fast and accurate.

As per discusion below you could add a boolean property to determine if a chunk is drawn or not then do simple querying on your map like so ...

Map.chunks.Where(c => c.IsBeingDrawn);
Map.chunks.Where(c => !c.IsBeingDrawn);

EDIT: Ok apparently this is totally different question now so here's my factored answer (v3) ...

Marching Squares

http://www.emanueleferonato.com/2013/03/01/using-marching-squares-algorithm-to-trace-the-contour-of-an-image/

Taking this approach will allow you to crawl your map and determine areas on the outside of / inside of something.

This assumes you can easily represent your map as an image and then "march" the pixels.

Asker appears to be confused ... trying to go with it
Source Link
War
  • 1.7k
  • 1
  • 18
  • 33

This depends largely on the construction of your map ... the best recommmendation I can give you is to break your map in to chunks then you can use some form of "paging" to load in the portions of interest with inverse of the same "query" being the non drawn portions.

For example ...

Most people like to use the camera as a point of reference for their world so i might say something like:

Map.chunks.Where(c => Vector.Distance(Camera.Position, c.Start) < drawDistance);

By that definition to get all the non drawn chunks I can simply do ...

Map.chunks.Where(c => Vector.Distance(Camera.Position, c.Start) >= drawDistance);

This method would be both fast and accurate.

As per discusion below you could add a boolean property to determine if a chunk is drawn or not then do simple querying on your map like so ...

Map.chunks.Where(c => c.IsBeingDrawn);
Map.chunks.Where(c => !c.IsBeingDrawn);

This depends largely on the construction of your map ... the best recommmendation I can give you is to break your map in to chunks then you can use some form of "paging" to load in the portions of interest with inverse of the same "query" being the non drawn portions.

For example ...

Most people like to use the camera as a point of reference for their world so i might say something like:

Map.chunks.Where(c => Vector.Distance(Camera.Position, c.Start) < drawDistance);

By that definition to get all the non drawn chunks I can simply do ...

Map.chunks.Where(c => Vector.Distance(Camera.Position, c.Start) >= drawDistance);

This method would be both fast and accurate.

This depends largely on the construction of your map ... the best recommmendation I can give you is to break your map in to chunks then you can use some form of "paging" to load in the portions of interest with inverse of the same "query" being the non drawn portions.

For example ...

Most people like to use the camera as a point of reference for their world so i might say something like:

Map.chunks.Where(c => Vector.Distance(Camera.Position, c.Start) < drawDistance);

By that definition to get all the non drawn chunks I can simply do ...

Map.chunks.Where(c => Vector.Distance(Camera.Position, c.Start) >= drawDistance);

This method would be both fast and accurate.

As per discusion below you could add a boolean property to determine if a chunk is drawn or not then do simple querying on your map like so ...

Map.chunks.Where(c => c.IsBeingDrawn);
Map.chunks.Where(c => !c.IsBeingDrawn);
Source Link
War
  • 1.7k
  • 1
  • 18
  • 33

This depends largely on the construction of your map ... the best recommmendation I can give you is to break your map in to chunks then you can use some form of "paging" to load in the portions of interest with inverse of the same "query" being the non drawn portions.

For example ...

Most people like to use the camera as a point of reference for their world so i might say something like:

Map.chunks.Where(c => Vector.Distance(Camera.Position, c.Start) < drawDistance);

By that definition to get all the non drawn chunks I can simply do ...

Map.chunks.Where(c => Vector.Distance(Camera.Position, c.Start) >= drawDistance);

This method would be both fast and accurate.