{"id":624,"date":"2016-10-30T20:16:56","date_gmt":"2016-10-30T20:16:56","guid":{"rendered":"http:\/\/spaceengine.org\/?page_id=624"},"modified":"2018-11-22T21:11:31","modified_gmt":"2018-11-22T21:11:31","slug":"introduction","status":"publish","type":"page","link":"https:\/\/spaceengine.org\/manual\/making-addons\/introduction\/","title":{"rendered":"Introduction"},"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\" background_transparency=\"no\" style=\"boxed_accordion\"][no_accordion_section title=\"Introduction\" accordion_type=\"accordion_icon\" icon_pack=\"font_elegant\" fe_icon=\"icon_cog\"][vc_column_text]<\/p>\n<h4 class=\"se_h4\">SpaceEngine folders<\/h4>\n<p>SpaceEngine has two major folders with data files, which can be found in its root (installation) directory: <span class=\"se_path\">data<\/span> and <span class=\"se_path\">addons<\/span>. They are equivalent in many respects. The first contains the standard SpaceEngine files, which you should not modify. The second mirrors the internal structure of the first one, and is used for user mods and addons. It has a higher priority when searching for files at startup. This means that if you have some file in the <span class=\"se_path\">addons<\/span> folder with the same path and name as a file in the <span class=\"se_path\">data<\/span> folder, SpaceEngine will load the file from <span class=\"se_path\">addons<\/span>. This is useful for creating mods which change some of the system files (such as shaders), without actually touching the system files.<\/p>\n<p>Internally, the <span class=\"se_path\">data<\/span> folder has these <i>standard<\/i> subfolders inside: <span class=\"se_path\">catalogs, locale, models, music, scripts, shaders, sounds, textures<\/span>. 'Standard' means that SpaceEngine expects to find specific data files in these subfolders, for example, music files must be in <span class=\"se_path\">data\/music\/<\/span>, and star catalogs must be in <span class=\"se_path\">data\/catalogs\/stars\/<\/span> (some of these subfolders have their own next-level standard subfolders inside).<\/p>\n<p>The <span class=\"se_path\">addons<\/span> folder may also contain these standard subfolders, which would work as mirrors of the subfolders in <span class=\"se_path\">data<\/span>. This means that SpaceEngine will load data files from both <span class=\"se_path\">data<\/span> and <span class=\"se_path\">addons<\/span> as if they were a single large folder (but with higher priority for <span class=\"se_path\">addons<\/span> in case of a file name conflict, as has been described above).<\/p>\n<p>The <span class=\"se_path\">addons<\/span> folder also allows the use of additional internal subfolders, for better organization of addons. These additional subfolders may have any name (which obviously cannot match the name of the standard subfolder), typically representing the name of an addon or a franchise, for example <span class=\"se_path\">addons\/StarWars\/<\/span>. Internally, the additional subfolder may contain standard subfolders with data files: <span class=\"se_path\">catalogs, models, textures<\/span> and so on, or it may contain pak files (see below), or it may contain a next-level additional subfolder, for example <span class=\"se_path\">addons\/StarWars\/EmpireShips\/<\/span>. SpaceEngine allows for an unlimited amount of nested subfolders (limited by OS, typically the path length must not exceed 256 characters).<\/p>\n<h4 class=\"se_h4\">The pak files<\/h4>\n<p>pak files are zip archives provided for better organization and distribution of game content. For example, a large addon with thousands of files may be zipped into a single pak file and distributed in this form, which is more convenient for the user. Zip compression can also be used while creating the pak file, which is useful to save disk space and download traffic.<\/p>\n<p>pak files are zip archives that include files and folders with the same structure as they have on the disk, starting from the <span class=\"se_path\">data<\/span> or <span class=\"se_path\">addon<\/span> root level (or <span class=\"se_path\">addon\/YourCustomFolder\/<\/span>). This means that the uppermost folder which can be zipped into a pak file is one of the standard subfolders: <span class=\"se_path\">catalogs, models, textures<\/span> and so on. SpaceEngine reads the content of all pak files at startup and uses them as a virtual file system with date priority. This leads to many consequences:<\/p>\n<h5 class=\"se_h5\">1) The pak file format<\/h5>\n<p>pak files are zip archives (i.e. .zip files with the extension renamed to .pak). You may associate the .pak file type with WinRar or 7zip or whatever program you use to work with archives, and open any .pak file and extract files from it. Creating a .pak file is easy too: just select needed files and folders and compress them as .zip, then rename it to .pak when finished.<\/p>\n<h5 class=\"se_h5\">2) Virtual path<\/h5>\n<p>You may think of a pak file as a container for files\/folders. The internal folder structure inside a pak file is a continuation of the SE folder structure. This means that SE looks for files and folders on the disk and inside all pak files as if there were no pak files and all their content is extracted at the place where these pak files are. We will call this a <i>virtual path<\/i>. The path of the disk in this article will be colored <span class=\"se_path\">green<\/span>, and inside the pak file will be colored <span class=\"se_pak\">orange<\/span>. For example, these three <i>virtual paths<\/i> are equal (remember that the <span class=\"se_path\">StarWars<\/span> folder is optional):<br \/>\n<span class=\"se_path\">addons\/StarWars\/<\/span><span class=\"se_pak\">StarWarsPlanets.pak\/catalogs\/planets\/Coruscant.sc<\/span> (packed into pak file)<br \/>\n<span class=\"se_path\">addons\/StarWars\/catalogs\/planets\/Coruscant.sc<\/span> (unpacked on the disk)<br \/>\n<span class=\"se_path\">addons\/catalogs\/planets\/Coruscant.sc<\/span> (unpacked addon content moved to the addons root - still works)<\/p>\n<h5 class=\"se_h5\">3) Priority by modification date<\/h5>\n<p>If there are two or more files with the same <i>virtual path<\/i>, SE will load the most recent one. It compares the modification date\/time of the disk files, or those of the entire pak file. For example, consider that you have 3 files named <span class=\"se_path\">SolarSys.sc<\/span> in different places, but with the same <i>virtual path<\/i>:<br \/>\n<span class=\"se_path\">data\/catalogs\/<\/span><span class=\"se_pak\">Catalogs0980.pak\/planets\/SolarSys.sc<\/span> in the default pak file, pak date is 2016\/08\/06<br \/>\n<span class=\"se_path\">data\/catalogs\/planets\/SolarSys.sc<\/span> unpacked on the disk, file date is 2016\/09\/01<br \/>\n<span class=\"se_path\">data\/catalogs\/<\/span><span class=\"se_pak\">SolarSysUpdate001.pak\/planets\/SolarSys.sc<\/span> in another pak, pak date is 2016\/09\/05<br \/>\nIn this case, SpaceEngine will load the last one, because it has the most recent date. This is useful for making updates. Consider someone adding an addon with this file:<br \/>\n<span class=\"se_path\">addons\/<\/span><span class=\"se_pak\">SolarSystemMod.pak\/catalogs\/planets\/SolarSys.sc<\/span> pak date is 2016\/08\/15<br \/>\nIn this case, SpaceEngine will load the file from this addon pak, despite its older date. This is because files in the <span class=\"se_path\">addons<\/span> folder have priority over files in the <span class=\"se_path\">data<\/span> folder. This is to prevent breaking addons after updating the default SE files. Inside the <span class=\"se_path\">addons<\/span> folder, the same file\/pak modification date priority rules apply.<\/p>\n<h5 class=\"se_h5\">4) Extracting files<\/h5>\n<p>You may extract any file from the pak archives by opening it as a zip archive. When extracting the file, you must create all the folders contained inside the pak, so the extracted file will have the same <i>virtual path<\/i> as the packed one (use the 'extract here' option in your archiver program). For example, if you want to extract the file <span class=\"se_pak\">SolarSys.sc<\/span> from the <span class=\"se_pak\">Catalogs0980.pak<\/span>, you must create the folder <span class=\"se_path\">data\/catalogs\/planets\/<\/span> and extract that file into it so that it has this path:<br \/>\n<span class=\"se_path\">data\/catalogs\/planets\/SolarSys.sc<\/span><br \/>\nAfter this, SpaceEngine will load the extracted file, because it will have the more recent date. Now you may modify it.<\/p>\n<h5 class=\"se_h5\">5) Creating pak files<\/h5>\n<p>For example, consider you are making a planetary system addon which has these files:<br \/>\n<span class=\"se_path\">addons\/StarWars\/catalogs\/stars\/StarWarsSystems.sc<br \/>\naddons\/StarWars\/catalogs\/planets\/Coruscant.sc<br \/>\naddons\/StarWars\/catalogs\/planets\/Tatooine.sc<\/span><br \/>\nWhen you finish creating it, testing everything, and are ready to release, go to the <span class=\"se_path\">StarWars<\/span> folder, select the <span class=\"se_path\">catalogs<\/span> folder and pack it into a zip archive. Rename that archive to <span class=\"se_path\">StarWarsPlanets-v001.pak<\/span>. The file name doesn't really matter, but it should reflect the file's content, and having a version\/revision number in it is also a good idea. After that, delete the <span class=\"se_path\">catalogs\/<\/span> folder and its content (or move it to some backup place) and leave only the newly created pak file. If you did the packing correctly, your addon should work in SE as before. Your data files will have this virtual path:<br \/>\n<span class=\"se_path\">addons\/StarWars\/<\/span><span class=\"se_pak\">StarWarsPlanets.pak\/catalogs\/stars\/StarWarsSystems.sc<\/span><br \/>\n<span class=\"se_path\">addons\/StarWars\/<\/span><span class=\"se_pak\">StarWarsPlanets.pak\/catalogs\/planets\/Coruscant.sc<\/span><br \/>\n<span class=\"se_path\">addons\/StarWars\/<\/span><span class=\"se_pak\">StarWarsPlanets.pak\/catalogs\/planets\/Tatooine.sc<\/span><br \/>\nSo you are ready to share the file <span class=\"se_path\">StarWarsPlanets-v001.pak<\/span> with the community. Note that it will work if it is placed in any subfolder in the <span class=\"se_path\">addons<\/span> folder (except standard subfolders of course):<br \/>\n<span class=\"se_path\">addons\/StarWarsPlanets-v001.pak<\/span><br \/>\n<span class=\"se_path\">addons\/StarWars\/StarWarsPlanets-v001.pak<\/span><br \/>\n<span class=\"se_path\">addons\/blabla\/ololo\/123\/StarWarsPlanets-v001.pak<\/span><br \/>\nYou are free to put any set of data files in a single pak file. For example, you may create a full Star Wars franchise pak, which includes all planetary systems, galaxy and galaxy model, and all ship models. Note that there are some restrictions.<\/p>\n<h5 class=\"se_h5\">6) Restrictions<\/h5>\n<p>1) The SpaceEngine root folder cannot be used as a place for pak files. The following will <span class=\"se_warn\">not<\/span> work:<br \/>\n<span class=\"se_path\">SpaceEngine\/<\/span><span class=\"se_pak\">StarWars.pak\/data\/catalogs\/planets\/Coruscant.sc<\/span><br \/>\n2) The pak file cannot contain additional subfolders, only default ones are allowed. The following will <span class=\"se_warn\">not<\/span> work:<br \/>\n<span class=\"se_path\">SpaceEngine\/addons\/<\/span><span class=\"se_pak\">StarWars.pak\/StarWars\/StarWarsPlanets\/catalogs\/planets\/Coruscant.sc<\/span><br \/>\n3) The pak file should be less than 4GB in size. If your addon is bigger than that, split it into several smaller pak files.<br \/>\n4) Music and sound files in ogg format cannot be zipped into pak files.<\/p>\n<h5 class=\"se_h5\">7) Compression rate<\/h5>\n<p>Zip archives can be created with or without compression. SpaceEngine supports only the \"Deflate\" compression method. Some file types have a great compression rate (text files such as scripts and catalogs), some have a medium compression rate (binary files such as ship models .sm, .dds and uncompressed .tga images), some almost cannot be compressed (.jpg, .png, .tif images). It is a good idea to save a large set of image files (such as a planet textures addon) into an archive <i>without<\/i> compression, because it has great extracting\/loading performance. Higher performance is always better than saving few megabytes of disk space. You could experiment to find better options for your addon. For example, you may save textures into a pak without compression, and scripts with models into another pak file with compression.<\/p>\n<h5 class=\"se_h5\">8) Never touch the default pak files<\/h5>\n<p>Just like in all other games, changing the default game resources is a bad idea. In the future, the game client will check the default files for changes and will kick you from the server if it finds that the default files have been changed. So remember these simple rules:<br \/>\n1) If you want to add something, create your own pak file (or simply store files in the folders, non-packed).<br \/>\n2) If you want to modify something, extract the file from the default pak and modify the extracted file.<\/p>\n<h4 id=\"se-scr-path\" class=\"se_h4\">SpaceEngine scripts<\/h4>\n<p>SpaceEngine has a special <i>scripting language<\/i> to describe astronomical objects, ships, models and configuration files, and for scenarios. Scripts are stored in files with the extensions <span class=\"se_path\">*.sc, *.sss, *.cfg, *.se<\/span>. All file formats are plain text documents, so you can edit them with notepad (or the better program Notepad++, which we recommend you download and install). Lets take a look at some of SpaceEngine's default catalog scripts. For example, look at the description of Saturn, located in the file <span class=\"se_path\">data\/catalogs\/<\/span><span class=\"se_pak\">Catalogs0980.pak\/planets\/SolarSys.sc<\/span>:<\/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; height: 200px;\">Planet\u00a0\u00a0\u00a0\"Saturn\"<br \/>\n{<\/p>\n<div class=\"codepaddingleft \">\nParentBody\u00a0\u00a0\u00a0\u00a0\u00a0\"Sol\"<br \/>\nClass\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"GasGiant\"<br \/>\nMass\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a095.162<br \/>\nRadius\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a060268<br \/>\nOblateness\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.09796<br \/>\nRotationPeriod\u00a0\u00a010.65622<br \/>\nRotationOffset\u00a0\u00a0358.922<br \/>\nObliquity\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a028.049<br \/>\nEqAscendNode\u00a0\u00a0\u00a0\u00a0169.53<br \/>\nColor\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0( 1.000 1.000 0.850 )<br \/>\nAlbedo\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.342<br \/>\nAlbedoBond\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.342<br \/>\nAlbedoGeom\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.47<br \/>\nBrightness\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01.8Surface<br \/>\n{<\/p>\n<div class=\"codepaddingleft \">\n\/\/ Surface map author: Bjorn Jonsson<br \/>\nDiffMap\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Saturn\/Surface-BJ\"<br \/>\nDiffTileSize\u00a0\u00a0\u00a0\u00a0256<br \/>\nDiffTileBorder\u00a0\u00a00<br \/>\nDayAmbient\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00<br \/>\nNoClouds\u00a0\u00a0\u00a0\u00a0\u00a0true\n<\/div>\n<p>}<br \/>\nAtmosphere<br \/>\n{<\/p>\n<div class=\"codepaddingleft \">\nHeight\u00a0\u00a0\u00a0250\u00a0\u00a0\/\/ km<br \/>\nModel\u00a0\u00a0\u00a0\"Earth\"<br \/>\nBright\u00a0\u00a0\u00a05.0<br \/>\nOpacity\u00a0\u00a00.2<br \/>\nSkyLight 0.002<\/p>\n<p>Composition \/\/ values in percent<br \/>\n{<\/p>\n<div class=\"codepaddingleft \">\nH2\u00a0\u00a0\u00a096.3<br \/>\nHe\u00a0\u00a0\u00a03.25<br \/>\nCH4\u00a0\u00a00.45<br \/>\nNH3\u00a0\u00a00.0125<br \/>\nC2H6\u00a00.0007\n<\/div>\n<p>}\n<\/p><\/div>\n<p>}<\/p>\n<p>Aurora<br \/>\n{<\/p>\n<div class=\"codepaddingleft \">\nHeight\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01000\u00a0\u00a0\u00a0\/\/ km<br \/>\nTopColor\u00a0\u00a0\u00a0\u00a0(1.5 0.0 0.8)<br \/>\nBottomColor (1.0 0.1 0.0)<br \/>\nNorthLat\u00a0\u00a0\u00a0\u00a0\u00a090\u00a0\u00a0\u00a0\u00a0\/\/ degrees<br \/>\nNorthLon\u00a0\u00a0\u00a0\u00a0\u00a00\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ degrees<br \/>\nNorthRadius\u00a0\u00a015000 \/\/ km<br \/>\nNorthWidth\u00a0\u00a0\u00a05000\u00a0\u00a0\/\/ km<br \/>\nNorthRings\u00a0\u00a0\u00a03\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ number of rings<br \/>\nNorthBright\u00a0\u00a01.0<br \/>\nSouthLat\u00a0\u00a0\u00a0\u00a0-90\u00a0\u00a0\u00a0\u00a0\/\/ degrees<br \/>\nSouthLon\u00a0\u00a0\u00a0\u00a0\u00a00\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ degrees<br \/>\nSouthRadius\u00a0\u00a016000 \/\/ km<br \/>\nSouthWidth\u00a0\u00a0\u00a05000\u00a0\u00a0\/\/ km<br \/>\nSouthRings\u00a0\u00a0\u00a03\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ number of rings<br \/>\nSouthBright\u00a0\u00a01.0\n<\/div>\n<p>}<\/p>\n<p>Rings<br \/>\n{<\/p>\n<div class=\"codepaddingleft \">\n\/\/ Rings texture author: Vladimir Romanyuk \"SpaceEngineer\"<br \/>\nTexture\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Saturn-rings.*\"<br \/>\nInnerRadius\u00a0\u00a0\u00a0\u00a0\u00a060284<br \/>\nOuterRadius\u00a0\u00a0\u00a0\u00a0\u00a0356993<br \/>\nFrontBright\u00a0\u00a0\u00a0\u00a0\u00a01.0<br \/>\nBackBright\u00a0\u00a0\u00a0\u00a0\u00a0\u00a05.0<br \/>\nBrightness\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01.5\n<\/div>\n<p>}<\/p>\n<p>Orbit<br \/>\n{<\/p>\n<div class=\"codepaddingleft \">\nRefPlane\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Ecliptic\"<br \/>\nPeriod\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a029.4577<br \/>\nSemiMajorAxis\u00a0\u00a0\u00a09.5371<br \/>\nEccentricity\u00a0\u00a0\u00a0\u00a00.0542<br \/>\nInclination\u00a0\u00a0\u00a0\u00a0\u00a02.4845<br \/>\nAscendingNode\u00a0\u00a0\u00a0113.715<br \/>\nLongOfPericen\u00a0\u00a0\u00a092.432<br \/>\nMeanLongitude\u00a0\u00a0\u00a049.944\n<\/div>\n<p>}\n<\/p><\/div>\n<p>}\n<\/p><\/div>\n<\/div>\n<p>The script starts with the <i>keyword<\/i> <span class=\"se_script\">Planet<\/span>, followed by the <i>string<\/i> <span class=\"se_script\">\"Saturn\"<\/span>. After that, there are many lines with some <i>parameters<\/i> enclosed in a curly braces. The construction <span class=\"se_script\">Planet \"Saturn\" { ... }<\/span> is called a <i>tag<\/i> and plays an important role in SE scripts. Tags divide the script into logical sections, and they can themselves include other tags (for example, <span class=\"se_script\">Surface { ... }<\/span>).<\/p>\n<p>Tags can be named, like the <span class=\"se_script\">Planet<\/span> tag, or unnamed, like <span class=\"se_script\">Surface<\/span>. A named tag can have multiple, or <i>alternate<\/i>, names, separated by a slash '\/'. For example: <span class=\"se_script\">Star \"ALF Cen\/Toliman\/Rigel Kentaurus\/Gliese 559\"<\/span>. All of these names identify the same object in SpaceEngine, and they can each be used to search for the object in-game, or to refer to it from another script (for example, you must specify a star name in the parameter <span class=\"se_script\">ParentBody<\/span> in the planet script - you can use one of the multiple names of the star there).<\/p>\n<p><a name=\"greek\">Greek letters<\/a>, if used, must be entered in the object's name using abbreviations: ALF, BET, etc. This is the full list of abbreviations:<\/p>\n<table style=\"line-height: 5px;\">\n<tbody>\n<tr>\n<td style=\"width: 20px;\"><span class=\"se_script\">ALF<\/span><\/td>\n<td style=\"width: 20px;\">\u03b1<\/td>\n<td>(alpha)<\/td>\n<\/tr>\n<tr>\n<td><span class=\"se_script\">BET<\/span><\/td>\n<td>\u03b2<\/td>\n<td>(beta)<\/td>\n<\/tr>\n<tr>\n<td><span class=\"se_script\">GAM<\/span><\/td>\n<td>\u03b3<\/td>\n<td>(gamma)<\/td>\n<\/tr>\n<tr>\n<td><span class=\"se_script\">DEL<\/span><\/td>\n<td>\u03b4<\/td>\n<td>(delta)<\/td>\n<\/tr>\n<tr>\n<td><span class=\"se_script\">EPS<\/span><\/td>\n<td>\u03b5<\/td>\n<td>(epsilon)<\/td>\n<\/tr>\n<tr>\n<td><span class=\"se_script\">ZET<\/span><\/td>\n<td>\u03b6<\/td>\n<td>(zeta)<\/td>\n<\/tr>\n<tr>\n<td><span class=\"se_script\">ETA<\/span><\/td>\n<td>\u03b7<\/td>\n<td>(eta)<\/td>\n<\/tr>\n<tr>\n<td><span class=\"se_script\">TET<\/span><\/td>\n<td>\u03b8<\/td>\n<td>(theta)<\/td>\n<\/tr>\n<tr>\n<td><span class=\"se_script\">IOT<\/span><\/td>\n<td>\u03b9<\/td>\n<td>(iota)<\/td>\n<\/tr>\n<tr>\n<td><span class=\"se_script\">KAP<\/span><\/td>\n<td>\u03ba<\/td>\n<td>(kappa)<\/td>\n<\/tr>\n<tr>\n<td><span class=\"se_script\">LAM<\/span><\/td>\n<td>\u03bb<\/td>\n<td>(lambda)<\/td>\n<\/tr>\n<tr>\n<td><span class=\"se_script\">MU<\/span><\/td>\n<td>\u03bc<\/td>\n<td>(mu)<\/td>\n<\/tr>\n<tr>\n<td><span class=\"se_script\">NU<\/span><\/td>\n<td>\u03bd<\/td>\n<td>(nu)<\/td>\n<\/tr>\n<tr>\n<td><span class=\"se_script\">KSI<\/span><\/td>\n<td>\u03be<\/td>\n<td>(xi)<\/td>\n<\/tr>\n<tr>\n<td><span class=\"se_script\">OMI<\/span><\/td>\n<td>\u03bf<\/td>\n<td>(omicron)<\/td>\n<\/tr>\n<tr>\n<td><span class=\"se_script\">PI<\/span><\/td>\n<td>\u03c0<\/td>\n<td>(pi)<\/td>\n<\/tr>\n<tr>\n<td><span class=\"se_script\">RHO<\/span><\/td>\n<td>\u03c1<\/td>\n<td>(rho)<\/td>\n<\/tr>\n<tr>\n<td><span class=\"se_script\">SIG<\/span><\/td>\n<td>\u03c3<\/td>\n<td>(sigma)<\/td>\n<\/tr>\n<tr>\n<td><span class=\"se_script\">TAU<\/span><\/td>\n<td>\u03c4<\/td>\n<td>(tau)<\/td>\n<\/tr>\n<tr>\n<td><span class=\"se_script\">UPS<\/span><\/td>\n<td>\u03c5<\/td>\n<td>(upsilon)<\/td>\n<\/tr>\n<tr>\n<td><span class=\"se_script\">PHI<\/span><\/td>\n<td>\u03c6<\/td>\n<td>(phi)<\/td>\n<\/tr>\n<tr>\n<td><span class=\"se_script\">CHI<\/span><\/td>\n<td>\u03c7<\/td>\n<td>(chi)<\/td>\n<\/tr>\n<tr>\n<td><span class=\"se_script\">PSI<\/span><\/td>\n<td>\u03c8<\/td>\n<td>(psi)<\/td>\n<\/tr>\n<tr>\n<td><span class=\"se_script\">OME<\/span><\/td>\n<td>\u03c9<\/td>\n<td>(omega)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>A parameter is a line with the <i>parameter name<\/i> (keyword) on the left side and the <i>parameter value<\/i> on the right side. The name and value must be separated with spaces or tabs. Only one parameter per line is allowed. Parameters can be one of the following <i>types<\/i>:<\/p>\n<p>string (text): <span class=\"se_script\">Class \"GasGiant\"<\/span><br \/>\nnumber: <span class=\"se_script\">Mass 95.162<\/span><br \/>\nvector: <span class=\"se_script\">Color ( 1.000 1.000 0.850 )<\/span> or <span class=\"se_script\">Color ( 1.000, 1.000, 0.850 )<\/span><br \/>\nnumber in 'deg min sec' or 'hrs min sec' format: <span class=\"se_script\">Dec 18 32 16.23<\/span><br \/>\nboolean (binary): <span class=\"se_script\">NoClouds true<\/span> or <span class=\"se_script\">NoClouds 1<\/span><\/p>\n<p>Comments are allowed in SE scripts, which are in the C\/C++ format:<br \/>\n<span class=\"se_script\">\/\/ this is a single-line comment<\/span><br \/>\n<span class=\"se_script\">\/* this is an inline comment *\/<\/span><br \/>\nThe first is the single-line comment. All text after the <span class=\"se_script\">\/\/<\/span> symbols until the end of line is considered a comment and ignored by SE. The second is an inline or multi-line comment. All text between <span class=\"se_script\">\/*<\/span> and <span class=\"se_script\">*\/<\/span> is considered a comment and ignored by SE. New lines are allowed in this type of comment:<br \/>\n<span class=\"se_script\">\/* this is a<br \/>\nmulti-line<br \/>\ncomment *\/<\/span><\/p>\n<h4 class=\"se_h4\">Catalogs of astronomical objects<\/h4>\n<p>SpaceEngine handles information about all catalog objects in <i>script files<\/i> (with the extension *.sc) or in CSV files (*.csv), located in the virtual directory <span class=\"se_path\">*\/catalogs\/<\/span>. Both file formats are plain text documents, so you can edit them with notepad. The csv files can be edited using specialized software for editing csv (like Microsoft Excel, with some side effects). The directory <span class=\"se_path\">*\/catalogs\/<\/span> has subdirectories named <span class=\"se_path\">galaxies\/<\/span>, <span class=\"se_path\">clusters\/<\/span>, <span class=\"se_path\">nebulae\/<\/span>, <span class=\"se_path\">stars\/<\/span> and <span class=\"se_path\">planets\/<\/span>, for each type of object.<\/p>\n<p>The majority of stars in the default SpaceEngine installation are stored in the csv file <span class=\"se_path\">data\/catalogs\/<\/span><span class=\"se_pak\">Catalogs0980.pak\/stars\/HIPPARCOS.csv<\/span>, and the main catalog of galaxies is in <span class=\"se_path\">data\/catalogs\/<\/span><span class=\"se_pak\">Catalogs0980.pak\/galaxies\/NGC-IC.csv<\/span>. They are the HIPPARCOS star catalog containing about 110,000 stars, and the NGC\/IC galaxy catalog containing about 10,000 galaxies. Other objects, including some galaxies and stars with additional data, binary star systems, black holes, star clusters and nebulae, Solar System objects, and exoplanets and their host stars, are stored in multiple sc files in the same system pak. These default files should not be modified or changed in any way. If you want to update an object, remove it, or add a new one, create your own sc or csv file in the corresponding addon folder (<span class=\"se_path\">addons\/catalogs\/stars\/<\/span> for stars and so on). SpaceEngine has scripting options to modify and remove stars or other objects from the default catalogs, or to add new ones. After finishing work on your catalogs, you can zip the catalog files into the pak file and share it with the community.<\/p>\n<p>The csv format is used to create large catalogs of objects with similar data. It is more compact and a lot faster than sc, but has limitations in the types of data which can be specified in it. It is just a table with values separated by a comma. The current version of SpaceEngine (0.9.8.0) supports csv files only for stars and galaxies. The sc format is designed to specify any possible data that SE can use to describe an object. It is script-like text with 'tags' used to describe an object (galaxy, star, planet etc) and its various parameters.<\/p>\n<h5 class=\"se_h5\">Adding, updating, and removing catalog objects<\/h5>\n<p>If you describe a new object using SpaceEngine sc scripts, it will be added to the game. \"New object\" means that it didn't exist in SE before you made a script for it. More precisely, an object of the same type (for example, a star) and the same name didn't exist in SE. If the object of that type with the same name already exists in SE, it will be <i>updated<\/i> or <i>merged<\/i> with the data you have provided in your script. The order of merging (which data has priority) is defined by the modification date of the sc file or the pak file in which this sc file is packed. The newer file has higher priority, so some data from the script of this object in a previous file will be replaced with the new data provided. If the previous script doesn't have some specific data (for example, planet mass), but the new one has it, the newly provided data will be used.<\/p>\n<p>Planetary objects (planets, moons, asteroids, comets, and stars in multiple-star systems) are identified in a more complicated way. SpaceEngine allows there to be many planetary objects with the same name, but with different parent bodies (specified in the parameter <span class=\"se_script\">ParentBody<\/span>). For example, the Solar system has two objects with the name \"Pandora\": a moon of Saturn and an asteroid. They have different parent bodies, Saturn and Sun, so they are different objects in SE.<\/p>\n<p>While looking for identical objects, SpaceEngine scans all alternative names provided in the scripts. For example, you may update the old star <span class=\"se_script\">Star \"ALF Cen\/Toliman\/Rigel Kentaurus\/Gliese 559\"<\/span> by describing a star in your script by <span class=\"se_script\">Star \"Toliman\/Bungula\"<\/span>. SpaceEngine will detect that this is the same object when it finds the name \"Toliman\". It will update the old star with the new data provided in your script, including the star name: it will add the new provided name \"Bungula\" to the list of alternative names, so it will become \"ALF Cen\/Toliman\/Bungula\/Rigel Kentaurus\/Gliese 559\". For a planetary object, as has been noted, you have to specify the parent object. SpaceEngine will merge them only if the object's name and parent object name are identical (any alternative name of the parent object can be used).<\/p>\n<p>It's possible to cancel out some data in the old scripts, for example, <span class=\"se_script\">NoClouds true<\/span> will disable <span class=\"se_script\">Clouds { }<\/span> tags in the old scripts. But if the <span class=\"se_script\">Clouds { }<\/span> tags are provided for the planet which had <span class=\"se_script\">NoClouds true<\/span> in the old script, these <span class=\"se_script\">Clouds { }<\/span> tags will be used.<\/p>\n<p>It's possible to change the type of an object by defining it with the other tag. For example, if older script has a planet \"Kek\" defined as <span class=\"se_script\">Planet \"Kek\"<\/span>, and you create a new script and define it as <span class=\"se_script\">Moon \"Kek\"<\/span>, it will change its type to moon. Changing the type is only possible within the set of types supported by the current catalog. This means that you cannot add a galaxy named \"Saturn\" to the planets catalog using the tag <span class=\"se_script\">Galaxy \"Saturn\"<\/span>. It will be ignored by SE, because tag <span class=\"se_script\">Galaxy<\/span> is not allowed in the planets catalog. Here is the list of object types (tags) which are allowed in the corresponding catalogs:<\/p>\n<p>Planet catalogs <span class=\"se_path\">*\/catalogs\/planets\/*.sc<\/span>: <span class=\"se_script\">Star, Planet, Moon, DwarfPlanet, DwarfMoon, Asteroid, Comet, Barycenter<\/span><br \/>\nStar catalogs <span class=\"se_path\">*\/catalogs\/stars\/*.sc<\/span>: <span class=\"se_script\">Star, StarBarycenter<\/span><br \/>\nGalaxy catalogs <span class=\"se_path\">*\/catalogs\/galaxies\/*.sc<\/span>: <span class=\"se_script\">Galaxy, Quasar<\/span><br \/>\nStar cluster catalogs <span class=\"se_path\">*\/catalogs\/clusters\/*.sc<\/span>: <span class=\"se_script\">Cluster<\/span><br \/>\nNebula catalogs <span class=\"se_path\">*\/catalogs\/nebuale\/*.sc<\/span>: <span class=\"se_script\">Nebula<\/span><\/p>\n<p>It's possible to remove (more precisely, disable) some object from the old catalogs. Use the parameter <span class=\"se_script\">Remove<\/span> with the name of object you want to remove. For example, <span class=\"se_script\">Remove \"Toliman\"<\/span>. It must be used outside any tag. Any of the object's alternate names can be used. Star catalogs also support the <span class=\"se_script\">RemoveStar<\/span> parameter with the same effect (for backward compatibility). In the planets catalog you must use a more complex construction: <span class=\"se_script\">Remove \"Saturn\" { ParentBody \"Sol\" }<\/span>. This is because SpaceEngine identifies a planetary object by its name and its parent's name.<\/p>\n<p>Removing old objects is useful when upgrading the default SE catalogs. For example, the default star catalogs still have many binary stars described by two solitary stars. One can use <span class=\"se_script\">Remove<\/span> in the star catalog to delete them, and add a barycenter description to the same star catalog. Then make a planet catalog with two stars with proper orbits and that barycenter as their parent. See <a class=\"link\" href=\"http:\/\/spaceengine.org\/manual\/making-addons\/creating-a-star\" target=\"_blank\" rel=\"nofollow\">Creating a star<\/a> for details.<\/p>\n<p><span class=\"se_warn\">Note:<\/span> the <span class=\"se_script\">Remove<\/span> parameter affects all catalog files, regardless of their modification date. So if you used it once, it will no longer be possible to create an object of the same type with the same name. It is a bug in the current version (0.9.8.0).<\/p>\n<h5 class=\"se_h5\">Checking for errors in catalogs<\/h5>\n<p>SpaceEngine can output some errors and warnings into the log file <span class=\"se_path\">system\/se.log<\/span> while loading catalogs. This is useful for catching possible errors. There are two ways to enable logging: global and per catalog file. The global logging level is controlled by the parameters <span class=\"se_script\">CatalogLogLevel<\/span> (for sc catalogs) and <span class=\"se_script\">CsvLogLevel<\/span> (for csv catalogs) under the <span class=\"se_script\">Log<\/span> tag in the <span class=\"se_path\">config\/main-user.cfg<\/span> file. Possible values are:<\/p>\n<p>0 - do not log anything<br \/>\n1 - log errors and warnings, using the lesser log level between those in the main-user.cfg and in the sc file, if defined there<br \/>\n2 - log everything, using the lesser log level between those in the main-user.cfg and in the sc file, if defined there<br \/>\n3 - log errors and warnings, ignoring log level in all sc files<br \/>\n4 - log everything, ignoring log level in all sc files<\/p>\n<p>The last two are used to override the log level settings in all sc files (not usable in the <span class=\"se_script\">CsvLogLevel<\/span> parameter). They are provided for global searching for catalog errors.<\/p>\n<p>Each sc catalog file may have its own log level settings, specified by the parameter <span class=\"se_script\">LogLevel<\/span>, added somewhere in the global space (i.e. outside the tags <span class=\"se_script\">Star<\/span>, <span class=\"se_script\">StarBarycenter<\/span> etc). Possible values are:<\/p>\n<p>0 - do not log anything<br \/>\n1 - log errors and warnings only<br \/>\n2 - log everything<\/p>\n<p>It is recommended to specify <span class=\"se_script\">LogLevel 2<\/span> in your sc files and <span class=\"se_script\">CatalogLogLevel 2<\/span> in <span class=\"se_path\">main-user.cfg<\/span> while you are working on catalogs so you will have all information about <i>star solver<\/i> work in the log file (see <a class=\"link\" href=\"http:\/\/spaceengine.org\/manual\/making-addons\/creating-a-star\" target=\"_blank\" rel=\"nofollow\">Creating a star<\/a> for details). If you need to see only possible errors, specify <span class=\"se_script\">LogLevel 1<\/span>. If some errors or warnings are still visible in the release version of your catalog (for example, no RA\/Dec data are provided for a star, and star solver generates them procedurally), it's recommended to specify <span class=\"se_script\">LogLevel 0<\/span>, so other users will have their log files clean of errors related to your catalog.[\/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\" background_transparency=\"no\" style=\"boxed_accordion\"][no_accordion_section title=\"Introduction\" accordion_type=\"accordion_icon\" icon_pack=\"font_elegant\" fe_icon=\"icon_cog\"][vc_column_text] SpaceEngine folders SpaceEngine has two major folders with data files, which can be found in its root (installation) directory: data and addons. They are equivalent in many respects. The first contains the...<\/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-624","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/pages\/624","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=624"}],"version-history":[{"count":23,"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/pages\/624\/revisions"}],"predecessor-version":[{"id":2757,"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/pages\/624\/revisions\/2757"}],"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=624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}