Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Level Editor Tool for 2D games  (Read 4884 times)
0 Members and 1 Guest are viewing this topic.
Offline doppler

Senior Member


Medals: 10
Projects: 5



« Posted 2013-11-13 21:47:36 »

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!
https://github.com/doppl3r/Dark-Saunter

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

Practice! Practice! Practice!
Offline Kyperbelt

Junior Member


Medals: 1



« Reply #1 - Posted 2013-11-13 23:17:11 »

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 ? Cheesy 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
Offline doppler

Senior Member


Medals: 10
Projects: 5



« Reply #2 - Posted 2013-11-13 23:27:10 »

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 Cheesy

Practice! Practice! Practice!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Kyperbelt

Junior Member


Medals: 1



« Reply #3 - Posted 2013-11-13 23:32:54 »

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 Cheesy

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 Smiley
Offline opiop65

JGO Kernel


Medals: 154
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #4 - Posted 2013-11-14 00:33:16 »

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?

Offline thunderfist123

Senior Newbie





« Reply #5 - Posted 2013-11-14 00:48:20 »

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

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

Senior Member


Medals: 10
Projects: 5



« Reply #6 - Posted 2013-11-14 01:28:35 »

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 Cheesy

Practice! Practice! Practice!
Offline unenergizer

Junior Member


Medals: 3
Exp: 1 year


Work hard, practice often, and you will succeed!


« Reply #7 - Posted 2013-11-14 06:39:00 »

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

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! Cheesy

JGO is AMAZING!
Steam: unenergizer
Offline doppler

Senior Member


Medals: 10
Projects: 5



« Reply #8 - Posted 2013-11-14 18:18:05 »

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  Shocked

Practice! Practice! Practice!
Offline lcass
« Reply #9 - Posted 2013-11-14 20:27:04 »

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? Cheesy looking great though very nice project.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline doppler

Senior Member


Medals: 10
Projects: 5



« Reply #10 - Posted 2013-11-16 02:38:14 »

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

Practice! Practice! Practice!
Offline unenergizer

Junior Member


Medals: 3
Exp: 1 year


Work hard, practice often, and you will succeed!


« Reply #11 - Posted 2013-11-16 06:10:23 »

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!

JGO is AMAZING!
Steam: unenergizer
Offline Mads

JGO Ninja


Medals: 26
Projects: 3
Exp: 6 years


One for all!


« Reply #12 - Posted 2013-11-16 10:26:41 »

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?

Offline doppler

Senior Member


Medals: 10
Projects: 5



« Reply #13 - Posted 2013-11-16 18:14:23 »

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!

Practice! Practice! Practice!
Offline opiop65

JGO Kernel


Medals: 154
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #14 - Posted 2013-11-16 18:27:55 »

Threw you a medal for the good work and the solid idea Wink

Offline Mads

JGO Ninja


Medals: 26
Projects: 3
Exp: 6 years


One for all!


« Reply #15 - Posted 2013-11-16 19:28:36 »

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.  Smiley Cheers!

Offline saucymeatman
« Reply #16 - Posted 2013-11-16 23:13:20 »

This is a really awsome, great tool! Really original.  Grin (+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?
Offline doppler

Senior Member


Medals: 10
Projects: 5



« Reply #17 - Posted 2013-11-22 01:05:52 »

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

Practice! Practice! Practice!
Offline wessles

JGO Wizard


Medals: 66
Projects: 4
Exp: 3 years


Profile picture isn't relevant.


« Reply #18 - Posted 2013-11-23 23:09:15 »

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:
1  
2  
3  
4  
5  
6  
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?

1  
2  
3  
4  
5  
6  
7  
8  
9  
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?

Offline doppler

Senior Member


Medals: 10
Projects: 5



« Reply #19 - Posted 2013-11-23 23:15:51 »

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.

Practice! Practice! Practice!
Offline opiop65

JGO Kernel


Medals: 154
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #20 - Posted 2013-11-24 00:22:48 »

Or, you could just put spaces between your tile ids in the map file, and parse all the spaces out so all you're left with is integers, which can have a much wider range in terms of the number of ids. Is there some reason why you can't do that? Tongue

Offline doppler

Senior Member


Medals: 10
Projects: 5



« Reply #21 - Posted 2013-11-24 00:29:24 »

That would work better than my current system haha. I chose to keep no spaces for reasons such as resource consistency, but I can see how this could create larger files in some cases. Good idea!

Practice! Practice! Practice!
Offline CodeHead

JGO Knight


Medals: 41


From rags to riches...to rags.


« Reply #22 - Posted 2013-11-24 06:02:05 »

Why go with base 10 integers? Hexadecimal numbers will give you a wider id range with less characters needed if you're worried about size when using text formats.

Arthur: Are all men from the future loud-mouthed braggarts?
Ash: Nope. Just me baby...Just me.
Offline doppler

Senior Member


Medals: 10
Projects: 5



« Reply #23 - Posted 2013-11-24 21:23:16 »

I decided to cap at '0000' instead of hex conversions for a few reasons:

  • Even if you texture sheet is 32x32, the number of possible textures is 1024. In order to reach the limits, you'd have to have a 100x100 texture sheet which is not very practical in the 2D design world.
  • File size will remain consistent. You won't have to worry about your file workspace increasing after you save.
  • It encourages smaller texture sheets (my own personal preference)


Practice! Practice! Practice!
Offline wessles

JGO Wizard


Medals: 66
Projects: 4
Exp: 3 years


Profile picture isn't relevant.


« Reply #24 - Posted 2013-12-02 02:06:55 »

Yeah, I guess that would be silly to have such a large file...

But I managed to add it in! Now I can easily create map files, thanks to you!

Keep up the AMAZINGLY awesome work.

-wes

Offline wessles

JGO Wizard


Medals: 66
Projects: 4
Exp: 3 years


Profile picture isn't relevant.


« Reply #25 - Posted 2014-02-03 22:29:02 »

Doppler, I am noticing some bugginess with the saving. I am getting extra 0's sometimes. It keeps happening, and I don't know why. I am pretty sure it could have something to do with your 4-digit system (not sure how though Tongue).

For example, one line will have 135 digits total. 135/4 is not a whole number, thus making this system break!

Wierdly enough, however, the Editor seems to open the file again without flaw.

Here is the pastebin.

I hope I am not making a ridiculous mistake!
-wes


Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (12 views)
2014-08-28 18:26:30

CopyableCougar4 (24 views)
2014-08-22 19:31:30

atombrot (37 views)
2014-08-19 09:29:53

Tekkerue (30 views)
2014-08-16 06:45:27

Tekkerue (29 views)
2014-08-16 06:22:17

Tekkerue (18 views)
2014-08-16 06:20:21

Tekkerue (28 views)
2014-08-16 06:12:11

Rayexar (65 views)
2014-08-11 02:49:23

BurntPizza (41 views)
2014-08-09 21:09:32

BurntPizza (33 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!