Xmoto-edit

From X-Moto
Revision as of 23:24, 6 February 2007 by The only dude (talk | contribs)
Jump to: navigation, search

Deutsch - Català - Español - Français

A new tool to create level is available: Inksmoto Level Editor.
It allows you to create smoother and better looking levels.
(It uses the free vector drawing tool Inkscape with true undo/redo capabilities).
More informations here: How_to_create_smooth_levels_using_Inkscape

It should be pretty easy for anyone to add new stuff to the game; either new levels using standard graphics, or new levels using home-made graphics and stuff. This page will cover most of the possibilities, when I get the time to write it :)

Using The Level Editor

Note that since X-Moto 0.2.4, you have to press F5 at the menu stage
when you modify the Levels directory (if you make a new level for example)

This part is a small tutorial that goes through the easy steps involved in creating a simple X-Moto level. Before we start, it is probably a good idea to introduce you to some of the different buzzwords that will be used again and again:

  • Blocks are the basic parts of an X-Moto level, it is those who form the solid ground below the player's wheels. Any given block can only have a single texture. If a block has the background flag it is not touchable by the player, and merely is reduced to pure background graphics. Blocks can have any form, both convex and concave. They are also allowed to overlap.
  • An edge is a side of a block. Edge effects can be assigned to edges, for instance to create grass.
  • Vertices are the corners of the blocks.
  • An entity is a game object. Examples of such are strawberries and player start positions.
  • A sprite is a type of entity that are useful for display static graphics inside the game, like trees.
  • Particles can be used to create smoke.
  • The editor offers four different editing modes. In a given editing mode it is only possible to modify a specific aspect of the level, for example positions of vertices or entities.

Start up the editor by invoking the program xmoto-edit. On Windows it is located in the same directory as the X-Moto game itself.

The editor window opens, and looks like this:

Xmoto-edit.png

On the screen you can find:

  • The big gray area is the view of the level. The part the grid is the actual play area, everything outside is not in the level.
  • Cursor coordinates in the upper left corner of the screen.
  • Main menu is located in upper right corner of the screen.
    • New Level - Loses the current level and begins a new one. Be careful with this one, there is no regretting.
    • Save Level - Saves the current level.
    • Load Level - Loads a level.
    • Play Level - Play the current level in the game.
    • Move Limits - Moves the limits of the level, i.e. lets you resize the gridded area in the view.
    • Create Block - Creates a new block.
    • Edit Sel. Entity - Edit the currently selected entity.
    • Level Properties - Edit the curerent level's properties.
    • Edit Edge FX - Adds/removes effects from the currently selected edge.
    • Smooth Edges - Smooths the selected edges. Be careful with this, a level can quickly get very slow.
    • Delete Selection - Deletes selected block/vertex/edge/entity.
    • Tgl. Blk BG - Toggles the background flag of currently selected block.
    • Copy Entity - Easy way of making lots of the same entity.
    • Exit - Quits the editor. Note that it will not ask you to save, it is very cruel.
  • Just below the main menu you can see the list of available entities. To place an entity, simply click on its type and then on the level locating it should be positioned.
  • The texture selector is located in the bottom right corner of the screen. This is only active when in block editing mode.
  • Below the gray level view, there is a darker gray area, which is the log. When the editor wants to say something, it writes the message here.
  • The snap selection is provided in the lower left corner. This controls whether (and how much) the cursor should snap to the grid.
  • The editing mode selection menu is just to the right of the snap selection menu. Use this to jump between the four different modes.

You can navigate around the level with your mouse. Right-clicking anywhere will center the view at that location and your mouse wheel zooms in and out, or if you don't have a mouse wheel, the keys A and Z do the same job.

Initially when the editor starts up, it opens a new blank level, only with a player start position entity:

Xmoto-edit start.png

You can move it around by going into entity editing mode and then drag and drop it with the cursor. The first thing you should do when creating a new level is to activate the "Level Properties" main menu item:

Xmoto-edit levelprops.png

Click on the file name and enter something that will be unique for the level. All levels should be located in the /Levels sub directory. Then click on the ID to change it. The level ID is what will be used to identity your level in an unique way independent of the file name. The ID should not include any spaces. Finally click "Name" and enter a more descriptive name of the level. When done it should look something like this:

Xmoto-edit levelprops edited.png

For our level we will start by creating a block. Zoom in a bit, so you can better see the area around the player start position. Then click "Create Block" in the main menu to initiate the block drawing. Place vertices one after another until you decide to close the block by clicking on the first vertex. Note how the order of vertex placement is important:

Xmoto-edit creating block.png

Vertices must be placed in clockwise order, otherwise the level will be broken. This is very important!

Now we want a tree on our block! Click on "Sprite" in the list of entity types, and then click where you want the root of the tree to be located. Note that you should click somewhere inside the block, otherwise the tree will float in mid air.

Xmoto-edit sprite.png

If you placed sprite too high like on the picture above, you can go into entity editing mode, set snap to "off", and then drag the sprite a bit further into the block.

To tell the game that this is a tree, select the sprite:

Xmoto-edit sprite sel.png

Click on "Edit Sel. Entity" in the main menu. Then modify the parameters to look like this:

Xmoto-edit sprite edited.png

That is, you should set the name to either "Tree1" and "Tree2". Now we will try to see how it looks like inside the game. Simply click "Play Level" in the main menu, the game loads, and something like this should appear:

Xmoto-edit ingame1.png

(Up to X-Moto 0.2.2, remember to close the game before continuing work in the editor, here you should always quit the game after testing your level)

Wouldn't it be nice with some grass on the top of the blocks? Sure, and it is easy to add: Go into edge selection mode and select the edges you want to add grass to:

Xmoto-edit edges sel.png

With the edges selected and red, click on "Edit Edge FX" in the main menu, and set "Edge Effect" to "Grass" (the capital G is important):

Xmoto-edit edges edited.png

After deselecting the edges, they now appear with a blue color. This is useful for keeping track of which edges that have been given effects:

Xmoto-edit edges with grass.png

"Play Level" again, and voila, now there's grass.
Note: Since X-Moto 0.2.4, you will have to press F5 in the game running, to reload the level directory. Otherwise you will only see the old version of your level. The advantage is, that you don't have to quit X-Moto after testing when returning to editor work. Just press F5 to reload.

Xmoto-edit ingame2.png

Now you probably want to make the level playable. This is done by adding an "EndOfLevel" entity and any number of "Strawberry" entities. Also try to create another block. It could look something like this:

Xmoto-edit playablelevel.png

Try "Play Level" it and see if you can actually finish it.

To add some extra depth to the level appearance, you can try creating a background block. Create a block that appears to "lift" your two other non-background blocks, like this:

Xmoto-edit bgblock.png

Note how the new block overlaps the two others to make sure there is no gaps. To make it a background block, go into block selection mode, select the new block, and click "Tgl. Blk BG" in the main menu. You should also assign another texture to it. Click on the texture menu in the lower right corner of the screen, and click on the dark ground texture:

Xmoto-edit texturesel.png

Deselect everything, and see how background blocks are drawn in green:

Xmoto-edit bgblock2.png

Now click on "Play Level" again, and your level is finished:

Xmoto-edit ingame3.png