OpenSpace logo

OpenSpace Editor » Main menu

The main menu of the OpenSpace Editor contains the button for the basic actions: create a new project, open an existing project, save the current project and export the project’s data to be used by the OpenSpace engine. The menu also contains a button to access the application log.

A project can also be created by clicking on the New project button contained in the Editor's initial splash screen; similarly an existing project can be loaded by clicking on the Open project button or selecting one of the entries in the recent projects list.

Create a new project

Clicking on the New project button to open the following project's creation panel. Configure the project and click the Create button.

The table below describes the project's parameters. When the Create button is pressed, an OSP file (.osp extension, from: OpenSpace Project) is saved in the selected project's folder; the name of the file is generated from the project's title by stripping invalid characters. After the project is created it is not possible to change those values visually. In case you need to make changes, edit the OSP file with a text editor and locate the relevant xml tags.

Title The project's name.
Unique id The project's unique identifier. This id is used when exporting the maps data and it is useful when multiple projects are created in order to organize and manage maps in case of large virtual worlds.
Folder The folder where the project file should be saved.
Avatar mockup scale The scaling factor of the mockup avatar with respect to the tile dimensions.
NOTE: the mockup avatar is not used in the current version of the OpenSpace Editor.
Tile size The width of the tiles, expressed in pixels.
Tile ratio The aspect ratio of the tiles: it's the ratio between the height and width of the tile. This value must be grater than 0 and between 0 and 1. If equal to 1, the tile’s height is the same as its width (the tile looks like a square rotated of 45 degrees).
Show tile elevation Show the tiles elevation along the isometric z-axis. If the checkbox is selected, the tile elevation is always visible even if the aspect ratio is 1. This parameteris enabled if the tile ratio is equal to 1 only, in order to have a top-down view of the maps.
Separator The character that OpenSpace should use to split the custom parameters assigned to skin instances in the Tile Editor. Default value is | (pipe).

Open an existing project

Click the Open project button and select a .osp project file in the system's file selection panel that pops up. Please notice that at startup the OpenSpace Editor registers itself as default application for the .osp file type, so after the first execution it is possible to open project files by simply double clicking them in the file system.

Save project changes

Whenever a change occurs in one of the sub-editors, the Save project button is enabled. Clicking it causes all the project's data to be saved in the project’s .osp file. Please notice that only data which has been committed (by clicking the Create/Update button under the Properties panel of each sub-editor) is saved; changes to the items currently being edited are not saved.

Export maps, library and inventory data

The export panel allows the creation of the files that will be loaded by the OpenSpace Extension and sent to the client when the OpenSpace component requests a map (by means of the IOpenSpace.loadMap method) or the inventory (by means of the IOpenSpace.loadInventory method). Files are exported in the target folder selected by clicking the Select button. By default, the folder containing the project's .osp file is selected.

The three file types described below are text files containing a JSON encoded string for best data size reduction, while keeping a human-readable format (the files can be opened in any text editor).

Assets library
The assets library contains the definitions of all the skins, tiles and backgrounds/foregrounds created in the Skin editor, Tile editor and Background editor respectively. These assets are the building blocks of the final maps and inventory that will be sent to the client; they are kept in a separate file for optimization purposes, as usually different maps and the inventory share the same skins/tiles.
The assets library is a .lib file which is mandatory for the OpenSpace functioning. The Editor gives this file a name equal to the id set during the project's creation, which must be unique in case the maps of the virtual world are split across multiple projects. Of course the assets library file doesn't contain the actual graphical assets used by skins: those will be loaded by the client directly, before the map rendering (see SWFs manager and the OpenSpaceEvent.MAP_LOADED event description).

Maps
The .map files contain the definitions of maps created in the Map editor. The Export button is enabled if at least one map is selected in the list. Use the shift or control (PC) / command (Mac) keys to select multiple maps at once. The file names can be customized by adding or removing the map id or by entering a custom name instead of letting the Editor use the map title (invalid characters are stripped). The Editor always adds a prefix to the file name, equal to the project's id. This is mandatory in order to associate the maps with the corresponding assets library file.
Please notice that map re-exporting is not necessary in case the assets library is updated (by adding new skins and tiles for example) but the map is not affected by the changes.

Inventory
The .inv file contains the definitions of inventory items created in the Inventory editor. Its name is set by the Editor to the project's id, so that it can be associated with the corresponding assets library file. Just like with the maps, inventory re-exporting is not necessary in case the assets library is updated but the inventory is not affected by the changes.

The exported files must be copied to the Server/openSpace/data/ folder inside the SmartFoxServer PRO installation folder, or to the SFS2X/extensions/openSpace/data/ folder inside the SmartFoxServer 2X installation folder. When a map or the inventory has to be sent to the client, the OpenSpace Extension loads it together with the assets library. The required assets definitions are then merged with the map or inventory data; the resulting data is cached by the Extension and sent to the client which will take care of the rendering step.

In order to make OpenSpace load a map at runtime, the map must be associated with a SmartFoxServer Room. This can be achieved by defining a Room Variable of type String called _os_mapId. The value of the variable must be set to the map's filename, excluding the .map extension.

In case one of the above data files already exists in the mentioned server-side folder and it is overwritten (for example due to a map/inventory update, or a new tile definition being added to the assets library), the OpenSpace Extension will take care of realoading it and updating the cache the first time the data is needed.

Check the application log

The Editor's log can be accessed by pressing the Log button. Specific informations are traced in the log during the OpenSpace Editor usage. In case an error occurred (for example assets are missing when loading the external SWF files), the button's label turns to red and a warning icon is displayed on the button itself.

Next: SWFs manager