Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

2D-Plane data structure

Name: Anonymous 2007-07-28 23:54 ID:FnbT6tna

I am writing an rts game engine in C++. Does anyone know of a good example of a 2d plane data structure for storing mobile units and fog of war?

Name: Anonymous 2007-07-31 11:24 ID:1ECclkE4

You misunderstand. By using x+y*WIDTH you are essentially converting

 |---|---|---|
 |1,1|2,1|3,1|
 |---|---|---|
 |1,2|2,2|3,2|
 |---|---|---|
 |1,3|2,3|3,3|
 |---|---|---|

into

 |---|---|---|
 | 1 | 2 | 3 |
 |---|---|---|
 | 4 | 5 | 6 |
 |---|---|---|
 | 7 | 8 | 9 |
 |---|---|---|

which relies on one of the dimensions - the one whose range is represented by WIDTH - being finite. If both dimensions are infinite, this will fail to work.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List