Welcome, Guest

Author Topic: Coding Constellations XML?  (Read 4874 times)

DarkExcalibur42

  • *
  • Posts: 3
Coding Constellations XML?
« on: August 03, 2012, 10:30:21 AM »
Hi.  I've been having loads of fun with Universe Sandbox so far, though there is one thing I need to do with it which I have not yet been able to figure out.  

I'm trying to draw lines to connect stars on one of my simulations so that I can visualize trade routes for a sci-fi novel I'm working on.  So far, the best I've been able to manage is launching bowling balls at 11,000c and using the trails as a visual work-around.  But if I could use the same method that Universe Sandbox uses to draw constellations, I could save myself a lot of trouble.  

I found an XML file called "Constellations" in directory "C:\Program Files\Steam\steamapps\common\universe sandbox\Data"

This clearly gives the program the info needed to draw constellations, and from reading the code it shouldn't be hard for me to write some custom constellations all on my own.  Unfortunately, all of the stars are identified by some sort of 5 digit registry which I am unfamiliar with.  How do these numbers relate to stars in the simulations?  And if these numbers are directly linked to predetermined stars, what about stars I add to a simulation?  I've been using the "Nearest 300 Stars" simulation for most of what I'm doing, but it was just short of a couple stars so I added in Delta Pavonis, Pi(3) Orionis (Tabit), and Eta Cassipeiae (Archid) myself.  

If I could get a translation of these 3 to 5-digit values to star names or a listing or something, I believe I could handle the rest myself.  

The stars I'm working with are the Sun (Sol), Epsilon Indi, Tau Ceti, Keid (40 Eridani), Eta Cassiopeiae (Achird), Delta Pavonis, Vega (Alpha Lyrae), 82 G. Eridani, Pi(3) Orionis (Tabit), and Chara (Beta Canum Venaticorum).  

My thinking is I could add something like this:

   <Constellation>
      <Name>Trade Routes</Name>
      <Group>Custom</Group>
      <Stars>Well... this part's the problem, isn't it?</Stars>
   </Constellation>

UPDATE: I continued digging and playing with files, and I found this one: "C:/Program Files/Steam/steamapps/common/universe sandbox/Data/Stars.xml"

