Русский New site

Advanced search

[ New messages · Forum rules · Members ]
Page 1 of 212»
Forum » SpaceEngine » Space Journeys » Automatic space exploration (Discussion about autopilots or automatic space exploration)
Automatic space exploration
midtskogenDate: Tuesday, 05.02.2013, 08:43 | Message # 1
Star Engineer
Group: Users
Norway
Messages: 1670
Status: Offline
I've occasionally found myself clicking randomly around in space looking for interesting systems. Perhaps a bit silly way to pass time. And in the real world few survey the sky manually these days anyway. So I wrote a quick bash script which clicks randomly in the Space Engine window, grabs the window contents, extract the top left part, remove the stars and run in through OCR. Loop. I put Space Engine in spacecraft mode, set it for a course through the central Milky way and let the script run overnight. I got the descriptions for about 85,000 systems in 8 hours. I can probably increase the efficiency by a factor of a few if I pipeline the image processing and OCR. For some reason the spacecraft speed had dropped a lot overnight (doesn't Newton's first law apply in spacecraft mode?), so there probably were many duplicates (the OCR wasn't perfect, so it's a bit hard to tell).

I found several binary systems with 27 planets. I haven't seen that before. But no systems with more than 3 worlds with life. Perhaps I need to figure out why the spacecraft almost stopped, so I can cover a larger area.

Am I cheating? smile

I'm using xdotool, xwd, ImageMagick and gocr for the job. This is in Linux. I've no idea what would work in Windows. For some reason it doesn't work to send key events to Space Engine, so I'm restricted whatever can be done with the mouse. Perhaps it's a Wine thing, that the normal X Window events somehow get circumvented.





NIL DIFFICILE VOLENTI
 
HarbingerDawnDate: Tuesday, 05.02.2013, 20:53 | Message # 2
Cosmic Curator
Group: Administrators
United States
Messages: 8714
Status: Offline
Quote (midtskogen)
Am I cheating?

No more than astronomers using digital sky surveys are cheating smile

Really cool system you've invented here midtskogen, I look forward to seeing what comes of it and what discoveries you make.





All forum users, please read this!
My SE mods and addons
Phenom II X6 1090T 3.2 GHz, 16 GB DDR3 RAM, GTX 970 3584 MB VRAM
 
WatsisnameDate: Tuesday, 05.02.2013, 22:34 | Message # 3
Galaxy Architect
Group: Global Moderators
United States
Messages: 2610
Status: Offline
Heh, I have spent hours going through the universe map looking for interesting things, so I don't think it's cheating. Developing an automated method for searching and cataloging them is pretty novel. smile And you're getting about 3 systems per second with this? That's not bad at all!

As for your ship velocity changing -- if I recall correctly Space Engine has a few different modes of movement/framerate, so maybe you went into a more CPU-intensive area of the galaxy and this caused your speed to decrease. I'm not sure if that's exactly how it works, but it's my best guess anyway.





 
Joey_PenguinDate: Tuesday, 05.02.2013, 22:55 | Message # 4
Pioneer
Group: Users
United States
Messages: 311
Status: Offline
Does your system sort different kinds of star systems, like single brown dwarfs, or stars without any planets, or one with a green atmosphere?




Careful. The PLATT Collective has spurs.

Edited by Joey_Penguin - Tuesday, 05.02.2013, 22:56
 
midtskogenDate: Tuesday, 05.02.2013, 23:14 | Message # 5
Star Engineer
Group: Users
Norway
Messages: 1670
Status: Offline
Currently I get lines like:

