← Back to team overview

logame team mailing list archive

Re: Level Editor

 

Thanks for the kind words Ben :)
I like what I did with the editor too ;)

Enemies are now handled by the editor, so I only have locations left to
do for part one on my todo list.  
PS: any idea why when dragging an enemy onto the background its
direction is reversed?  I can't work it out :(

If you want to help with the editor, my next job would be to get saving
the levels functional.  If you are any good at dumping yaml it should be
easy, but this is my first time with yaml, so you are more than welcome
to have a go.  
The Save button is detected at line 138 in Editor.py, at present it just
prints a line to the console.  All the level objects: tiles,
collectables, enemies are stored in the lists: self.tiles,
self.collectables, self.enemies in Editor. We just need a function to
sort by type the collectables/enemies/tiles (for enemies and tiles this
is their id attribute, for collectibles it is their __class__), create a
list of all their positions (their rect.x and rect.y) and then dump this
info to a file in the format type:
                                 (x,y)
                                 (x,y)
ie: a list of positions in tuples for each type, under the heading
Collectables: or Enemies: or Tiles:  (see current testlevel.yaml)

The other info in the level.yaml file is the background path and is
stored in self.level.background in editor.  I am not sure how to give
the level a title at present as we have no way of typing into the GUI.
It might have to be a command line option later on, it is not important
yet anyway.
If you want to take this on shout, so I don't start doing it:) and
please ask if you have any queries about my code.

Other stuff you may want to do is: we will need simple icons for the
location tiles.  These tiles will only be shown in the editor (but the
position info needs to be saved to file) and they will be how designers
determine player start points, the y axis of the ground (should make
detection of the floor simpler), potentially we could also use them for
music changes and to trigger sound effects (we could have a CRAP! tile
etc..)  But initially we need Fab and Dan start point tiles and a ground
level tile.  I had in mind semi-transparent tiles with a simple image
(in the case of Dan and Fab) or a word on, but do whatever you think
would be good if you are interested.

One other thing to be thinking about: I was talking to Dan in the IRC
last week and mentioned the game, he said he would happily help with any
music or samples we may want, even recording them specially for us and
that Fab would probably do the same.  So it would be good to have a
blueprint on launchpad of voice/sound sample ideas that we would like in
the game, then we can ask Dan for some help :) 

Thanks again for the nice comments,
Paul

On Mon, 2009-10-05 at 20:30 +0200, Benjamin Klüglein wrote:
> Oh my God,
> 
> that editor is so cool, I could hardly believe my eyes when I saw it!
> What a great job!!! It is so easy to use and you even integrated it
> using the games own code, cool.
> I don't know what to say else but WOW :-) 
> Oh well, there's one thing to say, please tell me if I can help you
> with the editor in any way. 
> 
> Ben
> 
> 2009/10/5 Paul Elms <paul@xxxxxxxxxxxxxx>
>         Hi all,
>         I have just committed a first version of the Level Editor.  I
>         don't
>         think I quite anticipated how much work it would be ;)  The
>         version I
>         have committed is not yet complete but I wanted to get
>         something out to
>         the team to get some initial feedback and comments.
>         
>         So, what works (and what doesn't):
>         The editor can be started with the ./editor.py script.
>          Eventually,
>         you'll be able to use command line options to specify which
>         level to
>         edit, or to create a new level using a specified background
>         image.
>         The GUI is complete and mostly functional.  The left and right
>         arrow
>         keys scroll the background along.  You can drag and drop tiles
>         (all red,
>         green and blue at the moment) and collectables.  Right
>         clicking on tiles
>         or collectables on the background deletes them.  Clicking on
>         the arrows
>         on the Tiles button scrolls through the tiles and into the
>         Collectables.
>         This will eventually have lists of Enemies that can be added,
>         and game
>         locations such as player 1 start and so on.
>         
>         The quit button works :) but the save button doesn't yet :(.
>         
>         New collectable or enemy types need to be added to
>         collectables.yaml or
>         enemies.yaml as this is where the game and editor now look for
>         them.  As
>         with the tiles.yaml, eventually we can make it load from sets
>         of
>         tiles/collectables/enemies etc..
>         
>         There is a limit on how big a tile or collectable can be at
>         present or
>         it won't fit in the GUI.  The limit is 100x100.  Again, I want
>         to remove
>         this limit at some point.
>         
>         So, my TODO list at present looks like this:
>         1. Get the editor to handle enemies and locations.
>         2. Get saving to work.
>         3. Allow specifying on the command line a level to edit or new
>         level to
>         create.
>         
>         Have a look and let me know what you think or changes you
>         would like.
>         
>         Paul
>         
>         
>         _______________________________________________
>         Mailing list: https://launchpad.net/~logame
>         Post to     : logame@xxxxxxxxxxxxxxxxxxx
>         Unsubscribe : https://launchpad.net/~logame
>         More help   : https://help.launchpad.net/ListHelp
> 





Follow ups

References