S P A C E N E R D S I N S P A C E
An Open Source Multi-player Networked Starship Bridge Simulator for Linux
Please consider donating to support development of Space Nerds In Space.
Or consider contributing code, either to the core codebase, or mission scripts
Here is a demo video from July 9, 2016, showing one of the mission scripts, "Saving Planet Erph".
Space Nerds In Space is an open source (GPLv2) cooperative multiplayer networked starship simulator for linux (may also work on Mac). So go out and get together with a crew of your linux-nerd friends and their computers in a room with a projector or TV, and go forth and explore the galaxy.
One computer runs the central server simulation of the game's universe. Each player's computer acts as a station on a simulated spaceship. There are stations for Navigation, Weapons, Engineering, Communications, Damage Control, and the "Main View", an out-the-window 3d rendering. Multiple starships each with their own team may connect to the server for bridge-vs-bridge combat, or for cooperative play. Additionally, a game master may inject and control various NPC ships into the game to entertain the players, and scenarios may be constructed with a Lua based scripting API.
Latest development video (August 2018):
Here is a short mini-documentary created at the premier hackerspace of Houston, TX, TX/RX Labs, camera work and editing by Jack Younger. This is from 2013, and the graphics and other aspects of the game are much better now, but this video will still give you a good idea of what the game is all about.
Space Nerds In Space was designed with hackerspaces in mind -- where else are you going to find enough people to run a linux-based multi-player LAN game spaceship simulator for Star Trek nerds but a hackerspace? The very first 3D model created for Space Nerds In Space may seem strikingly familiar. If you're a member of a hackerspace, this game is explicitly made for you.
A Rocky Planet
A Terrestrial Planet
A Gas Giant
This is a linux game. You will need a computer running linux.
A raspberry pi doesn't count, it's not powerful enough. The game is
currently developed using Mint 17.3
It is within the realm of possibility that the game could be made to build
and work on Mac OSX (it has been done before, but not within the last
couple years.) You're on your own if you want to try to run it on Mac.
Build dependencies
Perform these steps as root:
If you want to try the optional pocketsphinx based local speech recognition,
you will want the following packages:
The above list may be incomplete, and these are the package names on mint 17.3 / ubuntu,
so may be different on RPM based systems.
The source code is here:
Space Nerds In Space github page
NOTE: Do To get the source code, there are three methods:
After downloading the zip file, you must unpack the zip file. Type (as a non-root user):
To build the code, make sure you are in the top level
directory for the game ("space-nerds-in-space" if you
got the source using git, or "space-nerds-in-space-master" if you
downloaded the zip file), and type (as a non-root user):
You should see quite a lot of output, like this:
If you have problems building the code, it likely means there is some
missing dependency. Double check that you have all the required dependencies
installed.
You can also file a bug report if you think you have discovered a problem
with the build process, or the instructions here. I believe you will need a github
account to file a bug report.
Or you can skip to step 5 and download them.
This step will take a long time and requires that you installed OpenSCAD.
In general, unless you are working on the models, you can skip this step.
(Again, as a non-root user):
If you skipped step 4 and didn't build the openscad models, they will be downloaded
in this step, along with some other things. This step requires an internet connection.
If you performed step 4, you may skip this step though it is not recommended,
as you will be missing some additional solarsystem assets. As a non-root user:
Type (as a non-root user):
Note: This will run both the "server" and the "client" on your machine.
After awhile, you should see a screen that looks something like this
(without the white ovals):
Once connected to the lobby, you should see something like this:
Click on the white text "KARADO". When you do that, you should see:
Click on the "CONNECT TO SERVER" button on the right side of the screen.
After you do that, you should briefly see this:
and then this should quickly be replaced be an "out the window" view
of space, as below, the "main screen" view of Space Nerds In Space. It may not look
exactly like this as your ship will be placed in a semi-random location facing
an arbitrary direction. If you've gotten this far, congratulations, you're doing
better than most.
The function keys are used to switch between screens, except for F1, which is the 'help' key.
To quit the game, press ESC and confirm using arrow keys and ENTER.
Note, this only quits your client process.
You can re-join the server (via "./quickjoin" script)
It still leaves several processes running, the snis_server, the lobby process
and snis_multiverse. To kill all of them, run the "./killem" script.
From the navigation screen, you can steer the ship and maneuver around.
Here is a 10 minute tutorial video about the Navigation screen.
You can use the following keys to steer the ship:
From the weapons screen, you can fire the laser turret and launch torpedoes.
Here is a short tutorial video about the Weapons screen.
From the engineering screen, you can control how power and coolant is distributed
to the various systems of the ship. Here is a tutorial video about the Engineering
and Damage control screens.
From the damage control screen, you can repair the various systems of the ship.
Take a look at the tutorial video for the Engineering and Damage control screens
above.
From the science screen, you can scan ships, planets, asteroids, launch the mining
robot and help navigate to distant targets.
Short Range Scanner
Scanning Target Details
Long Range Scanner
The long range scanner is useful for locating distant planets and starbases.
It shows a 3D view of the space around your ship.
From the communications screen, you can hail starbases and other player ships and
control what is displayed on the "main screen" as well as activate the RED ALERT alarm.
You also control the ship's inventory and can interact with the ship's computer to
ask it questions or even use it to control almost any aspect of the ship.
The row of buttons at the top is for the COMMS OFFICER to control
what is displayed on the MAIN SCREEN. For this to work best, individual
player stations should not have the MAIN SCREEN ROLE checked (on the
NETWORK SETUP SCREEN when they joined the game) but only the computer
attached to the projector or big TV should have the MAIN SCREEN role
checked. Essentially these buttons make all terminals that have the MAIN
SCREEN role switch to displaying the selected station instead. The idea
behind this comes from Captain Picard's command, "On screen!" The captain can command any
station's screen be displayed "On Screen!" and the COMMS OFFICER can
"make it so". Note: it is also possible for any player to press Ctrl-O
on their station to make their screen be displayed on the main screen.
If they press Ctrl-O a second time, the main screen reverts to showing
the main view out the window into space. So if the captain orders "Weapons,
On Screen!", either the Weapons Officer can press Ctrl-O,
or the Comms Officer can press the WEAPONS button on
the COMMS screen. Again, if players have the "MAIN SCREEN" role
checked when they join the game, it can be a bit confusing, because
then their own computer will be considered to be a "main
screen". In general, there normally should only be one computer
per bridge that joins the game with the MAIN SCREEN role enabled,
and that computer should be the one connected to a projector.
The "EMF" chart in the upper right shows a measuring of local EMF. When
an NPC ship scans the players ship, this chart will show elevated levels of
EMF. This can give a heads up that some ship is scanning you, and an attack
might be coming soon.
The MAIN SCREEN button in the lower right portion of the screen
makes the last 4 lines received appear on the main screen so everyone
can see them.
The RED ALERT button toggles the red alert system on and off.
The shields display is there so the COMMS officer can know if a request
to dock will be denied due to shields still being up.
The zoom slider control at the bottom of the screen controls the zoom
level of the MAIN SCREEN
So what can Comms do with this terminal interface? First of all, anything
which is typed in that is not a command is broadcast on the current channel,
which is by default channel 0, which all player ships receive. You can also
switch channels, and only player ships tuned to the particular channel will
receive those messages. The intent here is for player-to-player chat in a
multi-bridge setup. The channel system is also used (implicitly) for
communications with starbases and with mining bots.
Commands you can type in are preceded with a slash, '/', along the lines of IRC commands.
Of the above, /hail, and /computer are the most powerful.
/hail is how you communicate with starbases to request permission to dock,
or other things that starbases do (not all of which are implemented yet):
You may /hail other player ships, or mining bots. The mining bots have some
functionality accessed via comms:
If you aren't sure of the name of the mining bot, you can ask the
SCIENCE OFFICER to scan it.
The /computer command is the most powerful action the Comms officer can use,
with this, the entire ship may be controlled just by asking the computer to do
things in English. For example, stuff like this should all work:
From the main screen, you can steer the ship with the ARROW KEYS
and with the A, W, S, D keys and additionally Q and E
allow you to roll the ship. The primary purpose of the main
screen view it to be projected on a large screen for all players to view at once.
The backquote key cycles through first person and a few third person views
of the ship.
The + and - (plus and minus) keys and the Mouse Scroll Wheel
zoom and unzoom the camera. Additionally the zoom can be controlled from the
COMMS screen.
SHIFT-W toggles the main screen view between front facing and weapons
facing. This is fun to let the whole crew see what the WEAPONS OFFICER
is busy destroying.
Note, in a proper multi-player setup, the MAIN SCREEN ROLE (on the
NETWORK SETUP SCREEN, see below) should not be active (checked) for most
players, but only for the computer which is connected to the projector or
big TV.
The R key can be used to cycle through different renderer modes
(this is really just for debugging though.)
Game Master Screen (aka "Demon" screen).
Possible roles are as follows:
Example: lua saving-planet-erph.lua
Note: Now if you enter a command that isn't a built-in, an
attempt is made to run it as a lua script. This means that
instead of entering What a typical multiplayer setup looks like, showing
which processes typically run on which physical machines.
You will need the following hardware:
It helps to have a basic understanding of how the system works
in order to set it up and troubleshoot in case something doesn't work
like you expect. The system is composed of the following linux processes:
The first thing that you need to do is get all the hardware into your game room,
arranged on furniture in such a way that everyone can see the big TV or projector,
connect it all up and make sure it is nominally working. That means:
There is a script to help with setting up: snis_launcher.
and after a short time, you should see the "main view", something like this:
Repeat the following steps for each bridge station.
That's it for the bridge station setup. Repeat for each station.
Anything you can type into "the computer" via the Navigation screen or the Comms screen,
you can also just speak, provided you set things up. There are two methods by which you can
do speech recognition: local, pocketsphinx-based speech recognition, and Android based speech
recognition using your phone or other Android device. Both methods are done outside of Space
Nerds In Space proper, and feed the text of the recognized speech into snis_client through a
fifo: You must install some packages (as root, or using sudo):
And for the pocketsphinx based speech recognition:
Once these are installed, on a machine that is running There is an Android app called Space Nerds Communicator which is very simple and just allows your Android device to do speech recognition and forward
the resulting text to a specified IP address and port. By default the port is Then run the Note that with the Android app, you should not precede your commands with
"Computer". For example, use "Ramming speed!" not "Computer, ramming speed!"
There is a config file in share/snis/joystick_config.txt that can be used
to configure the game to understand your usb controllers.
Follow the other examples to add mappings from your device buttons and
axes to game functions for each appropriate game mode. The game functions are:
This means one of several things:
"CREATE SHIP" has to do with whether snis_multiverse knows about your shipname/password.
The snis_multiverse process maintains a database of shipname/password hashes which is persistent
across invocations. However snis_server also has a notion of whether a ship is known to it.
When you check "CREATE SHIP", you are telling snis_server to tell snis_multiverse to create
a new ship. If snis_multiverse thinks the ship already exists, you will get BRIDGE VERIFICATION
FAILURE. The "JOIN SHIP" checkbox means that you are attempting to join a ship that snis_server
already knows about -- that means, a ship that already has other snis_clients attached to it.
If you are the first snis_client in a session to use a ship, you should not check JOIN SHIP.
If you are not the first snis_client to use a ship name, then you should check
JOIN SHIP.
Basically it is about intent. The game needs to know the difference between intentionally
creating a new ship vs. mistyping a ship name, and the difference between creating a new ship
and joining an existing ship. Not to suggest that there isn't room for improvement in how
it works.
Or you made a ship, and you want to delete it. You cannot recover the
password, or recover the ship. You can delete the ship and make a new one
with the same name though.
First, make sure the game is not running. Use snis_launcher and select the
"Stop all SNIS processes" option on the system that is running snis_multiverse.
Then, on the system that runs snis_multiverse, look for a directory called
snisdb. Let's say you named your ship enterprise, and you want
to delete it and create a new one with the same name.
Delete this file.
Now you should be able to create a new ship with the name "enterprise" in the usual way.
Audio on linux is complicated. In general, there are two main takes on how
audio should work in linux, "the pulse way", and "the JACK way". The "JACK way"
is generally concerned with professional audio recording, very low latency, etc.
The "pulse way" is less concerned with such things, and is more concerned with
"just make some damn sound work." I'm going to assume you're using the "pulse
way," since if you're using JACK, you probably already know what you're doing
and can troubleshoot it yourself.
Space Nerds in Space uses the Portaudio
library for sound. You need version 1.9 of portaudio (not 2.0).
There is a test program, Here is an example of running the So, you can see what devices it thinks you have, and try them out.
I also made it so snis_client can use alternate sound devices, e.g.
Another thing worth trying. On my system (Mint 18.1)
there is a "Sound Settings..." thing that I can play with. When the game is
running, it shows "ALSA plug-in [snis_client]: ALSA Playback on", and from this
GUI Sound Setting thing, I can dynamically switch it to play on either
"Built-in Audio Analog Stereo" (which I think is probably what portaudio calls
"0: HDA Intel PCH: ALC887-VD Analog (hw:0,0)", and the Scarlett 2i2. But I
think that is via pulse, so if snis_test_audio shows "pulse" as a device it
knows, then you should probably do: export SNIS_AUDIO_DEVICE={whatever number
portaudio thinks pulse is according to snis_test_audio output} (You can install
Note: I have seen the sound get stuck on a per-program basis to a particular
audio device. For example, I used the "Sound Settings..." to set the audio output
to HDMI for Space Nerds In Space. Later, I disconnected the HDMI cable. The sound
output remained stuck to HDMI, however, since there was no HDMI cable plugged in,
the HDMI interface doesn't even show up in the Sound Settings. However other programs
which used portaudio (e.g. Word War Vi) continued to work just fine. I was able to
fix this using pavucontrol (which is will show the HDMI sound interface even if no HDMI
cable is connected), or by manually using the SNIS_AUDIO_DEVICE environment
variable to override the default.
Suppose you see something like this ("Segmentation fault"):
Now type Space Nerds In Space has a Lua scripting API to allow you to create mission scripts.
This API is described in
lua-api.txt.
Additionally, the game comes with a few scripts which you can take a look at to get some
ideas in share/snis/luascripts.
The best examples are:
Additionally, have a look at
MAINMENU.LUA to see how you can tie them all together with a menu system.
Here are a few video tutorials explaining how to use Lua to create mission scripts:
Here is a youtube
playlist of development videos for Space Nerds In Space spanning the time from the very beginning
when the game was literally not much more than
just a bunch of dots on the screen up until the present day.
Here is a set of slides about speech recognition and
natural language processing in Space Nerds In Space.
Here is a set of slides from a talk I gave about procedurally generating gas giant
planet textures: Procedurally Generating
Gas Giant Textures.
Here are some pictures showing various noise-scales and the effect they have in gaseous-giganticus.
Here is a slideshow about the
implemenation of planetary rings and shadows cast by and on them in Space Nerds
In Space.
Here is a slideshow about 'earthlike', which
is a program used to generate some of the earthlike planet textures within Space Nerds In Space.
(Use arrow keys to navigate the slideshow. And press F11 for full screen.)
Most of the code is
licensed under the GPL v. 2, or at your option, any later version. Some parts of the code
have an MIT license. Audio files have
various other licenses, typically some variant of a Creative Commons license. I have tried
to be diligent about making sure it is clear which parts of the code have what licenses.
Consult the source if in doubt.
Here are some very old out-of-date instructions
about creating bootable images to play the game.
Build Instructions
Step 0: Acquire Hardware and OS
Step 1: Install Dependencies
apt-get install build-essential;
apt-get install portaudio19-dev;
apt-get install libvorbis-dev;
apt-get install libgtk2.0-dev;
apt-get install libgtkglext1-dev;
apt-get install liblua5.2-dev;
apt-get install libglew1.5-dev;
apt-get install libssl-dev;
apt-get install libttspico-utils; # for text to speech
apt-get install sox; # for "play" command, used by text to speech
# (The following are optional)
apt-get install espeak; # optional alternative to libttspico-utils
apt-get install alsa-utils; # optional alternative to sox, for "aplay" command
apt-get-install libsdl1.2-dev; # optional, only needed for mesh_viewer
apt-get install openscad; # optional, only needed if you intend to work on 3D models.
# Also, it is recommended to get it from http://www.openscad.org/downloads.html
# as the version in the repos tends to be out of date.
apt-get install git; # Version control, useful if you're hacking on the game
apt-get install stgit; # Useful for making patches if you're hacking on the game. It's like "quilt"
but on top of git.
Note: SDL should only be required if you want to build mesh_viewer,
which is a utility program for viewing 3D models, and which is not
required to run the game. mesh_viewer uses SDL 1.2, not SDL 2.x
apt-get install pocketsphinx-utils;
apt-get install pocketsphinx-lm-en-hub4;
apt-get install pocketsphinx-lm-en-hub4;
apt-get install libpocketsphinx1;
Step 2: Download the Source Code
git clone git@github.com:smcameron/space-nerds-in-space.git
git clone https://github.com/smcameron/space-nerds-in-space.git
unzip space-nerds-in-space-master.zip
cd space-nerds-in-space-master
Step 3: Build the Code
make
COMPILE mathutils.c
COMPILE snis_alloc.c
COMPILE snis_socket_io.c
... many steps omitted here ...
LINK snis_server
LINK snis_client
LINK snis_limited_client
LINK snis_multiverse
Step 4: build openscad models (optional)
make models
Step 5: Download additional assets
make update-assets
Step 6. Run the Game on a single system (Try this before trying multiplayer)
./quickstart
Step 6. Play around
Keyboard Controls
NAVIGATION SCREEN
Navigation Controls
Q W E ^
|
A S D <- ->
|
V
WEAPONS SCREEN
Weapons Screen Controls
ENGINEERING SCREEN
Engineering Screen Controls
DAMAGE CONTROL SCREEN
Damage Control Controls
SCIENCE SCREEN
Science Short Range Scanner Controls
Science Details Screen
Science Long Range Scanner Controls
COMMUNICATIONS SCREEN
/help -- displays a list of commands (I need to update the help screen)
/computer
LOCAL TRAVEL ADVISORY
REQUEST PERMISSION TO DOCK
BUY WARP-GATE TICKETS
REQUEST REMOTE FUEL DELIVERY
BUY FUEL
REPAIRS AND MAINTENANCE
BUY SHIELD SYSTEM PARTS
IMPULSE DRIVE PARTS
BUY WARP DRIVE PARTS
BUY MANEUVERING PARTS
BUY PHASER BANKS PARTS
BUY SENSORS PARTS
BUY COMMUNICATIONS PARTS
BUY TRACTOR BEAM PARTS
ARRANGE TRANSPORT CONTRACTS
BUY CARGO
SELL CARGO
BOARD PASSENGERS
DISEMBARK PASSENGERS
EJECT PASSENGERS
SIGN OFF
STATUS REPORT
RETURN TO SHIP
TRANSPORT ORES TO CARGO BAYS
STOW MINING BOT
RETARGET MINING BOT
SIGN OFF
/computer set a course for the nearest starbase
/computer launch the mining bot
/computer lower shields
/computer set warp power to 100%
/computer engage warp drive
/computer turn left 10 degrees
/computer engineering on screen
/computer calculate a course to the nearest asteroid
/computer describe
MAIN SCREEN
DEMON SCREEN
From the demon screen, the game master can inject all kinds of objects into
the game, direct NPC ships, run Lua scripts and construct scenarios to entertain
the other players. Note: The "demon" screen began life as a debugging screen,
and it contains kind of a mish-mash of features that don't necessarily hang
together in a very coherent way. Consider yourself warned. Some quirkiness
lies ahead.
The EXECUTE button executes whatever command is typed into the text
box immediately above it. Commands are as follows:
The command takes several forms. Here are some examples:
NOTE: You only have to type the first three characters of the role names (e.g. lists the roles for client number 10. restrict client number 7 to role add remove allow client 3 to use all roles.
NOTE: it is not possible to remove the
Multiplayer Setup
Step 0. Obtain Necessary Hardware for Multiplayer Setup
Step 0.5 Understanding the Software Components
Note that the above diagram shows that snis_server, snis_multiverse,
and ssgl_lobby are all running on the same computer that controls the
projector and stereo, and this computer also runs a snis_client process
to drive the projector and stereo. This is not a requirement. The snis_server,
snis_multiverse, and ssgl_lobby processes could also run on
any other computers reachable on the network. It's usually just easiest to use a big
powerful desktop system for the "main screen" snis_client and then also run the
server processes on that system as well, and means the other computers are simpler to
set up, in that they are all identical, and only run a single process, snis_client.
Step 1. Preliminary Hardware Setup
Step 2. Software Setup
Step 3. Setting up the Main Computer
capnkirk@enterprise ~ $ cd github/space-nerds-in-space
capnkirk@enterprise ~/github/space-nerds-in-space $ ./snis_launcher
Welcome to Space Nerds In Space
------------------------------------------------------------
No SNIS processes are currently running.
------------------------------------------------------------
1. Launch SNIS lobby server
The lobby server allows clients to find servers
There should be one lobby server total.
2. Launch SNIS multiverse server
The multiverse server stores player ship data
There should be one multiverse server total
3. Launch SNIS server
There should be one snis server per solarsystem.
There should be at least one instance of snis_server.
4. Launch SNIS client process
There should be one snis client process per player
plus one more per ship for the main screen.
5. Stop all SNIS processes
6. Stop all SNIS clients
7. Stop all SNIS servers
0. Quit
Choose [0-7]:
And then the menu will be displayed again.
Starting the lobby server
Welcome to Space Nerds In Space
------------------------------------------------------------
The following SNIS processes are running:
LOBBY SERVER -- capnkirk 6290 0.0 0.0 17232 2024 ? Ssl 12:01 0:00 ./bin/ssgl_server
------------------------------------------------------------
and then the menu again.
Welcome to Space Nerds In Space
------------------------------------------------------------
The following SNIS processes are running:
LOBBY SERVER -- capnkirk 6290 0.0 0.0 25428 2024 ? Ssl 12:01 0:00 ./bin/ssgl_server
MULTIVERSE SERVER -- capnkirk 6313 0.0 0.0 170188 1724 pts/7 Sl+ 12:03 0:00 ./bin/snis_multiverse localhost nickname narnia
------------------------------------------------------------
Type in the name of the solarsystem you want.
You should see something like this:
Choose a solar system:
default
default2
karado
polaris
sirius
Enter the name of the solarsystem:
You can repeat this step to start multiple instances of snis_server with different solar systems.
Enter the name of the solarsystem: default2
Using solar system default2
Welcome to Space Nerds In Space
------------------------------------------------------------
The following SNIS processes are running:
LOBBY SERVER -- capnkirk 6290 0.0 0.0 99160 2024 ? Ssl 12:01 0:00 ./bin/ssgl_server
MULTIVERSE SERVER -- capnkirk 6313 0.0 0.0 170188 2856 pts/7 Sl+ 12:03 0:00 ./bin/snis_multiverse localhost nickname narnia
SNIS SERVER -- capnkirk 6459 1.0 0.0 260608 9724 pts/7 Sl+ 12:09 0:00 ./bin/snis_server -l localhost -g SPACENERDS -L DEFAULT2 x --enable-enscript -m narnia -s default2
------------------------------------------------------------
This will quickly be covered over by the graphical display of the snis_client process which will look like this:
Starting snis_client
Welcome to Space Nerds In Space
------------------------------------------------------------
The following SNIS processes are running:
LOBBY SERVER -- capnkirk 6290 0.0 0.0 99160 2024 ? Ssl 12:01 0:00 ./bin/ssgl_server
MULTIVERSE SERVER -- capnkirk 6313 0.0 0.0 186580 2856 pts/7 Sl+ 12:03 0:00 ./bin/snis_multiverse localhost nickname narnia
SNIS SERVER -- capnkirk 6459 1.5 0.0 277000 11772 pts/7 Sl+ 12:09 0:04 ./bin/snis_server -l localhost -g SPACENERDS -L DEFAULT2 x --enable-enscript -m narnia -s default2
SNIS CLIENT -- capnkirk 6583 94.0 0.9 708860 114848 pts/7 Rl+ 12:14 0:00 ./bin/snis_client --fullscreen
------------------------------------------------------------
Make sure the MAIN SCREEN checkbox is checked.
capnkirk@enterprise$ ifconfig | grep 'inet addr'
inet addr:10.0.0.3 Bcast:10.0.0.255 Mask:255.255.255.0
inet addr:127.0.0.1 Mask:255.0.0.0
inet addr:10.236.226.31 Bcast:10.255.255.255 Mask:255.224.0.0
Step 4. Setting up the Bridge Stations
Note that it shows "No SNIS processes are currently running." This
is because this is a different computer (not the Main Computer).
capnkirk@enterprise $ ./snis_launcher
Welcome to Space Nerds In Space
------------------------------------------------------------
No SNIS processes are currently running.
------------------------------------------------------------
1. Launch SNIS lobby server
The lobby server allows clients to find servers
There should be one lobby server total.
2. Launch SNIS multiverse server
The multiverse server stores player ship data
There should be one multiverse server total
3. Launch SNIS server
There should be one snis server per solarsystem.
There should be at least one instance of snis_server.
4. Launch SNIS client process
There should be one snis client process per player
plus one more per ship for the main screen.
5. Stop all SNIS processes
6. Stop all SNIS clients
7. Stop all SNIS servers
0. Quit
Choose [0-7]:
which will quickly be covered up by the network setup screen, something like this:
Starting snis_client
Welcome to Space Nerds In Space
------------------------------------------------------------
The following SNIS processes are running:
SNIS CLIENT -- capnkirk 7247 98.0 1.1 748036 142528 pts/7 Rl+ 12:38 0:00 ./bin/snis_client --fullscreen
--------------------------------------------------
Talking to "The Computer" (how to set up speech recognition)
echo "turn right forty five degrees" > /tmp/snis-natural-language-fifo
apt-get install libttspico-utils; # for text to speech
apt-get install espeak; # optional alternative to libttspico-utils
apt-get install sox; # for "play" command, used by text to speech
apt-get install alsa-utils; # optional alternative to sox, for "aplay" command
apt-get install pocketsphinx-utils;
apt-get install pocketsphinx-lm-en-hub4;
apt-get install pocketsphinx-lm-en-hub4;
apt-get install libpocketsphinx1;
netcat -lvk -p 8080 > /tmp/snis-natural-language-fifo
This starts up a
Troubleshooting
Contents:
$
In this case, we see we have two devices of interest,
capnkirk@enterpise $ ./joystick_test
usb-Thrustmaster_T.16000M-joystick
usb-Thrustmaster_TWCS_Throttle-joystick
Discovered 2 joysticks
Here we see two devices, Device 0, and Device 1, corresponding to the usb-Thrustmaster_T.16000M-joystick
and the usb-Thrustmaster_TWCS_Throttle-joystick. We can press the buttons on the devices and move the
axes and this will cause more output to be printed. For example, moving the throttle controller:
Device: 1, time 99830028, value -29041, type: 2, axis/button: 2
Device: 1, time 99830168, value -28732, type: 2, axis/button: 2
Device: 1, time 99830196, value -21727, type: 2, axis/button: 2
Device: 1, time 99830224, value -18962, type: 2, axis/button: 2
Here we see that the throttle axis is on device 1 (usb-Thrustmaster_TWCS_Throttle-joystick.) and
on axis 2. Make a note of this. Pressing one of the buttons on the joystick, we see:
Here we see that this button is button 0 on the usb-Thrustmaster_T.16000M-joystick.
Make a note of this. Continue to do this with each axis and button you are
interested in, making a note of the button numbers and axis numbers.
device:your-device-name
If there is such a line, there is already a configuration for your device
and you just need to modify it to suit your taste. If there is no such
line, you need to add a new device configuration. Go to the bottom of the
file and add
device:your-device-name
where "your-device-name" is the name of your device. Note, this is actually
a regular expression
so if your device name contains a serial number it is possible to write a generic
name that will ignore the serial number part, but for most devices, just using
the device name as is will be fine.
The game modes are:
So for example, if you have a "super-duper-brand-controller", and you want
the Navigation screen to map axis 5 to yaw, axis 6 to pitch, and button 3
engage warp, you would write:
device:super-duper-brand-controller
mode 1 axis 5 yaw
mode 1 axis 6 pitch
mode 1 button 3 nav-engage-warp
From this we can see that the data for the "enterprise" ship (including the hashed password) is
stored in
capnkirk@enterprise ~/github/space-nerds-in-space $ ls -l snisdb/*/*/*
-rw-r--r-- 1 capnkirk capnkirk 5370 Jul 19 18:36 snisdb/2aa8/3672/2aa83672bace43178acab8e73b7391d1c316e80d.data
-rw-r--r-- 1 capnkirk capnkirk 5241 Jul 19 18:36 snisdb/80f2/969e/80f2969eded0cb559081e3e3202c94fcb5917a41.data
-rw-r--r-- 1 capnkirk capnkirk 5355 Jul 19 18:36 snisdb/82b2/4d25/82b24d25b042724aa94a39a9ea38e05cf0cf6340.data
-rw-r--r-- 1 capnkirk capnkirk 5241 Jul 19 18:36 snisdb/d253/706d/d253706d8cecf7537337da834ea7d48894f0618f.data
-rw-r--r-- 1 capnkirk capnkirk 5432 Jul 19 18:36 snisdb/e7d9/fa36/e7d9fa368467e5549e6846be3d8d11ebac751851.data
-rw-r--r-- 1 capnkirk capnkirk 5427 Jul 19 18:36 snisdb/fc4c/c56a/fc4cc56a58319495465a36128e65d1dcf69b2c08.data
capnkirk@enterprise ~/github/space-nerds-in-space $ grep enterprise snisdb/*/*/*
capnkirk@enterprise ~/github/space-nerds-in-space $ rm snisdb/e7d9/fa36/e7d9fa368467e5549e6846be3d8d11ebac751851.data
You can try alternate devices, for example, I can make it play through my
Scarlett 2i2 USB sound device by:
$ make snis_test_audio
$ ./snis_test_audio
Space Nerds In Space audio test program.
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map
connect(2) call to /dev/shm/jack-1000/default/jack_0 failed (err=No such file or directory)
attempt to connect to server failed
Portaudio reports 21 sound devices.
Portaudio says the default device is: 20
wwviaudio_initialize_portaudio returned 0
Portaudio reports 21 devices
0: HDA Intel PCH: ALC887-VD Analog (hw:0,0)
1: HDA Intel PCH: ALC887-VD Digital (hw:0,1)
2: HDA Intel PCH: ALC887-VD Alt Analog (hw:0,2)
3: HDA Intel PCH: HDMI 0 (hw:0,3)
4: HDA Intel PCH: HDMI 1 (hw:0,7)
5: HDA Intel PCH: HDMI 2 (hw:0,8)
6: Scarlett 2i2 USB: Audio (hw:1,0)
7: sysdefault
8: front
9: surround21
10: surround40
11: surround41
12: surround50
13: surround51
14: surround71
15: iec958
16: spdif
17: hdmi
18: pulse
19: dmix
20: default
Attempting to play sound... ...finished attempting to play sound
$ ./snis_test_audio 6
Space Nerds In Space audio test program.
Manually setting sound device to 6
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map
connect(2) call to /dev/shm/jack-1000/default/jack_0 failed (err=No such file or directory)
attempt to connect to server failed
Portaudio reports 21 sound devices.
Portaudio says the default device is: 20
Using sound device 6
wwviaudio_initialize_portaudio returned 0
Portaudio reports 21 devices
0: HDA Intel PCH: ALC887-VD Analog (hw:0,0)
1: HDA Intel PCH: ALC887-VD Digital (hw:0,1)
2: HDA Intel PCH: ALC887-VD Alt Analog (hw:0,2)
3: HDA Intel PCH: HDMI 0 (hw:0,3)
4: HDA Intel PCH: HDMI 1 (hw:0,7)
5: HDA Intel PCH: HDMI 2 (hw:0,8)
6: Scarlett 2i2 USB: Audio (hw:1,0)
7: sysdefault
8: front
9: surround21
10: surround40
11: surround41
12: surround50
13: surround51
14: surround71
15: iec958
16: spdif
17: hdmi
18: pulse
19: dmix
20: default
Attempting to play sound... ...finished attempting to play sound
then launch the game and it will play sounds through my Scarlett 2i2 USB device instead of the default device.
export SNIS_AUDIO_DEVICE=6
snis_multiverse: hash 82b24d25b042724aa94a39a9ea38e05cf0cf6340 exists, as expected.
snis_multiverse: checking hash 82b24d25b042724aa94a39a9ea38e05cf0cf6340
snis_multiverse: verify existence pass=1
snis_multiverse: looking up hash '82b24d25b042724aa94a39a9ea38e05cf0cf6340'
snis_multiverse: checking against '2aa83672bace43178acab8e73b7391d1c316e80d'
snis_multiverse: checking against '80f2969eded0cb559081e3e3202c94fcb5917a41'
snis_multiverse: checking against '82b24d25b042724aa94a39a9ea38e05cf0cf6340'
snis_multiverse: match hash '82b24d25b042724aa94a39a9ea38e05cf0cf6340'
First, see if you can make it happen reliably. If you can, then do the following:
Here is a summary of what to do (more detailed instructions are below).
Here is a more detailed version of the above instructions.
$
Then run the game again. This time you should see something like this for example:
Replacing ./share/snis/solarsystems/default/../../textures/planet-texture4-4.png with ./share/snis/solarsystems/karado/ounii-with-clouds-4.png
Replacing ./share/snis/solarsystems/default/../../textures/planet-texture4-5.png with ./share/snis/solarsystems/karado/ounii-with-clouds-5.png
Replacing ./share/snis/solarsystems/default/../../textures/planet-texture4-0.png with ./share/snis/solarsystems/karado/ounii-with-clouds-0.png
Replacing ./share/snis/solarsystems/default/../../textures/planet-texture4-2.png with ./share/snis/solarsystems/karado/ounii-with-clouds-2.png
snis_text_to_speech.sh Leaving high security area.
The "(core dumped)" means a memory image of the game was captured in a file
named "core" (or maybe "core.xxxxxx", where xxxxxx is some numbers.) Run the following
command:
$
$
From this, we can see that the core file came from the
$
At this point, you're running
(gdb)
Not very helpful. Type
(gdb)
This is because the program was built optimized
and stripped of debugging symbols (to make it smaller). So now we should try
to recreate the problem with an unoptimized version of the program with
debugging symbols. To make an unoptimized build, do the following:
$
Now, try to recreate the problem by running the unoptimized game.
Presuming you're successful at recreating the problem, you should
have a new core file.
$
Let's run the debugger on the new core file:
$ file core
core: ELF 64-bit LSB core file x86-64, version 1 (SYSV), SVR4-style, from './snis_client --fullscreen --starship spacenerd --pw spacenerd'
capnkirk@enterprise ~/github/space-nerds-in-space $ gdb -c core ./snis_client
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./snis_client...done.
[New LWP 6866]
[New LWP 6851]
[New LWP 6867]
[New LWP 6850]
[New LWP 6848]
[New LWP 6841]
[New LWP 6849]
[New LWP 6847]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./snis_client --fullscreen --starship spacenerd --pw spacenerd'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x000000000043c305 in vec3_init (vo=0x7c, x=221934.969, y=-5072.68408, z=175696.594) at quat.c:419
419 vo->v.x = x;
[Current thread is 1 (Thread 0x7fb02f7fe700 (LWP 6866))]
(gdb) _
Now we see some more information. It's telling us the program crashed in the function
called
(gdb)
Now it's showing us all the function calls along the way that lead up to the crash
within the
(gdb)
Unless you know C, that probably doesn't mean much to you. If you
do know C, you can see that "vo" is a pointer to a union, and the function
is setting several members of the union, and there aren't any other pointers
in the vicinity, so let's look at vo.
(gdb)
Hmm,
(gdb)
Nope, it's not valid. Digging a little more, let's go
(gdb)
Hmm,
(gdb)
So
Lua Scripting
Miscellaneous Development Topics
Here is a copy of the freegamdev.net thread about this game (just a backup in case some disaster strikes that forum)