{"id":633,"date":"2016-10-30T20:25:19","date_gmt":"2016-10-30T20:25:19","guid":{"rendered":"http:\/\/spaceengine.org\/?page_id=633"},"modified":"2023-02-10T19:21:05","modified_gmt":"2023-02-11T00:21:05","slug":"creating-a-ship","status":"publish","type":"page","link":"https:\/\/spaceengine.org\/manual\/making-addons\/creating-a-ship\/","title":{"rendered":"Creating a ship"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row row_type=\"row\" use_row_as_full_screen_section=\"no\" type=\"full_width\" text_align=\"left\" box_shadow_on_row=\"no\"][vc_column][no_accordion active_tab=\"1\" collapsible=\"yes\" background_transparency=\"no\" style=\"boxed_toggle\"][no_accordion_section title=\"Creating a ship\" accordion_type=\"accordion_icon\" icon_pack=\"font_elegant\" fe_icon=\"icon_cog\"][vc_column_text]This tutorial describes how to import a custom ship model into SpaceEngine. Before continuing, it is recommended to read this manual: <a class=\"link\" href=\"http:\/\/spaceengine.org\/manual\/making-addons\/introduction\/\" target=\"_blank\" rel=\"nofollow noopener\">Introduction<\/a>.<br \/>\nAll the examples in this tutorial do not uses the pak files, but it is advisable to ensure that your final (release) version of the addon has been packed to a pak file.<\/p>\n<h4 class=\"se_h4\">Spaceships in SpaceEngine<\/h4>\n<p>Ships in SpaceEngine may consist of several parts, each of which is represented by a separate model file. For example, ships made in the SHW editor can have several engines, radiators, tanks, connecting farms, etc. Identical modules use the same model (for example, engines or farm element), which saves a lot of video memory. But the ship may also have a single module (like a Shuttle). If your new model is complex and has repetitive elements, it makes sense to cut it into modules.<\/p>\n<p>Later in this guide we will assume that you are creating a model of the ship Discovery from the \"2001: A Space Odyssey\" story. We also assume that this is not the only ship of that franchise that you want to import. Therefore, create a new folder in the <span class=\"se_path\">addons<\/span> directory: <span class=\"se_path\">2001<\/span> (we will call it the <i>worker folder<\/i>), and default SE folders for models and textures inside it:<br \/>\n<span class=\"se_path\">addons\/2001\/models\/<\/span><br \/>\n<span class=\"se_path\">addons\/2001\/textures\/<\/span><\/p>\n<p>Any model of the ship, even a single-module one, consists of multiple files, split into two groups. The first group is related to the <i>models<\/i>, the second - to the <i>textures<\/i>. The models are stored in the <span class=\"se_path\">addons\/2001\/models\/spacecraft\/<\/span>, and textures in the <span class=\"se_path\">addons\/2001\/textures\/spacecraft\/<\/span> folder. So now we need to create two folders called <span class=\"se_path\">spacecraft<\/span>:<\/p>\n<p><span class=\"se_path\">addons\/2001\/models\/spacecraft\/<\/span> - we will call it the <i>standard<\/i> models folder<br \/>\n<span class=\"se_path\">addons\/2001\/textures\/spacecraft\/<\/span> - we will call it the <i>standard<\/i> textures folder<\/p>\n<p><span class=\"se_warn\">Important note:<\/span> all folders with a path which has the form of <span class=\"se_path\">*\/models\/spacecraft\/<\/span> (and the same for <span class=\"se_path\">*\/textures\/spacecraft\/<\/span>) are considered by SpaceEngine as one large virtual folder. So if you put your texture or model addons directly into the default location, like this: <span class=\"se_path\">addons\/2001\/texture\/spacecraft\/engine.jpg<\/span>, it is likely to be overriden by some texture with the same name in another addon, according to the modification date priority rule (or your texture may override another texture in some addon). To avoid this situation, it is necessary to create additional folders with unique names inside our standard models and textures folders. For example, create a folder <span class=\"se_path\">Odyssey2001<\/span>:<\/p>\n<p><span class=\"se_path\">addons\/2001\/models\/spacecraft\/Odyssey2001<\/span><br \/>\n<span class=\"se_path\">addons\/2001\/textures\/spacecraft\/Odyssey2001<\/span><\/p>\n<p>Now the folder <span class=\"se_path\">Odyssey2001<\/span> should be taken into account when specifying file paths in the ship's script and material files, but this is necessary to avoid ambiguities and overriding files in other addons.<\/p>\n<p>If your addon may end up having many ship models, for convenience you can create another extra level of folders, although this is not necessary. For example, a unique named folder for each of the ship types. In our case, it makes sense to create a folder named <span class=\"se_path\">Discovery<\/span>, because we are importing the model of this ship:<\/p>\n<p><span class=\"se_path\">addons\/2001\/models\/spacecraft\/Odyssey2001\/Discovery\/<\/span> - we will call it a models folder<br \/>\n<span class=\"se_path\">addons\/2001\/textures\/spacecraft\/Odyssey2001\/Discovery\/<\/span> - we will call it a textures folder<\/p>\n<p>If some models use common textures, you may create a folder for them called, for example, <span class=\"se_path\">common<\/span>. But this is not necessary either, it's just for convenience; you may store common textures directly in the <span class=\"se_path\">addons\/2001\/textures\/spacecraft\/Odyssey2001\/<\/span>. In general, all such subfolders are optional, you decide whether or not to use them. But it is important to keep in mind that they affects the paths to the files, which are written to in the scripts. Furthermore, we assume in this manual that you have created an innermost folder <span class=\"se_path\">Discovery<\/span>.<\/p>\n<p>So, any spaceship in SpaceEngine consists of these files:<\/p>\n<ul class=\"manlist\">\n<li>One or more <i>model<\/i> files (modules) with the extension <span class=\"se_path\">*.sm<\/span> (Spacecraft Model), located in the folder <span class=\"se_path\">addons\/2001\/models\/spacecraft\/Odyssey2001\/Discovery\/<\/span>. The sm file is the binary file with the model's geometry, its description is given below. It is possible to import a model from the <span class=\"se_path\">obj<\/span> format (look below).<\/li>\n<li>The configuration file with the extension <span class=\"se_path\">*.cfg<\/span> for each sm file model. The cfg file name must match the name of the sm file, and it must be in the same folder. The configuration file describes what material each sm model mesh uses, and some other parameters.<\/li>\n<li>One or more <i>texture<\/i> files in the folder <span class=\"se_path\">addons\/2001\/textures\/spacecraft\/Odyssey2001\/Discovery\/<\/span> (remember that the <span class=\"se_path\">Discovery<\/span> subfolder is optional). Texture files are in the common graphics file format <span class=\"se_path\">jpg, png, tiff, dds, tga<\/span>. The model can have no textures, but it must have <i>materials<\/i>.<\/li>\n<li>One or more <i>material library<\/i> files with the extension <span class=\"se_path\">*.sml<\/span> (SpaceEngine Material Library), located in the default textures folder or in some optional inner subfolder. The library file contains a description of one or more materials used in the sm model. A material is a description of which textures are being used, with their paths, how they are using brightness, color, and other parameters.<\/li>\n<li>A ship's <i>scheme<\/i> file with the extension <span class=\"se_path\">*.sss<\/span> (SpaceEngine Spacecraft Scheme), located in the folder <span class=\"se_path\">addons\/2001\/models\/spacecraft\/Odyssey2001\/Discovery\/<\/span>. The scheme file describes which modules the ship uses, their location and orientation, as well as the standard name of the ship, its class, size, weight, and other parameters. The ship must have at least one module. The ship scheme files are automatically searched in all subfolders which have a path like <span class=\"se_path\">*\/models\/spacecraft\/*\/<\/span> at the startup of SpaceEngine, and are displayed in the Ship manager's build menu. So, to make a ship visible in the Build menu, it must have the sss file. But to make its model visible in game, it must have all other files described above).<\/li>\n<li>All ships built by the player are saved in the script file called <span class=\"se_path\">config\/spacecraft.sc<\/span>. For all ships, it saves the ship's name, a path to its sss scheme file, its coordinates, velocity and orbit. This file is automatically generated, it is not necessary to change it when importing new ships.<\/li>\n<\/ul>\n<p>First I will describe the format of the scheme file, as it is needed for further understanding.<\/p>\n<h4 class=\"se_h4\">The ship scheme file - *.sss<\/h4>\n<p>To add the Discovery ship, create an empty file with name <span class=\"se_path\">DiscoveryShip.sss<\/span> in the models folder <span class=\"se_path\">addons\/2001\/models\/spacecraft\/Odyssey2001\/Discovery\/<\/span>. Open it in Notepad and type the code shown below.<\/p>\n<p><!--uzcode--><\/p>\n<div class=\"bbCodeBlock\">\n<div class=\"bbCodeName\" style=\"padding-left: 5px; font-weight: bold; font-size: 7pt;\">Code<\/div>\n<div class=\"se_code\" style=\"border: 1px inset; max-height: 200px; overflow: auto;\"><!--uzc-->Name\u00a0\u00a0\u00a0\u00a0\"Discovery\"<br \/>\nClass\u00a0\u00a0\u00a0\"Planetship\"<br \/>\nPack\u00a0\u00a0\u00a0\u00a0\"2001\"<br \/>\nFaction \"NASA\"<br \/>\nLength\u00a0\u00a0\u00a0168.63181<br \/>\nOffset\u00a0\u00a0(0 1.5 5)<br \/>\nQuat\u00a0\u00a0\u00a0\u00a0(1 0 0 0)<br \/>\nMass\u00a0\u00a0\u00a0\u00a0\u00a02000000<br \/>\nAlbedo\u00a0\u00a0\u00a00.1<br \/>\nExposure 3<br \/>\nColor\u00a0\u00a0\u00a0(1 1 1)<br \/>\nMainEngines\u00a0\u00a030<br \/>\nRetroEngines 0<br \/>\nHoverEngines 0<br \/>\nCorrEngines\u00a0\u00a00.5<br \/>\nTurnEngines\u00a0\u00a00.002<br \/>\nWarpBoostLog 0<br \/>\nHyperdrive\u00a0\u00a0\u00a0false<br \/>\nAerodynamics false<\/p>\n<p>Module\u00a0\u00a0\"Main\"\u00a0\u00a0\u00a0\u00a0\u00a0{ \"Odyssey2001\/Discovery\/DiscoveryHull.cfg\" (-1 0 0 0 0 1 0 0 0 0 -1 0 5 15 0 1) }<br \/>\nModule\u00a0\u00a0\"Engine1\"\u00a0\u00a0{ \"Odyssey2001\/Discovery\/DiscoveryEngine.cfg\" (0.5 0.8660253882408142 0 0 -0.8660253882408142 0.5 0 0 0 0 1 0 0 60 -20 1) }<br \/>\nModule\u00a0\u00a0\"Engine2\"\u00a0\u00a0{ \"Odyssey2001\/Discovery\/DiscoveryEngine.cfg\" (-0.5 0.8660253882408142 0 0 -0.8660253882408142 -0.5 0 0 0 0 1 0 -51.96152496337891 30 -20 1) }<br \/>\n<!--\/uzc--><\/div>\n<\/div>\n<p><!--\/uzcode--><\/p>\n<p><span class=\"se_script\">Name<\/span> - the default name of the ship, it is displayed in the Ship build menu. When building the first ship of this type, it will have the specified name - \"Discovery\". The second built ship of this type will be named \"Discovery 01\", the third one - \"Discovery 02\", and so on. You can rename the ship in the game by clicking the \"Rename\" button in the Ship manager window. You can give a name that matches the name of some existing ship, but this is not recommended because it would be difficult to distinguish them from each other.<\/p>\n<p><span class=\"se_script\">Class<\/span> - the ship class, shown in the table of information about the ship in SpaceEngine. Possible classes are<br \/>\n<span class=\"se_script\">\"Astronaut\"<\/span> - astronaut<br \/>\n<span class=\"se_script\">\"Probe\"<\/span> - probe<br \/>\n<span class=\"se_script\">\"Shuttle\"<\/span> - shuttle<br \/>\n<span class=\"se_script\">\"Starship\"<\/span> - interstellar spacecraft<br \/>\n<span class=\"se_script\">\"Planetship\"<\/span> - interplanetary spacecraft<br \/>\n<span class=\"se_script\">\"Station\"<\/span> - space station<\/p>\n<p><span class=\"se_script\">Pack, Faction<\/span> - the ships' pack (or collection, franchise) and faction. The Ship building menu has a two-level filter scheme using these parameters. In this example, it would be logical to include the ship in the pack called \"2001\", and a faction called \"NASA\". Other ships may by imported for this addon, with the same franchise name \"2001\", and the same or different faction. For example, \"Leonov\" ship have the faction \"USSR\". All names must be in English.<\/p>\n<p><span class=\"se_script\">Length<\/span> - length of the ship in meters. It is automatically calculated when you first load the ship (using information about the positions and sizes of modules). Therefore, when creating this script, specify a value of 0.<\/p>\n<p><span class=\"se_script\">Offset<\/span> - displacement of the center of the ship, in meters. It is automatically calculated when you first load the ship, and can be changed in the Ship editor. Therefore, when creating this script, specify the value of (0 0 0).<\/p>\n<p><span class=\"se_script\">Quat<\/span> - orientation quaternion of the whole ship, it can be changed in the Ship editor. Therefore, when creating this script, specify the value of (1 0 0 0).<\/p>\n<p><span class=\"se_script\">Mass<\/span> - ship's mass in kilograms. It is not yet calculated, and is not used by SE except in the info table of the ship.<\/p>\n<p><span class=\"se_script\">Color<\/span> - RGB color of the particle, which is drawn instead of the model, when the ship is far away. It is not calculated automatically.<\/p>\n<p><span class=\"se_script\">Albedo<\/span> - the average albedo (reflectivity) of the ship, which affects the brightness of the particle. It is not calculated automatically.<\/p>\n<p><span class=\"se_script\">Exposure<\/span> - this exposure level is applied to all materials on the ship. Sets the overall brightness of the model.<\/p>\n<p><span class=\"se_script\">MainEngines, RetroEngines, HoverEngines, CorrEngines<\/span> - maximum acceleration (in m\/s<sup>2<\/sup>) caused by the engines: the main, braking, takeoff, and shunting engines. If the value is zero, it means that ship has no corresponding engines (for example, the Shuttle has no braking engines, while any starship has no takeoff engines).<\/p>\n<p><span class=\"se_script\">TurnEngines<\/span> - \"thrust\" of the shunting engines while using them to rotate the ship. Larger value for faster rotations.<\/p>\n<p><span class=\"se_script\">WarpBoostLog<\/span> - logarithm of the maximum warp drive boost factor (ie, how many times it increases the ship's physical speed when the warp engine is at full power). For example, to make it 10<sup>12<\/sup>, type <span class=\"se_script\">WarpBoostLog 12<\/span>. The value of 10<sup>12<\/sup> corresponds to about 1 light year per second in warp with the physical speed of 10 km per second.<\/p>\n<p><span class=\"se_script\">Hyperdrive<\/span> or <span class=\"se_script\">Warpdrive<\/span> - does the ship have a warpdrive.<\/p>\n<p><span class=\"se_script\">Aerodynamics<\/span> - whether the ship is designed for atmospheric flight. If value is <span class=\"se_script\">true<\/span>, SpaceEngine uses the aerodynamic model of the shuttle with control surfaces (ailerons, elevator, rudder) that are controlled with the mouse and keyboard. If value is <span class=\"se_script\">false<\/span>, the ship behaves like an arrow (rotated in the direction of air flow) and has no control surfaces - the correction engines are used for turning instead (like in spaceflight).<\/p>\n<p><span class=\"se_script\">Module<\/span> - one or more tags describing the modules of the ship:<br \/>\n<!--uzcode--><\/p>\n<div class=\"bbCodeBlock\">\n<div class=\"bbCodeName\" style=\"padding-left: 5px; font-weight: bold; font-size: 7pt;\">Code<\/div>\n<div class=\"se_code\" style=\"border: 1px inset; max-height: 200px; overflow: auto;\"><!--uzc-->Module\u00a0\u00a0\"Main\"\u00a0\u00a0\u00a0\u00a0\u00a0{ \"addons\/Odyssey2001\/DiscoveryHull.cfg\" (-1 0 0 0 0 1 0 0 0 0 -1 0 5 15 0 1) }<br \/>\n<!--\/uzc--><\/div>\n<\/div>\n<p><!--\/uzcode--><br \/>\nIn this code:<br \/>\n<span class=\"se_script\">\"Main\"<\/span> - the name of the module is used to distinguish one from the other modules in the Ship editor (see below).<br \/>\n<span class=\"se_script\">\"Addons\/Odyssey2001\/DiscoveryOne.cfg\"<\/span> - path to the cfg file of the module relative to the standard models folder <span class=\"se_path\">addons\/2001\/models\/spacecraft\/<\/span>.<br \/>\n<span class=\"se_script\">(-1 0 0 0 0 1 0 0 0 0 -1 0 0 0 0 1)<\/span> - the module transformation matrix (4x4) by rows, i.e. the first 4 numbers corresponds to the first row, the next 4 numbers to the second row, and so on. In this example the matrix is:<span style=\"font-family: courier;\"><br \/>\n|\u00a0-1\u00a0\u00a00\u00a0\u00a00\u00a0\u00a00\u00a0|<br \/>\n|\u00a0\u00a00\u00a0\u00a01\u00a0\u00a00\u00a0\u00a00\u00a0|<br \/>\n|\u00a0\u00a00\u00a0\u00a00\u00a0-1\u00a0\u00a00\u00a0|<br \/>\n|\u00a0\u00a05\u00a015\u00a0\u00a00\u00a0\u00a01\u00a0|<\/span><br \/>\nThe upper left sub-matrix is a rotation and scale matrix. The first three numbers on the bottom line (5 15 0) are the displacement of the module's center.<br \/>\nIf you import a single-module ship, make this matrix uniform:<br \/>\n<span class=\"se_script\">(1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1)<\/span><br \/>\nThis will place the module in the center of the model and orients it like it was done by the model's author.<\/p>\n<p>If the intended orientation does not coincide with the orientation in SpaceEngine's coordinate system, you can reorient the module or the entire ship in the Ship editor (see below).<\/p>\n<h4 class=\"se_h4\">The module model file - *.sm<\/h4>\n<p>SpaceEngine has its own binary format model <span class=\"se_path\">*.sm<\/span>. In the example above, the ship \"Discovery\" contains three modules, which correspond to two models - <span class=\"se_path\">DiscoveryHull.sm<\/span> and <span class=\"se_path\">DiscoveryEngine.sm<\/span> (the latter is used twice). They are located in the folder <span class=\"se_path\">addons\/2001\/models\/spacecraft\/Odyssey2001\/Discovery\/<\/span>, as specified in the sss file. To create a new modular ship, you can use existing models of the modules, or import new models from the obj format (see below).<\/p>\n<p>Below is the technical information about the <span class=\"se_path\">*.sm<\/span> file format provided, for those who want to make a converter or editor.[\/vc_column_text][vc_raw_html]JTNDZGl2JTIwY2xhc3MlM0QlMjJsaXN0Y2hhbmdlcy1hY2NvcmRpb24lMjIlM0UlMEElM0NkaXYlMjBjbGFzcyUzRCUyMnRhYndyYXBwZXJsaXN0JTIyJTNFJTBBJTBBJTNDaW5wdXQlMjBpZCUzRCUyMnRhYmxpc3QtMSUyMiUyMG5hbWUlM0QlMjJ0YWJsaXN0LTElMjIlMjB0eXBlJTNEJTIyY2hlY2tib3glMjIlMjAlMkYlM0UlMEElM0NsYWJlbCUyMGZvciUzRCUyMnRhYmxpc3QtMSUyMiUzRVRIRSUyMFNNJTIwRk9STUFUJTI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Iyc2VfaDUlMjIlM0VGb3JtYXQlMjBvZiUyMHRoZSUyMHZlcnRpY2VzJTNDJTJGaDUlM0UlMEEzJTIwJTJBJTIwZmxvYXQzMiUyMC0lMjB2ZXJ0ZXglMjBjb29yZGluYXRlcyUzQ2JyJTNFJTBBMyUyMCUyQSUyMGZsb2F0MzIlMjAtJTIwdmVydGV4JTIwbm9ybWFsJTNDYnIlM0UlMEEzJTIwJTJBJTIwZmxvYXQzMiUyMC0lMjB0YW5nZW50JTIwdmVjdG9yJTNDYnIlM0UlMEExJTIwJTJBJTIwZmxvYXQzMiUyMC0lMjBiaW5vcm1hbCUyMHNpZ24lM0NiciUzRSUwQTIlMjAlMkElMjBmbG9hdDMyJTIwLSUyMHRleHR1cmUlMjBjb29yZGluYXRlcyUzQ2JyJTNFJTBBJTNDYnIlM0UlMEFOZXh0JTIwaXMlMjBhJTIwY29udGludW91cyUyMGFycmF5JTIwb2YlMjBpbmRpY2VzJTIwaW4lMjB0aGUlMjBmb3JtYXQlMjBvZiUyMHVpbnQzMi4lMjBUaGUlMjBtZXNoJTIwaXMlMjBkcmF3biUyMGJ5JTIwdGhlJTIwbW9kZSUyMHRoYXQlMjBpcyUyMHNwZWNpZmllZCUyMGluJTIwdGhlJTIwb2JqZWN0JTI3cyUyMGhlYWRlci4lMEElM0MlMkZkaXYlM0UlMEElM0MlMkZkaXYlM0UlMEElM0MlMkZkaXYlM0U=[\/vc_raw_html][vc_column_text]<!--\/ust--><!--usn(=sm format details)--><\/p>\n<p><!--\/uSpoiler--><\/p>\n<h4 class=\"se_h4\">The sm-model configuration file - *.cfg<\/h4>\n<p>This is a text file whose name must match the name of the sm file. In this example, there should be two such files - <span class=\"se_path\">DiscoveryHull.cfg<\/span> and <span class=\"se_path\">DiscoveryEngine.cfg<\/span>, located where the corresponding sm files are, i.e. in the folder <span class=\"se_path\">addons\/2001\/spacecraft\/Odyssey2001\/Discovery\/<\/span>. An example of the content of the <span class=\"se_path\">DiscoveryHull.cfg<\/span> file is:<\/p>\n<p><!--uzcode--><\/p>\n<div class=\"bbCodeBlock\">\n<div class=\"bbCodeName\" style=\"padding-left: 5px; font-weight: bold; font-size: 7pt;\">Code<\/div>\n<div class=\"se_code\" style=\"border: 1px inset; max-height: 200px; overflow: auto;\"><!--uzc-->Unit\u00a0\u00a0\u00a0\u00a01<br \/>\nLength\u00a0\u00a0168.6318Material \"Discovery_hull\"<br \/>\nMaterial \"Discovery_hull1\"<br \/>\nMaterial \"Discovery_HAL2001\"<br \/>\nMaterial \"Discovery_Sideairlockete\"<br \/>\nMaterial \"Discovery_antenna\"<br \/>\nMaterial \"Discovery_bridge\"<br \/>\nMaterial \"Discovery_bridge1\"<br \/>\nMaterial \"Discovery_elbow\"<br \/>\nMaterial \"Discovery_keyboard1\"<br \/>\nMaterial \"Discovery_material01\"<br \/>\nMaterial \"Discovery_material02\"<br \/>\nMaterial \"Discovery_material05\"<br \/>\nMaterial \"Discovery_podbayDiscoveryhull\"<br \/>\nMaterial \"Discovery_podbaydoors\"<br \/>\nMaterial \"Discovery_radar1\"<br \/>\nMaterial \"Discovery_sideairlockintDiscoveryhull\"<br \/>\n<!--\/uzc--><\/div>\n<\/div>\n<p><!--\/uzcode--><\/p>\n<p><span class=\"se_script\">Length, Unit<\/span> - length of the model in meters or length of the 3D editor's unit in meters. These values are necessary for the proper scaling of the model. Initially, one of the values may be zero, depending on whether unit length or model length is known. In this case, SpaceEngine calculates the second value and stores it in the script:<br \/>\n1) <span class=\"se_script\">Unit = 0<\/span>, <span class=\"se_script\">Length = 0<\/span><br \/>\n<span class=\"se_script\">Unit<\/span> is equal to 1 meter, <span class=\"se_script\">Length<\/span> is calculated from the farthest vertex coordinates of the model.<br \/>\n2) <span class=\"se_script\">Unit = 0<\/span>, <span class=\"se_script\">Length != 0<\/span><br \/>\n<span class=\"se_script\">Length<\/span> is specified, therefore <span class=\"se_script\">Unit<\/span> is calculated by dividing the <span class=\"se_script\">Length<\/span> value by the length of the model, calculated by the coordinates of the farthest vertex.<br \/>\n3) <span class=\"se_script\">Unit != 0<\/span>, <span class=\"se_script\">Length = 0<\/span><br \/>\n<span class=\"se_script\">Unit<\/span> is specified, therefore <span class=\"se_script\">Length<\/span> is calculated by multiplying the <span class=\"se_script\">Unit<\/span> value by the length of the model model, calculated by the coordinates of the farthest vertex.<br \/>\n4) <span class=\"se_script\">Unit != 0<\/span>, <span class=\"se_script\">Length != 0<\/span><br \/>\nBoth <span class=\"se_script\">Unit<\/span> and <span class=\"se_script\">Length<\/span> are specified, nothing to calculate.<\/p>\n<p><span class=\"se_script\">Material<\/span> - name of the material that is used by the model's mesh (see description of the <span class=\"se_path\">*.sm<\/span> format). The number of <span class=\"se_script\">Material<\/span> parameters is equal to the number of the meshes in the model, and they are stored in numerical order of the meshes, starting from zero. The list of materials is automatically generated while importing from the <span class=\"se_path\">*.obj<\/span> format. The materials themselves are described in the <span class=\"se_path\">*.sml<\/span> files - the SpaceEgnine Material Libraries (see below).<\/p>\n<h4 class=\"se_h4\">The material library file - *.sml<\/h4>\n<p>This is a text file that contains a description of one or more materials. SpaceEngine automatically searches for all sml files in the folders like <span class=\"se_path\">*\/textures\/spacecraft\/*\/<\/span>. Thus, it is possible to have any number of material libraries, e.g., one library per ship model, or one library for a set of ship models. Similar ships can use the same materials, so it makes sense to combine them into a single library.<\/p>\n<p>The ship's module model can consist of multiple meshes. Each mesh has one material assigned, containing from 0 to 6 textures (see below), and the <span class=\"se_script\">Material<\/span> tag which describes how to use these textures (if no texture is assigned, then mesh will have a uniform color).<\/p>\n<p>While importing from <span class=\"se_path\">*.obj<\/span> format, the material library is created automatically from a <span class=\"se_path\">*.mtl<\/span> file, which comes with the <span class=\"se_path\">*.obj<\/span> file. The names of the materials are taken from there, as are most of their parameters (detailed textures are not supported by <span class=\"se_path\">*.obj<\/span>, so they can be added to materials after importing). Names of the materials in the cfg file are stored in the order in which they were used in the <span class=\"se_path\">*.obj<\/span> file.<\/p>\n<p><span class=\"se_warn\">Important!<\/span> During the import, if a duplicate material is found (all parameters, except the name, are identical to some existing material from this or another library), then the already-existing material will be assigned to the mesh. This is done to increase the performance of the engine - the smaller the number of different materials used by the model, the less they need to be switched, which reduces the cost of CPU time. Automatic combining of materials <span class=\"se_warn\">only works while importing<\/span>, and can be disabled in SpaceEngine's main config file <span class=\"se_path\">main-user.cfg<\/span> (the parameter <span class=\"se_script\">ReplaceDuplicateMat<\/span>).<\/p>\n<p>In our example, we will use the single material library <span class=\"se_path\">2001.sml<\/span> for all the ships from the 2001 franchise, located in the folder <span class=\"se_path\">addons\/2001\/textures\/spacecraft\/Odyssey2001\/<\/span> (outside the innermost subfolder <span class=\"se_path\">Discovery<\/span>):<\/p>\n<p><!--uzcode--><\/p>\n<div class=\"bbCodeBlock\">\n<div class=\"bbCodeName\" style=\"padding-left: 5px; font-weight: bold; font-size: 7pt;\">Code<\/div>\n<div class=\"se_code\" style=\"border: 1px inset; max-height: 200px; overflow: auto;\"><!--uzc-->Material\u00a0\u00a0\u00a0\u00a0\"Discovery\u00a0hull\u00a0notex\"<br \/>\n{<\/p>\n<div class=\"codepaddingleft\">\nDiffColor\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0(0.878 0.878 0.878)<br \/>\nSpecColor\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0(1.000 1.000 1.000)<br \/>\nSpecPower\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0362.039<\/div>\n<p>}<\/p>\n<p>Material\u00a0\u00a0\u00a0\u00a0\"Discovery\u00a0hull\"<br \/>\n{<\/p>\n<div class=\"codepaddingleft\">\nDiffColor\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0(0.878 0.878 0.878)<br \/>\nSpecColor\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0(1.000 1.000 1.000)<br \/>\nSpecPower\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0362.039<br \/>\nDiffMap\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Odyssey2001\/Discovery\/Discovery\u00a0hull.png\"<br \/>\nBumpMap\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Odyssey2001\/Discovery\/Discovery\u00a0hull\u00a0bump.png\"<br \/>\nBumpHeight\u00a0\u00a0\u00a0\u00a0\u00a0\u00a05.0<br \/>\nDetDiffMap\u00a0\u00a0\u00a0\u00a0\u00a0\"default\/detail-noise.*\"<br \/>\nDetBumpMap\u00a0\u00a0\u00a0\u00a0\u00a0\"default\/detail-noise.*\"<br \/>\nDetDiffScale\u00a0\u00a0\u00a0\u00a08.0<br \/>\nDetBumpScale\u00a0\u00a0\u00a0\u00a08.0<br \/>\nDetBumpHeight\u00a0\u00a0\u00a00.3<br \/>\nDiffMapAlpha\u00a0\u00a0\u00a0\"Transp\"<br \/>\nTwoSided\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0true<\/div>\n<p>}<\/p>\n<p>Material\u00a0\u00a0\u00a0\u00a0\"Discovery\u00a0engine01\"<br \/>\n{<\/p>\n<div class=\"codepaddingleft\">\nDiffColor\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0(0.500 0.500 0.500)<br \/>\nSpecColor\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0(1.000 1.000 0.800)<br \/>\nSpecPower\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a015.0<br \/>\nEmisColor\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0(1.000 1.000 1.000)<br \/>\nEmisBright\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.5<br \/>\nDiffMap\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Odyssey2001\/Discovery\/Discovery\u00a0engine.jpg\"<br \/>\nNormMap\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Odyssey2001\/Discovery\/Discovery\u00a0engine\u00a0bump.png\"<br \/>\nEmisMap\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Odyssey2001\/Discovery\/Discovery\u00a0engine\u00a0lights.dds\"<br \/>\nDetBumpMap\u00a0\u00a0\u00a0\u00a0\u00a0\"default\/detail-noise.*\"<br \/>\nDetBumpScale\u00a0\u00a0\u00a0\u00a020.0<br \/>\nDetBumpHeight\u00a0\u00a0\u00a00.5<\/div>\n<p>}<\/p>\n<p><!--\/uzc--><\/div>\n<\/div>\n<p><!--\/uzcode--><\/p>\n<p><span class=\"se_script\">Material \"Discovery_hull_notex\"<\/span> - the tag's title; \"Discovery_hull_notex\" is the name of the material. When importing from <span class=\"se_path\">obj<\/span> + <span class=\"se_path\">mtl<\/span>, the name of the material will be the same as in the <span class=\"se_path\">mtl<\/span> file.<\/p>\n<p><span class=\"se_script\">DiffMap<\/span> - the diffuse color texture, RGB or RGBA format (if there is an alpha channel, it is interpreted as the size (exponent) of the specular flare, or transparency, see the <span class=\"se_script\">DiffMapAlpha<\/span> parameter). The path is relative to the standard textures folder: <span class=\"se_path\">addons\/2001\/textures\/spacecraft\/<\/span> folder.<\/p>\n<p><span class=\"se_script\">BumpMap<\/span> - the bump texture, Grayscale or RGB format (grayscale is better). If only this texture is specified, the normals texture is generated from this texture automatically, using the <span class=\"se_script\">BumpHeight<\/span> parameter (see below). The path is relative to the <span class=\"se_path\">addons\/2001\/textures\/spacecraft\/<\/span> folder.<\/p>\n<p><span class=\"se_script\">NormMap<\/span> - the texture of the normals in the tangent space, RGB format. If this texture is specified, parameters <span class=\"se_script\">BumpMap<\/span> and <span class=\"se_script\">BumpHeight<\/span> are ignored. The path is relative to the <span class=\"se_path\">addons\/2001\/textures\/spacecraft\/<\/span> folder.<\/p>\n<p><span class=\"se_script\">SpecMap<\/span> - the reflectance (specular) texture, RGB or RGBA format. The RGB channels set the color of the specular spot. If it has an alpha channel, it is interpreted as the size (exponent) of the spot, so you can set the size of your spot for each pixel. The brightness of the alpha channel of this texture is multiplied on the <span class=\"se_script\">SpecPower<\/span> parameter. The path is relative to the <span class=\"se_path\">addons\/2001\/textures\/spacecraft\/<\/span> folder.<\/p>\n<p><span class=\"se_script\">EmisMap<\/span> - the emission (glow) texture, RGB or RGBA format. Alpha channel is not used. The path is relative to the <span class=\"se_path\">addons\/2001\/textures\/spacecraft\/<\/span> folder.<\/p>\n<p><span class=\"se_script\">DetDiffMap<\/span> - the detail diffuse texture, i.e. small color pattern. Applied to the entire model with repetitions, so should be cycled. The format is similar to <span class=\"se_script\">DiffMap<\/span>.<\/p>\n<p><span class=\"se_script\">DetBumpMap<\/span> - the detail bump texture, i.e. small surface irregularities. Applied to the entire model with repetitions, so should be cycled. The format is similar to <span class=\"se_script\">BumpMap<\/span>. Note that in this example, the path <span class=\"se_path\">default\/Detail-noise.*<\/span> is used, so SE will load the texture Detail-noise.png from the default texture pack (it's virtual path is <span class=\"se_path\">data\/textures\/spacecraft\/default\/Detail-noise.png<\/span>). Remember that all folders like <span class=\"se_path\">*\/textures\/spacecraft\/<\/span> are treated as a single virtual folder.<\/p>\n<p><span class=\"se_script\">DetDiffScale, DetBumpScale<\/span> - the scale (frequency) of the detail color and bump textures.<\/p>\n<p><span class=\"se_script\">BumpHeight, DetBumpHeight<\/span> - the amplitude (height) of the detail bump texture.<\/p>\n<p><span class=\"se_script\">DiffMapAlpha<\/span> - how to interpret the alpha channel of the <span class=\"se_script\">DiffMap<\/span> texture, if it is used:<br \/>\n<span class=\"se_script\">\"None\"<\/span> - the alpha channel is ignored<br \/>\n<span class=\"se_script\">\"Spec\"<\/span> - the alpha channel gives the size (exponent) of the specular flare. It is multiplied by <span class=\"se_script\">SpecPower<\/span>. If there is a <span class=\"se_script\">SpecMap<\/span> texture used, this effect is added to the effect of the <span class=\"se_script\">SpecMap<\/span> alpha channel.<br \/>\n<span class=\"se_script\">\"Transp\"<\/span> - the alpha channel is transparency. When alpha is less than 0.5 (or 128 units of integers from 0 to 255), the pixel is discarded and there will be a hole. Used to create lattice\/truss structures with a minimum of polygons (see the <span class=\"se_script\">TwoSided<\/span> parameter).<\/p>\n<p><span class=\"se_script\">TwoSided<\/span> - if this flag is set to true, the material is considered to be two-sided, i.e. backface culling is not used. Thus the inner (back) faces of the mesh will be rendered. If you create a truss using <span class=\"se_script\">DiffMapAlpha \"Transp\"<\/span>, you must use this parameter, otherwise the back (inner) surfaces of the truss will not be visible. The outer and inner faces of this texture coincide. Another way to create truss structures with different textures on the outer and inner surfaces - make an overlapping geometry, but with reversed normals and different texture coordinates (or different materials) for the inner surface. In this case, the transparency should be enabled (<span class=\"se_script\">DiffMapAlpha \"Transp\"<\/span>), and two-sided materials must be disabled (the <span class=\"se_script\">TwoSided<\/span> parameter is false or simply not specified).<\/p>\n<p><span class=\"se_script\">DiffColor<\/span> - the diffuse color of the surface. If the <span class=\"se_script\">DiffMap<\/span> texture is not assigned or not yet loaded, the mesh is drawn with this color. Otherwise the <span class=\"se_script\">DiffMap<\/span> texture is modulated by this color. This can be useful for the quick creation of a different colored skin for the same mesh. But make sure <span class=\"se_script\">DiffColor<\/span> is non-zero, otherwise the mesh will be black!<\/p>\n<p><span class=\"se_script\">SpecColor<\/span> - the specular flare color multiplier. Final specular spot color is multiplied by this color. The components of the <span class=\"se_script\">SpecColor<\/span> can be greater than 1.0, in which case the flare effect will be very bright, with a shining effect around it (if Bloom is enabled in the graphics settings).<\/p>\n<p><span class=\"se_script\">SpecPower<\/span> - the size (exponent) multiplier of the specular flare. Multiplied by the pixel's alpha channel value in the <span class=\"se_script\">SpecMap<\/span> or <span class=\"se_script\">DiffMap<\/span> texture.<\/p>\n<p><span class=\"se_script\">EmisColor<\/span> - the color of the emission light. The <span class=\"se_script\">EmisMap<\/span> texture is modulated by this color. If the <span class=\"se_script\">EmisMap<\/span> texture is not assigned or not yet loaded, the emission effect is <b>not drawn<\/b>. The components of the <span class=\"se_script\">EmisColor<\/span> can be greater than 1.0, in which case the emission effect will be very bright, with a shining effect around it (if Bloom is enabled in the graphics settings).<\/p>\n<p><span class=\"se_script\">EmisBright<\/span> - brightness of the emission effect. May be greater than 1.0, in which case the emission effect will be very bright, with a shining effect around it (if Bloom is enabled in the graphics settings).<\/p>\n<p>All paths to the textures in the <span class=\"se_path\">*.sml<\/span> should be specified relative to the default textures folder <span class=\"se_path\">addons\/2001\/textures\/spacecraft\/<\/span>. That is, if you are placing textures for your model in the <span class=\"se_path\">addons\/2001\/textures\/spacecraft\/Odyssey2001\/Discovery\/<\/span> folder, you need to specify the paths in the sml in the form of <span class=\"se_script\">DiffMap \"Odyssey2001\/Discovery\/texture.jpg\"<\/span>. A wildcard is allowed for the file format, i.e. specifying <span class=\"se_script\">DiffMap \"Odyssey2001\/Discovery\/texture.*\"<\/span> forces SpaceEngine to find and load the texture in one of the supported formats, in this order of priority: dds, png, jpg, tif, tga. Your ships can also use some of the standard textures from the (virtual) folder <span class=\"se_path\">data\/textures\/spacecraft\/default\/<\/span>, like the detail textures in this example.<\/p>\n<p>It is better to use textures in png or dds format (dds supports compression: DXT1, DXT3, DXT5, LATC1 and LATC2). But remember, that if you use Photoshop, saving RGBA images to png format is not easy, because png does not formally support an alpha channel. To get around this, save the RGBA image to the tga format, and then convert it to an alpha-png using the SpaceEngine console command:<\/p>\n<p><!--uzcode--><\/p>\n<div class=\"bbCodeBlock\">\n<div class=\"bbCodeName\" style=\"padding-left: 5px; font-weight: bold; font-size: 7pt;\">Code<\/div>\n<div class=\"se_code\" style=\"border: 1px inset; max-height: 200px; overflow: auto;\"><!--uzc-->SavePNG addons\/2001\/textures\/spacecraft\/Odyssey2001\/Discovery\/texture.tga<!--\/uzc--><\/div>\n<\/div>\n<p><!--\/uzcode--><\/p>\n<p>You must specify the full path inside the SpaceEngine folder. Similarly, you can convert to other texture formats by commands <span class=\"se_code\">SavePNG, SaveDDS, SaveJPG, SaveTIF, SaveTGA<\/span>.<\/p>\n<h4 class=\"se_h4\">Importing the model from the *.obj format<\/h4>\n<p>SpaceEngine supports importing models from the <span class=\"se_path\">*.obj<\/span> format with an automatic conversion into <span class=\"se_path\">*.sm<\/span> format. All you need to do is export your model from your 3D editor to the format <span class=\"se_path\">*.obj<\/span> with the creation of the materials library <span class=\"se_path\">*.mtl<\/span> (optional), copy these files and texture files into the appropriate SpaceEngine subfolders (see below), and create a ship scheme file <span class=\"se_path\">*.sss<\/span>.<\/p>\n<p>When you export the model to the <span class=\"se_path\">*.obj<\/span> format in the 3D editor, you must select the option to export meshes as triangles (triangulation), and tick the following boxes - save vertices, normals, texture coordinates, and create a materials library (Create mat-library).<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/spaceengine.org\/media\/2016\/11\/3366457.png\" alt=\"Example settings for 3ds Max\" \/><\/p>\n<p>Lets consider that we are working on the \"Discovery\" ship's main body model without engines, called DiscoveryHull (in our example, engines were imported as a separate models). After exporting, you should have two files - the model geometry and the material library: <span class=\"se_path\">DiscoveryHull.obj<\/span> and <span class=\"se_path\">DiscoveryHull.mtl<\/span>. They should be copied to the models and textures folders of your addon:<br \/>\n<span class=\"se_path\">DiscoveryHull.obj<\/span> - copy to <span class=\"se_path\">addons\/2001\/models\/spacecraft\/Odyssey2001\/Discovery\/<\/span><br \/>\n<span class=\"se_path\">DiscoveryHull.mtl<\/span> - copy to <span class=\"se_path\">addons\/2001\/textures\/spacecraft\/Odyssey2001\/Discovery\/<\/span><br \/>\nTextures must also be copied to the folder <span class=\"se_path\">addons\/2001\/textures\/spacecraft\/Odyssey2001\/Discovery\/<\/span>.<\/p>\n<p>You then need to create a ship scheme file <span class=\"se_path\">*.sss<\/span> (see above), with the path <span class=\"se_path\">addons\/2001\/models\/spacecraft\/Odyssey2001\/Discovery\/DiscoveryHull.cfg<\/span> specified in the <span class=\"se_script\">Module<\/span> parameter. Although this <span class=\"se_path\">*.cfg<\/span> file does not exist, it will be created automatically by SE. You can create your own <span class=\"se_path\">*.sss<\/span> file, or copy and change an existing file.<\/p>\n<p>After that, you just have to run SpaceEngine, find the ship in the build menu and build it. SpaceEngine will load the <span class=\"se_path\">*.obj<\/span> and <span class=\"se_path\">*.mtl<\/span> files and automatically create the <span class=\"se_path\">*.sm<\/span> and <span class=\"se_path\">*.cfg<\/span> files in the models folder and the <span class=\"se_path\">*.sml<\/span> file in the textures folder. Depending on the number of polygons, importing of the <span class=\"se_path\">*.obj<\/span> file may take a while. While importing, some progress and possible error messages will appear in the log file <span class=\"se_path\">system\/se.log<\/span>. After a successful import, the <span class=\"se_path\">*.obj<\/span> and <span class=\"se_path\">*.mtl<\/span> files can be removed. If it is necessary to repeat the import (e.g. update the model), simply remove the <span class=\"se_path\">*.sm<\/span> file and copy the new <span class=\"se_path\">*.obj<\/span> to the models folder and new <span class=\"se_path\">*.mtl<\/span> to the textures folder, and start SpaceEngine again.<\/p>\n<p>To check the orientation of the spacecraft or module, take control of it. If the orientation is not correct, change it in the Ship editor (see below).<\/p>\n<p>If there is no materials library <span class=\"se_path\">*.mtl<\/span> or it has not been exported, SpaceEngine will create the <span class=\"se_path\">*.cfg<\/span> file anyway, but it will contain only the parameters <span class=\"se_script\">Unit<\/span> and <span class=\"se_script\">Length<\/span>, without links to materials. Links to materials (and possibly an entire materials library) must be added manually.<\/p>\n<p>When you import a model with a materials library <span class=\"se_path\">*.mtl<\/span>, <span class=\"se_warn\">the paths and extensions of the textures will be automatically replaced<\/span> to <span class=\"se_path\">Odyssey2001\/Discovery\/<\/span> and <span class=\"se_path\">.*<\/span>. That is, for example, if the there is this description of a texture in the <span class=\"se_path\">*.mtl<\/span> file:<br \/>\n<span class=\"se_path\">C:\/User\/3dsmax\/ship1\/hull.jpg<\/span><br \/>\nthen in the <span class=\"se_path\">*.sml<\/span> file it will be changed to<br \/>\n<span class=\"se_path\">Odyssey2001\/Discovery\/hull.*<\/span><br \/>\nIf this change is not correct (e.g. the model uses a texture from a different SpaceEngine folder, for example <span class=\"se_path\">Odyssey2001\/Discovery\/engine1.jpg<\/span>), it will be necessary to close SpaceEngine, open the <span class=\"se_path\">*.sml<\/span> file and correct the path manually.<\/p>\n<p>Since formats <span class=\"se_path\">*.obj + *.mtl<\/span> do not support such effects as detail textures, transparency, two-sided materials, etc., after importing you will need to edit the <span class=\"se_path\">*.sml<\/span> file manually, or change links to materials in the <span class=\"se_path\">*.cfg<\/span> file to existing materials in other libraries.<\/p>\n<h4 class=\"se_h4\">Using the ship editor<\/h4>\n<p>If the orientation of the ship in SpaceEngine after the import is not correct, it is possible to rotate the whole ship model or individual modules in the Ships editor in SpaceEngine. To do this, select the ship and press [Shift]+[F2]. There you can also add engine exhaust effects, docking ports and the first- and third-person camera. Editor modes are selected by tickboxes in the upper side of the panel.<\/p>\n<h5 class=\"se_h5\">Editing the whole ship<\/h5>\n<p>Tick \"Edit entire ship\". You can rotate and move the ship as a whole using the \"Position\" and \"Rotation\" buttons. The distance unit is meters, angle unit is degrees. Pressing the [Shift] key toggles these buttons to \"coarse mode\" - useful for fast moving of the model. Checking \"Show axes\" will help in determining the position of the model's center. Rotate the camera around the ship using the right mouse button to drag, to determine whether the alignment is done correctly. Take control of the ship to determine whether the model is orientated in the game correctly (it must be viewed from the automatic camera, see below). Cameras can be added\/edited in this mode also (see below).<\/p>\n<p>Note: unpause time, otherwise there may be errors in the alignment of the model.<\/p>\n<h5 class=\"se_h5\">Editing the module<\/h5>\n<p>Tick \"Edit Module\". Select a module from the drop-down list below. The selected module will start blinking. You can rotate, pan and resize the module using the \"Position\", \"Rotation\" and \"Size\" buttons. The distance unit is meters, the angle unit is degrees. Pressing the [Shift] key toggles these buttons to \"coarse mode\" - useful for fast moving of the module. Changes apply only to that particular copy of the module in this class of ship. I.e. if you displace the engine module of the ship \"Explorer-1\", all new instances of the \"Explorer-1\" ship will have this module displaced, and all old instances as well after restarting SpaceEngine.<\/p>\n<h5 class=\"se_h5\">Adding or changing the engine exhaust effect<\/h5>\n<p>Tick \"Edit engine effect\", while a module is selected. The effect is applied to the module. This allows you to add a single effect to some \"engine\" module and use it multiple times in the modular ships. In contrast, single-module ships needed multiple exhaust effects added to the single module.<\/p>\n<p>Type - affects the appearance of the jet effect.<br \/>\nGroup - affects the behavior of the jet effect.<\/p>\n<p>Main, Retro, Hover, Thruster mean, respectively: the main engines, reverse (brake) engines, engines for hovering and vertical take-off, and shunting engines. SpaceEngine automatically determines the size and brightness of the effect depending on its position, orientation, and group. So if you put the main engine effect (Group \"Main\") to the nose of the ship, it will not work (i.e. the effect will never be shown). The engine exhaust effect is not related to physics, it is just a visual effect.<\/p>\n<p>The position, orientation and scale of the effect can be changed using buttons similar to those in module editing. The changes are applied to all modules of this type, and for all ships using that modules! So if you adjusted the engine module once, then you can't return back to it. The changes are saved to the module's cfg file (tags EngineEffect are added).<\/p>\n<h5 class=\"se_h5\">Adding or changing the docking port<\/h5>\n<p>Tick \"Edit docking port\" while a module is selected. The docking port effect is applied to the module, as well as the engine exhaust effect. This allows you to add docking ports to some \"docking bay\" module and use it multiple times in the modular ships. For example, this is done for the \"shuttle_deck_front\" and \"shuttle_deck_back\" modules in the SHW ships.<\/p>\n<p>The edited port can be chosen in the drop-down list below. The position and orientation of the port are controlled using the same buttons as in module editing. The Type drop-down box does not affect anything for now. The changes are applied to all modules of this type, and for all ship using that modules, similar to the engine exhaust effect. The changes are saved to the module's cfg file (tags DockingPort are added).<\/p>\n<h5 class=\"se_h5\">Adding or changing the docking port corridor<\/h5>\n<p>Tick \"Edit docking port corridor\" while a module is selected. Docking ports in SpaceEngine have visual markers which look like a shimmering corridor of rectangles. It allows a pilot to navigate his ship before docking. Therefore, the end of the corridor (where the \"light wave\" comes out) must be located next to the docking port itself.<\/p>\n<p>The corridor effect is also saved to the module's cfg file, to the same DockingPort tag as the docking port itself. Therefore its name in the drop-down list is the same as that of the docking port. The position, orientation and size of the effect are controlled by the same buttons as in module editing. The Type drop-down box does not affect anything for now.<\/p>\n<h5 class=\"se_h5\">Adding or changing the behind camera<\/h5>\n<p>To add an external third-person view camera or a cockpit first-person view camera, tick the \"Edit behind camera\" when the Editor is in the \"Edit entire ship\" mode. Choose an existing camera in the drop-down list below, or click \"Add\" to add a new camera. Its type can be changed in the drop-down list:<\/p>\n<p>Behind - third-person view, camera is smoothly coupled with the ship model.<br \/>\nCockpit - view from the cockpit, camera is fixed with the ship model.<br \/>\nAuto - default smooth third-person camera, it is also used if no custom cameras were added to the ship.<\/p>\n<p>By clicking \"Add\", the camera is created at the point where the observer is at that moment. After that, it can be moved\/rotated using the corresponding buttons. The position and orientation of the \"Auto\" camera are ignored, they are calculated by SpaceEngine. You can check the camera by simply taking control of the ship and switching view to it.<\/p>\n<p>The changes are saved in the ship's sss-file (Camera tags are added).<\/p>\n<h5 class=\"se_h5\">Saving changes<\/h5>\n<p>Click the \"Save\" button to save the changes. Saving into pak-files is not performed, instead SpaceEngine will create an sss or cfg file on the disk with the same virtual path as the original file in the pak-file. Be careful when editing the ship! As long as changes are saved to the ship's sss file, they will affect all the ships of this type, not only the particular ship you are editing.<\/p>\n<p>When you click \"Close\", it closes the editor without saving the recent changes to the disk. Changes, however, remain on the ship which was edited, but only until SpaceEngine is restarted.[\/vc_column_text][\/no_accordion_section][\/no_accordion][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>[vc_row row_type=\"row\" use_row_as_full_screen_section=\"no\" type=\"full_width\" text_align=\"left\" box_shadow_on_row=\"no\"][vc_column][no_accordion active_tab=\"1\" collapsible=\"yes\" background_transparency=\"no\" style=\"boxed_toggle\"][no_accordion_section title=\"Creating a ship\" accordion_type=\"accordion_icon\" icon_pack=\"font_elegant\" fe_icon=\"icon_cog\"][vc_column_text]This tutorial describes how to import a custom ship model into SpaceEngine. Before continuing, it is recommended to read this manual: Introduction. All the examples in this tutorial do not...<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":519,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-633","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/pages\/633","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/comments?post=633"}],"version-history":[{"count":22,"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/pages\/633\/revisions"}],"predecessor-version":[{"id":6962,"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/pages\/633\/revisions\/6962"}],"up":[{"embeddable":true,"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/pages\/519"}],"wp:attachment":[{"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/media?parent=633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}