(The documentation concerning the level editor is currently fairly incomplete. I'll see that we could add something suitable once the dialog editor docu is complete.)
FreedroidRPG comes with a built in level editor. It offers level editing using a similar viewpoint like inside the game. A screenshot might look like this:
The level editor can be entered at any point of a running game and it's also possible to continue a game after level editing. This feature is there for testing and development purposes (and not for cheating). To enter the level editor, use the 'Level Editor' option from the escape menu inside a running game.
If you wish to make permanent changes to a map and then contribute the map to the Freedroid project, please make sure that you start a fresh game and then edit the fresh map. Otherwise there will be blood on the floor, items lying around and mission relevant doors already opend and the like. So best select 'New Game' and then enter level editor immediately after game startup.
For further explanation, I'll add some numbers to each of the buttons and elements you see in the above image, such that I can refer to them more easily. Like this:
The button group 1 consists of 5 buttons. Their meaning is as follows (from left to right):
The next group of buttons is the group with the number 2. These four buttons mainly deal with appearance of the level editor. You can toggle whether you wish to see a number of things or not:
The next group of buttons it the group with number 3. Those two buttons allow you to enter some submenus directly:
The last group of 'normal' buttons is the group with the number 4. Those buttons are of mixed purpose:
The next most important group of buttons is the group with the number 8.
Those buttons are most handy. Whenever you are on a map, that has an
interface area to other maps (such that you can go to other maps without even
noticing much of the process), you can go to that other map inside the level
editor by clicking the button in the corresponding direction. This way you
can also see in which direction there is a map glued to the current map: If
there is a button for that direction, then there is some map glued to it,
otherwise the button would disappear automatically.
Note: Since not all maps have interface areas to other maps, it's
not possible to reach every map by only clicking those buttons. For some of
the maps you will have to use the level editor main menu and the 'current
level' option there to reach them.
That should be about all there is to say about the level editor buttons. Now it might be a good idea to plunge right into it and start a little editing session:
First we need to start a fresh game. We can do so via the menus inside the game or via giving the command line parameter -m. That should take us right into a new game.
Then of course Francis will start a dialog. That shouldn't be a problem. Just quit out of the dialog.
Now we need to enter the level editor. This can be done via the menu, so hit Esc key to enter the menu and select Level Editor. Ok. That should take you right into the level editor with the editor cursor centered on the position where Tux has just been. A screenshot might look like the above one.
Now we can already do some level editing. For now, we just need the mouse for this. You have notices there are several tabs in the top display of the level editor. They look somewhat like this:
As you see, currently the Floor tab is selected. But that is now the only tab available. You can change tabs by clicking Walls, Machinery, Furniture, Containers, Plants and All, depending on what you would like to insert.
Ok, now there is some technical difference that you should take into account: FreedroidRPG makes a difference between floor and obstacles. The floor consists of lots of tiles, that have all the same size. The floor tiles are completely irrelevant for the Tux movement, i.e. you can't block the Tux from going somewhere with just floor tiles. For that, you must use obstacles. Obstacles are any map elements visible in the game, that are not floor tiles, i.e. everything that is above the floor.
The number of obstacles is far greater than the number of floor tiles, so all of the floor tiles have been collected together in the tab floor while the obstacles have been split up into the groups Walls, Machinery, Furniture, Containers and Plants.
While the Floor group is selected, you can choose the tiles you want to insert from the top selection bar. Using the mouse wheel should scroll it in both directions. When clicking the right mouse button into the scene, the currently selected floor tile type will be inserted at the position you clicked. Note that the position of floor tiles is automatically adjusted so that the tile will fit well together with the other floor tiles. For obstacles, inserted this way, this does not hold.
Inserting obstacles is somewhat similar to inserting floor tiles. You can choose the obstalce type you want to insert from the top selection bar. Clicking the right mouse button into the scene should insert the obstacle in question. However some differences to inserting floor tiles should be taken into account: The position of the new obstacle is not automatically alligned when using the mouse buttons. (There are some cursor keys for this.) Also you will notice that old obstacles will not automatically be overwritten when you insert some new obstacles. You will have to delete those obstacles you do not like manually. (We will come to that later.)
If you would like to keep your changes, you should save them now. Clicking the button with the disk symbol on it should do the trick. There should be some confirmation message. Your level should then be saved. You can exit the level editor again, using the top right button.
When you press the escape key while inside the level editor, this will take you to the level editor main menu. The menu looks like this:
As you see, there are lots of options from here. You can
It is often desired to place a lot of obstacles such that they fit together in a particular manner. Like e.g. wall pieces with a length of one should often be placed such that they tiles fit together well and the wall as a whole looks regular and smooth. To achieve this, you can use the number pad. Each of the numbers on the number pad (mostly on the very right side of your keyboard) corresponds to a special location on the square of your current floor cursor. The '8' is the very north, the '2' is the very south, the '4' is the west and the '6' is the east side of the current square. Of course you can also use intermediate direction and enter '7' for the northwest corner, '9' for the northeast corner, '1' for the southwest corner and '3' for the southeast corner. Of course there is also '5' to place the new obstacle at the exact center of the current square.
In combination with the cursor keys to change the current floor square, these keys can be used very effectively to generate larger sections of alligned walls, fences or other structures.
However, sometimes it might suffice to use the mouse, holding the position still and placing obstacles with the right mouse button while moving around with the cursor keys. That way similar allignments can be achieved without being restricted to specific positions inside the tile grid.
FreedroidRPG frequently needs to access the obstacles that are on or around a particular spot on the map for various purposes. So accessing these has to be done in a quick maner. Otherwise performance of the game would drop considerably. That's why the (otherwise unordered) list of obstacles on each level is linked with the (geometric) position of floor tiles.
The above concept is essential to understand, because it also governs part of how editing obstacles on a map is working. So you can think of it like the obstacles are glued to the floor tiles. Sometimes however, there are multiple obstacles resting on one single floor tile. That's ok, as you will see:
Whenever the floor cursor of the level editor is on a square with obstacles glued to that square, one of those obstacles will start blinking. That means that this obstacle is currently 'marked'. If you press 'x' now, the obstacle will be deleted. However it might occur that several obstacles are glued to that square and the wrong one is marked. You can use the 'n' key to toggle between all the obstacles that are glued to that square. Since every obstacle is glued to some square, every obstacle can be reached this way.
Whenever an obstacle is marked (like above in the section about deleting obstacles) you can fine-tune the position of it using the mouse or exact placement. For this, the obstacle must be marked at first. Then press the 'm' key. The obstacle in question should now follow your mouse for fine positioning. Now you can move the obstacle to the location you like. To drop the obstacle again, press the 'm' key again.
Currently, friendly droids and characters move around on a level using predefined waypoints. They will never leave the system of waypoints and waypoint connections, except maybe if they try to rush the Tux and open a chat or also if they are attacking and enemy. But otherwise they should stick faithfully to the waypoint system. That way you should be able to clearly define where an NPC can move around. Like e.g. the shopkeeper Mrs. Stone has a few connected waypoints inside her shop but no connections to waypoints from outside, so she will move around inside her shop but never leave.
To plant a waypoint, press the 'w' key. This should turn on/off the waypoint on the square where you're standing.
Waypoints are of no use as long as they are not connected among each other. To connect one waypoint to another waypoint, go to the first waypoint, press the 'c' key, then go to the second waypoint and press the 'c' key again. This has established a one-way connection from the first waypoint to the second waypoint. To allow the droids to move the other way around as well, do the same thing with reversed order of waypoints. To inspect the possible ways for droids from one waypoint to other waypoints, just step on the square with the waypoint. You will notice a dotted line leading from this waypoint to all other waypoints that are possible targets from here.
Map labels (i.e. 'floor labels') are not the same as obstacle labels. Map labels can be used for various purposes, like e.g. to define the point where a teleporter should put the Tux or to define a spot that will cause some event to happen as soon as the Tux steps on this spot. To define a new map label, press the 'm' key on the keyboard. You will be prompted for the map label. Giving an empty string here will delete the existing label on this square. Note that there will be a colorful circle appearing on any map tile that has been fitted with a map label.
Obstacle labels are important so that some obstacles can be marked for events to happen. If e.g. an event is supposed to remove a special wall obstacle, then this obstacle must be given a name first, so it can be referred to later in the definition of the event. To plant a label on an obstacle, you must first mark this obstacle (see obstacle mode explanation above). As soon as the obstacle in question is marked, you can use the 'h' key on the keyboard. You will be prompted for the new label to attach to this obstacle. Giving an empty string here will delete any existing obstacle label of this obstacle.
There is a 'jump target' in all four directions. By default it's set to -1 (no jump). If a new level should be integrated into the existing wilderness maps, a proper source level must be found from where you want to establish the new connection. The jump target in the proper direction (e.g. east) must be set to the level number of the new level. And on the new level the jump target in the other direction (west) must be set to the source level so that you can go in both directions.
The next thing that has to be dealt with is the interface areas. To make the transition from one level to the other as smooth as possible, there is always a certain area of both levels where they are identical. Some size for the interface area has to be specified. It should be the same size on both levels. Typically sizes like 13 or something are known to work well.
Note: Also it is of importance that the two levels to be connected do have the same size, at least on the side where they are connected. Otherwise you might jump into nowhere when crossing from the larger level over to the smaller level. That shouldn't be happening.
The 'export' button can be used to immediately sync the new levels once the connection has been created and the interface area sizes have been specified. I think we even have some 'consistency check' menu option inside the level editor. If it's working, it should mention any potential problems with the current level connections.