4. Using Sssim Studio [Advanced]


4.1 Creating Scenarios

1) Scenarios and Commands

Solar System Simulator is able to record operations and replay these operations freely. These records are called "Scenarios" and the files describing them are called "Scenario Files". Once you assign a scenario file to a button, you can execute complicated operations by just clicking of the button.

A scenario is made of sequence of Solar System Simulator operations to be executed. Each of these operations is called "Command". Solar System Simulator has more than 100 types of predefined commands. Whenever you operate Solar System Simulator using GUI and key shortcuts, corresponding commands are executed internally.

To check operations and corresponding commands, use the Simulation Controller to open the Scenario Edit Panel of the Control Window. Here you can record and edit scenarios. Click on the New Scenario () button on the Scenario Edit toolbar to clear the scenario edit area. Next, click on the Record Operations button (). All Solar System Simulator operations will be recorded in the scenario edit area hereafter. Click the Simulation Window to activate it, then select the desired celestial body using the cursor keys [<-],[->] or control time using the [Z],[X],[C] keys to check that commands are recorded in the scenario edit area. You may also want to switch the Simulation Controller to Basic Panel and try out various operations from GUI of the Simulation Controller. To quit recording, click on the Record Operations button () in the Scenario Edit panel again.

2) Property and Method

Solar System Simulator has two types of commands "Property" and "Method".

"Property" is a variable indicating the state of specific elements of the Solar System Simulator. For instance, by checking the Ssystem.Orbit property, you can find out if names of celestial bodies in the solar system are displayed. On the other hand, by setting a value to the Ssystem.Orbit property (1: ON, 0: OFF), you can show/hide names. To set property, describe the command as:

Ssystem.Orbit 1

"Method" is the command for Solar System Simulator to operate in a certain way. Some methods change property values. Describe the command as:

Ssystem.OrbitTog

This Ssystem.OrbitTog ,ethod switches to show/hide the name of the current solar system celestial body. When you execute this method, the value of the Ssystem.Orbit property changes to 1 if 0 and 0 if 1. To change the state of the Solar System Simulator or operate it, you can set properties or execute methods.

Solar System Simulator is defined with more than 100 commands (properties and methods). You can use these to access various functions. All of these commands are described in the Command Reference. Below is a simple guide to using these commands.

Open the Scenario Edit panel of the Simulation Controller. At the Property/Method settings area below, you can set and acquire properties, as well as execute methods directly. Properties and methods are categorized into groups called "Class" according to the Solar System Simulator operations. From the first pull down list, select the Ssystem class, and in the next pull down list, select Orbit. Value: shows the current Ssystem.Orbit property value (e.g. 1). Let's try changing the property value. Enter a new value, (e.g. 0), and click on the Set button. You will see that the show/hide of orbits switches at the Simulation Window. Next, select the Ssystem class OrbitTog. Though the current value will not be displayed for method, clicking the Set button executes method. Each time method is executed, orbits are switched between show/hide.

Now that you have become familiar with property and method, you will see that the series of commands (scenarios) recorded using the Record Operations button () are actually records of property settings and executed methods. To find out the property name or method name of the command of the desired operation, this Record Operations button () will be useful.

3) Executing Scenarios and Setting Timing

Now that you have understood property and method, let’s try creating a simple scenario. Open the Scenario Edit panel of the Simulation Controller. Click on the New Scenario () button on the Scenario Edit toolbar to clear the scenario edit area. Next describe as follows in the scenario edit area.

Ssystem.NameTog

First, let’s execute just this scenario. Click on the Play Scenario button (). You will see that the scenario is executed and the solar system celestial body name is shown/hidden at the Simulation Window.

Next, let’s try blinking the names of celestial bodies in the solar system. As this Ssystem.NameTog Method switches between show/hide of names, rewrite the scenario as follows so that this is executed repeatedly.

Ssystem.NameTog
Ssystem.NameTog
Ssystem.NameTog
Ssystem.NameTog

