Hello I have a question for everyone who has implemented a map format before. How have you gone about structuring it? For example I use XML which I parse through tinyXML ( a great lightweight xml parsing libraryfor C++ ) I have heard that other people use JSON and a lot of indie game developers just develop their own customized formats. So anyway post how you structure your file formats cheers. ( Note this is not a problem it is a discussion ).
This is a test map we are using in the Kickle Cubicle Remake ( it still needs some refinement but it is shaping up to work quite well, note this has already been implemented and is a working system ):
not necessarily a good idea, until the game is finished. If you can use text files, use them, but not once you're ready to "release" the game. But I don't think XML is a good idea, as that will make level loading a lot slower. If you can make an easy, text-style format, that'd be better ("[tilesheet filename] [anim config file] 1 12 4 4 ... ") Also, having the anim config in a custom text file would be faster than XML. However, it should be noted that, on PCs, the overhead of XML may not be significant.
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
I'm not a big fan of XML for reason that Ginto8 stated. The only time that XML is worth your time is if you are directly editing the text file. If a Level Editor is editing/saving, you are ten times better off saving resources and lowering your loadtime with a simple format.
I'm just using simple text files, they work wonders, and you could still read in your entities with that format if you just wrote some extra code, not that you have to, you could just load your map in a text file, and enemies in XML. What ever your preference is
Dejai, I think it looks great. While you're making your game, a nice, easy to read format like this is a great way to do things. That way you can easily modify it with or without an editor.
However, for all of the reasons stated, you may want to consider saving in binary or your own custom format before release.
Any my apologies for not using your topic as intended and showing you how I store shit--Gyro would probably shoot me. After skinning me alive. An filleting my face.
<qpHalcy0n> decided to paint the office, now i'm high and my hands hurt
not necessarily a good idea, until the game is finished. If you can use text files, use them, but not once you're ready to "release" the game. But I don't think XML is a good idea, as that will make level loading a lot slower. If you can make an easy, text-style format, that'd be better ("[tilesheet filename] [anim config file] 1 12 4 4 ... ") Also, having the anim config in a custom text file would be faster than XML. However, it should be noted that, on PCs, the overhead of XML may not be significant.
I agree with this, while i'm making a game my maps are just lists of numbers, then later on you can convert to binary to save space and load time.
Yup I agree with all of your points on XML and I thought I would post some reasons why we chose it for this project in particular. First off the game is going to be completely based around UGC (user generated content) with community members writing custom maps and scripts for the game. This instantly resonated that we needed something in a human readable format so we had the choice of either designing our own simple file format or going with something more generic such as XML. We decided on XML for a couple of reasons firstly it is very structured which makes it easy to read, secondly we have a very specific target for the game to be based completely around puzzle solving this gave us a lot of headroom in terms of loading maps because frankly the maps are not that complicated and are only 15x15 tile map which we can easily load in with no lag ( less the loading of resources, which are then stored by the resource manager ) also we found TinyXML which provided a very straightforward API for dealing with our xml files. This meant that we could spend more time working directly on polishing the game mechanics. I can see for an RPG for instance that you would actually have significant concern about the size of files due to the sheer volume of activity that takes place in such a level ( which was kind of why I was interested in seeing some other map formats ) and it could actually impact on loading time. Anyway great discussion thanks. On the issue of binary that might just be something we do when we release thanks for the heads up ( or at least support it ).
Write your engine to support a binary format, optimized and structured as needed.
Then, you can write out a map compiler. Using a compiler, you can write hand-coded maps or editor-"coded" maps. The intermediate map can then be run through your map compiler for the format needed by the engine.
Takes more effort, and proper planning in the design stage is critical, but it's certainly a viable option.
A nice side effect is that people who want to make maps don't need your editor. They just need to know the map format (i.e. your XML structure) and they could use their own, in-house, editor. Submitting a map, then, to your game world could invoke a server-side instance of the compiler. It could sanity check the XML and compile the map into the engine's accepted structure.
that could be a good learning experience, and it would be more efficient in game, but it might be too complex for the simplicity of his what is it? 15 x 15 map? still a consideration for larger things