Giter Club home page Giter Club logo

smapidedicatedservermod's Introduction

SMAPI Dedicated Server Mod for Stardew Valley

This mod provides a dedicated (headless) server for Stardew Valley, powered by SMAPI. It turns the host farmer into an automated bot to facilitate multiplayer gameplay.

Configuration File

Upon running SMAPI with the mod installed for the first time, a config.json file will be generated in the mod's folder. This file specifies which farm will be loaded on startup, farm creation options, host automation details, and other mod configuration options. Default values will be provided, which can then be modified. Here is an overview of the available settings:

Startup options

  • FarmName: The name of the farm. If a farm with this name exists, it will automatically be loaded and hosted for co-op. Otherwise, a new farm will be created using the specified farm creation options and then hosted for co-op.

Farm Creation Options

  • StartingCabins: The number of starting cabins for the farm. Must be an integer in {0, 1, 2, 3}.
  • CabinLayout: Specifies the starting cabin layout. Options are "nearby" or "separate".
  • ProfitMargin: The farm's profit margin. Options are "normal", "75%", "50%", and "25%".
  • MoneyStyle: Determines whether money is shared or separate among farmers. Options are "shared" or "separate".
  • FarmType: The type of farm. Options include "standard", "riverland", "forest", "hilltop", "wilderness", "fourcorners", and "beach".
  • CommunityCenterBundles: The community center bundle type. Options are "normal" or "remixed".
  • GuaranteeYear1Completable: Set to true or false to determine if the community center should be guaranteed completable during the first year.
  • MineRewards: The mine rewards type. Options are "normal" or "remixed".
  • SpawnMonstersOnFarmAtNight: Set to true or false to determine if monsters should spawn on the farm at night.
  • RandomSeed: An optional integer specifying the farm's random seed.

Host Automation Options

  • AcceptPet: Set to true or false to determine if the farm pet should be accepted.
  • PetSpecies: The desired pet species. Options are "dog" or "cat". Irrelevant if AcceptPet is false.
  • PetBreed: An integer in {0, 1, 2} specifying the pet breed index. 0 selects the leftmost breed; 1 selects the middle breed; 2 selects the rightmost breed. Irrelevant if AcceptPet is false.
  • PetName: The desired pet name. Irrelevant if AcceptPet is false.
  • MushroomsOrBats: Choose between the mushroom or bat cave. Options are "mushrooms" or "bats" (case insensitive).
  • PurchaseJojaMembership: Set to true or false to determine if the automated host should "purchase" (acquire for free) a Joja membership when available, committing to the Joja route. Defaults to false.

Additional Options

  • EnableCropSaver: Set to true or false to enable or disable the crop saver feature. When enabled, seasonal crops planted by players and fully grown before the season's end are guaranteed to give at least one more harvest before dying. For example, a spring crop planted by a player and fully grown before Summer 1 will not die immediately on Summer 1. Instead, it'll provide exactly one more harvest, even if it's a crop that ordinarily produces multiple harvests. Defaults to true.

Host Options

  • MoveBuildPermission: Changes farmhands permissions to move buildings from the Carpenter's shop. Is set each time the server is started and can be changed in the game. Set to off to entirely disable moving buildings, set to owned to allow farmhands to move buildings that they purchased, or set to on to allow moving all buildings.

In Game Command

All commands in the game must be sent privately to the player ServerBot. For example, you must write the following /message ServerBot MoveBuildPermission on.

Commands

Command Description Parameters Alias
build Build a cabin in front of player on the farm. - building_name: The type of cabin to construct. Valid options are "stone_cabin," "plank_cabin," and "log_cabin." -
demolish Demolish a structure in front of player on the farm. - -
invisible Toggle the visibility of the host character. - -
pause Pause or resume the game. - -
movebuildpermission Change the move build permission setting for the server. - parameter: The new move build permission setting. Valid options are: off to entirely disable moving buildings, owned to allow farmhands to move buildings that they purchased, on to allow moving all buildings movepermissiong, mbp

Running the Server on Linux Without GUI

This mod can be run without the use of a GUI. To start the game, you must enter the following command:

xvfb-run -a "$HOME/GOG Games/Stardew Valley/game/StardewModdingAPI"

You can shut down the server from the started terminal session by pressing Control-C. From another terminal session, you can send Control-C with kill -SIGINT .....

ps -aux | grep StardewModdingAPI
kill -SIGINT ....

Development

If Stardew Valley was not installed in the default path, the installation path must be added to the project file DedicatedServer.csproj. Add the path with the tag GamePath to the PropertyGroup. Depending on the path, it should look something like this:

  <PropertyGroup>
    <TargetFramework>net5.0</TargetFramework>
    <GamePath>D:\SteamLibrary\steamapps\common\Stardew Valley</GamePath>
  </PropertyGroup>

smapidedicatedservermod's People

Contributors

objectmanagermanager avatar dailyxcz avatar chris82111 avatar reyqn avatar xraverx avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.