make
'. If you don't have jikes
installed you can compile it with 'make JAVAC=javac
'.
If all else fails you can simply run 'javac *.java png/*.java
'.
Alternatively, you can download the procompiled program in the jarfile: Editor_0_19.jar.
java Editor
'.
If you downloaded the jar file, simply run
'java -jar Editor_0_19.jar
', or double-click on the
jar file if you are using Windows.
A new map is created when you start the editor without a map. You may load or import a map from the file menu, or specify a map to load on the command line. The editor uses 2 file formats for the maps.
The first format is specific to the editor and is useful for day-to-day use. This is the .jsf format (stands for java serialized file). The .jsf files load into the editor the fastest, but are not guaranteed to work between different editor versions.
The second format is the map format of the game itself. This is the .zon format. When you want to load your maps into the game, you must export your map as a .zon file. You may also import .zon files if needed.
The editor itself has 2 major regions, the map views on the left side, and the editing panel on the right.
There are 3 map views on the left, a top-down view of the x-y plane, and two different side views. The top view is typically the most used. The map views can be in one of 4 different modes.
While in select mode, you may select a map entity by left-clicking on it. You can select multiple items by holding down shift while you left-click. You can toggle an item by holding down control. You can also select multiple items by pressing and dragging the left mouse button to create a rubberband region. The control and shift keys work similarly in this mode.
The items on the map which may selected are Sectors, Lines, Vertexes, and Lights. Only one type of item may be selected at a time, that is the set of selected items must be homogenous by type.
The selected item(s) may be dragged to a different location by pressing the middle button and dragging the mouse.
You may enter Select Mode at any time by pressing the S
key.
The New Sector Mode is used to create new sectors on the map. To create a new sector you simply place the vertexes by left-clicking. When you have placed all the vertexes, you may complete the new sector by right-clicking, or by left-clicking on the first vertex. You may cancel a sector creation by middle-clicking or hitting ESC.
New Sectors should be convex and should not overlap any other sectors. However, a new sector can and often should share vertexes and edges with existing sectors.
You may enter New Sector Mode at any time by pressing the A
key.
The New Light Mode allows you to create new light sources by left-clicking. That's it!
You may enter New Light Mode at any time by pressing the D
key.
The Clip Region Mode allows the user to define a clipping region for the map. This is useful if you are working on a very large or complex map, and want to limit the scope of what you are viewing in the 2d views.
Left-clicking places the lower left corner of the clipping region, and Right-clicking places the upper right corner.
You may enter Clip Region Mode at any time by pressing the C
key.
The Edit Panel on the right allows you to modify the properties of the selected items(s). If multiple items are selected, the changes you make will be propogated to all the selected items.
The editor looks for its textures in a subdirectory called textures
.
It simply uses all .png files in that directory. I usually just create a symbolic
link to the lib/gfx/textures directory of sdl-dg.
Furthermore, the editor has no texture display capabilities at this point. I usually
run an instance of ee textures/*.png
alongside my editor while working.
ee stands for Electric Eyes, and is available with most Linux distros.
As soon as you export the .zon file from the Editor, it is immediately runnable
in the game. Simply copy the file to lib/maps/ and run the game with the argument
'-map mapname
' in the command line.
However, in its raw state, the .zon file has neither potentially-visible-sets (PVS) information nor lightmapping data. The lack of PVS will make the map run slower, and the lack of lightmaps will make it look uglier.
To create the PVS, you need the visify
utility which is included
in the source distribution of sdl-dg. To compile it, simply configure the makefiles
and run 'make utils
'. The program is placed in src/server/.
Then you simply
run the resulting program on your .zon file: ./visify ../../lib/maps/yourmap.zon
To create the lightmaps, the procedure is similar to that of the PVS. Then you simply
run the resulting program on your .zon file: ./illuminate ../../lib/maps/yourmap.zon
PVS should be created before running the illumination, as the presence of PVS data will speed up the lightmapping. However, it is not strictly necessary.
If you make any interesting maps, please send them to me so I can check them out!