Pokemon Go!

Pokemon Go! has been released in the US now, and of course I just had to download it. I’m really looking forward to going out and exploring my neighborhood, and catching as many Pokemon as possible. If I just so happen to get some exercise in the process, so be it. I need the exercise, for sure.

I hear the game is similar to Ingress, made by the same company, Niantec. In Pokemon Go, the goal (as with any Pokemon game) is to catch as many Pokemon as you can, and use those Pokemon in gym battles. What makes Go so unique, is that you actually have to travel to different areas, using the app’s GPS tracking to follow your position at all times. You can catch wild Pokemon in various locations, with the type of area you’re nearby determining what type of Pokemon are available to catch. Walk next to a river, and you’ll get some water types. Walk through a park, and get some forest types. Pretty much anywhere else will get you very common types. Even the time of day determines what you catch.

You can use items as well, but once those items run out, you’ll need to rest at a PokeStop – special landmarks all across the map that usually contain valuable items, experience, and ‘stardust’ to help you on your journey. They can be things like statues, firehouses, bridges, or anything else that stands out. I’ve got a few stops nearby my house that I’d like to go to so I can restock at some point.

Unfortunately, due to the extreme popularity of the app, the game’s servers are severely overwhelmed. This means that you’d be lucky to even be able to log in, much less play the game. Niantec should have definitely foreseen this level of traffic though, given how popular Pokemon as a whole is. If you do happen to be able to log in, it’s also possible that the location-specific assets won’t load, since those are not saved locally, and can only be retrieved from Niantec’s servers – which are unstable to say the least.

Hopefully the servers won’t be so bloated this weekend, as I have plans to walk all over my neighborhood as much as possible so that I can catch every damned Pokemon that I can!

UPnP woes

I’ve had various successes and failures with my media sharing system. I’ve got a whole network of programs set up so that I can add, remove and update my various media at home – mostly videos of course. I’ve got Samba set up so that I can share files throughout my network, and Universal Media Server set up so that I can watch videos and podcasts on various devices throughout my home. So far, everything’s worked out quite well to stream all of my movies and TV shows. All except VLC.

Since version 2.2.0, VLC has had issues with Universal Plug-and-Play streams. Either it would not find the media server, or if it did, it would have issues playing the files. Recently, VLC updated to version 2.2.4, and with it, they’ve inexplicably removed the UPnP network streaming option altogether. I haven’t found any reason as to why, exactly. There’s been no mention of the omission on their site, or in the changelogs as far as I can tell. It’s very frustrating to have to stream my videos via Samba file sharing, since I can’t use the more interesting features that media servers offer, such as live subtitles and playlists.

I do know that VideoLAN is going through a huge rewrite with their next update to 3.0, and I’ve tried out some of their nightly builds. It does seem that they are re-adding UPnP support, but in their most recent builds, it seems that even selecting that option crashes the program. So it might be some time before I can use my favorite media player to stream my shows and movies. Til then, I’ll just stream my shows either via Samba, or via the lightweight web server that Universal Media Server offers.

Creating an Ark: Survival Evolved dedicated server

Wow, this one was fun. I spent several days knocking my head against my desk trying to figure out why this wasn’t working, only to find out I was being silly.

So if you want to install and run a dedicated Ark: Survival Evolved server, you’ll first need to install the prerequisites. For our server, we used SteamCMD, as I feel it’s the easiest way to keep the game server updated. So install the dependencies.

# sudo yum install glibc libstdc++

Now, there’s some quirks to Ark: Survival Evolved that require us to make some changes to our server. If you haven’t already, you’ll need to increase the open files limit for your server by editing your configurations.

  1. Add the following line to the /etc/sysctl.conf file:
    fs.file-max=100000
  2. Run the following command to apply the change:
    # sudo sysctl -p /etc/sysctl.conf
  3. Add the following lines to /etc/security/limits.conf:
    * soft nofile 1000000
    * hard nofile 1000000
  4. Add the following line to /etc/pam.d/common-session:
    session required pam_limits.so

Now we want to create a specific user to run your server. You can absolutely run the server as root, but do you really want to risk some exploit being discovered, allowing some hacker root access to your host? Didn’t think so.

# sudo useradd -m gameserver
# su - gameserver

