I am making a little 2d overhead RPG type game just for fun. I have almost all the basic stuff set up, but I just need a little help on level creation. I can already make a level and place each tile how I want it, but having to place each tile gets annoying after a while.

I noticed that in a lot of games, even extremely simple ones, they have LOTS of levels with LOTS of tiles in each. Creating all that in this fashion would take forever. So I guess my question is, as a game developer, am I supposed to do all that, or maybe make a little level editor so I can see things as I create it? What do game developers do? I'm using Java.

EDIT: Okay, say if I had an image for a map, that I made in MS paint or photoshop, and each pixel represent a tile value, could I somehow in Java detect what color an individual pixel is? If so, that would be perfect. If so, how?

  • 2
    \$\begingroup\$ Small projects will either hard-code the levels, or write their own level-editor. Since you're the one making both the editor and the levels, it's up to you to decide if it's worth the effort. \$\endgroup\$ – BlueRaja - Danny Pflughoeft Jun 23 '11 at 21:01

You want to use a map editor, such as Tiled.

EDIT: You can save it as an image if you really want, but that means you must have a rectangular map. What if you want an irregular one?

Also, you are then making it much harder to have an editor spit out the level code for you. I would advise against it, personally. Especially if your image is going to be many milions of pixels.

  • 1
    \$\begingroup\$ I completely fail to see the problems you describe. Lots of games use rectangular maps just fine, if he want a different shape he can just leave out using a part of the image. As for scale, image editors are amongst the few types of programs that will flawlessly handle millions of data points. \$\endgroup\$ – aaaaaaaaaaaa Jun 23 '11 at 22:22
  • \$\begingroup\$ Each map would be at most probably 128x128 tiles. If each tile is represented bu a pixel, that's a 128x128 pixel image. Don't think that's an issue. But do you know how I could get Java to get an individual pixel's color? \$\endgroup\$ – Brandon oubiub Jun 23 '11 at 22:30
  • \$\begingroup\$ @Brandon oubiub I'm not really into Java, but Google is my friend, so I now know there is a PixelGrabber class which should do pretty much what you need. \$\endgroup\$ – aaaaaaaaaaaa Jun 23 '11 at 22:56
  • \$\begingroup\$ @The Communist Duck Tiled is great! i didn't know it but i think is love at first sight \$\endgroup\$ – FxIII Jun 24 '11 at 7:53
  • \$\begingroup\$ @Brandon oubiub I wasn't sure if you were doing pixel per tile, or real sized tile per tile. I personally don't think you'll get much advantage out of it. Chances are it will be much slower. \$\endgroup\$ – The Communist Duck Jun 24 '11 at 8:46

try tiled. it's a opensource level editor. and working with it is really simple. it's also opensource so you can easily implement your own file format for it. although many 2d game engines use tmx file format (it's an xml based format) and tiled have all tmx export options.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.