Alternate/New Level Editor?

Alternate/New Level Editor?

Postby Beren » 16 May 2012, 13:51

Hi,

when I learned about Me And My Shadow, I was thrilled. Loved the concept! Thanks for this game.
I actually wrote a clone in Java for MAMS, which is not finished yet.

More importantly, though, I have used my "generic" Level Editor to produce levels for my version of Me And My Shadow. The level editor can read "your" levels (i.e. "map" files) and "my" levels (i.e. "xml" files) -- but currently, it can only write my files.
If anyone is interested in using/trying/expanding this level editor (written in Java), feel free to, you can have sources and binaries.

Of course, there are a lot of features still missing, but maybe you like what you see...

So first: Here's a screenshot: Image

Here's the binary release as a zip file (unpack and click on either bat file to start -- if you are using Windows, that is :)): http://www.phbouillon.de/MAMSLevelEditor.zip [Needs Java 6]

and finally, here's the source release as a zip file: http://www.phbouillon.de/MAMSLevelEditor_src.zip

So, tell me what you think. Is this a good alternative for the existing level editor? Or is it just overkill? Note: I realize that the editor is completely useless as long as I don't write your format, but this can be changed easily enough.

Mouse editing of paths is implemented for moving blocks only (and moving shadow blocks and moving spikes): Select the "pick" tool and drag an end-point of a moving vector to your desired destination (end points are squares; starting points are circles).

Questions? Just ask me :)

Have fun,
Beren
Beren
 
Posts: 9
Joined: 09 May 2012, 14:10

Re: Alternate/New Level Editor?

Postby Edward_Lii » 16 May 2012, 14:04

Hello Beren,

Beren {l Wrote}:when I learned about Me And My Shadow, I was thrilled. Loved the concept! Thanks for this game.
I actually wrote a clone in Java for MAMS, which is not finished yet.

That's funny, in the beginning of the project there was a moment where I considered porting/rewriting in Java. (here).
But that's a very long time ago. :p

Beren {l Wrote}:More importantly, though, I have used my "generic" Level Editor to produce levels for my version of Me And My Shadow. The level editor can read "your" levels (i.e. "map" files) and "my" levels (i.e. "xml" files) -- but currently, it can only write my files.
If anyone is interested in using/trying/expanding this level editor (written in Java), feel free to, you can have sources and binaries.

...

So, tell me what you think. Is this a good alternative for the existing level editor? Or is it just overkill? Note: I realize that the editor is completely useless as long as I don't write your format, but this can be changed easily enough.

Mouse editing of paths is implemented for moving blocks only (and moving shadow blocks and moving spikes): Select the "pick" tool and drag an end-point of a moving vector to your desired destination (end points are squares; starting points are circles).

I must say it looks very good, well done. ;)
Though as much as I like it, I hope you understand that we like to keep the main focus on the internal leveleditor.
I have nothing against an alternative editor for meandmyshadow, in fact I have thought about that a few times before, but I think in the end it will be mostly duplicate work.
The advantages of improving the internal editor is that you can easily integrate it with other parts of the project, like directly testing the level, uploading level(pack)s, etc...
And it will make it easier for users to start creating levels and levelpacks.

One thing I would like to see is how you parse the .map files, the format that is used is based on an old Java project of mine.
I will probably look around in your code some more. :)
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 774
Joined: 20 Dec 2010, 16:46

Re: Alternate/New Level Editor?

Postby Beren » 16 May 2012, 14:47

Uh-oh... Of the one aspect of the level editor, you'd like to have a look at parsing of the map files :) -- Ouch... Ok. Have fun :). The relevant part is in LevelReader.loadMapFile.

What I do here is that I convert your map files into my xml files and use my XMLParser (jaxb) to create Java objects for it... (I already had the map to xml converter so that I could use your levels in my game). Not what anyone could call straightforward :)

Obviously, I agree that focusing on the internal editor is the way to go. However, I must say that I first stumbled upon the editor on my laptop -- no mouse attached... And I was wildly clicking the "configure" button in order to try to make a solid block "move". It wasn't until way later (my level editor was working) that I discovered how to use the internal level editor. Maybe a tutorial would be helpful :) [Or maybe, I'm just the only one around not getting the concept :)].

Oh, and in case you were wondering: In "my" MeAndMyShadow, I have added PushBlocks and ShadowPushBlocks, which work as in Sokoban: Push blocks can be moved bei either Player or Shadow: If he walks into it, the block is moved one field. (So, for example, if player walks right and hits a PushBlock and the field to the right of the PushBlock is empty, the player will push the PushBlock to the right). Same is true for ShadowPushBlocks, only that the Player walks right through them, while only the shadow can push them. I thought about the idea and the more I thought about it, the more I liked it. As soon as my game is finished, I'll post the link here.

