Space Nerds In Space is an open source (GPLv2) cooperative multiplayer 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.
You might be reminded of Artemis Spaceship Bridge Simulator, and you would not be out of line, as this game was the inspiration for Space Nerds In Space. Within a month after mentioning Space Nerds In Space publicly, and before I'd gotten very far at all, but about the time I realized that what I was working on might be more than vapor, I wrote to Thom Roberts, expressing my desire to write a linux based spaceship bridge simulator with essentially the same raison d'etra as Artemis (though differing radically in the details), and he replied:
I can think of no greater flattery, especially since I've seen other games that made ME want to make my own version. Good luck!
And so I proceeded.
If you're on mobile, you would probably have a better time viewing this site on a real computer.
Contents
Latest development video (November 2018):
Step 2: Download the Source Code
The source code is here: Space Nerds In Space github page
NOTE: Do NOT perform these steps as root!
To get the source code, there are three methods:
- If you are a registered github user, type (as a non-root user):
git clone git@github.com:smcameron/space-nerds-in-space.git
- If not a registered github user, you can still use git with https. Type (as a non-root user):
git clone https://github.com/smcameron/space-nerds-in-space.git
- Finally, you can just download a snapshot zipfile without using git at all:
After downloading the zip file, you must unpack the zip file. Type (as a non-root user):
unzip space-nerds-in-space-master.zip cd space-nerds-in-space-master
Step 3: Build the Code
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):
make
You should see quite a lot of output, like this:
COMPILE mathutils.c COMPILE snis_alloc.c COMPILE snis_socket_io.c ... many steps omitted here ... LINK bin/snis_server LINK bin/snis_client LINK bin/snis_limited_client LINK bin/snis_multiverse
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.
Step 4: build openscad models (optional)
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):
make models
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:
make update-assets
Type (as a non-root user):
$ ./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. Launch limited SNIS client process (no Open GL required). 6. Stop all SNIS processes 7. Stop all SNIS clients 8. Stop all SNIS servers 9. Check for asset updates 10. Enter Lobby Host IP addr (currently localhost) 0. Quit Choose [0-10]: _Choose option 1, then option 2, then option 3, then option 4 (taking defaults for any questions you might be asked.)
After awhile, you should see a screen that looks something like this:
- Click on the MAIN SCREEN ROLE checkbox to be sure it is checked.
- The very first time you run it, leave the CREATE SHIP box checked. On subsequent runs, make sure CREATE SHIP is not checked.
- Enter the name of your ship in the "SHIP NAME" field.
- Choose a password for your ship and enter it in the PASSWORD field. (Note: the passwords are not cryptographically secure.)
- Click the "ENTER LOBBY ..." button in the lower left part of the screen
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.
Step 6. Play around
The function keys are used to switch between screens, except for F1, which is the 'help' key.
- F1 is the help screen. What it displays depends on which screen you're on.
- F2 - NAVIGATION
- F3 - WEAPONS
- F4 - ENGINEERING
- F5 - DAMAGE CONTROL
- F6 - SCIENCE
- F7 - COMMUNICATIONS
- F8 - MAIN SCREEN
- F9 - DEMON SCREEN (dungeon master screen)
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 "./snis_launcher" script option 4) 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.
Note: Initially, your ship may have power to all systems turned off via Engineering. Many things won't work without power, including steering and moving the ship. See the section on Engineering, below.
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: saving-planet-erph 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 lua saving-planet-erph.lua, you can just enter saving-planet-erph, which is a little more convenient. 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: Note: By default, the game assumes that the internet-facing network will be used. If you have a private network (the internet is inaccessible) or if your system is on multiple networks and you wish to use a network other than the default internet-facing network, special action will be required. Note also that it is not currently possible to play with a multi-network setup in which all the stations are not on the same network. That is, you cannot host the lobby server and snis_server on a multi-networked system and expect clients to be able to connect via more than one network. Currently, the lobby server and snis_server only server a single network, but you can choose which network. If you wish to run the game on a network other than the default internet-facing network, do the following prior to running snis_launcher: If on the lobby screen, you see blinking red snis_server instances with IP addresses of 0.0.0.0 this indicates that the snis_server instances were not able to determine a network interface to use. Typically this means SSGL_PRIMARY_IP_ADDR_PROBE is not set, but should be (because the internet is inaccessible from your network), or is set to an invalid value, e.g. it is blank, or has a value which is not an IP address. There is a script to help with setting up: snis_launcher. Make sure the MAIN SCREEN checkbox is checked. 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. To use the voice chat feature, you can press and hold F12 and whatever your microphone records will be transmitted to the other terminals on your ship. If you press and hold ctrl-F12, then whatever your microphone records will be transmitted to all other terminals on all ships in the current snis_server instance. Suppose you have set up Space Nerds In Space previously but development has moved on and now what's in github and on the assets server is newer than what you have, or that you have several players together to play the game but they each have a different version of Space Nerds In Space. How do you sync up your game with the latest stuff? Use the following procedure: 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: /tmp/snis-natural-language-fifo. For that matter, you can echo text directly into this fifo if you want to, e.g.: 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 snis_client, you can then open up a terminal window and run (as a non-root user)speech/queeg500 This will start up pocketsphinx listening on the default microphone to recognize text and feed it into /tmp/snis-natural-language-fifo. If you're wondering why it's called queeg500, this is the reason. You must begin every spoken command with "Computer". For example, try saying: "Computer, Ramming speed!" 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 8080. Then run the Space Nerds Communicator app on your Android device, and configure the IP address and port to match your snis_client machine. Then tap the microphone button and speak your commands. The app will send them to netcat, which will then feed them into the fifo. 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, snis_test_audio to help trace down audio problems. It will print out a list of devices that Portaudio knows about. Often, when there is some audio problem, the problem turns out to be that sound is by default playing on a different device than what you expected. Here is an example of running the snis_test_audio program on my system: 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 pulse and pavucontrol if they aren't installed and see if that helps. The pavucontrol program should let you dynamically control to which device a running program's sound output is directed. 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. For most recent versions of Space Nerds In Space, OpenGL version 2.1 (aka "#version 120" (See OpenGL version decoder ring)) is required. This is quite old, so your computer probably supports it. For awhile OpenGL version 3.0 (aka "#version 130") was required. This is no longer the case. Historically, the following OpenGL versions were required: From Apr 12, 2018 until Feb 17, 2019, the shaders used by Space Nerds In Space required OpenGL version 3.0 (aka "#version 130") or better. If your computer does not support a recent enough version of OpenGL, you can run the limited client instead, which does not use OpenGL at all. Be sure to de-select MAIN SCREEN and WEAPONS roles on the login screen, as these screens do not work well with the limited client. The remaining should work sufficiently well with the limited client, although NAVIGATION and especially the DEMON screen will probably exhibit poor performance and reduced FPS, so it's best to use the limited client only for ENGINEERING, DAMAGE CONTROL, COMMS, and SCIENCE. NOTE: The limited client is not as well tested as the OpenGL client, so you are more likely to encounter bugs. Suppose you see something like this ("Segmentation fault"): Now type bt to see a back trace: First make sure your computers can ping each other. You can find out the IP address of your computer via ifconfig -a or ip a. Try pinging 8.8.8.8, which is Google's DNS server. If you are trying to run SNIS on a private network without access to the internet (if you cannot successfully ping 8.8.8.8), and you are able to ping other machines on your network, then special action is required to make SNIS work. Let's say all the machines on your network have an IP address like 192.168.1.xxx. When you start snis_launcher, you should do it like so: IPv6. SNIS does not yet work with IPv6. Feel free to send patches. Space Nerds in Space is designed to be run on a LAN, not over the internet. Generally on a LAN, you shouldn't have too much trouble, provided you have a wired network and not a wireless network. You can monitor graphs of bandwidth usage and latency on the DEMON screen (press the NET STATS button). That being said, there are several variables that are tweakable via the DEMON screen which you can use to reduce the bandwidth requirements and potentially improve latency. (note: use the "vars" command on the DEMON screen to see a list of tweakable variables and their minimum, maximum, and default values). Space Nerds in Space was designed to be played on a LAN, not over the internet. I do not recommend playing over the internet. Be aware that the protocol is not encrypted in any way and is not secure. Some people insist on attempting it anyway. You can control the port that the lobby server runs on via the environment variable via the "Options" menu item of the snis_launcher script or via the environment variable SSGL_PORT. For snis_client, the lobby port number may be entered via the "Options" menu of the snis_launcher script, via the SSGL_PORT environment variable, or via the UI on the network setup screen. You can control the range of ports which snis_server will use via the "Options" menu of the snis_launcher script or via the environment variable SNIS_SERVER_PORT_RANGE, e.g. "export SNIS_SERVER_PORT_RANGE=32000:32100". You might want to do this to limit what ports you need to open up on your firewall. See doc/running-in-the-cloud.txt for more information. 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: Why aren't there binaries? Why do I have to compile it myself? I will let Linus Torvalds explain why: What about installing the game? The above instructions for building the game have you download the source, compile it, then run it right where you compiled it. What if you want to install it on your system? One reason you might not want to install the game is that the game changes quite frequently, and if the protocol changes (as it does) the version you installed is likely to be out of date and you will have to recompile anyway. So "git pull" followed by "make" is not that hard. That being said, maybe you do want to try installing the game in the traditional sense. Here's how to install the game into /usr/local: Note that DESTDIR is . by default, so you must specify DESTDIR= if you want it to really land in /usr/local. Then you can run it via: /usr/local/bin/snis_launcher Note that I don't use "make install" very much, so it's quite possible there are some bugs in the Makefile around this area, though it worked as of Jan 16, 2019, so far as I know. Here is a set of slides about speech recognition and natural language processing in Space Nerds In Space. Here are some pictures showing various noise-scales and the effect they have in gaseous-giganticus. 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.Navigation Controls
Q W E ^
|
A S D
|
V
Weapons Screen Controls
Engineering Screen Controls
Damage Control Controls
Science Short Range Scanner Controls
Science Details Screen
Science Long Range Scanner Controls
/help -- displays a list of commands (I need to update the help screen)
/computer ",
/channel channel-number - change current channel",
/eject cargo-bay-number - eject cargo",
/hail ship-name - hail ship or starbase on current channel",
/inventory - report inventory of ship's cargo hold",
/passengers - report list of passengers
/about - report information about the game (i.e. version number, etc.)
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
/computer set warp drive coolant to 50 percent
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. ENG is the same as ENGINEERING.)
ROLE 10
lists the roles for client number 10.
ROLE 7 MAIN
restrict client number 7 to role MAIN SCREEN.
ROLE 7 +ENG
add ENGINEERING role to client 7
ROLE 4 -WEAP
remove WEAPONS role from client 4.
ROLE 3 ALL
allow client 3 to use all roles.
NOTE: it is not possible to remove the DEMON role from a client.
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
export SSGL_PRIMARY_IP_ADDR_PROBE=192.168.1.1
Of course you should replace "192.168.1.1" with some address that is on your desired network. It is not required that a host be present at the address you specify, this address is merely used to probe the host's routing table to find out which interface to use.
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
------------------------------------------------------------
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
--------------------------------------------------
cd space-nerds-in-space; # Or wherever you checked out the code
git checkout master; # Just in case you switched branches
make mostly-clean; # Let's start fresh
git pull; # Fetch the new code from github
make; # Build everything
make update-assets; # Fetch any new or updated art
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 netcat process listening for connections on port 8080 (or choose another port). Netcat just copies whatever comes in to its stdout, which in this case is redirected into /tmp/snis-natural-language-fifo.
Contents:
$ ls -l /dev/input/by-id
total 0
lrwxrwxrwx 1 root root 9 Nov 9 07:13 usb-0461_USB_Optical_Mouse-event-mouse -> ../event8
lrwxrwxrwx 1 root root 9 Nov 9 07:13 usb-0461_USB_Optical_Mouse-mouse -> ../mouse0
lrwxrwxrwx 1 root root 9 Nov 9 07:13 usb-0461_Wired_USB_Keyboard-event-if01 -> ../event7
lrwxrwxrwx 1 root root 9 Nov 9 07:13 usb-0461_Wired_USB_Keyboard-event-kbd -> ../event6
lrwxrwxrwx 1 root root 9 Nov 10 10:54 usb-Thrustmaster_T.16000M-event-joystick -> ../event5
lrwxrwxrwx 1 root root 6 Nov 10 10:54 usb-Thrustmaster_T.16000M-joystick -> ../js1
lrwxrwxrwx 1 root root 9 Nov 10 10:54 usb-Thrustmaster_TWCS_Throttle-event-joystick -> ../event4
lrwxrwxrwx 1 root root 6 Nov 10 10:54 usb-Thrustmaster_TWCS_Throttle-joystick -> ../js0
In this case, we see we have two devices of interest, usb-Thrustmaster_T.16000M-joystick and usb-Thrustmaster_TWCS_Throttle-joystick.
capnkirk@enterpise $ ./joystick_test
usb-Thrustmaster_T.16000M-joystick
usb-Thrustmaster_TWCS_Throttle-joystick
Discovered 2 joysticks
0: usb-Thrustmaster_T.16000M-joystick
1: usb-Thrustmaster_TWCS_Throttle-joystick
Device: 0, time 99672500, value 0, type: 129, axis/button: 0
Device: 1, time 99672520, value -32767, type: 130, axis/button: 6
Device: 0, time 99672520, value 0, type: 130, axis/button: 5
[... many lines omitted ...]
Device: 1, time 99672520, value -32767, type: 130, axis/button: 7
Device: 1, time 99672524, value 0, type: 130, axis/button: 8
Device: 1, time 99672524, value 0, type: 130, axis/button: 9
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
Device: 1, time 99830308, value -18918, 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:
Device: 0, time 99919292, value 1, type: 1, axis/button: 0
Device: 0, time 99919388, value 0, type: 1, axis/button: 0
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 snisdb/e7d9/fa36/e7d9fa368467e5549e6846be3d8d11ebac751851.data
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/*/*/*
snisdb/e7d9/fa36/e7d9fa368467e5549e6846be3d8d11ebac751851.data:sdata.name:enterprise
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
Feb 17, 2019 - Present
OpenGL 2.1
Commit fa60c565411db509a9dccaf4a83ec2dfc7951a00
Apr 12, 2018 - Feb 16, 2019
OpenGL 3.0
Commit 3c8ea5c71021b3eb3ede34543013d30cce117529
Dec 22, 2013 - Apr 11, 2018
OpenGL 2.1
Commit fad901a5602c1edecab75e6cc1171e9c6f39cfe5
Aug 31, 2013 - Dec 22, 2013
Very old OpenGL (fixed pipeline)
Commit 8b039d60cf96a08b69f394a9ee07c8f2a928b8da
Nov 3, 2012 - Aug 31, 2013
No OpenGL required at all
Commit f421da62ce8d7a0b5e489e78a77e526d7448a62e (first commit)
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'
Segmentation fault
capnkirk@enterprise ~/github/space-nerds-in-space $ Last buffer length read from socket 14 was 67
32 30 31 37 2d 30 33 2d 30 34 20 30 37 3a 35 39 3a 30 30 20 64 31 39 64 62 64 66 30 62 39 33 38 30 34 62 63 62 65 35 36 66 31 33 64 34 66 33 32 63 63 62 34 39 32 33 31 63 37 32 34 20 2b 20 33 36 38 00
snis_server: client refcount = 1
snis_server: client refcount = 0
snis_server: client count of bridge 0 = 0
snis_server: calling remove_client 0
snis_server: remove_client 0 returned
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).
$ ulimit -c unlimited
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.
Segmentation fault (core dumped)
capnkirk@enterprise ~/github/space-nerds-in-space $ Last buffer length read from socket 14 was 16
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:
$ ls -ltr | tail -5
-rwxr-xr-x 1 capnkirk capnkirk 850856 Mar 4 07:59 snis_server
-rwxr-xr-x 1 capnkirk capnkirk 1193104 Mar 4 07:59 snis_client
-rwxr-xr-x 1 capnkirk capnkirk 909616 Mar 4 07:59 snis_limited_client
-rwxr-xr-x 1 capnkirk capnkirk 212432 Mar 4 07:59 snis_multiverse
-rw------- 1 capnkirk capnkirk 417386496 Mar 4 08:17 core
$ $ file core
core: ELF 64-bit LSB core file x86-64, version 1 (SYSV), SVR4-style, from 'bin/snis_client --fullscreen --starship spacenerd --pw spacenerd'
From this, we can see that the core file came from the snis_client program (rather than from snis_server, snis_multiverse, or something else.) Now that we know what program the core file is from, we can try to get a bit more info out of it. Run the following:
$ gdb -c core ./snis_client
$ gdb -c core
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".
[New LWP 6365]
[New LWP 6386]
[New LWP 6371]
[New LWP 6375]
[New LWP 6372]
[New LWP 6373]
[New LWP 6385]
[New LWP 6374]
Core was generated by `./snis_client --fullscreen --starship spacenerd --pw spacenerd'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0000000000431960 in ?? ()
[Current thread is 1 (LWP 6365)]
(gdb) _
At this point, you're running gdb and it is waiting for you to tell it what to do. We can already see some information though. The program terminated with SIGSEGV (segmentation fault, we already knew that).
(gdb) bt
#0 0x0000000000431960 in ?? ()
#1 0x000000000044de3b in ?? ()
#2 0x00000000006fb480 in ?? ()
#3 0x00000000004752dd in ?? ()
#4 0x00007ffc221ca910 in ?? ()
#5 0x00000001bc70f20e in ?? ()
#6 0x00007ffc221ca900 in ?? ()
#7 0x00007ffc221f3cd5 in ?? ()
#8 0x00007ffc221ca930 in ?? ()
#9 0x000000017fffffff in ?? ()
#10 0x0000000000000001 in ?? ()
#11 0xa4ef74cf09462800 in ?? ()
#12 0x00007ffc221ca968 in ?? ()
#13 0x0000000000000000 in ?? ()
(gdb) _
Not very helpful. Type quit to exit gdb.
(gdb) quit
$ _
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:
$ make mostly-clean
... lots of output omitted ...
$ make O=0
COMPILE mathutils.c
COMPILE snis_alloc.c
COMPILE snis_socket_io.c
COMPILE snis_marshal.c
... lots of output omitted ...
LINK snis_server
LINK snis_client
LINK snis_limited_client
LINK snis_multiverse
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.
$ ls -ltr | tail -5
-rwxr-xr-x 1 capnkirk capnkirk 1410480 Mar 4 08:37 snis_client
-rwxr-xr-x 1 capnkirk capnkirk 1124344 Mar 4 08:37 snis_limited_client
-rwxr-xr-x 1 capnkirk capnkirk 237352 Mar 4 08:37 snis_multiverse
drwxr-xr-x 2 capnkirk capnkirk 4096 Mar 4 08:37 bin
-rw------- 1 capnkirk capnkirk 417390592 Mar 4 08:39 core
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 vec3_init in the file quat.c at line 419 and it's even showing use the line of source code where the program crashed. This is perfect information to put into bug report. Type bt to get a back trace:
(gdb) bt
#0 0x000000000043c305 in vec3_init (vo=0x7c, x=221934.969, y=-5072.68408, z=175696.594) at quat.c:419
#1 0x0000000000433034 in update_entity_pos (e=0x0, x=221934.969, y=-5072.68408, z=175696.594) at entity.c:189
#2 0x0000000000456383 in laserbeam_move (o=0x7da290 <go+938448>) at snis_client.c:1335
#3 0x0000000000456774 in init_laserbeam_data (o=0x7da290 <go+938448> at snis_client.c:1389
#4 0x000000000045587e in update_laserbeam (id=887, timestamp=243, origin=293, target=354) at snis_client.c:1143
#5 0x00000000004628ba in process_update_laserbeam () at snis_client.c:5386
#6 0x0000000000462fdf in gameserver_reader (arg=0x0) at snis_client.c:5586
#7 0x00007fb07228d6ba in start_thread (arg=0x7fb02f7fe700) at pthread_create.c:333
#8 0x00007fb071dba82d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
(gdb)
Now it's showing us all the function calls along the way that lead up to the crash within the vec3_init function, which is more great info to put into a bug report. This is probably sufficient. But, if you want to go a little further...
(gdb) list
414 quat_init_axis_v(q, &v, angle);
415 }
416
417 void vec3_init(union vec3 *vo, float x, float y, float z)
418 {
419 vo->v.x = x;
420 vo->v.y = y;
421 vo->v.z = z;
422 }
423
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) print vo
$1 = (union vec3 *) 0x7c
(gdb) _
Hmm, 0x7c does not look especially like a valid memory address.
(gdb) print *vo
Cannot access memory at address 0x7c
(gdb) _
Nope, it's not valid. Digging a little more, let's go up the stack and see what called this vec3_init() function.
(gdb) up
#1 0x0000000000433034 in update_entity_pos (e=0x0, x=221934.969, y=-5072.68408, z=175696.594) at entity.c:189
189 vec3_init(&e->e_pos, x, y, z);
(gdb) list
184 }
185 }
186
187 void update_entity_pos(struct entity *e, float x, float y, float z)
188 {
189 vec3_init(&e->e_pos, x, y, z);
190 }
191
192 void update_entity_orientation(struct entity *e, const union quat *orientation)
193 {
(gdb) print e
$2 = (struct entity *) 0x0
Hmm, e is null, but was passed in here, so let's go up the stack again.
(gdb) up
#2 0x0000000000456383 in laserbeam_move (o=0x7da290 <go+938448> at snis_client.c:1335
1335 update_entity_pos(o->entity, x, y, z);
(gdb) list
1330
1331 x = origin->x + 0.5 * target_vector.v.x;
1332 y = origin->y + 0.5 * target_vector.v.y;
1333 z = origin->z + 0.5 * target_vector.v.z;
1334
1335 update_entity_pos(o->entity, x, y, z);
1336 update_entity_orientation(o->entity, &orientation);
1337 update_entity_material(o->entity, o->tsd.laserbeam.material);
1338 update_entity_non_uniform_scale(o->entity, length, 2.0 + snis_randn(7), 0.0);
1339
(gdb) print o
$3 = (struct snis_entity *) 0x7da290 <go+938448>
(gdb) print o->entity
$4 = (struct entity *) 0x0
(gdb)
So o seems to be a valid pointer, but o->entity is 0 (means NULL). So it seems we have an unexpected null pointer.
capnkirk@enterprise ~ $ ifconfig
enp3s0 Link encap:Ethernet HWaddr 30:5a:3a:78:f9:d8
inet addr:192.168.1.157 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::29fe:4469:7af1:2fcb/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:18743 errors:0 dropped:0 overruns:0 frame:0
TX packets:12293 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:14826741 (14.8 MB) TX bytes:2321884 (2.3 MB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:20 errors:0 dropped:0 overruns:0 frame:0
TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:2106 (2.1 KB) TX bytes:2106 (2.1 KB)
capnkirk@enterprise ~ $ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 30:5a:3a:78:f9:d8 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.157/24 brd 192.168.1.255 scope global dynamic enp3s0
valid_lft 85692sec preferred_lft 85692sec
inet6 fe80::29fe:4469:7af1:2fcb/64 scope link
valid_lft forever preferred_lft forever
Here's what it looks like when the network is working:
capnkirk@enterprise ~ $ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=57 time=10.8 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=57 time=11.1 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=57 time=11.2 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=57 time=9.08 ms
This is what it looks like if you can't ping:
scameron@wombat ~ $ ping 192.168.1.99
PING 192.168.1.99 (192.168.1.99) 56(84) bytes of data.
From 192.168.1.157 icmp_seq=1 Destination Host Unreachable
From 192.168.1.157 icmp_seq=2 Destination Host Unreachable
From 192.168.1.157 icmp_seq=3 Destination Host Unreachable
From 192.168.1.157 icmp_seq=4 Destination Host Unreachable
export SSGL_PRIMARY_IP_ADDR_PROBE=192.168.1.1
./snis_launcher
Note, adjusting ASTEROID_COUNT and NPC_SHIP_COUNT generally will not help when running Lua scripted scenarios as such scenarios typically do not use the procedural generation code used by the REGENERATE command when populating the universe but instead typically use their own custom code or a pre-set configuration when populating the initial conditions.
from Hacker News https://ift.tt/38kZOF0
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.