Jump to content
  • Advertisement
Sign in to follow this  
steved3298

Map Editor Creation Help

This topic is 4770 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'm having trouble finding where to begin with creating a tile-based level editor for my game. First off I'm not sure which GUI toolkit to use, especially since not all are available for the language I'm using (Ruby), but most are. I was thinking wxWindows. Secondly, I don't really know where to begin. I know the basics are needed: loading/splicing tiles/tilesets, grid-based drawing area, and the basic functions (copy/paste, fill). Right now I am using 32x32 tiles, and that seems to work fine but my game can easily do any size tile. I was also wondering how I would do the drawing area. I'm not sure where to begin really, do I use Canvas or some other way. I have never really made a level editor so this is a new experience. Thanks for the help, Steve Oh yes, and I would like to add that I do have a file format worked out, and my game can parse it correctly, and quite well.

Share this post


Link to post
Share on other sites
Advertisement
The guy doing the map editor for my game might have some tips for you. Our game also uses 32x32 tiles and the map files are in the form of Lua scripts. We chose QT3 as our GUI of choice for the editor (C++). Your map editor doesn't have to be written in the same language as your game though. You could write it in C with GTK+, or use Java's AWT/Swing API (which I'm a personal fan of). It also depends on the licensing you plan for your game. QT3 (IIRC) doesn't charge anything if you are developing the software for free, but there are licensing fees for for-profit projects. So you want to factor that into your decision as well.


Our map editor is still in its infant stages, but it can do the basics such as grid construction, tile placing, etc. Honestly I haven't ran it in a while though, so I don't know what state its in at the moment. If you'd like, I can get my map editor guide to take a look at the thread and post any insights that he has gained from his work thus far.

Share this post


Link to post
Share on other sites
Thanks, that would be great.

It doesn't really matter what toolkit I use as I could learn. I would love to use Java/Swing but I've never really used java and would rather not learn right now. I do however know C++ and that would be great in combination with QT.

Licensing is probably not a problem as it will probably be GPL or some other open source license.

Share this post


Link to post
Share on other sites
Sent him an e-mail about it so hopefully he'll post here shortly. If your game is GPL, maybe you can take what we've started and modify it to fit your own needs. At the very least you can start with the plopping down of tiles onto a grid and then expand the code in your own direction from there. You'd just need to give our game and the map editor designer credit [wink]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hey there!

Roots sent me this way, so here I am. I'll try to give you some insight into what I've learned about map editors. I'll admit I was in pretty much the same boat as you when I started working on it, and our map editor is still quite primitive. There's still a lot for me to learn.

So as you know, I'm writing it in C++ and Qt. Qt's working out pretty well so far. I'd say the hardest thing I've come across is trying to get it to play nicely autoconf/automake. I don't know much about other gui toolkits, but I'm sure they all can do the same thing.

Our map editor is split in two right now, with a graphical list of tiles to select from on the left, and the grid-based drawing area on the right (along with the requisite menus). About the grid-based drawing area, at first it wasn't a canvas, I thought I could just have something that would hold tiles. But that didn't work out too well, so I ended up rewriting the editor to use a canvas instead. Canvases are nifty things, and I can imagine it being a lot easier to implement some more complex features down the road if I'm using a canvas. You can draw anything on them, it handles drag 'n' drop nicely (which is something you'll probably want in your editor). It did take a while to get drag 'n' drop functionality, but after looking at some examples Qt provided I finally figured it out. Is there a better way than using a canvas? Perhaps. I didn't explore all the possible options out there, but it is certainly a worthy method of doing things. Another good thing is it can accommodate multiple sized objects. So you may have a majority of 32x32 tiles, but maybe also 64x64 tiles. You can plop both of them down just as easily.

At first I wanted to implement the editor a la Gimp style. So basically I'd have a small window with the File menu and a grid of tiles to use, and then if I wanted to create a new map, it would pop up in another window (just the grid-based drawing area), and then I could do drag 'n' drop that way. But then I'd need some way of keeping track of how many maps were open at one time, and this seemed just too complicated, at least for starting out.

Um well, hope that helps and let me know if you have any other questions.

Share this post


Link to post
Share on other sites
Thats great, thanks. I have one question actually. Do you know where I can find a QT Canvas reference or tutorial as there doesn't seem to be anything in the official QT4 docs.

Actually one other question are you using QT3 or 4?

Last question, sorry. Did you use QT Designer by any chance, would that make it easier?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Oh yeah, I forgot to mention Qt Designer. At first I was using it a lot, and it was great! It's awesome for laying out forms exactly how you want them. But then I started delving into the more complicated aspects of the map editor, and it started to suck. Now, yes, they provide the capability for custom widgets, but after messing around with it for a (long) while I figured it would be easier to just write C++ code myself instead of having it be generated by some program. I also found it makes writing a general makefile for your project a lot more complicated. So, I'd say try it out to see what it's like. You'll probably like it a lot at first. And who knows, you may even figure out the more complex parts with it (and make it seem really easy too).

Qt 4 wasn't released when we started work on our project, so I'm still using Qt 3 and haven't upgraded yet. Not yet sure if I will either. We shall see.

The following is what I use for all my Qt needs:
http://doc.trolltech.com/3.3/index.html

gorzuate

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!