Well... Back to work for me :)
Beren
 
Posts: 9
Joined: 09 May 2012, 14:10

Re: Alternate/New Level Editor?

Postby odamite » 16 May 2012, 14:52

Hello Beren,

Your level editor is just great! It seems to be a little more user friendly than our editor because it's using a native toolkit. This provides a familiar user interface behaviour for users. It's also great you've chosen cross-platform language and the editor works well on linux! :D

I've noticed couple of things in the program. First it doesn't quite fit in the looks of a linux desktop. It seems that you're using some windows specific code to theme things and removing this would help a lot. I understand that this is just a early version and user interface isn't final and polished. But I've got some suggestions for you. First you should use a menu for stuff like save and load. Secondly you should make a small horizontal toolbar at the top containing all tools. Also there is duplicated tab header in the blocks section. Finally widgets always need some padding between them.

I'm glad you liked meandmyshadow and I'm looking forward to the final version of the application. Last thing I would like to see is compatibly with original game. On the whole this is looking very promising and good luck with it. :)
User avatar
odamite
 
Posts: 166
Joined: 16 Jan 2012, 16:28

Re: Alternate/New Level Editor?

Postby Edward_Lii » 16 May 2012, 15:02

Hello Beren,

Beren {l Wrote}:Uh-oh... Of the one aspect of the level editor, you'd like to have a look at parsing of the map files :) -- Ouch... Ok. Have fun :). The relevant part is in LevelReader.loadMapFile.

What I do here is that I convert your map files into my xml files and use my XMLParser (jaxb) to create Java objects for it... (I already had the map to xml converter so that I could use your levels in my game). Not what anyone could call straightforward :)

* Me looking at the code *
* Reading stuff like bw.write(" <offset x=\"" + (xPos.get(i) / 50) + "\" y=\"" + (yPos.get(i) / 50) + "\" time=\"" + times.get(i) + "\"/>\r\n"); * :?
* parseXMLData(map, editorPanel); * :shock:

Just kidding, it's a nice workaround. :D

Beren {l Wrote}:Obviously, I agree that focusing on the internal editor is the way to go. However, I must say that I first stumbled upon the editor on my laptop -- no mouse attached... And I was wildly clicking the "configure" button in order to try to make a solid block "move". It wasn't until way later (my level editor was working) that I discovered how to use the internal level editor. Maybe a tutorial would be helpful :) [Or maybe, I'm just the only one around not getting the concept :)].

I agree that there should be some more guidance regarding the level editor, preferably in the form of a (video) tutorial.

Beren {l Wrote}:Oh, and in case you were wondering: In "my" MeAndMyShadow, I have added PushBlocks and ShadowPushBlocks, which work as in Sokoban: Push blocks can be moved bei either Player or Shadow: If he walks into it, the block is moved one field. (So, for example, if player walks right and hits a PushBlock and the field to the right of the PushBlock is empty, the player will push the PushBlock to the right). Same is true for ShadowPushBlocks, only that the Player walks right through them, while only the shadow can push them. I thought about the idea and the more I thought about it, the more I liked it. As soon as my game is finished, I'll post the link here.

That sounds quite interesting, and when you push the block it will move a whole square (50px)?
One thing I noticed about your editor is that the blocks are aligned in a grid, while this is kind of true for the internal editor also it doesn't have to be (holding shift while placing/moving blocks).
I'm wondering if in your project the blocks are stuck in the grid or can also be placed "outside" the grid.

We're quite cautious with adding new blocks and features in the game since it's quite easy to bloat the original/core gameplay.

One last question, do you use the C++ source as reference or do you write it on the output, in other words do you follow the code or the game?
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 774
Joined: 20 Dec 2010, 16:46

Re: Alternate/New Level Editor?

Postby Beren » 16 May 2012, 15:05

Hey Odamite,

thanks for your suggestions. Removing the Windows stuff is a one liner, actually :)... This should be trivial.

The duplicated tab header is "by design" (if you are referring to the vertical and horizontal occurence of "Solid Blocks" in my screenshot): You see, in the "groups" (vertical tab), you can arrange subgroups (of which, in Me And My Shadow, there's always just one). But I agree that removing the tab header if there is just one subgroup would look better. I'll put it on my list.

Menu instead of buttons: Definitively! [But buttons are so easily implemented for testing :d]
Tools in a toolbar above: Hmm, I was thinking of a separate window with tools like in Gimp or Photoshop, but a toolbar at the top of the window is fine, too...
Padding: Ok. That's one of those things that I, as a programmer, always fail to see... I'm not a designer, so thanks for the hints.

Saving map files: Ok, should not be too hard to implement. I'll post an update as soon as it's finished...
Beren
 
Posts: 9
Joined: 09 May 2012, 14:10

Re: Alternate/New Level Editor?

Postby Beren » 16 May 2012, 15:12

No-no, I completely agree: The map parsing is ---- well ---- weird :). It works, however...

