Jump to content
  • Advertisement
Sign in to follow this  
tcsavage

Game Map Formats?

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

Hi! I have been experimenting with c++ and directx for a number of months now and I have been wandering what the best way to load a map into a game would be. I have looked at the samples in the book "Programming a Multiplayer FPS in DirectX" which uses a property script and a .x file (I think) but I don't think that it is the best way to do it, especially as Microsoft looks as if it is going to stop supporting the .x format anyway. I was also wandering if the BSP file format could be a better way but it seems antiquated and out of date. I was also wandering if an XML type format could work but I honestly have no idea. Does anyone have an idea of the best way to do this? It's been nagging me for a while :D

Share this post


Link to post
Share on other sites
Advertisement
tcsavage,

First, Microsoft isn't going to stop support for the .X format any time soon. Both DirectX 9 and by extension XNA use .X as a native file format. While DX10 appears to have less support for loading meshes from dotX, you can always use the D3DX Interfaces.

Second, which method you use for your level data is dependent upon the type of game, the dimensions, and how dynamic the objects in your world are. For example, if your 3D game world is entirely static or there's no need to duplicate entities, then it's possible to load your entire map as a single model, thus a .X or other model file format may be acceptable. However if your game is entirely 2D sprite based, a .X file format isn't really going to be an option.

Additionally, if your world is dynamic with things such as collapsing bridges, buildings, etc...or if you've got a large number of objects being repeated throughout the world, then it may be more efficient to have a non-mesh based file format, and then instance your models where necessary in the world.

Once you've made the decision not to use a mesh based format for your levels it's up to you what format those levels are in. They could be binary or text based, and if text based they could be either XML or you could write your own parser and file format.

In the end, the best idea is to always "code by necessity". Determine which functionality you need, and then determine whether it's best to use an existing library/API or to write your own parser and use a custom file format.

If you provide more information about the type of game you're working on, the number of dimensions, and the relative size of your levels, people should be able to provide suggestions about the best way to implement your level files.

Cheers and Good Luck!

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!