该游戏用Linux搭建难度要复杂很多且稳定性不足,建议用Windows搭建

一、系统准备

需要最低2核4G配置的Windows服务器,系统选择为Windows server 2019或者Windows server 2022

云服务器开启UDP8766, 27015 和 27016端口

二,安装steamcmd并下载游戏

1.用服务器浏览器下载steamcmd后解压压缩包并双击运行steamcmd,会自动下载steamcmd

2.设置游戏安装目录(桌面路径)

force_install_dir C:\Users\Administrator\Desktop\Forest

3.匿名登录steam(国内服务器搭建可能存在登录不了的现象,重新启动服务器后重试有大概率成功)

login anonymous

4.下载The Forest游戏(下载完×掉窗口)

app_update 556450 validate

三、配置文件

1.去游戏目录运行TheForestDedicatedServer.exe等个10秒左右就叉掉

2.打开文件夹上面的查看→勾选上隐藏的目录

3.进入C:\Users\Administrator\AppData\LocalLow\SKS\TheForestDedicatedServer\ds目录

4.双击编辑server.cfg

5.修改以下参数(ip填写内网IP,别用公网IP,The Forest Games为服务器名称,自行修改需要用英文)

serverIP 127.0.0.1

serverName The Forest Games

howLogs on

6.配置文件翻译(on和off可自行修改,设置密码前要空格)

serverIP 192.168.0.1
// 服务器的IP地址。如果你使用路由器,请注意这是内部地址,你需要配置端口转发。

serverSteamPort 8766
// Steam通信端口。如果你使用路由器,请注意需要打开该端口。

serverGamePort 27015
// 游戏通信端口。如果你使用路由器,请注意需要打开该端口。

serverQueryPort 27016
// 查询通信端口。如果你使用路由器,请注意需要打开该端口。

serverName The Forest Game
// 服务器显示名称。

serverPlayers 4
// 最大玩家数量。

enableVAC on
// 是否启用VAC(Valve反作弊系统)。

serverPassword
// 服务器密码。留空表示没有密码。

serverPasswordAdmin
// 服务器管理员密码。留空表示没有密码。

serverSteamAccount
// 你的Steam账号名称。留空表示匿名。

serverAutoSaveInterval 30
// 服务器自动保存间隔时间(以分钟为单位)。最小间隔时间为15分钟,默认时间为30分钟。

difficulty Normal
// 游戏难度模式。可选择Peaceful、Normal或Hard。

initType Continue
// 开始新游戏或继续游戏。可选择New或Continue。

slot 1
// 保存游戏的槽位。可选择1、2、3、4或5。

showLogs on
// 是否显示事件日志。

serverContact [\[email protected\]](https://lonelyxm.com/cdn-cgi/l/email-protection)
// 服务器管理员的联系邮箱。

veganMode off
// 无敌模式。关闭表示允许敌人存在。

vegetarianMode off
// 白天无敌模式。关闭表示白天允许敌人存在。

resetHolesMode off
// 加载游戏时是否重置所有结构洞。

treeRegrowMode off
// 睡觉时是否重新长出被砍倒的树木的10%。

allowBuildingDestruction on
// 是否允许建筑被破坏。

allowEnemiesCreativeMode off
// 是否允许创意模式中存在敌人。

allowCheats off
// 是否允许客户端使用内置的调试控制台。

realisticPlayerDamage off
// 对战其他玩家时是否使用全武器伤害值。

saveFolderPath
// 自定义保存游戏槽位的文件夹路径。留空表示使用默认位置。

targetFpsIdle 5
// 当没有客户端连接时的目标帧率。

targetFpsActive 60
// 当至少有一个客户端连接时的目标帧率。

四、常见问题

1.物理内存不足报错或者闪退

Log: InitMaterial Starfield
Error: Couldn't extract exception string from exception (another exception of class 'OutOfMemoryException' was thrown while processing the stack trace)
Exception:
Error: Couldn't extract exception string from exception (another exception of class 'OutOfMemoryException' was thrown while processing the stack trace)
Exception:

解决方法:需要调整虚拟内存(最小值8000,最大值16000)