Tidally locked twin planets bug

Report bugs, bug fixes and workarounds here.
Topic author
john71
Posts: 1004
Joined: 10.08.2016
With us: 7 years 9 months

Tidally locked twin planets bug

Post #1by john71 » 12.03.2017, 14:19

I tried to build a complex star system with tidally locked twin planets, but it is not working.

Only one planet is drawn, the other one disappeared or when there are two planets orbiting each other I can't make them tidally locked.

What can be the problem?

Stc:

Code: Select all

Barycenter "PROGRAM001"            
{            
   RA   50      
   Dec   50      
   Distance 100         
}            
            
Barycenter "PROGRAM001x"             
{            
OrbitBarycenter      "PROGRAM001"      
EllipticalOrbit {            
      Period      20
      SemiMajorAxis   8000   
      Eccentricity   0   
      Inclination   90   
      AscendingNode   0   
      ArgOfPericenter   0   
      Epoch      0
   }         
}            
            
Star "PROGRAM002"            
{            
SpectralType "M1.0V"             
Radius 800000            
AbsMag 4              
Oblateness   0.009         
OrbitBarycenter "PROGRAM001x"            
            
EllipticalOrbit             
{            
      Period      3
      SemiMajorAxis   20   
      ArgOfPericenter   0   
        Inclination     90            
        MeanAnomaly     0            
   }         
            
UniformRotation            
   {         
      Period            900      
      Inclination       0      
      AscendingNode     0      
      MeridianAngle     0      
   }         
}            


Ssc:

Code: Select all

"PROGRAM003barycenter" "PROGRAM002"
{
Class "planet"
Radius 0.0000001
EllipticalOrbit
{
Period 0.1
SemiMajorAxis 0.2
Eccentricity 0
Inclination 90
}
}

"PROGRAM004" "PROGRAM002/PROGRAM003barycenter"
{
   Texture "earth.*"
   Radius 5000
   EllipticalOrbit
    {
       Period            28
       SemiMajorAxis     250000
       Eccentricity      0
       Inclination       45.6
       AscendingNode     41.256
       LongOfPericenter 301.0
         MeanAnomaly   53.2
 }
FixedRotation { Inclination 90 AscendingNode 0}
}

Modify "PROGRAM004" "PROGRAM002/PROGRAM003barycenter"
{
BodyFrame {
    TwoVector {
        Center "PROGRAM002/PROGRAM003barycenter/PROGRAM004"
        Primary {
            Axis "z"
            RelativePosition { Target "PROGRAM002/PROGRAM003barycenter" }
        }
        Secondary {
            Axis "x"
            RelativeVelocity { Target "PROGRAM002/PROGRAM003barycenter" }
        }
}
}
}

"PROGRAM005" "PROGRAM002/PROGRAM003barycenter"
{
   Texture "earth.*"
   EllipticalOrbit
    {
       Period            28
       SemiMajorAxis     250000
       Eccentricity      0
       Inclination       45.2
       AscendingNode     41.256
       LongOfPericenter 301.0
            MeanAnomaly   233.2
 }
 FixedRotation { Inclination 90 AscendingNode 0}
}

Modify "PROGRAM005" "PROGRAM002/PROGRAM003barycenter"
{
BodyFrame {
    TwoVector {
        Center "PROGRAM002/PROGRAM003barycenter/PROGRAM005"
        Primary {
            Axis "z"
            RelativePosition { Target "PROGRAM002/PROGRAM003barycenter" }
        }
        Secondary {
            Axis "x"
            RelativeVelocity { Target "PROGRAM002/PROGRAM003barycenter" }
        }
}
}
}

Avatar
selden
Developer
Posts: 10190
Joined: 04.09.2002
With us: 21 years 8 months
Location: NY, USA

Post #2by selden » 12.03.2017, 22:48

There's something broken which is unique to your system.