You will see that nothing changes on the Simulation Window when the scenario is executed. This is because Solar System Simulator executes each line of the scenario all at once, and the show/hide switching of each name completes instantaneously. You can make the names blink clearly by inserting "intervals" between commands. The Sssim.Wait Method is a command which temporarily suspends the execution of scenarios for the specified interval time. Specify the interval time using Solar System Simulator’s unique time unit "Frame" which counts 1 second as 30.

Ssystem.NameTog
Sssim.Wait 30
Ssystem.NameTog
Sssim.Wait 30
Ssystem.NameTog
Sssim.Wait 30
Ssystem.NameTog

Executing this scenario blinks the name of the Solar System celestial body for about three seconds. Create scenarios by combining such commands you want to execute and interval time. Remember to save scenarios as scenario files. Choose Scenario->Save Scenario As menu, and save under a filename that ends with the extension ".scn". Hereafter, choose File->Open to open this scenario file, and blink the name of the solar system celestial body. A way to easily execute this scenario file by creating a shortcut key or a link at the contents page will be described later.

4) Storing and Restoring States

Solar System Simulator states are always reflected in property values. You can restore a Solar System Simulator state by recording all property values in that state, and setting these property values again. Record of Solar System Simulator state are displayed as a scenario written with commands setting all Property values.

Since there are many properties defined by Solar System Simulator, and it would be inefficient to reset all of these every time you restore a state, group them into two categories; "State" group consisting of properties which are frequently changes such as selected celestial body name and observation location name, and "Option" group consisting of properties which are seldom changed such as font name and display color. At the Store State and Restore state button on the menu bar and toolbar, save and reset only the values of these state settings. Clicking the Store Current State button () at the Scenario Edit panel of the Simulation Controller enables you to record the current state at the scenario edit area.

When Solar System Simulator is started, the Initial state setting file (scenarios/init.scn) and Options setting file (scenarios/options.scn) are loaded and executed. To change the initial state of Solar System Simulator, set Solar System Simulator to the state which you want to set as the initial state, record state settings using the Record Current State button (), and save this as the scenario file under the filename scenarios/init.scn. For option settings, clicking the Save button in the Detail Setting dialog saves all property values of option settings as a scenario file under the filename scenarios/options.scn.

With Solar System Simulator scenarios, commands are executed for the current Solar System Simulator state to change the state. Therefore to create scenario files to be automatically executed, first describe the initial state using the Record Current State button (), then write commands and intervals hereafter.

5) Setting Animations

Some of the Solar System Simulator commands can continuously change the current state to a new state with time for smooth transitions and animations. The following shows an example.

First reset Solar System Simulator to its initial state, click the Init State button () on the Control Window toolbar, select Earth as the celestial body (set Celestial body Name: at the Basic panel of Simulator Control to Earth). The Simulation Window will show Earth floating in the center of space. Next, open the Scenario Edit panel of Simulation Control. Click on the New Scenario () button on the Scenario Edit toolbar to clear the scenario edit area, and then describe as follows in the scenario edit area.

Timer.RefTime 3600

Click on the Play Scenario button (). The time of Solar System Simulator advances 3600 seconds (one hour) from the current time. By repeatedly executing the scenario, you can advance the time by one hour each time, however note that in this case, time will change instantaneously when the scenario is executed.

Next, try changing this smoothly. Some of the methods set states while continuously changing time. The names of these methods are ended by "To" following a property name. Rewrite the scenario as follows and execute.

Timer.RefTimeTo 3600 30

The 30 at the end is the length of time of continuously changing time. (the unit is "frame", 30 is equivalent to 1 second) Each time this scenario is executed, time will advance by one hour for each second smoothly. Refer to the Command Reference for other methods which can set animation.

6) Setting Viewpoint and Animation

You can record most Solar System Simulator operations by turning ON the Record Operations button() on the toolbar of the Scenario Edit panel of Simulation Control. But viewpoint positions and directions will not be recorded because these values are frequently changed by mouse operations and the volume of record results becomes enormous, and undesired tremble of the mouse operations also recorded. For viewpoint animations, record viewpoint information manually at the desired timing, and rewrite with the animation mentioned earlier to realize smooth transfer between viewpoints.

