Jump to content
  • Advertisement
Sign in to follow this  
baker

can someone explain to me grids? as in pacman/tetris/wc3?

This topic is 4485 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

a grid is nothing more than having your code divide up an area/picture into coordinates that actor/objects/etc...can use for a frame of reference correct? like if i am programming pacman, my code will basically import a picture, i then divide up the picture into a double array for example, and now i can set each array space as walkable/unwalkable right? is this all a grid is? how about terrains? is that just another way of saying ground in a game? or a texture applied to the picture which internally in the code is a grid?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by baker
like if i am programming pacman, my code will basically import a picture, i then divide up the picture into a double array for example, and now i can set each array space as walkable/unwalkable right?

Yep, that should work. You might want to store a bit more information than just whether or not a cell/square/tile is walkable or not though - for pacman, a single space can be impassable, it could contain a 'pill'...

Quote:
how about terrains? is that just another way of saying ground in a game? or a texture applied to the picture which internally in the code is a grid?

Pretty much. The term you'd be looking for here is 'tile map'. You can also use much the same technique for a side-scroller game.


We have a section of articles covering isometric and tile-based maps if you're interested in having a look at some more material on the subject.

Share this post


Link to post
Share on other sites
hi, thanks for the post.

about those 3d modeling programs, i notice that you can create a picture and has a grid option where you can see the lines that divide up the picture. when you export it and import them into your program, the grid still doesnt mean anything until you manually divide them in your code right?

how about 3d maps where there are varying heights? how does one know where each high point on the map is when importing the map into the game? is it predetermined or are there programs that can load the map and spit out a data structure with all the 'nodes' into a 3d array or something?

Share this post


Link to post
Share on other sites
Quote:
Original post by baker
when you export it and import them into your program, the grid still doesnt mean anything until you manually divide them in your code right?

Nothing means anything until you use it the appropriate way in your code. For example, you could load an MP3 and display it as a texture (it would certainly look weird, but it's possible).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!