Ember Tutorial World Editing

From WorldForgeWiki
Jump to: navigation, search

This page is a work in progress,
meaning things are incomplete, unfinished, not fully thought out, might disappear again, and generally are subject to change.
Do not rely on any of this just yet!

Editing the world in Ember

This is a short tutorial of how to edit the world in Ember. You will learn how to log in as admin, how to create new entities in the world, how to create matching model definitions for your entities and finally how to edit the terrain.

Note: the information here is currently outdated and needs to be updated to better reflect the way Ember currently works.--Erik 17:43, 25 March 2008 (CET)

Logging in as admin

N.B. If you're going to edit the world, you must have access to a server where you have the ability to log on as admin. Please refer to http://wiki.worldforge.org/wiki/Installing_Cyphesis for information on running your own server.

Note: The Public Sandbox Server is an open server which allows newcomers to try out the world editing features of WorldForge using the Ember game client. Please refer to the page listed for details on how to access the administrative accounts on the open server.

The first thing you'll see when you start up Ember is the server browser
Error creating thumbnail: Unable to save thumbnail to destination
The server browser
. This will show all the servers currently registered with the main meta server. By double clicking on one of the servers you'll connect to it. You can also manually enter a server in the lower left edit box. This can be useful if you're running a local testing server that you don't want to be publically available.

Once you're connected to the server, you need to log in. All cyphesis servers by default comes with an "admin" account. The password for this can be set on the server by running the "cypasswd" command without any arguments, or running "cypasswd -s admin".

Error creating thumbnail: Unable to save thumbnail to destination
The login window

The admin account

The admin account is a bit different from other accounts as it allows you to create characters of many different classes, whereas any other type of account is restricted to a few (currently "settler" and "skeleton"). However, when we want to edit the world we want to log in as a "creator". Ember therefore provides a quick button labelled "Use creator"
Error creating thumbnail: Unable to save thumbnail to destination
Character creation when logged in as admin
. Press it.

This will create a new character of the type "creator". This entity differs from most other entities in that it's given almost unlimited ability to edit the world. Additionally, the entity is automatically destroyed upon disconnection (note that everything in the inventory of the creator entity is also destroyed. In Ember it's represented by a flame. Note the "Admin" window that has appeared down to the left. This provides some quick shortcuts to the most common tools you'll be using when in admin mode.

Error creating thumbnail: Unable to save thumbnail to destination
Entered the world as a creator

Switching camera

The first thing we want to do is to switch to a free flying camera, so we're not bound to the entity. Click on "Switch camera" to toggle between free flying mode and bound mode. When in free flying mode you can move the camera around using the regular "wasd" key combination. Also, the keys "r" and "f" can be used for moving up and down.

Error creating thumbnail: Unable to save thumbnail to destination
The camera in free flying mode

The object of this tutorial is to create a castle, so we'll look for a large expanse of flat land. There's such a place in the distance. We now have to move our creator entity over to this place.

Error creating thumbnail: Unable to save thumbnail to destination
Some open space in the distance

Moving entities

Error creating thumbnail: Unable to save thumbnail to destination
The action menu when clicking on the Creator

In order to move an entity, left click on it. This will bring up the entity action menu. Select "move" in the menu. While in "entity movement mode", mouse movement will move the entity. Using the scroll wheel will rotate it around the y-axis. Pressing "shift" while moving will shift the rate of movement. You can still click the right mouse button to switch to "camera movement mode", allowing you to reposition the camera while moving. Pressing "esc" will cancel the whole move operation. So, left click on the creator entity and move it over to the intended spot. Pressing "shift" will probably help.

Error creating thumbnail: Unable to save thumbnail to destination
Moving the Creator

Creating entities

Error creating thumbnail: Unable to save thumbnail to destination
The Creator in position

Once we're in position, it's time to bring up the Entity Creator. Press the "Entity creator" button in the admin menu. This will display a tool that helps with creating new entities. All current available entity types will be shown in a listbox. You can also give the new entity a name by entering it into the textbox. In this tutorial we'll start by creating an outer castle wall. The entity type "castle_outer_wall" would be excellent for that. Click create to bring it into the world.

Error creating thumbnail: Unable to save thumbnail to destination
The entity creator tool

A new entity has now been created, but there a problem: there's no corresponding model for the entity. Whenever Ember is asked to create a new entity for which it has no model to show, it will automatically create a placeholder model, shown as a black box. Clicking on the box will bring up the action menu. Select "Inspect" to inspect this entity. In the inspect window now shown, click on the "Eris bbox" button which will show how the server defines the entity. We want to make sure that our model lines up to this box as much as possible. This will naturally lead us to the next step of the tutorial: using the model editor.

Using the Model editor