5tar R5 8i03-287_-2394051-38|Type Orange dwarf (septuplet|Spectrum H0 V|Distance 32.519 pc|Diameter Illl410.100 km (O.79843 Dsolt|Mass 0.8098 Msol|Apparent mag 8.27|Absolute mag 5.71|Luminosity O.43005|Temperature 5250 H|Planets 14|

As you can see, the OCR isn't very good (but I can train it). Still good enough for basic searching. I also store the corresponding image of the text, so I can get the exact star name if it's unreadable. I've only spent like 10 minutes on the script, apart from the bit trying to eliminate the stars which will confuse the OCR, so there's plenty room for improvements. Performance wise I think I can get 1 million systems in a day with a few simple tricks.

I let it run a few more hours today and surveyed another 50,000 systems. Still no systems with more than 3 live worlds.

Here's the script right now (ugly and rough):

#!/bin/bash

ID=$(xdotool search "SpaceEngine.*"|tail -n 1)
NAME=$(xwininfo -root -all|grep -i Wine|sed 's/[^"]*"//;s/".*//')

mkdir -p ~/spaceengine/auto
i=0;
while true; do
let x=$RANDOM%1712+100;
let y=$RANDOM%700+250;
let i=i+1
xdotool mousemove --window $ID $x $y click 1
xwd -name "$NAME" | convert -colorspace YUV -channel CrCb -fuzz 50% -fill "#008080" +opaque "#c00000" -crop 500x300 xwd:- png:-|convert - pnm:- > ~/spaceengine/auto/pnm/pnm_$$_$i.pnm
gocr -p ~/spaceengine/auto/db/ -a 95 -m 2 ~/spaceengine/auto/pnm/pnm_$$_$i.pnm|tr '\n' \| > ~/spaceengine/auto/txt_$$_$i.txt
echo >> ~/spaceengine/auto/txt_$$_$i.txt
done

The images (which messes up the text slightly after star removal) look like:

Attachments: 6741447.jpg(24Kb)





NIL DIFFICILE VOLENTI
 
DisasterpieceDate: Wednesday, 06.02.2013, 02:53 | Message # 6
World Builder
Group: Users
United States
Messages: 640
Status: Offline
This is a pretty interesting way to find systems, what happens if SE crashes?




I play teh spase engien
 
TalismanDate: Wednesday, 06.02.2013, 06:02 | Message # 7
Pioneer
Group: Users
United States
Messages: 409
Status: Offline
Awesome and good idea, strangely I actually thought and wondered about a program like this because I wanted to cycle through thousands of systems more quickly looking for anomalies like stars with 8+ life worlds and other interesting things. cool

Weird how you didn't find any stars with more then 3 life planets in 85 thousand systems.

Maybe someone else could make something that could work on Windows as well. It would be interesting to see the strangest systems possible after tweaking a program like this to scan an entire galaxy.





 
midtskogenDate: Wednesday, 06.02.2013, 07:11 | Message # 8
Star Engineer
Group: Users
Norway
Messages: 1670
Status: Offline
80 thousand more systems overnight, but still nothing with more than 3 life planets. Weird. I thought that I had found some single systems with extremely many planets, though:



But it turns out that I have a sync problem. Apparently I got the grab just when there was an update, so the grab shows a mix between two systems. But a found a triple systems with 29 planets: RS 8403-173-6-195142-118

If Space Engine crashes? It doesn't. smile Well, in that case xdotool will fail and I wont get random clicking around on my desktop which could be bad... I should add some basic error testing.

Attachments: 9428190.jpg(21Kb)





NIL DIFFICILE VOLENTI
 
SpaceEngineerDate: Wednesday, 06.02.2013, 16:31 | Message # 9
Author of Space Engine
Group: Administrators
Russian Federation
Messages: 4796
Status: Offline
You are cheater! biggrin
I was thinking of a galaxy scanner for debug purpose. It's interesting to me to collect statistics, apply realistic observational selection effect and compare with a real exoplanet catalog. It would be useful to tweak the planetary system generator.
I may add some console commands like "select random star" or "select next closer star", and "write star data to the file". With such commands, it would be possible to implement random space exploration script (like screensaver), with collecting statistics. Generated star data file is a text file that can be processed and analysed by external software.





 
midtskogenDate: Wednesday, 06.02.2013, 22:15 | Message # 10
Star Engineer
Group: Users
Norway
Messages: 1670
Status: Offline
Quote (SpaceEngineer)
I may add some console commands like "select random star" or "select next closer star", and "write star data to the file". With such commands, it would be possible to implement random space exploration script (like screensaver), with collecting the statistics. Generated star data file is a text file that can be processed and analysed by external software.

Please also add some more screenshot options, such as (I've already suggested it) appending screenshots to a single file (not simply %08d.tga or whatever), which will allow external applications to read the video easily, since it's not easy to read the latest files from the capture directory. If the file is a pipe, it's trivial to produce video encoded in any format while Space Engine runs, or even stream live from Space Engine.

I ran into this need again today. My autopilot script is a dirty hack, so I thought I should do it better. I just wrote a C program which reads the files from the capture directory as Space Engine produces it, extracts the text and every time it changes, it prints it out and the screenshot files are also deleted, so I can run Space Engine in F9 mode without worrying about disk space. This is much faster than before.

Is anyone interested in helping out on this? I only have a few minutes now and then, so this might not turn into something very useful or user friendly for a while. I'm attaching what I have now. It's a program that should run first. Then delete any files in screenshots/capture, make sure Space Engine saves screenshots as tga, and start Space Engine. Hit F9 to start the fun, and the program will print as text whatever new text appears in the top left corner of the Space Engine window. It's a logger, sort of. It assumes that gocr is installed, but ideally a custom OCR should be used. It shouldn't be hard since it only needs to support one font. It can do simple SAD matching. What I have now is just a start in case anyone is interested in this.

Attachments: spaceengine.c(7Kb)





NIL DIFFICILE VOLENTI
 
NovaSiliskoDate: Wednesday, 06.02.2013, 22:36 | Message # 11
Explorer
Group: SE team
United States
Messages: 288
Status: Offline
Has your system found anything higher than a Septuple? There's language entries for Octuple but I've never run across one.
 
HarbingerDawnDate: Wednesday, 06.02.2013, 22:45 | Message # 12
Cosmic Curator
Group: Administrators
United States
Messages: 8714
Status: Offline
Quote (NovaSilisko)
Has your system found anything higher than a Septuple? There's language entries for Octuple but I've never run across one.

A couple of them have been found by people, but they are quite rare.





All forum users, please read this!
My SE mods and addons
Phenom II X6 1090T 3.2 GHz, 16 GB DDR3 RAM, GTX 970 3584 MB VRAM
 
midtskogenDate: Thursday, 07.02.2013, 10:10 | Message # 13
Star Engineer
Group: Users
Norway
Messages: 1670
Status: Offline
Quote (NovaSilisko)
Has your system found anything higher than a Septuple? There's language entries for Octuple but I've never run across one.

No, and I think the OCR needs improvement before I can survey millions of stars. But septuples seem not too rare. Here are a couple more: RS 8403-285-8-7179869-127, RS 8403-285-7-833447-73

The first one is a bit odd. It had 12 planets, no life, when it was surveyed, but now (on a different computer, though), it has life.





NIL DIFFICILE VOLENTI
 
RodrigoDate: Thursday, 07.02.2013, 13:04 | Message # 14
Explorer
Group: Local Moderators
Brazil
Messages: 285
Status: Offline
This could be useful to spaceengineer if you could publish some statistics on your findings.
What type of star is more common? It should be red dwafs, as in reality.
 
midtskogenDate: Saturday, 04.05.2013, 05:57 | Message # 15
Star Engineer
Group: Users
Norway
Messages: 1670
Status: Offline
Quote (Rodrigo)
This could be useful to spaceengineer if you could publish some statistics on your findings.
What type of star is more common? It should be red dwafs, as in reality.

The statistics would be more accurate if it comes directly from the algorithm, rather from something that has been through the user interface, been grabbed and OCR'd, and only having parts of the information.

For us users it would be nice to have a simple sqlite database, so we can make SQL queries asking for specific stuff. For instance, "give me a list of binary yellow dwarfs with at most 8 planets, but a least 2 with life". Currently I have a list of 300,000 systems, but the OCR isn't good enough for making that database.

Added (04.05.2013, 08:57)
---------------------------------------------
Automatic exploration is simple in 0.97. SE doesn't accept keypresses sent to the window by external programs, but mouse clicks work as in 0.96, so everything has to go through that, and luckily the star browser can be opened that way. I made a quick script which looks for the closest stars, saves them, go to a random star in the list and repeats. I left it overnight and in 7 hours it listed 470,000 stars. Unfortunately, only 69,000 of them were unique, so I seem stuck in the same neighbourhood. So the script needs some refining. At least it's possible to map automatically.

I wise thing probably is to switch off everything in the view settings to minimise the risk of crashes.





NIL DIFFICILE VOLENTI


Edited by midtskogen - Saturday, 04.05.2013, 05:57
 
Forum » SpaceEngine » Space Journeys » Automatic space exploration (Discussion about autopilots or automatic space exploration)
Page 1 of 212»
Search: