MySQL database backend and integrated console.
Posted: 04.05.2003, 15:22
I've finally finished the preliminary version of my database backend for Celestia.
Here are some screenshots to show what it is capable of.
http://mostlyharmless.sourceforge.net/p ... hots/3.jpg
http://mostlyharmless.sourceforge.net/p ... hots/4.jpg
http://mostlyharmless.sourceforge.net/p ... hots/5.jpg
And this is from the readme that comes with the installer.
Code: Select all
Mostly Harmless v 0.1
First up, it is not a game yet, it is identical to Celestia 1.3.0 but with the following features:
Embedded SQL star database of about 800,000 stars.
Integrated SQL console.
Ability to filter and mark the displayed stars using SQL select statements.
Those familiar with the previous version please note that the following features are not part of this release.
Gravity
Randomly generated solar systems.
Thrusters
Trajectory plotting.
They will be back though.
Requirements:
Same as Celestia 1.3.0 but with :
A little more memory.
(one of the mySQL buffers is set to 64M to make the queries nice and fast)
300MB of free hard drive space.
Installation :
Run the installer. The installer will kick off the generation process which takes about an hour.
Tutorial :
Here is a quick tutorial of how to use the SQL console once Mostly Harmless is running.
Press Ctrl+Enter to bring up the mySQL console. In this mode you can type any SQL statement.
Here is a simple statement, type the following:
SELECT pi();
Note that you must have the semicolon on the end to execute the SQL statement.
If a statement is long it can be split up with the enter key.
Press Ctrl+Enter to go back to the SQL console.
Ctrl+A This brings up the first part of a statement that will Mark/Unmark (toggle) the selected stars.
You should see the following:
mysql> SELECT hip FROM star
Complete the statement like so and press enter.
mysql> SELECT hip FROM star WHERE spectralClass='M' AND distFromSol<10;
The selected stars will be marked with little blue squares.
WARNING: Don't try and mark too many stars as it takes a long time. (I havn't yet waited long eneough to see all the stars marked.)
Bring up the console again and press [Ctrl+Z].
This brings up the last statement which is useful for fixing an error or unmarking stars.
Press enter to unmark the stars.
At startup MH only displays the 100,000 stars that come with celestia. The MH database is based on one of Pascal Hartmann's databases of about 800,000 stars.
Bring up the console and press [Ctrl+S]. This enters the first part of a statement that will select which stars are displayed by celestia.
To display all the stars simply complete the statement with a ; and press enter.
This query will take a little while so be patient.
To go back to the default database:
[Ctrl+Enter]
[Ctrl+S]
Then type
WHERE hip < 1000000;
[Enter]
In the console Ctrl+Q,W,E,R,T,Y,U,I will bring up some pre-set statements to play with.
In summary
Ctrl+Enter Bring up the console.
Ctrl+Z last statement
Ctrl+A mark/unmark stars
Ctrl+S select stars
Ctrl+Q,W,E,R,T,Y,U,I preset statements.
SQL is very powerful and im sure that people will be able to come up with some very interesting statements.
If your interested in learning more about SQL have a read of chapter 4 of the MySQL reference manual.
http://www.mysql.com
Lastly. I have replaced the WWWinfo for a star with data from the database. Right click on a star and click Info to bring up all the info in a star's row.
Please post feedback to the mostly harmless forum.
http://mostlyharmless.sourceforge.net/mhforum
Or to the relavent Celestia forum thread.
Credits :
http://mostlyharmless.sourceforge.net/mhforum/viewtopic.php?t=32
Enjoy.
http://mostlyharmless.sourceforge.net
For those interested it uses ver 1.2 of Pascal Hartmann's stars.dat file to create the database. This can be changed.
It is based on Celestia 1.3.0.
The installer is a 25MB download which unpacks and generates automatically.
http://sourceforge.net/project/showfile ... _id=157016
Any comments are welcome.