Interesting concept of moving blocks less than 50px... No, this is not implemented in my level editor and all blocks are completely aligned at the 50px border.
Even MovingBlocks can only be told to move by 50px offsets... I can see how this can be limiting... Hmmm... I have to think about this; this might be a bit more difficult to change, since I have a very static representation of my field... Hmm.....
So, for push blocks, the answer is the same: Yes, they move a whole block. And incidentally, if you push them over a hole, they will fall down -- until they reach the ground, possibly crushing a player (shadow) that is in their way. (Which obviously only happens if you let a push block fall down on a player. If you push it to the right and the player/shadow stands to the right of the push block, the player/shadow is moved to the right, too -- and possibly crushed if there's a wall next to him :)).

When I first stumbled upon MnMS (I always call it MAMS, sorry about that), I took a look at the C++ code but decided it would be more fun to rewrite the application from scratch, so: No, I did not take a look at your source code in depth, thus: I followed the game, not the code. If you are interested in seing my Java Code of the game, I can upload it, too, of course.
Beren
 
Posts: 9
Joined: 09 May 2012, 14:10

Re: Alternate/New Level Editor?

Postby Beren » 16 May 2012, 15:21

Actually, here's the link to my Java version of MnMS: http://www.phbouillon.de/MeAndMyShadow/test.html

Note that this is an Java APPLET (!) however... Thus, there are a couple of drawbacks... First, you'll have to accept the certificate (because I need JAXB to parse the XML data; rest assured that I won't harm any files on your computer). Second, it's loading times are slow. This is especially unnerving when viewing the help file. You click on next and you may have the impression that nothing happens... Well, give it a few seconds :).

Otherweise, the game is pretty much a clone of your 0.2 version -- or 0.3?! Can't remember. Following the game -- not the code.

Comments are welcome :)
And note: This was purely for fun! I am not trying to claim any credits for your work!
Beren
 
Posts: 9
Joined: 09 May 2012, 14:10

Re: Alternate/New Level Editor?

Postby Edward_Lii » 16 May 2012, 15:24

Hello Beren,

Beren {l Wrote}:...
When I first stumbled upon MnMS (I always call it MAMS, sorry about that), I took a look at the C++ code but decided it would be more fun to rewrite the application from scratch, so: No, I did not take a look at your source code in depth, thus: I followed the game, not the code. If you are interested in seing my Java Code of the game, I can upload it, too, of course.

I think what you did is better, looking at the game and not the code, you'll get a code base that you 100% understand.
Besides that from what I read it seems that it's going to be a different game on it's own with the same concept. :)

I would like to see the Java code if you don't mind, don't feel rushed though. ;)

Beren {l Wrote}:... MnMS (I always call it MAMS, sorry about that) ...

Call it what you want, we had a discussion about it some time ago, IIRC we settled on:
    - meandmyshadow In URLs and unix names.
    - Me & My Shadow for artwork and the logo.
    - Me and My Shadow at the start of sentences.
    - MeAndMyShadow somewhere in the sentence.
    - M&MS abbreviation
But I've seen everything by now, even translations (Yo y mi sombra) :p

EDIT: Seen your last post just.
Beren {l Wrote}:Note that this is an Java APPLET (!) however... Thus, there are a couple of drawbacks... First, you'll have to accept the certificate (because I need JAXB to parse the XML data; rest assured that I won't harm any files on your computer). Second, it's loading times are slow. This is especially unnerving when viewing the help file. You click on next and you may have the impression that nothing happens... Well, give it a few seconds :).

Otherweise, the game is pretty much a clone of your 0.2 version -- or 0.3?! Can't remember. Following the game -- not the code.

Wow, it remindeds me of the Web port that was made of meandmyshadow:
http://forum.freegamedev.net/viewtopic.php?f=48&t=2905
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 774
Joined: 20 Dec 2010, 16:46

Re: Alternate/New Level Editor?

Postby acme_pjz » 16 May 2012, 16:01

Hi Beren,

Beren {l Wrote}:Oh, and in case you were wondering: In "my" MeAndMyShadow, I have added PushBlocks and ShadowPushBlocks, which work as in Sokoban: Push blocks can be moved bei either Player or Shadow: If he walks into it, the block is moved one field. (So, for example, if player walks right and hits a PushBlock and the field to the right of the PushBlock is empty, the player will push the PushBlock to the right). Same is true for ShadowPushBlocks, only that the Player walks right through them, while only the shadow can push them. I thought about the idea and the more I thought about it, the more I liked it. As soon as my game is finished, I'll post the link here.