I have no problems seeing both PROGRAM004 and PROGRAM005 when using the STC and SSC files that you provided while running a vanilla copy of Celestia v1.6.1 with no other Addons.

program004-005.jpg
Selden

Avatar
FarGetaNik M
Posts: 484
Joined: 05.06.2012
With us: 11 years 11 months
Location: Germany

Post #3by FarGetaNik » 13.03.2017, 09:44

Also shows up correctly at my installation, both planets tidally locked. But well, tidal locking in Celetia is a mess. I've been there too...

It would be practical if Barycenters and ReferencePoints were better implemented. Also the distiction between ssc and stc is annoying.

Topic author
john71
Posts: 1004
Joined: 10.08.2016
With us: 7 years 9 months

Post #4by john71 » 13.03.2017, 19:46

Thank you for your replies!

I managed to make it work but the solution was VERY strange!

No matter how I tried to correct and edit my ssc file - even when I copied EVERY part of a working "tidally locked twin planet" ssc file into it - It was not working.

But when I duplicated the WHOLE working (different) ssc file and renamed everything in it, it suddenly worked!

It seems sometimes you cannot correct some ssc files or there are invisible data in a ssc file which cannot be corrected or edited.

Very strange. Have you ever experienced something like this?

By the way I made a second Celestia installation without any add-ons and the corrupted ssc file caused the SAME problem.

How can a ssc file become corrupted "invisibly"?

This is not a virus, I checked everything...

I use Notepad++ to edit ssc files. Maybe it adds some data to the file?
Last edited by john71 on 14.03.2017, 16:41, edited 1 time in total.

Avatar
selden
Developer
Posts: 10190
Joined: 04.09.2002
With us: 21 years 8 months
Location: NY, USA

Post #5by selden » 13.03.2017, 20:09

Some word processing codes are not visible in editors but cause Celestia to choke. Celestia's on-screen log file can sometimes help to track them down.

