Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

mastergoon

map structure

This topic is 5574 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

Hiya, 1st post Im working on a 2d MMORPG game. One thing I know nothing about is the map files, so I have been working on my map editor. Does this look like a reasonable structure for my maps? char mapname[128],tiles1[256][256],tiles2[256][256],sprites[256][256],sfx[256][256],props[256][256]; mapname is just the name of the area, tiles1 is the floor, tiles2 is stuff on top of the floor (duh ), sprites is players/items/etc, sfx is special effects, props is things like whether or not u can stand there, or if its something u can pick up. This is my first mmorpg so i have no idea if this is reasonable. thanks in advance, mastergoon

Share this post


Link to post
Share on other sites
Advertisement
I''m not even going to comment on the idea of making a MMORPG when you''ve never even made a game that requires maps before. I''m sure you''ll get more than enough of that.

Anyway, comments:
1) Why store sprites and objects in a map? Isn''t it more logical to maintain a list of them, and have each object store its own coordinates in the map?

2) You''re going to need more than one ''props'' array, if you''re going to store information that way. It''s probably a bad idea, anyway: You should have each tile/object/effect struct store its own properties.

Share this post


Link to post
Share on other sites
Try something like this:

class CMap
{
public:

struct TILE
{
TYPE floor; //DON'T use cryptic variable names
TYPE stuffOnFloor;
TYPE sprites;
TYPE specialEffects;
TYPE properties;
}

private:

TILE theMap[256][256];
string sName;

};

This isn't really a very good way of storing a map, but it's better than having a bunch of individual arrays.
quote:
Original post by mastergoon
This is my first mmorpg so i have no idea if this is reasonable.

Only your first? Wow, you really are new

[edited by - glassJAw on June 17, 2003 9:54:10 PM]

Share this post


Link to post
Share on other sites
lol yes its a big project tho im not quite that big of n00b :D

ive made single player rpgs but i always just have hard-coded the maps lol =/

umm you say thats not a very good way, does anyone have examply of a good way?

thanks,
mastergoon

Share this post


Link to post
Share on other sites

  • 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!