Great idea ;) but IMHO we need an efficient collision detecting code :|
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 514
Joined: 10 Dec 2009, 15:32
Location: Biejing, China

Re: Alternate/New Level Editor?

Postby ctdabomb » 16 May 2012, 16:09

Beren {l Wrote}:Obviously, I agree that focusing on the internal editor is the way to go. However, I must say that I first stumbled upon the editor on my laptop -- no mouse attached... And I was wildly clicking the "configure" button in order to try to make a solid block "move". It wasn't until way later (my level editor was working) that I discovered how to use the internal level editor. Maybe a tutorial would be helpful :) [Or maybe, I'm just the only one around not getting the concept :)

I also had a bit of difficulty figuring out all the special parts of the editor.
Some people are like slinkies... not really good for anything, but you still can't help smiling when you shove them down the stairs.
ctdabomb
SuperTux Moderator
 
Posts: 1074
Joined: 13 Dec 2011, 21:21
Location: halfway there

Re: Alternate/New Level Editor?

Postby Beren » 16 May 2012, 17:26

Thanks for your feedback... Have to be brief right now, so: I'll post the code of the game for you later tonight (or maybe tomorrow) -- no snide comments, though :) -- kidding of course; any feedback is welcome.

Regarding the collision detection for the push blocks, I found it relatively simple (with one exception), but that's of course due to the fact that everything is based on 50px boundaries....

Gotta run!
Beren
 
Posts: 9
Joined: 09 May 2012, 14:10

Re: Alternate/New Level Editor?

Postby Beren » 16 May 2012, 19:53

Hm: Wrong computer, so this is not the latest code, but only the push blocks are missing :).

I will update the code on Friday, though.

Check it out at http://www.phbouillon.de/MeAndMyShadow_src.zip

And as I said: Comments are welcome (criticize me, if you must :)).

I had some fun coding this. My "nightmare" class is the Physics class (isn't it always?). And there are some "short cuts" violating the loose coupling principle... Other than that, I think that it's somewhat clean -- for a private project.

Oh. To set it up, import it into Eclipse (or your preferred IDE) as an existing project. Main class is in main/MeAndMyShadow, which can be run as an Applet using the AppletViewer.
Setting it up so that it runs as an Application isn't hard, either.
Questions? Just ask me. Thanks.
Beren
 
Posts: 9
Joined: 09 May 2012, 14:10

Re: Alternate/New Level Editor?

Postby Edward_Lii » 16 May 2012, 20:55

Hello Beren,

Beren {l Wrote}:And as I said: Comments are welcome (criticize me, if you must :)).

I had some fun coding this. My "nightmare" class is the Physics class (isn't it always?). And there are some "short cuts" violating the loose coupling principle... Other than that, I think that it's somewhat clean -- for a private project.

Had a quick look around, it indeed looks quite organized. ;)
For some reason I hate collision/physics as well (constantly rewriting and debugging the code and still the player walks straight through the wall :p ).

I'm not going to criticize you, don't worry, although there were some...

Great work, glad you enjoyed coding it and of course telling us about it. :)
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 774
Joined: 20 Dec 2010, 16:46

Re: Alternate/New Level Editor?

Postby Beren » 17 May 2012, 07:33

(constantly rewriting and debugging the code and still the player walks straight through the wall :p ).


Spiky Travel did most of the testing for me: I can't recall how many times, the players fell through the bottom, mostly when they were moving and the group of blocks they stand in in this level, changed direction. Yargh....

But anyway: Back to the original topic :) -- I will try to work in your suggestions for the level editor and when it's "completed", I'll post an update. It will then be able to save .map files (and maybe levelpacks as well) and -- the most difficult change request -- it will feature positioning of blocks outside of the 50px bounds (I already have an idea how I can easily implement this).

This may take a while....
Until then: Happy coding -- and thanks again for MnMS!

Beren
Beren
 
Posts: 9
Joined: 09 May 2012, 14:10

Re: Alternate/New Level Editor?

Postby acme_pjz » 18 May 2012, 15:08

Hi Beren,

I have a new idea: pushable box with color which will eliminate when two box with same color comes together...
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 514
Joined: 10 Dec 2009, 15:32
Location: Biejing, China

Re: Alternate/New Level Editor?

Postby Beren » 20 May 2012, 15:40

Hey -- I like the idea... I will see to it...

I have started updating the level editor. Some of your suggestions have already been done, but I am struggling with the correct layout of properties... (Swing layout and its quirks :)).

Toolbar, menu, better icons are, however, done...
Beren
 
Posts: 9
Joined: 09 May 2012, 14:10

Who is online

Users browsing this forum: No registered users and 1 guest