Now we want to go ahead and install SteamCMD.

# mkdir ~/steamcmd
# cd ~/steamcmd

Now, download the SteamCMD files.

# wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz

And extract the files.

# tar -xvf steamcmd_linux.tar.gz

Navigate to the steamcmd directory, and start SteamCMD.

# cd ~/steamcmd
# ./steamcmd.sh

Next, you’ll need to login to Steam. In order to install Ark: Survival Evolved, you do not need to login to your Steam account. Which is nice, because with the recent requirements for Steam Guard, and all the extra security, it just gets super annoying having to login and verify every time you need to update.

login anonymous

Now, we’ll define our install directory. Without defining this, it’ll install the game files in our steamcmd directory. It’s possible to keep going like that, but I prefer to use a separate install directory so I can organize my Steam apps more efficiently.

force_install_dir /home/gameserver/ARK

And now install the game, which includes the game server files.

app_update 376030 validate

Depending on the speed of your internet connection, it may take quite a while for the game files to download and install. Once the files are installed, you can exit SteamCMD.

exit

Great! Now your game is installed. You could just run your server in a separate screen by running the command:

~./ARK/ShooterGameServer TheIsland?listen?SessionName=<server_name>?ServerPassword=<join_password>?ServerAdminPassword=<admin_password> -server -log

Where <server_name> is the name you are going to give your server, <join_password> is the password any player would have to enter to join your server, and <admin_password> is the password you would need to enter in the client console to enable cheats.

Unfortunately, we’re not quite ready to join the server, because you probably haven’t opened up the ports that Ark: Survival Evolved uses.

Port Purpose
UDP 27015 Query port for Steam’s server browser
UDP 7777 Game client port
TCP 32330 RCON for remote console server access (optional)

[su_spoiler title=”Finding nonstandard ports”]

Note: For my setup, I had to open up a different game client port for some unknown reason. I’m sure it’s different for a reason, but I have no idea why. If your server is not joinable after following these instructions, you should check which ports the game server is using by using netstat.

# sudo netstat -tulpn

You should see a list of ports and the services using them. You’d be looking for the ports being used by ShooterGameServer. Add those ports to your firewall rules.

[/su_spoiler]

Add these ports to your firewall rules.

# sudo firewall-cmd --permanent --add-port=27015/udp
# sudo firewall-cmd --permanent --add-port=7777/udp
# sudo firewall-cmd --permanent --add-port=32330/tcp

And reload the rules.

# sudo firewall-cmd --reload

Okay, now you can find your server when you search for LAN servers in the game client. For most people, that’s all you’ll need to do to run and play on a dedicated server. For me though, I wanted to have a way to be able to update the server when I need to, and I wanted to also have a way to start the server automatically as a service. If you’d prefer to just run a bash script to keep it updated and start/stop the server, I found a great script on Reddit. I modified it a little to suit my needs, and I think it works pretty well. Just make sure you edit the config file as needed, and run the script in a new screen session.

To run the server as a service, you’ll want to add a service file to systemd. An added bonus of doing this is that the service will automatically update the open file limits on-the-fly. Create the file /etc/systemd/system/ark-dedicated.service and add this text:

[Unit]
Description=ARK: Survival Evolved dedicated server
Wants=network-online.target
After=syslog.target network.target nss-lookup.target network-online.target

[Service]
ExecStart=/home/gameserver/ARK/ShooterGame/Binaries/Linux/ShooterGameServer TheIsland?listen?SessionName=<SESSION_NAME> -server -log
LimitNOFILE=100000
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s INT $MAINPID
User=gameserver
Group=gameserver

[Install]
WantedBy=multi-user.target

Make sure to reload your service lists.

# sudo systemctl daemon-reload

Before starting the service, make sure you add your configuration settings in the /home/gameserver/ARK/ShooterGame/Saved/Config/LinuxServer/GameUserSettings.ini file.

Now you can start the service.

# sudo systemctl start ark-dedicated

And make sure it runs on system startup.

# sudo systemctl enable ark-dedicated


That’s it! You should be all set to join your server now. I hope this tutorial helps a few people looking to host their own servers, and hopefully you won’t have such a hard time of it as I did.

Thanks for reading,

Nick