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

Pages: 1-

2d map represention

Name: zamda 2012-01-16 16:39

after reading this http://www.gamedev.net/page/resources/_/technical/artificial-intelligence/a-pathfinding-for-beginners-r2003 i decided i want to write 1.

Problem is i can't decide how to store my map with those 'masks'.
do i put them all in 1 object and make my map out of those objects or keep few arrays with 1/few property in each. like 1 array for tetrain type, 1 for movement cost, 1 for filling with 'water' to find unreachible nodes, etc

Name: Anonymous 2012-01-16 17:12

back to /g/, please

Name: Anonymous 2012-01-16 17:38

>>1
Usually it's best to keep graphics and logical map data separate. Putting the costs and unreachable areas (eg. as a special value) in the same structure is probably most convenient and most efficient.

Name: Anonymous 2012-01-16 18:40

>>1
The movement costs could be part of the tile, but the article says that the movement cost for changing directions should be encoded in the algorithm.

Also, keeping representation separate from the graphics is mostly important with 3d programming, because movement is done using 3d transformations on objects instead of just drawing pixels on the screen

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