Skip to content

Using a Private Server

Carson edited this page Aug 6, 2023 · 6 revisions

Why a Private Server?

We don't want to push dysfunctional code to MMO, as it can make our bot less efficient or have it stop working entirely. MMO is also slow, and doesn't always provide us with the scenarios we want to test for. Therefore, we need a place to test our code, and a private server works perfectly for this.

Customization

Check out this section once your private server is working.

To enhance our testing, there are various things we can change about our private server environment.

  • The steamless-client to more CPU efficiently view your server from the web, instead of using the steam desktop client
  • Commands to modify the game environment, or to fix server issues
  • (additional) Mods to change server behaviour easily, like mongodb for better performance, konami to change game constants, or market to, well, add a market

Docker Version

The Docker version provides much more control, less bugs, no memory leak and much faster speed than the Steam version. It is strongly suggested to use this instead.

  1. Go to Screeps Server and follow the readme instructions for setting up and running the server. There is also the wonderful Performance Server that has automated testing with milestones - although it isn't ideal for manual testing.
  2. When the server is running, open the top-left navigator and select "Change Password". Then enter your desired password. Alternatively, run setPassword('Username', 'YourDesiredPassword') in the server command line
  3. Open your credentials file in your bot's repo and set up the pserver section with your password and username
  4. You can now run npm run push-pserver from the bot repo directory

With your private server utilized for development, we can start looking at Spawning Into the World

Steam Version (Windows)

Please keep in mind the Steam version is slow, has many bugs, contains a memory leak that will slow the server to a crawl after a few hours, and is hard to customize. It is highly recommended you use the Docker version instead

  1. Start Screeps
  2. Click Private Server
  3. Click Start
  4. Open Server location via CMD (cd C:\Users\<user>\AppData\Local\Screeps\scripts\screeps.com\server
  5. Run npm install screepsmod-auth
  6. In the Screep Server window, click CLI tab
  7. Type setPassword('Username', 'YourDesiredPassword')
  8. Open your credentials file in your bot's repo and set up the pserver section with your password and username
  9. You can now run npm run push-pserver from the bot repo directory
  10. Done :-)

With your private server utilized for development, we can start looking at Spawning Into the World

Clone this wiki locally