Type a tilde (shift ` on US keyboards) to toggle it on and off, up/down arrow keys to navigate it.
Selden

Topic author
john71
Posts: 1004
Joined: 10.08.2016
With us: 7 years 9 months

Post #6by john71 » 13.03.2017, 20:55

Thanks, it shows missing textures lol

Avatar
FarGetaNik M
Posts: 484
Joined: 05.06.2012
With us: 11 years 11 months
Location: Germany

Post #7by FarGetaNik » 14.03.2017, 10:30

I've never experienced something like that. Celestia refused to accept code before, it sometimes took me months to correct it, but it always was a syntax problem. argh.
Does it matter which editor you're using? Maybe some are showing such file corruption and others don't?

Avatar
selden
Developer
Posts: 10190
Joined: 04.09.2002
With us: 21 years 8 months
Location: NY, USA

Post #8by selden » 14.03.2017, 11:06

Sorry, I dunno. It's happened to me infrequently enough that I've never investigated.
Selden

Janus
Posts: 537
Joined: 13.08.2016
With us: 7 years 9 months

Post #9by Janus » 14.03.2017, 16:05

A helpful hint for those just getting started with script making.

If you are working on windows, you should try notepad++.
It has a Lua syntax highlighter built in.
There is also a celx extension available as well, specifically for Celestia.

A few times I ran across scripts that refused to run despite nothing being wrong.
When I retyped them scratch, they worked, and even though they were identical, the old one refused to run.

After a bunch of investigation I found a pattern.
The Lua/Celx interpreter in Celestia is ascii based.
Internationalization of scripts appears to be a culprit.
Unicode/Utf-8 codes make it weird out.

In particular, the various versions of quote symbols are insane, though there are others.
Saving as text from any MS/Libre/Open/??? Office suite or application does not yield pure text.

In windows, never use ANY M$ text editor, even notepad in newer versions of windows saves invisible codes.
Write has saved with invisible codes in plain text since 2K, and notepad since Vista.

In windows, I use notepad++.
In Linux, I use Geany or Leafpad.

To clean your messy scripts in notepad++, open them for edit.
The same basic steps are available in Geany and Leafpad.

Select show all codes. View/Show Symbols/View All Characters
You will see some black background characters, don't panic.
Do the following by finding the first occurrence and highlighting it as a single character.
Using Ctrl-H, replace all single quote looking characters ' ' with real single quotes.
Using Ctrl-H, replace all double quote looking characters " " with real double quotes.
Using Ctrl-H, replace all half quote looking characters ` ` with real half quotes, to the left of 1/! above tab.
Unicode/Utf-8 quotes cause issues, and are the most common problem I have found helping others.

Starting back at the first line, look for of the black block characters other then CR , LF or TAB.
Highlight one, then use Ctrl-H and replace it with something.
BEL, SH, NUL are some examples of what you may see.

Good luck.

Janus.

P.S. If you get really stuck, you can view the file ztree, hex mode, then change any byte value outside of 0x09, 0x0A, 0x0D, 0x20-0x7F to 0x20.
Takes a while, but it works.

Topic author
john71
Posts: 1004
Joined: 10.08.2016
With us: 7 years 9 months

Post #10by john71 » 14.03.2017, 16:40

Thanks Janus for your reply! Well, I use Notepad++ and it is really good. But I cannot find the problem with it. It just does not show any problem in any way or form.

Maybe the number of "empty space" characters can influence a file?

It is not even a LUA file, just a simple ssc one... :insane:

Added after 10 minutes 33 seconds:
There are just CR, LF characters, and yellow arrows and yellow dots....

Janus
Posts: 537
Joined: 13.08.2016
With us: 7 years 9 months

Post #11by Janus » 15.03.2017, 00:53

To John71

I like puzzles.
Zip the file and send it to me via e-mail if you wouldn't mind.

Janus.

P.S. Or you can use the notepad++ compare plug-in.
Open both files in the same copy of notepadd++, then do a compare.
Your problem will be where the red is.

I looked at several ssc files with notepad++ set to chow all characters.
Besides text, I had CR, LF and some yellow/orange right arrows indicating tabs.
No yellow or orange dots anywhere.

Topic author
john71
Posts: 1004
Joined: 10.08.2016
With us: 7 years 9 months

Post #12by john71 » 15.03.2017, 13:53

Here we go.


It is the modified "problem file" in it's current state...
extras.zip

Janus
Posts: 537
Joined: 13.08.2016
With us: 7 years 9 months

Post #13by Janus » 15.03.2017, 16:12

To John71
I have seen this type/set of glitches before.
Happens mostly on internationalization, especially going through web browsers or libre/open office.
I have also seen this type of oddity dealing with things imported from macs/amigas/next/beos and some embedded systems.
Perhaps a unicode/utf-8 to ascii filter or simply {if ord(char)>0x7F) > null} can be added to the text reader/parser sections of celestia.

The end of program003.ssc has multiple non ascii characters in it.
In your case, 0xA0(Char 160) and 0xC2(Char 194).

John71 A0 highlight.png

and
John71 C2 highlight.png


See http://lwp.interglacial.com/appf_01.htm for an explanation of these characters.

Screen shots are from ztree, an xtree clone that works with windows and long filenames.
It has a masking function, if you keep the key pressed, non ascii will flash/flicker on the screen.
Once you learn which ones correspond to cr/lf/tab, you can mentally filter them out to concentrate on the rest.
In this case, it was the flickering capital A that drew my eye first.

To filter them out, here is a set of answers .http://stackoverflow.com/questions/20889996/notepad-how-to-remove-all-non-ascii-characters-with-regex, use which ever matches how you work.

Janus

Topic author
john71
Posts: 1004
Joined: 10.08.2016
With us: 7 years 9 months

Post #14by john71 » 15.03.2017, 17:24

Thank you for your help!

I was able to correct the problem in Notepad++! I simply used the "convert to ANSI" function, and it worked!!!

The saved ssc file now works properly!

Janus
Posts: 537
Joined: 13.08.2016
With us: 7 years 9 months

Post #15by Janus » 15.03.2017, 18:05

Glad to hear it.
Found the same solution a while later when I noticed that the encoding wasn't the ansi I keep things set for.
Didn't think to check it since it used to stay as I put it, thanks auto update, for breaking things once again.
I know most prefer to switch to utf-8, but I use notepad++ to get rid of that stuff, and having to re encode every single time by hand is nuts.
I actually want everything opened as ansi/simple ascii, and that is my main use for it, which now doesn't work properly, with no warning.

Tried to sign up for notepad++ forum to ask how to force it to always work in ascii ONLY!!! unless I chose otherwise.
Disgustingly, you have to use social media to sign up, which is insane, so no way.

Instead I am compiling my own that will stay in ansi mode.
I have nearly no end of trouble with unicode/utf-8 encodings in files and documents.
The older versions used to stay in whatever encoding you put it, opening everything as ansi in my case, which has changed, and thanks to the autoupdater, I didn't know.
That is why I don't typically have auto update turned on, and will be turning it off on one more thing now, yet another thing I can't trust to just work.
Changes like that are why I hate that function and do most of my updates by hand, that way I know what is happening.
So I will have to make my own, typical.

Janus.

Avatar
gironde M
Posts: 818
Joined: 16.12.2016
Age: 71
With us: 7 years 4 months
Location: Montigny-Les-Metz, France

Post #16by gironde » 28.03.2017, 07:24

john71,

I also use Notepad ++ in utf8 and I have no worries. This encoding allows to have in the editor both Western and other characters like Russian characters.
On the other hand, I noticed something that may help you:
If you copy and paste from a site to Notepad ++ or another editor, you imported html characters invisible to the screen. In your editor and thus in your script, these html characters remain invisible because they are hidden in what are believed to be spaces. During the course of your script, they are interpreted for what they are, so distort the results or plant the script.

I had the case with Lua files. One way to check is to edit the script in Excel by importing your file in txt format, and you usually see these characters with an unexpected display of the cells in the table.

Avatar
gironde M
Posts: 818
Joined: 16.12.2016
Age: 71
With us: 7 years 4 months
Location: Montigny-Les-Metz, France

Post #17by gironde » 27.03.2019, 08:17

To read or write a .ssc file, you use a text editor. A text editor maps codes to a representation of characters (letters, numbers, or signs). If in a file, code sequence, you have codes that do not correspond to these characters, there is a good chance that their representation is a space on the screen. In computer science, the space used in a text has the code 32, but in a text file, a space can represent a code that is not 32. The simplest is the tabulation that the same representation as 1 or more spaces. In ASCII code, the first 32 codes are sequences that do not represent a character.
When your ssc file, with so many 'fake' characters, is interpreted by Celestia, there are loading errors and when there are errors detected in a file, Celestia gives up loading it.
When you look at the forum, you see tabs, colors, slanted letters, ... all this formatting on the screen consists of invisible codes that do not take up space on the screen because the forum is an html editor. But if you copy and paste under certain conditions, you copy these html codes at the same time.

:hi:

samanthgates29
Posts: 1
Joined: 04.06.2019
With us: 4 years 11 months

Post #18by samanthgates29 » 04.06.2019, 15:22

Any two objects that orbit one another are in fact exchanging energy with each other (via gravitational acceleration). Since all systems move towards equilibrium, all (two-body) orbits would eventually enter tidal lock. In fact the Earth is slowly tidally locking to the Sun as it orbits, however this process will take billions of years.

Avatar
SpaceFanatic64
Posts: 427
Joined: 16.08.2018
Age: 18
With us: 5 years 8 months
Location: Southern California

Post #19by SpaceFanatic64 » 04.06.2019, 22:31

This is for the glitch, not for real world physics.


Return to “Bugs”