Sign in to follow this  
tont

Need advance for top/down map

Recommended Posts

Im currently working on a small top/down game with qualities similar to the classic bomberman. All of this is being done with Managed DirectX, so its in a 3d world. Now I've reached the point where i need to worry about how the maps are going to be stored though. Right now, i have a simple png for the background, and im able to set 'objects' around this map for collision purposes. But I dont believe that is the best method for doing it, seeing that editing the maps will be a pain. Ive also considered the tilemap route as well, but im not 100% sure how good it will be. I saw a few map editors out there, but im not sure how they would integrate into c#. Any pointers there? Lastly, I would eventually like to pack all that data into a .dat file of somesort, but I dont know how that would work or even how i would be able to read the data. Thank you in advance for any pointers.

Share this post


Link to post
Share on other sites
My opinion is this:

If you want a bomberman type setting, tile sets are certainly a reasonable route.
I would not strive for complexity. Your map files don't need to be needlessly complicated.

If I were to implement the map file for bomberman, I would:

Store your data in an ascii file. You can make the extension anything cool (*.map).

For each square tile, specify if it is just a floor, destrutable wall, or indestructable wall. This would define a fairly basic map. The file may look like the following, where floor is '.', solid or indestructable walls are '@' and destructable walls are '#'. This is a 5 by 5 map size, for the sake of example.

.###.
#@#@#
#####
#@#@#
.###.

this would be your map. You can see exactly what will be where. Since we may want to specify the textures of the floor, even beneath objects that will later be blown up, I would add a seperate layer to define those.

If you didn't do a layered approach, you would have to specify all the combinations of possibilities for texture and type type(empty, wall, etc). Such as an empty blue tile is ! while a red wall tile is $. But this is harder to remember and modify. So having a seperate layer is useful so each part of the map is easy to see and edit.

So, the second layer in the file would be something like (where 1 is blue and 2 is green)

11111
12221
12221
12221
11111

And walla.
You may also want to add things like a theme for the textures or walls. It is also common that you specify the size of the map in the entry of the file before reading the contents. This is useful so you can allocate the correct ammount of memory and just dump the data in.

Using this approach makes map editing easy from strictly an ascii stand point, but, and equally well, it makes the creation of an editor straight forward.

Good luck, ^sf

Share this post


Link to post
Share on other sites
Yeah the ascii approached was what i was thinking if i did go the tile route. I was just not sure if it was the best route to take. Also, when i was refering to the data for it being stored, i was planning on adding multiplayer to this. So i really wouldnt want them to be able to easily change maps around. Even though it would be the server still verifying their moves, i still wouldnt want it done.

Share this post


Link to post
Share on other sites
I wouldn't let this hang you up.

Later if you feel the same you could:

> Encrypt the map
> Convert to ascii to binary
> Have the server just send the map when the player connects
(this would mean the player never has access to the maps because they are only loaded via network and accessed in memory)

...as a small handfull keeping in mind you may do any combination of these.

=)

Share this post


Link to post
Share on other sites
When I made my bomberman game (IOTD link), I basically generated the playing field procedurally. I don't know what your game's map requirements are, but basically I used a grid, and filled in every second tile (of every second row) with a blocking object (sandbags in my case). For the rest of the map, I just placed boxes randomly. The items inside the boxes were also random. That way, it's always a different game each time you play, and it saves you the time of having to create maps yourself.

HTH.

- Andrew

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this