Page 1 of 1

loading order in Celestia extras

Posted: 02.09.2018, 08:29
by gironde
Celestia loading of .ssc files into the 'extras' folder:

Celestia proceeds in alphabetical order (in each level).
first the folders, then inside the folders, the subfolders, and then inside the subfolders, the files
The name given to folders and files is important


folder A
    subfolder AA '
      AA'a file
      AA'b file
      AA'c file
    subfolder AB '
      AB'a file
      AB'b file
      AB'c file
    subfolder AC '
      AC'a file
      AC'b file
      AC'c file
folder B
    subfolder BA '
      BA'a file
      BA'b file
      BA'c file
    subfolder BB '
      BB'a file
      BB'b file
      BB'c file
    subfolder BC '
      BC'a file
      BC'b file
      BC'c file
folder C
    subfolder CA '
      CA'a file
      CA'b file
      CA'c file
    subfolder CB '
      CB'a file
      CB'b file
      CB'c file
    subfolder CC '
      CC'a file
      CC'b file
      CC'c file

imagine that Earth.ssc is in CB'b and that moon.ssc is in AA'c.
Celestia will scan the dosiers in alphabetical order, so it will start with the AA 'folder to end with CC'
Celestia will load moon.ssc before Earth.ssc but as "Sol / Earth" is not known at this time of loading, it will detect an error and not keep loading moon.ssc in memory.
Result: you will not find Moon in Celestia.

The solution is to number the folders, and similarly number the subfolders and finally number the files, in the order they should be loaded.


extras /
    2-Planets and moons
        1-Earth x.ssc

When loading spacecrafts, all planets, moons, dwarfplanets, all asteroids, all comets, ... will already be loaded thus avoiding errors.

Posted: 04.09.2018, 23:49
by Janus

My personal fork does this, to the best of my knowledge this has not been incorporated into the main branch.
The main branch simply loads in whatever order the filesystem happens to return things in.
It is essentially random, with the exception of loading from cd/dvd, and that is SLOW!!!
I did the sorted loading thing for selden and offered the code here, but I have not seen it used.

Rearranging addons like above is one of the things I will get to in time.
What I have now is thus.
0 which is the SOL system.
0/1 is Mercury
0/2 is Venus
0/3 is Earth
0/3/1 is the Moon/Luna
0/3A are man made satellites, though I am considering 0/3/A instead.
0/4 is Mars.
0/4/1, well you get the idea.

With '1' being HIP1, or maybe 'HIP1' leaving open 'GAIA1' for parallel sets.
This is part of my work on making dynamic subsets that are (un)loadable on command.


Posted: 05.09.2018, 09:01
by gironde
Scheduling is done at each folder level.

Celestia reads the 1st folder (level 1) then scans the subfolders (level 2) then the sub-subfolders (level 3) and so on until the files (last level). Then he moves to the next folder which is again at level 1.
Each level can be ordered simply according to the prefixes "1-", "2-", …

Since I did this, I no longer have a loading error saying that the parent object was not found.
I still have to look at the 'spacecrafts' side because some orbit around others according to the Timeline. For example, ATV, HTV, Cygnus, ... orbit around the Earth but at some point they are docked to ISS. ISS is loaded after ATV, HTV and Cygnus. For these devices, if the ssc defines the parent as "Sol / Earth / ISS", something will not go to loading files by Celestia.


Posted: 06.09.2018, 17:26
by gironde
another mistake sometimes arriving:
In the 'extras' folder the textures, models and data folders must be at the same level as the .ssc file.
If they are not there, Celestia looks in the common pot: Celestia /models, Celestia /textures and Celestia /data. If they are not there either, Celestia triggers an error and does not load the ssc file into memory

recommended structure in 'extras':

extras / name_of_your_subfolder
data / (or xyz)
models / definition.cmod (or 3ds)
textures / medres / definition.jpg (or png or ...) (or lores or hire)