MOD - Creating a Star 0.95
|
|
SpaceEngineer | Date: Wednesday, 07.12.2011, 00:38 | Message # 1 |
Author of Space Engine
Group: Administrators
Russian Federation
Messages: 4800
Status: Offline
| This is the tutorial for adding new stars to SpaceEngine 0.95. It will be modified or appended in the future.
SpaceEngine keeps most of the real stars in a binary file called data/catalogs/stars/stars120k.dat, and the names file associated with it is called data/catalogs/stars/stars120k.txt. It contains about 120,000 stars from the HIPPARCOS catalog. The binary file cannot be changed, but it can be modified by the script. New stars can also be specified in a script.
Create a script for a star catalog (a text file with the extension .sc) in the folder data/catalogs/stars, and add path to that script to the universe.cfg config in the StarsCatalogs parameter. The catalog can describe a single star or a barycenter of multiple star, and can "remove" (disable) the star of the binary catalog.
Example of the stars catalog script:
Code // Create a new object - star "Mystar" Star "Mystar" { RA 16 10 45 // Right ascention Dec -25 12 11 // Declination Dist 100.0 // Distanse from our Sun Class "G5V" // Spectral class Lum 0.86 // Luminosity, or //AbsMagn 5.31 // absolute magnitude, or //AppMagn 10.31 // visual magnitude NoPlanets true // disable generation of procedural planetary system }
// Create a new object - bynary system "Mandel" barycenter StarBarycenter "Mandel" { RA 19 50 18 // Right ascention Dec 28 18 47 // Declination Dist 251.652 // Distanse from our Sun // Spectral class (Class) and Luminosity (Lum) will be calculated automatically // by SpaceEngine, based on data from the catalog of the planets }
RemoveStar "ALF Cen A" // disable star "ALF Cen A" from binary catalog RemoveStar "ALF Cen B" // disable star "ALF Cen B" from binary catalog
// Create a new object - bynary system "ALF Cen" barycenter StarBarycenter "Toliman/Rigel Kentaurus/ALF Cen/Gliese 559" { RA 14.6611677 // Right ascention Dec -60.837128 // Declination Dist 1.339 // Distanse from our Sun // Spectral class (Class) and Luminosity (Lum) will be calculated automatically // by SpaceEngine, based on data from the catalog of the planets }
Tags are special parameters that divide the script into sections, enclosed in curly braces. In star catalog script these tags are allowed:
Star - star StarBarycenter - barycenter of binary or multiple star system RemoveStar - remove (disable) a star from binary catalog
Parameters:
- RA
Right ascension in hours, in decimal format or formatted as HH MM SS.
- Dec
Declination in degrees, in decimal format or formatted as DD MM SS.
- Dist
Distance from our Sun in parsecs.
- Lum, AppMagn, AbsMagn
Allows for one of three options: Lum or Luminosity - luminosity in the units of Sun's luminosity, or AppMagn - visual magnitude, or AbsMagn - absolute magnitude.
- NoPlanets
If true, SpaceEngine does not generate the procedural planetary system for the star. WARNING: Current version (0.95) have a bug - using this option will disable the star itself. Don't use it in 0.95.
- Class
The spectral class of the Harvard classification: Main-sequence stars: O, B, A, F, G, K, M Additional classes of the Main Sequence: R, S, N, C Wolf-Rayett stars: WС WN Brown dwarfs: L T White dwarfs: DA DB DC DO DQ DZ After the designation of spectral class, type the digit from 0 to 9, that indicating the subclass. After it, type the luminosity class designation (except white dwarfs) Luminosity classes: Ia-0, Ia, Ib, II, III, IV, V, VI Example: G2V, M5III, DB3. There are also some special classes, but instead of using them it is better to use the tag StarBarycenter or the corresponding object type in the planets catalog script (see below): SB - barycenter Q - neutron star X - black hole
The mass and radius of the star is computed from the luminosity and temperature, and temperature is determined by the spectral class. This is done using tables of temperatures and formulas from astrophysics. If the calculated size or mass is wrong or inaccurate, then custom values can be specified in the planets catalog script (see below). If the planets catalog does not specify all these parameters, as well as its rotation, granulation cells size, etc, then it gets calculated or generated procedurally. The planets are also procedurally generated (if stars catalog does not specify NoPlanets as 'true'). The three space coordinates (RA, Dec and Dist) are necessary, because they determine the position of a star in 3D space. A fourth parameter is necessary for luminosity or magnitude: It must be included either in the catalog of stars or catalog of planets. If RA or Dec is not specified, then it will be generated procedurally. If Dist is not specified, SpaceEngine tries to calculate it based on apparent magnitude (luminosity) and visual magnitude, if both of them are specified. If absolute magnitude or luminosity is not specified, SpaceEngine tries to determine it from a star's spectral class (this gives very approximate value) or calculates it from distance and visual magnitude. Errors or warnings can be checked from within the se.log file, if set StarSilentLoading false in universe.cfg file.
To specify the mass, radius, rotation, it is necessary to describe the star in the stars catalog with a StarBarycenter tag (the barycenter of the system), and create a catalog of planets for it, where it describes the star with the Star {} tag, like planets described by the Planet {} tag. See Creating the planets guide for details. In the Star {} tag, it must specify the luminosity or magnitude of the star, otherwise SpaceEngine will compute it from a star's spectral class. If a star is a single sun in a system, then specify the name of the barycenter of the system in a ParentBody parameter, and make a static orbit for that star (use the parameter Type "Static" in Orbit {} tag, which has been commented out in the example script in the Creating the planets guide) - then it will just coincide with the barycenter. Important note - the star and the barycenter must have different names, i.e. the star could be named "Mandel", and the barycenter of the system named as "Mandel system."
Barycenter is also used to create binary stars - in the planets catalog it is described as two stars with their orbits around the barycenter of the system, as it would be for a double planet. To create a hierarchical multiple star system, create a local barycenter (the "Barycenter" object type in the catalog of the planets) to orbit the barycenter of that system, then around it put the stars or other local barycenters. SpaceEngine supports almost an infinite hierarchy of objects, but in reality star systems have no more than 3-4 levels of hierarchy. The planets of a star can also be specified in the planets catalog. The parameter ParentBody for each planet/barycenter/star should specify the name of the parent object which it is orbiting.
The parameters that are specified for a star/barycenter in the catalog of stars, determines the appearance of stars from interstellar space, i.e. when it is rendered as points. For example, when specifying a double star - a blue giant and yellow dwarf, the spectral class of it in the stars catalog should be the same as the brightest star (blue giant), as its contribution to the total luminosity is thousands of times greater than that of the dwarf. The luminosity of barycenter in the stars catalog should be equal to the summary luminosity of all stars in the system. But SpaceEngine can automatically calculate the summary luminosity and class of the whole system if these parameters are not specified in the stars catalog, unless of course its stars are properly described in the planets catalog.
To modify the star, which is defined in the binary catalog, simply define a new object (Star or StarBarycenter) with the same name in the stars catalog script. To completely remove the star from the binary catalog, use the RemoveStar tag with the name of that star. In the code example shown above, the two stars have been deleted from the binary catalog - "ALF Cen A" and "ALF Cen B", and created with a new barycenter "ALF Cen" to replace them. The two stars, as components of the binary system "ALF Cen" are described in the planets catalog, example here:
Code Star "Toliman A/Rigel Kentaurus A/ALF Cen A/Gliese 559 A/HD 128620/HIP 71683" { ParentBody "Toliman" Class "G2V" AppMagn 0.01
RotationPeriod 923.6 RotationOffset 64.7 Obliquity 0.0 EqAscendNode 67.726
Orbit { Period 79.914 SemiMajorAxis 10.765 // mass ratio 1.09:0.92 Eccentricity 0.5179 Inclination 82.986 AscendingNode 67.726 ArgOfPericenter 3.772 MeanAnomaly 200.119 } }
Star "Toliman B/Rigel Kentaurus B/ALF Cen B/Gliese 559 B/HD 128621/HIP 71681" { ParentBody "Toliman" Class "K0V" AppMagn 1.34
RotationPeriod 850.5 RotationOffset 127.4 Obliquity 0.0 EqAscendNode 67.726
Orbit { Period 79.914 SemiMajorAxis 12.755 // mass ratio 1.09:0.92 Eccentricity 0.5179 Inclination 82.986 AscendingNode 67.726 ArgOfPericenter 183.772 MeanAnomaly 200.119 } }
Next is a sample code for the VY Canis Majoris star. Custom mass and radius must be specified for it, because automatic calculations for this will give a slightly incorrect result. Create a planet catalog and describe the star "body" itself; and then create a stars catalog and describe the position of the star via the Barycenter tag:
Stars catalog: \data\catalogs\stars\stars.sc
Code StarBarycenter "VY CMa" { RA 07 22 58.3315 Dec -25 46 03.174 Dist 1500 Class "M4 II" AppMagn 7.9607 }
Planets catalog: \data\catalogs\planets\stars.sc
Code Star "VY Canis Majoris" { ParentBody "VY CMa" Class "M4 II" AppMagn 7.9607 Radius 1.8e+9 Mass 20 Orbit { Type "Static" } }
Pay attention to these features, as the code will not work without them: 1) In the stars catalog, describe a star as a system barycenter (StarBarycenter tag), if specifying the custom mass and radius, or create a multiple star system. 2) In the planets catalog, give a name to the star, it must be different from the name of the barycenter, and make the barycenter the parent of the star (ParentBody parameter). 3) If a star is single, make its orbit static (Type "Static" in Orbit {} tag) so it coincides with the barycenter. 4) If a star is double, describe the two stars with a common barycenter parent in the planets catalog, and make proper orbits around the barycenter for them.
*
|
|
| |
Diggles | Date: Thursday, 08.12.2011, 09:30 | Message # 2 |
Observer
Group: Newbies
United States
Messages: 3
Status: Offline
| Hi, thanks for the tutorial! I'm having a little trouble--I created a star with this script: Code // Create a new object - star "Kazar" Star "Kazar" { RA 18 0 0 // Right ascention Dec -10 0 0 // Declination Dist 3287.0 // Distanse from our Sun Class "G2V" // Spectral class Lum 0.86 // Luminosity, or //AbsMagn 5.31 // absolute magnitude, or //AppMagn 10.31 // visual magnitude NoPlanets true // disable generation of procedural planetary system }
It shows up in the galaxy, but when I rotate around it, the star sprite jerks wildly around like it's going berserk. When I get too close to it, the sprite disappears completely, and all that's left is the selection bracket. What mistake am I making in the script here?
|
|
| |
SpaceEngineer | Date: Thursday, 08.12.2011, 15:53 | Message # 3 |
Author of Space Engine
Group: Administrators
Russian Federation
Messages: 4800
Status: Offline
| Diggles, did you go to a star using autopilot (press 'g' key)?
*
|
|
| |
Diggles | Date: Friday, 09.12.2011, 01:21 | Message # 4 |
Observer
Group: Newbies
United States
Messages: 3
Status: Offline
| Yes. Here's what it looks like (or rather, doesn't) up close
|
|
| |
SpaceEngineer | Date: Friday, 09.12.2011, 01:50 | Message # 5 |
Author of Space Engine
Group: Administrators
Russian Federation
Messages: 4800
Status: Offline
| Hmm... can you show me your scripts?
|
|
| |
Diggles | Date: Friday, 09.12.2011, 03:53 | Message # 6 |
Observer
Group: Newbies
United States
Messages: 3
Status: Offline
| The script looks like this: Code // Create a new object - star "Kazar" Star "Kazar" { RA 18 0 0 // Right ascention Dec -10 0 0 // Declination Dist 3287.0 // Distanse from our Sun Class "G2V" // Spectral class Lum 0.86 // Luminosity, or //AbsMagn 5.31 // absolute magnitude, or //AppMagn 10.31 // visual magnitude NoPlanets true // disable generation of procedural planetary system }
it's called "galactopticon.sc". Everything else is default (0.94), I don't have any other custom scripts.
|
|
| |
SpaceEngineer | Date: Friday, 09.12.2011, 04:46 | Message # 7 |
Author of Space Engine
Group: Administrators
Russian Federation
Messages: 4800
Status: Offline
| I checked in debugger and found that option "NoPlanets true" disables generation of whole system with the star itself, because it is the body of system. In very old versions of SE it will work, but now it doesn't. I should fix this bug.
So, remove "NoPlanets true", and you get Kazar star with procedural planets. If you create a script with any body orbiting Kazar (planet or even asteroid), procedural planetary system will be disabled and replaced with system that you describe in script. (I'd suggest you want to create Kazar star without planets, as long as you type "NoPlanets true")
*
|
|
| |
Jouri | Date: Wednesday, 11.04.2012, 19:50 | Message # 8 |
Observer
Group: Newbies
Netherlands
Messages: 4
Status: Offline
| I know this is old but i want to know how i can make my stary a Hypergiant or Supergiant or just any size
|
|
| |
SpaceEngineer | Date: Wednesday, 11.04.2012, 21:56 | Message # 9 |
Author of Space Engine
Group: Administrators
Russian Federation
Messages: 4800
Status: Offline
| Jouri, go to wikipedia, find out typical luminosity and spectral class of such star, then follow this tutorial.
*
|
|
| |
Jouri | Date: Sunday, 15.04.2012, 09:29 | Message # 10 |
Observer
Group: Newbies
Netherlands
Messages: 4
Status: Offline
| Ok thank you
|
|
| |
apenpaap | Date: Wednesday, 11.07.2012, 23:05 | Message # 11 |
World Builder
Group: Users
Antarctica
Messages: 1063
Status: Offline
| Seeing a lot of binary stars missing in SE, I kind of want to make an addon adding a bunch of them. But all the catalog binaries seem to miss procedural planets, so I wanted to know whether this will always happen when you make a binary system, or if there's some way to avoid it and get procedural planets there.
I occasionally stream at http://www.twitch.tv/magistermystax. Sometimes SE, sometimes other games.
|
|
| |
SpaceEngineer | Date: Thursday, 12.07.2012, 19:29 | Message # 12 |
Author of Space Engine
Group: Administrators
Russian Federation
Messages: 4800
Status: Offline
| No, it is impossible. While generating the planetary system, SE looks into the catalogs, and if at least one catalog body found, it uses only catalog data, otherwise it go to full procedural generation. I will add supporting of procedural planets/moons for catalog stars/planets in the future.
|
|
| |
Psiyon | Date: Sunday, 29.07.2012, 22:33 | Message # 13 |
Observer
Group: Newbies
United States
Messages: 2
Status: Offline
| I've encountered something strange: when adding a new star in a different galaxy (Or maybe just the Large Magellanic Cloud), the star seems to jitter and jump all over the place as you move away from it. I substituted the star for another star I created that worked fine in the Milky Way, and when I did, that star had the same issue as well, making me think that this might be a bug.
Here's the star in question if you (SpaceEngineer) want to see for yourself:
Code Star "Afterlife" { RA 05 06 45.42 // Right ascention Dec -69 55 19.76 // Declination Dist 54995 // Distanse from our Sun Class "A0 II" Luminosity 1.33 Mass 1.62 RotationPeriod 408 RotationOffset 188.4133 Obliquity 0 EqAscendNode 38.97037
Albedo 0.3 Color (1.000, 0.524, 0.995) Surface { Randomize (0.047, -0.783, 0.538) colorDistMagn 0.4159007 colorDistFreq 55.1992 detailScale 1641790 colorConversion true mainFreq 13.39139 mareFreq 49.18508 mareDensity 0.002186948 terraceProb -1e+038 montesFraction 0 hillsFraction 0 hills2Fraction 0 canyonFraction 0 craterOctaves 0 BumpHeight 9.171237 BumpOffset 7.33699 SpecularPower 150 DayAmbient 0.07 Lommel 0 Exposure 1.5 }
Atmosphere { Model "Sun" Height 3191.591 Density 0 Pressure 1 Bright 1.222995 Opacity 0 SkyLight 0 EclipseBright 100 EclipseColor (0.700, 0.500, 0.200) }
Orbit { Type "STATIC" }
}
Or, is this a known issue, and am I just doing something stupid?
|
|
| |
SpaceEngineer | Date: Sunday, 29.07.2012, 23:15 | Message # 14 |
Author of Space Engine
Group: Administrators
Russian Federation
Messages: 4800
Status: Offline
| This is accuracy loss. I mentioned somewhere that SE does not directly support catalog stars in other galaxies. This is the reason why Star Wars galaxy planets are still not added
*
|
|
| |
Psiyon | Date: Monday, 30.07.2012, 01:18 | Message # 15 |
Observer
Group: Newbies
United States
Messages: 2
Status: Offline
| Ah, I see. A shame, but I suppose it's not too big of a big deal, as the jitter is really just an annoyance. Thanks for the reply.
|
|
| |