Level Editor Tool for 2D games

Level Editor - Doppler Indie Games

WARNING! I recently switched the parsing format from ‘00’ to ‘0000’. This dramatically changes how files are loaded/saved. If you have issues loading your file, please do NOT update to the latest version!

Try it out now!
https://github.com/doppl3r/Dark-Saunter/raw/master/out/artifacts/Editor/Editor.jar

Source Code!

Hello everyone! I recently “finished” my custom 2D level editor tool! Before I tie the bow on this project, I’d like to hear from you guys first. Here are the main features:

  • Flexable 2D array customization
  • Save/Load projects
  • History Tools (undo/redo)
  • Language Format Compiler (see below)
  • Fluid window resolutions for larger screens
  • Simplified navigation and shortcuts similar to Photoshop
  • Useful Tools (Draw, Erase, Fill, and Drag)
  • Custom Texture Pack Importations
  • Mac/PC/Linux Friendly

And here are some screenshots:

For those who like to hard-code their 2D arrays, you’ll love the Language Format Compiler feature. Simply copy+paste your map format of choice! Credit to Mads for recommending an option for each format!

UPDATE: Now supports ActionScript 3 2D Array conversions!

I definitely plan on using this tool for future games and I hope you do too! If you’re bored, feel free to download a game I made for Android last year: https://play.google.com/store/apps/details?id=pack.boxel.main&hl=en

wow man it is really neat. could use a bit more functionality but the interface is very slick and polished.

maybe add a select tool.

also would like to know how you got everything looking so nice ? :smiley: is it a custom ui ? gridbag?
is there a tut you can point me to? hehe i currently also made a map editor for a game i am working on but it is very ugly in respects to the iu and component placement

As far as the GUI goes, I designed all of the components in Photoshop and Paint.net. I use the ‘paintComponents()’ method built into awt.* as a way to draw the buttons to the screen. I tried using the GUI’s built into swing for the prototype version of this app, but I got overwhelmed with the nasty complications embedded with that library haha!

You can see how I did it by looking at the EditorGUI class code I wrote: https://github.com/doppl3r/Dark-Saunter/blob/master/src/editor/EditorGUI.java

Feel free to download all the source code for this project from that link, maybe it can be of use :smiley:

ok man cool , hehe . again great work on the look and feel . it really does look professional .

Maybe change the cursor when the user is using a certain tool . like you do when they use the drag tool but for everything else too :slight_smile:

Its cool, but why have support for C++ if this is a Java program? Are you actually converting those arrays into Java style arrays when loading the map file into the graphical editor? Or can you not edit text maps and then load them in the editor?

I like it! Put a little more work into it, and it would be great for everyone to use! :slight_smile:

@opiop65 I agree, why use C++ codes?

I plan on adding more 2D array formats for a few more languages (such as ActionScript3, Python, JavaScript etc) so that people can choose to use this tool according to their language of choice.

You can literally copy+paste (hardcode) them into your game and the data can be accessed by simply calling map[row][column];

Lots of my friends use C++ so it was an easy choice of conversion :smiley:

Great job! I find it fun just to play around with it :smiley:

Has a really awesome GUI, but not all of the features that Tiled has. Implement those features and I think you will have an award winning tool! :smiley:

Thanks for saying that!

This is definitely the most complex tool I’ve built up to date, hopefully I can match some of the cool features from Tiled :o

Is there the ability to shift entire sections of blocks? that would be epic. Also do you think you are going to expand this even further to support things such as isometric maps? :smiley: looking great though very nice project.

That’s a great idea! If I give the ‘Tile’ class a “selected” boolean, I should be able to come up with a drag feature fairly quick. The last feature would be to select tiles from the ‘Tile Sheet’ box on the bottom right so that you can draw chunks of textures such as trees…o boy! haha

Keep up the good work! Also you should implement a layers feature! Have multiple layers of tiles and implement a transparency color selector for tile-sets that have transparent spots. Otherwise, its great!

I think you should add the functionality to choose what kind of data is output, instead of just outputting all the formats.
When choosing a location for the file, theres that dropdown-menu. Why not use that?

That’s a good point! I think I’ll just have a pop-up field that allows users to choose which compiler to write to and the user can just copy/paste from the dialogue box rather than the hard-to-access .txt file.

I’m seriously going to try to implement this today, thanks man!

Threw you a medal for the good work and the solid idea :wink:

Awesome! You should still keep the option for a file though, so I can just save levels directly into my workspace. You know, when I’m not hardcoding them. :slight_smile: Cheers!

This is a really awsome, great tool! Really original. ;D (+1)
If I wanted to build the editor into a game, would I have your permission?
And if so, how would you like to be given credit?

Feel free to include this tool inside your game projects. Just leave the links that lead to the github page: https://github.com/doppl3r.

I hope this tool helps you create some really cool levels!
Edit: I just updated the Compiler to work with ActionScript variable types…not that any of us will ever use this haha

Hey, I want to add a parser for this to my game engine MERCury. Can you explain to me how you write the map files? I took a look at a standard file (made it 5x5 for JGO’s post size), and found this:

1303030313
0303000303
0300030003
0303000303
1303030313
texture[0808]=null

I am going to assume that each tile’s data is just 2 digits? What if one inputs a very large large tile-texture, like 1000x1000?

00010000000000000000
000000000000840284020000
0000000000000084020000
0000005293000000000000
0052930000000000000000
000000008402000084020000
00000000000000000000
00000000000000000000
texture[9999]=/home/wessles/maptilse.png

I just cannot tell how to parse this… Can you help?

The current parser only supports up to 99 tile types. I didn’t think I’d run into this issue until just now.

The file saves everything according to ‘00’-‘99’. What i’ll need to do is set it to ‘0000’-‘9999’. That way you can have almost 10,000 different types of tiles.

When this is fixed, you can use my ‘convertFileToMap(File file)’ method to parse your own custom map files. ‘Ctrl+F’ to find this method example here: https://github.com/doppl3r/Dark-Saunter/blob/master/src/editor/FileBrowser.java

I’ll add this issue to my list right now and hopefully fix it tonight.