Press the "Model editor" button to bring up the tool
Error creating thumbnail: Unable to save thumbnail to destination
The model editor
. On the left there's a list of all models registered in the system. Ember currently does an exact match of the entity type name to determine which model to show for a specific entity, so our "castle_outer_wall" entity would have a corresponding model with the same name. Press the "Reload" button to reload the list if you can't see this model. Since there wasn't any model definition for that entity type from before, Ember has created one itself, and as previously mentioned added a placeholder mesh to it. Once you've found the model defintion, select it. When the model is selected, you'll see a preview of it in right side window
Error creating thumbnail: Unable to save thumbnail to destination
The castle wall selected in the model editor
. Pressing and holding the left mouse button while moving the mouse will pitch and yaw the model. Holding down "ctrl" will also allow you to roll the model. The buttons in the lower right corner also allows you rotate the model in discreet steps of 45 degrees. Using the scroll wheel when the mouse is over the preview will zoom in and out.

Removing and adding meshes

A model can be made up of zero or many different meshes. A mesh will also be called a "submodel". These meshes can then be divided into parts, each part containing one or many submeshes. This is shown in the smaller listbox. Autogenerated models such as this one have a placeholder mesh added to them by default, with a part named "main". Our first order of business is to remove this placeholder. Therefore, select the placeholder mesh in the list and click on "Remove submodel".
Error creating thumbnail: Unable to save thumbnail to destination
Selecting the placeholder mesh
Once the placeholder mesh is removed we now need to add a more correct mesh. Start by selecting the model in the model list if it's not already selected. The lower half of the window will now show model settings to the right (we'll get back to those later on) and all meshes available in a list to the left. In this case there's already an excellent mesh to be found at 3d_objects/items/building/castle/outerwalls/outer_wall.mesh
Error creating thumbnail: Unable to save thumbnail to destination
Adding a new mesh to the model
. Select it and click on "Add submodel".

As you can see, a mesh has been added to the model. It has one part named "main" comprised of one submesh with the index 0. Let's take a look how this will look in the world. Click on "Reload models", which will reload all models in the world which uses this model definition. Then double click on the title bar of the window to roll it up. As you can see the castle wall has been updated, but there are still some things wrong with it.

  1. It's the wrong scale
  2. It's the wrong orientation
  3. It has no texture

Setting scale

We'll deal with these problems in order. Double click on the rolled up window to show the model editor again. The wrong scale issue is most easily fixed by telling Ember to use the width of the model as a reference scale. The meshes in the client will seldom match up exaclty to the bounding box defined in the server, so you'll probably have to experiment with different settings. For now, select "width" in the "Use scaling" drop down.

Setting orientation

As we can see in the model preview the mesh is by default oriented askew. Click on the "Down" button in the preview window which will pitch the model 45 degrees. After clicking it twice the model will be more correclty aligned. Now click on the "Rot. from preview" button. This will update the model's rotation to be of that shown in the preview window. You could of course manually enter the rotation, but it's cumbersome unless you're a 3d math wiz. Click on "Reload models" once more, and roll up the window once more. As you can see the model is now correclty aligned to the ground, but it's not yet completely fitting with the server bounding box. We need to rotate it 90 degrees around the z-axis. Bring up the model editor once more and press twice on the "Roll right" button. Then press "Rot. from preview", "Reload models" and roll up the model editor. The model now appears to fit with the server representation as it should!

Setting materials

On to the last problem then: the absense of texture. Bring up the model editor. As previously mentioned, each Model is made up of different meshes. Each mesh then have one or many submeshes. A submesh is basically a part of the mesh that has a material defined for it. So a mesh which requires two different materials would then have two submeshes. In this case however the outer wall mesh only has one submesh. The submeshes are shown in the smaller listbox in the third level (first level is the mesh, "outer_wall.mesh", the second level shows the part, in this case only the autogenerated "main" part, and the third part shows the submeshes (by index, "0" in this case). Select the "0" submesh.
Error creating thumbnail: Unable to save thumbnail to destination
The submesh is selected
This will show a listbox containing all the materials defined in the system. Now, for this tutorial there's already a material for the outer walls defined (how to create materials will need to be covered in another tutorial). To ease the finding of this material, use the filter field below the list. Enter "castle", which will narrow down the list a bit. Select the material "/global/items/building/castle/foundation/outer_walls". As you can see in the preview, this looks like the correct material. Click on the model entry in the model list to show the model specific settings and click on "Reload models". Roll up the window.

Saving model definitions

The castle walls now look correct, don't they? We've now created a model definition, so we want to save it. Bring back the model editor, select the model and click on the "Save" button. This will save the model defintion to disc, more precisely to the directory ~/.ember/user-media/modeldefinitions (on windows it's c:\Document and Settings\$user\Application Data\Ember\user-media\modeldefinitions). All media placed in the "user-media" will override the default media. Next time you start up Ember it will load our model defintion for the castle outer walls.