After reading over it, I found a lot of ID numbers.  I compared the constellation info for Orion with the entry on Mintaka (one of the stars on Orion's belt) and I now believe that the "HipID" value is the one used for constellations. 

New problem: this stars XML only has entries for Epsilon Indi, Tau Ceti, & Keid.  I could write my own entries for the other stars I'm working with, but what is this Hip ID thing?  I'd like to make sure I use the right ones if I write my own stars to add to this list. 
« Last Edit: August 03, 2012, 10:55:44 AM by DarkExcalibur42 »

DarkExcalibur42

  • *
  • Posts: 3
Re: Coding Constellations XML?
« Reply #1 on: August 03, 2012, 11:09:01 AM »
Okay... it works... at least partially.  Couldn't set my own constellation group, I instead had to list it under one of the pre-existing categories.  Which, no big deal.  

I figured out how to code this, too.  You put in the HipID of your start point and end point for each line you want to draw.  Then you do it again.  So, to make a triangle betwee Epsilon Indi (108870), Tau Ceti (8102), and Keid (19849) you would code it like this:

   <Constellation>
      <Name>Trade Routes</Name>
      <Group>Western</Group>
      <Stars>108870, 8102, 108870, 19849, 8102, 19849</Stars>
   </Constellation>

Now my only question is what is this Hip ID value so I can start coding additional stars into the stars XML?

Found it! 

DarkExcalibur42

  • *
  • Posts: 3
Re: Coding Constellations XML?
« Reply #2 on: August 04, 2012, 07:08:52 AM »
Well... darn.  I've got it almost all to work.  This is the code I added for constellations:

   <Constellation>
      <Name>Trade</Name>
      <Group>zodiac</Group>
      <Stars>12345, 0, 12346, 0, 38212, 0, 108870, 0, 8102, 0, 19849, 0, 91262, 0, 15510, 0, 61317, 0, 108870, 8102, 108870, 19849, 8102, 19849, 108870, 91262, 108870, 15510, 108870, 61317, 8102, 19849, 8102, 91262, 8102, 15510, 8102, 61317, 19849, 91262, 19849, 15510, 19849, 61317, 91262, 15510, 91262, 61317, 15510</Stars>
   </Constellation>

And the code I added to stars:

   <Object>
      <ID>2368</ID>
      <Name>Achird</Name>
      <Type>Star</Type>
      <HipID>38212</HipID>
      <GLID>Gl 34</GLID>
      <Mass>.972 s</Mass>
      <Diameter>2.02 s</Diameter>
      <Luminosity>1.29</Luminosity>
      <Temperature>6087</Temperature>
      <Metallicity>-0.31</Metallicity>
      <Rotation>1 d</Rotation>
      <Distance>5.94793486 pc</Distance>
      <PositionX>10.1</PositionX>
      <PositionY>2.20</PositionY>
      <PositionZ>16.4</PositionZ>
      <VelocityX>0</VelocityX>
      <VelocityY>0</VelocityY>
      <VelocityZ>0</VelocityZ>
      <Spectrum>G0V</Spectrum>
      <NameAlt>E. Cass.</NameAlt>
   </Object>
   <Object>
      <ID>2369</ID>
      <Name>Delta Pavonis</Name>
      <Type>Star</Type>
      <HipID>12346</HipID>
      <Mass>.991 s</Mass>
      <Diameter>2.44 s</Diameter>
      <Luminosity>1.52</Luminosity>
      <Temperature>5604</Temperature>
      <Metallicity>0.33</Metallicity>
      <Rotation>1 d</Rotation>
      <Distance>6.10736404 pc</Distance>
      <PositionX>4.29</PositionX>
      <PositionY>-6.81</PositionY>
      <PositionZ>-18.22</PositionZ>
      <VelocityX>0</VelocityX>
      <VelocityY>0</VelocityY>
      <VelocityZ>0</VelocityZ>
      <Spectrum>G8IV</Spectrum>
      <NameAlt>D.P.</NameAlt>
   </Object>
   <Object>
      <ID>2370</ID>
      <Name>Vega</Name>
      <Type>Star</Type>
      <HipID>91262</HipID>
      <Mass>2.135 s</Mass>
      <Diameter>5.18 s</Diameter>
      <Luminosity>40.12</Luminosity>
      <Temperature>9602</Temperature>
      <Metallicity>0.33</Metallicity>
      <Rotation>1 d</Rotation>
      <Distance>7.75684288 pc</Distance>
      <PositionX>3.63</PositionX>
      <PositionY>-11.4</PositionY>
      <PositionZ>-22.2</PositionZ>
      <Spectrum>A0V</Spectrum>
      <NameAlt>Alpha Lyrae</NameAlt>
   </Object>
   <Object>
      <ID>2371</ID>
      <Name>Sol</Name>
      <Type>Star</Type>
      <HipID>0</HipID>
      <Mass>1 s</Mass>
      <Diameter>1 s</Diameter>
      <Luminosity>1</Luminosity>
      <Temperature>5775</Temperature>
      <Metallicity>0.0122</Metallicity>
      <Rotation>25.4 d</Rotation>
      <Distance>0 pc</Distance>
      <PositionX>0</PositionX>
      <PositionY>0</PositionY>
      <PositionZ>0</PositionZ>
      <Spectrum>G2V</Spectrum>
      <NameAlt>the Sun</NameAlt>
   </Object>
   <Object>
      <ID>2371</ID>
      <Name>Chara</Name>
      <Type>Star</Type>
      <HipID>61317</HipID>
      <Mass>1 s</Mass>
      <Diameter>1.025 s</Diameter>
      <Luminosity>1.151</Luminosity>
      <Temperature>5653</Temperature>
      <Metallicity>-0.21</Metallicity>
      <Rotation>1 d</Rotation>
      <Distance>8.37003204 pc</Distance>
      <PositionX>-19.9</PositionX>
      <PositionY>4.73</PositionY>
      <PositionZ>18.1</PositionZ>
      <Spectrum>G0V</Spectrum>
      <NameAlt>Beta Canum Venaticorum</NameAlt>
   </Object>
   <Object>
      <ID>2372</ID>
      <Name>82 G. Eridani</Name>
      <Type>Star</Type>
      <HipID>15510</HipID>
      <Mass>.70 s</Mass>
      <Diameter>1.84 s</Diameter>
      <Luminosity>0.74</Luminosity>
      <Temperature>5401</Temperature>
      <Metallicity>-0.40</Metallicity>
      <Rotation>1 d</Rotation>
      <Distance>6.05830891 pc</Distance>
      <PositionX>8.81</PositionX>
      <PositionY>5.43</PositionY>
      <PositionZ>-17.7</PositionZ>
      <Spectrum>G8V</Spectrum>
      <NameAlt>82 G. Eri.</NameAlt>
   </Object>
   <Object>
      <ID>2373</ID>
      <Name>Tabit</Name>
      <Type>Star</Type>
      <HipID>12345</HipID>
      <Mass>1.236 s</Mass>
      <Diameter>1.31 s</Diameter>
      <Luminosity>2.822</Luminosity>
      <Temperature>6516</Temperature>
      <Metallicity>0.02</Metallicity>
      <Rotation>1 d</Rotation>
      <Distance>8.02664611 pc</Distance>
      <PositionX>7.83</PositionX>
      <PositionY>24.78</PositionY>
      <PositionZ>3.173</PositionZ>
      <Spectrum>F6V</Spectrum>
      <NameAlt>PiĀ³ Orionis</NameAlt>
   </Object>

For some reason my entries for Achird, Delta Pavonis, & Tabit don't seem to be working.  I can't get constellation lines to draw to those 3 stars, but the rest are all okay.  Here's a screenshot of what I have got so far:



The blue streaks are the bowling balls I was using before I stumbled across this DIY constellations idea. 

Anyone have any ideas?