Let’s try creating a simple viewpoint animation scenario here. First click the Init State button () on the Control Window toolbar and reset the Solar System Simulator to its initial state. Next, open the Scenario Edit panel of the Control Window. Click on the New Scenario () button on the Scenario Edit toolbar to clear the scenario edit area. Clicking the Record Current View button () on the Scenario Edit toolbar records the current viewpoint information in the command format in the scenario edit area. In the Space View Mode, the direction of the viewpoint (Camera.Rotate) and the distance from the selected celestial body (Camera.Dist) are recorded. In the Ground Observation Mode, the direction of the viewpoint (Camera.Orient) and the view angle ( Camera.Zoom) are recorded.

Camera.Rotate -0.247485 -0.503681 -0.827681 98.575606
Camera.Dist 22.944050

Next, drag the mouse left with the sun in the center to rotate the viewpoint. Drag right to change the distance from the sun. After these operating, click Record Current View button () again to record viewpoint information.

Camera.Rotate -0.206113 -0.088140 -0.974550 78.676038
Camera.Dist 26.796242

To connect these two viewpoints using animation, rewrite the two line method name recorded later with a method name that includes "To", leave space after the end of the line, and add 60 as the animation length (30 is equivalent to one second). The scenario edit area will show the following eventually (values differ according to the recorded viewpoint position).

Camera.Rotate -0.247485 -0.503681 -0.827681 98.575606
Camera.Dist 22.944050
Camera.RotateTo -0.206113 -0.088140 -0.974550 78.676038 60
Camera.DistTo 26.796242 60

When this scenario is executed, the viewpoint jumps to the first viewpoint position, and the viewpoint position and direction will animate for about two seconds. Here, the property values of the viewpoint direction and distance with the selected celestial body are animated for the same time length, but by setting these values separately, animations looks different.

As viewpoint information is not recorded automatically like other property values, this procedure will take time. But you can realize various animations by adjusting timing manually using this procedure.

7) Tutorial - Creating a scenario

Now that you have gained general knowledge on creating scenarios, let’s take a look at how a scenario is normally created.

Click the Init State button () on the Control Window toolbar and reset the Solar System Simulator to its initial state. Next, open the Scenario Edit panel of the Control Window. Click on the New Scenario () button on the Scenario Edit toolbar to clear the scenario edit area.

Click the Record Current State button () on the Scenario Edit toolbar to record the current state of Solar System Simulator as the initial state of the scenario created here. Insert "interval" in this state, and add Sssim.Wait 30 after recording the current state.

Next, set Tokyo as the observation location and describe the procedure for landing. For details on the respective commands, refer to the Command Reference. Insert interval after the command with animation until that animation ends. You can also execute other commands without waiting for the animation to end as well as to execute multiple animations simultaneously.

Ssystem.AstrNameTo Earth 30
Sssim.Wait 30
Ssystem.PlaceName Tokyo:Japan
Sssim.Wait 30
Camera.ModeTo Observe 45
Sssim.Wait 60

After landing on Tokyo, add the animation for looking at the northern skies. When you record the initial state of the scenario, property values of the viewpoint direction (Camera.Orient) and view angle (Camera.Zoom) were also recorded. Now, you need only the animation destination value. Execute the scenarios created up to this point by clicking Play Scenario button () on the Scenario Edit toolbar, and adjust the Solar System Simulator to the state of scenarios up to this point.

In the Ground Observation Mode, left drag on the Simulation Window, or click Fixed Star in the Centering panel of the Control Window and double-click Polaris to face the direction of Polaris. Here, click Record Current View button () on the Scenario Edit toolbar to record viewpoint information, change Camera.Orient to Camera.OrientTo, and Camera.Zoom to Camera.ZoomTo, and add "60" at the end with one space in between.

amera.OrientTo 35.522145 179.959078 60
Camera.ZoomTo 45.000000 60

The following command can also be used as the command for centering Polaris.

Camera.LookTo Polaris 60

Upon completing the above procedure, you now have a scenario which select Tokyo on Earth in the solar system, landing on Earth, and looking up at the northern skies. On the menu bar, choose Scenario->Save Scenario As, and save under a filename added with the extension ".scn".

Solar System Simulator has various other functions which can be used in scenarios. Create your own unique and convenient scenario file by referring to the Command Reference and trying out various scenarios.