设置和模组化《方舟:生存进化》专用服务器的最佳方法 - 无需SteamCMD或第二份《方舟:生存进化》游戏副本!

0 点赞
ARK: Survival Evolved
转载

I wrote a guide a while back on how to change a single-player or non-dedicated server to a dedicated server (http://steamcommunity.com/sharedfiles/filedetails/?id=689712529). At the time, I only read 2 guides about setting up an ARK server but saw there were many more, so I thought it would be pointless to write my own guide on how to set up a dedicated server. However, I recently decided to add a mod to my server so I read many of the existing guides, only to find out none of the guides I read explained how to set up a server using the method I did and many of them specified requirements which are simply idiotic. For example, some people claim you need a 2nd Steam account with a 2nd copy of ARK to run a dedicated server AND be able to play ARK. Some claim you must use SteamCMD to download & install a complete 2nd copy of ARK and go through extra unnecessary configurations to get it to work & be able to play at the same time. Some claim you must download the ARK dedicated server tool (possibly a good idea depending on what you want to do, but not absolutely necessary so read on). Others claim you must jump through hoops while standing on your head & rubbing your stomach (okay, maybe that's not quite what they claim) to allow other people to join your server from over the internet (as opposed to your local LAN). While these methods would probably work (except for that last method XD ), do you want to create a 2nd Steam account & buy a 2nd copy of ARK to be able to host a dedicated server AND play the game at the same time? Do you want to waste 30-60GB of your HDD space (or worse, your even more valuable SSD space!) to be able to host & play? Do you want to open up 10 ports on your router, or only 3 or 4? All of these methods are unnecessary, so let me explain how I set mine up. Note: I never got mods working on my server (I figured it out, read on), and I actually broke my server in the process of trying some of the methods I read about how to do so. 2 of the methods caused it to crash before it even finished loading, 1 of them caused it to appear to load but nobody could join it & the standard method of stopping the server wasn't working (so I was forced to kill it using Task Manager), and 2 of them appeared to have no effect at all on the server. Basically, back up your world's save file before you begin! I'll update this if I ever find a method which actually works to install mods to a dedicated server. Edit: Got mods to work. Add -automanagedmods to the batch file & the mod ID's to the GameUserSettings.ini in the ShooterGame Saved Config WindowsServer folder. Read the modding section below. I also moved the server back to my laptop's SSD which reduced the server loading time to around 2-2.5 minutes. Before you begin There are 3 methods of doing this: 1 - Host the server & play your game on 1 computer. 2 - Host and/or play on multiple computers. 3 - Host the server & play your game on separate computers. My method allows me to play and/or host from any computer attached to my Steam account using only the standard installation of ARK. However, if you plan to host & play on the same PC, be aware you will need a powerful enough PC to do so. ARK doesn't take much CPU to run the server, but the game client can if you don't have a powerful CPU. Both the client & server can take 4-6GB of RAM each (depending on your settings & such), so I suggest having at least 8GB of RAM for a computer you intend to run either on and 16GB of RAM if you intend to do both on the same PC. Also be aware hosting from different PC's creates several more things to consider: 1 - It is easy to host completely different ARK servers on different computers by simply following this guide to set up a server on each computer & leaving it at that. 2 - It is possible to host the same server from different computers, but not at the same time if you want it to work properly. However, doing so would require 1 of several methods to synchronize the save files. I don't particularly think this would be useful to anybody, but if somebody thinks this will help them & wants me to explain it, leave a note & I'll write up a new section in the guide for it. Regardless of how you choose to do this, you do not need to set up a 2nd Steam account & buy a 2nd copy of ARK, to download a 2nd installation of ARK (on the same computer, anyways, but ARK must obviously be installed to each computer), or to be a Martian ninja for this to work. The 1st thing you must do is decide which of the 3 methods you want to be able to do & install accordingly. If you want to be able to host & play from any computer you set up to do either, then you must install the standard Steam & ARK clients on each computer. You can even use the same Steam account for the host & 1 client to run at the same time, whether on the same PC or separate PC's! However, if you intend to use a dedicated server with no ability to play the game from that PC, then I suggest installing the ARK Dedicated Server tool to that PC instead of the full client because the dedicated server uses about 1/10 the space (6.5GB instead of 60+GB). Next, you must know how to create a simple .bat file (called a batch file). Skip to the next paragraph if you already know how. If you don't already know how, I suggest downloading & using Notepad++ to do so, though any text editing program like Notepad, Wordpad, Microsoft Word, or the OpenOffice/LibreOffice versions will work fine. How to create a .bat file will vary slightly depending on which program you use. For Notepad++: Create a new file (if you never used it before, a new file is opened by default), put the contents in it (I will explain those in the next section), then either hit CTRL + S or click File (in the top-left corner) then Save, then give the file a name which ends with .bat & select "Batch file" in the "Save as type" dropdown box, then hit save. For plain Notepad (included with Windows): Basically do the exact same thing but select "All files" in the "Save as type" dropdown box. For MS Word (which I don't suggest for this because it's more complicated, but the resulting .bat file will be the same): You must first save it as a plain text document (select "Plain Text" in the "Save as type" dropdown"), then you must use Windows Explorer to navigate to where you saved the file & change its extension (.txt) to .bat. If you can't see the .txt extension at the end of the file's name, Google "Windows show file extensions" for how to fix it. For any others, I haven't used them in a loooooong time so you must figure them out yourself (probably using Google). What to put in the .bat file Here is an example of a basic batch file for a default installation of Steam & ARK (do not include the < & >, only what is between them): < "C: Program Files (x86) Steam steamapps common ARK ShooterGame Binaries Win64 ShooterGameServer.exe" "TheIsland?listen" > If you're using the dedicated server tool instead of the standard game client, the default path would be: < "C: Program Files (x86) Steam steamapps common ARK Survival Evolved Dedicated Server ShooterGame Binaries Win64 ShooterGameServer.exe" "TheIsland?listen" > Those will work for a default installation of Steam & either the ARK client or dedicated server tool on a 64-bit version of Windows (I believe I read ARK will only work on 64-bit operating systems), but they are also very basic. For example, here is mine, though I'm adding extra line-breaks so it is easier for you to identify each individual command: < @ECHO OFF ECHO Do NOT close this window! It will close automatically after you close the ARK server window by pressing CTRL + C in it. ECHO Launching ARK server... CD /D C: Games Steam steamapps common ARK ShooterGame Binaries Win64 ShooterGameServer.exe "TheIsland?listen" -useallavailablecores -usecache -NoBattlEye -insecure -noantispeedhack -automanagedmods EXIT > My .bat file wouldn't work as-is for most people, but it would work fine if you changed the path on the CD line to point to the same folder in your ARK directory. Using the options I use to launch my ARK server reduced the time it takes to launch it by about 5 minutes on average. When I initially set up the dedicated server & launched it with only the default options, it took about 11-12 minutes to launch the server despite the fact it was barely using any of the potential of my PC's CPU, RAM, or HDD. CPU usage was under 10%, RAM would slowly fill up to about 6 of 8 GB capacity, HDD would only be transferring about 10-20MB/s on average (despite my HDD array being able to transfer up to 150MB/s). After setting the options I did, it now takes about 5-7 minutes to load most of the time, never even takes 8 minutes, and sometimes (for some reason I can't yet explain) will load in about 2.5-3 minutes. Another benefit to using a dedicated server is, despite however long the server takes to load, clients take MUCH less time to load. For example, it took around 3-4 minutes to load my game (not from initial launch of the game but from when I tried to load my save) when I initially played using single-player, but now my client takes around 25-30 seconds to load from when I initiate the connection to the server. How long depends on the client PC's hardware. There are many more options to alter how your server loads & how the game works after it is launched, and there are 2 ways to implement these changes. The easy way (because you're already creating the .bat file) is to add them as extra arguments in the .bat file. They can also be added to the GameUserSettings.ini file (located under your Steam folder in ARK ShooterGame Saved Config WindowsServer) as separate lines under the ServerSettings section, which is the method I prefer. Check the official ARK wiki for a complete list of the options (http://ark.gamepedia.com/Server_Configuration). When I first added options to my server, I added them to the .bat file because there was some confusion & disagreement online about which .ini file in which folder would actually be used to alter the launch options of a dedicated server. After launching it once, I found it added the options in the .bat to the GameUserSettings.ini file I mentioned above, so I took them out of the .bat file to see if the server would read them from the .ini file and it did. An option I knew I would love the moment I saw it was ShowFloatingDamageText=True. If you add it to the GameUserSettings.ini file, you add it as its own line under the ServerSettings section exactly as I wrote it. If you want to do the easy method of adding it to the .bat file, then add it after the "TheIsland?listen" in your file & put a ? in front of it, so the line would look like this: < CD /D C: Program Files (x86) Steam steamapps common ARK ShooterGame Binaries Win64 ShooterGameServer.exe "TheIsland?listen?ShowFloatingDamageText=True" -useallavailablecores -usecache -NoBattlEye -insecure -noantispeedhack > How you know what to do is by how they show it on the wiki. If the wiki shows the command with a ? before it (?PvPDinoDecay=True, ?NonPermanentDiseases=True, etc), then add it inside the quotes to the end of the text string which contains "TheIsland?listen". If the wiki shows the command begin with a - (-UseAllAvailableCores, -UseCache, etc), then add it with a space before it to the end of the line which contains the text string "TheIsland?listen". Also, I just realized I don't know if it would work if you put the options beginning with a - in your GameUserSettings.ini file. I believe they MUST be added at the end of the line in your .bat file. Modding Your Server If you want to mod your server, you must do a few things. The order you do them doesn't particularly matter, and from what I can tell it also doesn't matter if you launch the server without fully setting it up as the server will launch normally. Though, as I said above, setting it up incorrectly can cause other problems like your server appearing to launch but never being accessible. So how to add mods? 1 - Add -automanagedmods to the .bat file. See the example I gave of my .bat file above. 2 - Find mods in the Steam Workshop. 3 - Add the mod ID's to the ARK ShooterGame Saved Config WindowsServer GameUserSettings.ini file under the ServerSettings section. Mods & map mods (don't use map mods myself so don't ask me how to identify them) use separate lines. Search your GameUserSettings.ini file to see if the lines are already there, if not add them: ActiveMods=821530042,1134943864 ActiveMapMod=0 Replace the mod ID's above with whatever your mod ID's are, those are simply the examples. Put a comma between each mod ID. There are several methods to find the mod ID's. If your Steam client is configured to show the web address, then you can find the mod ID at the end of the line. To show the address bar, open Steam Settings, go to the Interface category, & check the box for "Display Steam URL address bar when available". That is the best method because you will know which mod ID's belong to which mods, but you can alternatively pull the ID's from the files. To do so, look in the ARK ShooterGame Content Mods folder. The folders directly under it will be named with each mod ID you subscribed to through the Steam Workshop. You can possibly identify which folder (and therefore mod ID) belongs to which mod if you look at the files/subfolders for something you recognize, but no guarantee. 4 - Each client must subscribe to the mods you install to the server. When playing single-player, the client specifically sets which mods they want active before loading the game. When playing as a client to another host, the person needs only subscribe to the mods & the ARK client will auto-activate them when you join the server. Opening your server for internet friends If you know how to open ports in your firewall, then you need only grab the ports below & point them at your PC hosting the ARK server. Continue reading if you don't know how to do it. With the server up & running, we must open ports for clients (any computer not hosting the server but will connect to play) to join. Depending on how your computer is set up, you may or may not need to open ports in your computer's firewall. In most configurations, Windows will make it easy by asking if you want to allow a new program access to the internet the 1st time it's started, if the program requests internet access. If not, Google how to open a firewall port for the operating system you're running. With all that done, your ARK server will now be accessible to anybody in your LAN (basically, any computer connected to the same router you are). You must now open ports in your router to allow friends from over the internet to join. The ports you need are: UDP ports 7777, 7778, & 27015 TCP port 27020 TCP port 27020 is used for the RCON remote server console, so it is optional if you are hosting your server locally, have physical access to the computer hosting the server, and the computer has a monitor & keyboard. However, if the server is located elsewhere or, for whatever reason, you must connect remotely to it using RCON, then TCP port 27020 becomes a necessity. Port 27015 allows your friends to see the game exists when they try to join through Steam. Ports 7777 & 7778 are required for the ARK server to talk to ARK clients so they can play on the server, though I read somewhere port 7778 may not be necessary (I have not confirmed this yet). Okay, so those are the ports you must open, but you don't simply open a port in your router; you must point it somewhere. In this example, they must be pointed at your ARK server. You have several options to do this. The easiest method can only be done if your router allows a port to be forwarded to a computer by host name istead of IP address, but not many can do this. The next 2 best methods are to either set your PC to a static IP address (this could cause problems if you don't configure your router appropriately because 2 computers could end up with the same IP address) or to configure your router to always give the same IP address to the PC which is hosting your ARK server, typically called something similar to DHCP reservation, DHCP static lease, static IP lease, etc. As stated above for opening ports, there are too many routers for me to explain how to do so here. For DHCP reservation (the method I prefer): Looking at portforward.com, I don't think they have a guide on setting this up, so you must Google how to do so for your router. After you find the appropriate interface in your router to do this, you need to know how it sets the lease & which computer is hosting the ARK server to give the static lease to. The router will either want a host name or MAC address, though some make it easy to select by allowing you to pick a computer which is already connected to the router. However, you still need to know which PC is the ARK host. An easy way to identify this is to go to the computer which will host the server, open a CMD prompt (easiest way is to press the Windows key + R to open a Run prompt, then type CMD & hit enter), type ipconfig /all, then find the Host Name, IP address (preferably IPv4), & MAC address (Windows calls this the "Physical address", it is 6 sets of 2 characters each like this: 01-25-3F-95-1C-GF) for whichever connection is active. It will most likely be under either "Ethernet adapter Local Area Connection:" or "Wireless adapter Local Area Connection:". Depending on what router you're using, some require the static IP lease to be made within the DHCP range and some require it to be outside of it. For a static IP configuration: PortForwarding.com has a guide which explains how to set up a static IP address for many operating systems. If you configure your PC to have a static IP address instead of using DHCP reservation, then you must ensure the IP address you give your PC is NOT within the DHCP address range of your router. Doing so will prevent the earlier mentioned issue of 2 PC's getting the same IP address. Unfortunately, different routers use different default DHCP ranges which could potentially be any IP address on the network, so I can't tell you any specific IP address which is always safe to use. You must find the DHCP range of your router. You should now be all set up, so the only thing left to do is get your clients connected to your server! Connecting to the server The easiest method is to add the ARK server to your steam servers. Depending on your Steam interface.... Click View on the menu at the top of Steam, then click Servers, then click the Favorites tab, then "Add a server", then type the IP address of the server, then click "Add this address to favorites". If you don't have View at the top of your Steam window, I'm guessing you have the 3 horizontal bars menu, which I believe has the Servers option directly under it. The rest is the same. However, what IP address you put in depends on where somebody is connecting from and how you set this part up. If you are connecting from within the LAN, you can & should use the local IP address. Doing so will provide you with the fastest connection and won't cause your connection to go outside your LAN & then back in (which means it would be picked up by your ISP, limited by your internet bandwidth, & count against any data usage limits you have). If somebody is connecting from outside your LAN, they need your external IP address assigned to you by your ISP (internet service provider). You can either use whatismyip.com (or some other similar website) to get your external IP address & give it to them or set up a dynamic DNS (DDNS) address using a DDNS service & give them the host name you create. The IP address assigned to you by your ISP can change periodically for various reasons. Mine has been the same for several years, but changed a few days back. If your IP address changes, you must check it & give it to your friends again if you don't set up a DDNS host name. If you set up a DDNS host name, you simply give your friends the host name, which will never change unless you change it. Many DDNS services are free, but they have different benefits, options, & restrictions. I use dtdns.com, but I also have my router configured to be able to update my DDNS service to reflect my new external IP address if it changes. Most routers will only offer you 1 or 2 DDNS service providers, if any, but they are usually the "most popular" providers (read: you must pay for their services :/ ). If your router doesn't have the ability to automatically update your external IP address with your DDNS provider, then you must do it manually if your external IP address changes (read: when your friends say they can't connect so you went to whatismyip.com & see it has changed). Again, there are many DDNS providers so I won't explain how to do so with each. Your DDNS provider should tell you how to do so with them. The End You should now have a working .bat file to launch your server without setting up a 2nd Steam account or buying a 2nd copy of ARK or trying to figure out how to use SteamCMD or downloading a 2nd installation of ARK to allow you to host & play at the same time. You should also now know how to configure ports on your computer & router, set up a static IP address or DHCP reservation, get your external IP address, and possibly set up a DDNS service. If you have any problems, questions, or suggestions, let me know!