Jump to content
  • Advertisement
Sign in to follow this  
Mangocheese

Need direction getting started

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

Hello, I need some direction with getting started making a tile based game/map editor. I've searched everywhere but nothing really answers my question, so I thought I'd ask myself. Ok, before anyone says, I want to clear it up, I *want* to make a map editor and game separate applications and I have played around with Mappy and TileStudio, it's just I want to learn for myself. I know C++ and I own Visual Studio 2008. The direction I need is I want to start making the map editor, but I cannot decide on what I should use to make it, should I use MFC (which I haven't learnt yet) or is there another alternative that is easier/better? A bit of info if you need it, I just want to make a simple 2D tile map editor, make simple maps, export them in a format both my map editor and game can read. I hope someone can give me some direction on where I should start exploring! Thanks, Scott

Share this post


Link to post
Share on other sites
Advertisement
Well, if you've programmed a simple renderer (or if you're using a game engine), and created a GUI wrapper, you could create a map-creator in your rendering API (dx9, dx10, openGL) instead of creating a windows application. It isn't the way most programmers would do it, but it works.

Oh, and if I were you:
First put down a rough version of the map/level format on a piece of paper. Brainstorm on it for a while, adjust the rough version.
When you've finished the rough file format, create an importer. THEN create an exporter. Test the importer with a handwritten ASCII text file.

Share this post


Link to post
Share on other sites
Well, the most simple solution is to make a graphical grid wich you can click on with your mouse, representing a screen and the cells are tiles, and create a multidimensional array; each byte (character) representing a tile; then collect the data the user clicked in the screen and load it neatly into the array. Save the array to a text file; and read it into your game. The char represents the tile your render on the screen.

Share this post


Link to post
Share on other sites
Thanks a bunch for replying! Your answers are really helpful to me. Just a quick question about file I/O... is it possible to export arrays/structs as text? I've only done it via Binary.

Thanks again, I might start planning the map format.

Share this post


Link to post
Share on other sites
Text I/O can be simplified greatly by using XML. Many people recommend the TinyXML library for this. Depending on what you want to do, XML files can get very large very quickly as it is a markup language but this isn't really an issue in most cases.

I use an embedded database called SQLite to store most of my game information which gives me quite a bit of flexibility and is surprisingly fast.

I found from working with flat files like XML that human readable/editable files (i.e. open in notepad and go to town) tend to get corrupted too easily with stupid mistakes like an extra space or a forgotten comma costing (me anyway) more time than I thought was necessary. Besides, SQL offers cool features like triggers and date math that I don't have to implement myself.

SQLite is also public domain so if you are already in dll hell, you can build it directly into your source rather easily.

There are also GUI tools available for manually editing your database(s). I use SQLiteStudio however I have also used SQLite Adminisrator for some time prior to sqlitestudio. Open Office applications such as calc (like Excel) are also capable of reading from SQLite databases.

Share this post


Link to post
Share on other sites
for a poorly written, but functional! chunk of code, you could take a look at the code behind this little guy i threw together.
GUI? kind of!
(right click to open tile menu)
(F-keys for saving and loading)

File type is very very simple (just save the whole class!)

http://www.2shared.com/file/3534759/83eb03ea/leveleditor.html

2shared takes a minute to load the link

(VS6 project & source)
(2.3MB file Sorry!)
(uses SDL)

Share this post


Link to post
Share on other sites
I created my own GUI system from scratch; it took a lot of work. It is not something I would recommend if you only want to concentrate your work on the central parts of an editor, i.e. data editing and loading/saving. If you don't like the standard Win32 controls you could always try a third party library.

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.

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!