Linux系统下的搭建
首先我们需要准备一台linux系统服务器,(win也可以最后更新win教程了,更简单!),不论是
CPU | 4 Cores (recommend) |
RAM | 16GBRecommend over 32GB for stable operation.It is possible to start the server with 8 GB, but the further you play, the server will crash due to out of memory. |
Network | UDP Port 8211 (Default) Port forwarding required. |
一、开始安装 SteamCMD
steamcmd我们可以理解它是用命令行界面来安装、更新、运行steam专用服务的东西。(瞎编的
1.切换到root创建一个名为
su -
sudo useradd -m steam
sudo passwd steam
切到root
新建steam用户
设置密码
2.进入用户目录
sudo -u steam -s
cd /home/steam
3.手动安装steamcmd
①首先安装依赖yum install glibc.i686 libstdc++.i686
②创建Steam文件夹并进入mkdir ~/Steam && cd ~/Steam
③下载并解压SteamCMDcurl -sqL "
https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
" | tar zxvf -
二、运行 SteamCMD并登录
手动运行:进入Steam文件夹cd ~/Steam
,执行./steamcmd.sh
,将会自动更新SteamCMD,等待终端变为steam>
即可,不要退出。紧接着在steam>
下匿名登录:login anonymous
等待5秒执行完成。
三、下载并运行Pal服务
- 还是在
steam>
下app_update 2394010 validate
,下载完成后quit
退出。 - 有个报错,我们设置一下steamclient.so文件的软链接,
cd ~
到steam用户根目录,创建sdk64文件夹mkdir -p ~/.steam/sdk64/
,链接文件ln -s ~/Steam/linux64/steamclient.so ~/.steam/sdk64/steamclient.so
- 进入Pal目录
cd ~/Steam/steamapps/common/PalServer
,运行Pal./PalServer.sh
。出现[.steam/sdk64/steamclient.so OK. (First tried local ‘steamclient.so’)]不用问,后面有问题也可以排除steamclient.so的原因。
- 防止终端关闭pal服务也中断了,我们使用screen命令来新建一个窗口会话
- 新建:
screen -S pal ,在该窗口下运行pal服务,成功后,CTRL+A 再按D ,会自动退掉,这样服务就在后台运行了。 screen -r pal ,调出pal会话窗口,如果出现问题调不出请screen -d -r pal ,就可以了。
四、进入游戏连接你的Pal专用服务器吧!
进入游戏选加入多人游戏(专用服务器),在最下的这里
Windows系统下的搭建
windows系统下安装非常简单
一、下载steamcmd并运行
下载steamcmd:https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip
- 在硬盘根目录创建一个文件夹
steamcmd
把刚才下载好的文件解压到这里 - 在这个文件夹空白处shift+右键,选择在此处打开运行窗口,输入
steamcmd
这时会下载更新文件,等待终端变成steam>
- 在
steam>
后输入login anonymous
很快大概三四秒,执行完后下载palapp_update 2394010 validate
,多等一会这里会下载加校验。确定完成后quit退出。
二、启动palserver
我们进入steam\steamapps\common\PalServer文件夹,直接双击PalServer.exe文件就成功运行了,可右键发送到桌面快捷方式,方便后续重启。
- 可能会遇到的一些问题:
- pal运行了但是游戏客户端连接网络失败:请确认8211 udp规则放行,然后打开你的win服务器终端,输入netstat -ano,回车查看有没有0.0.0.0:8211,没有的话win添加防火墙8211 udp出入站规则。
- 打开pal文件时提示报错,缺少运行库。安装下面两个即可:
- DirectX Repair:https://www.123pan.com/s/YXh9-IZuPH.html提取码:CwAT,分享有效期30天
- 运行库合集:https://www.123pan.com/s/YXh9-gZuPH.html提取码:6xFS,分享有效期30天
更新V0.1.3
今天有些小伙伴问我怎么更新,其实就是下载pal的步骤重新执行一遍。
WIN
在STEAMCMD文件夹,双击打开steamcmd.exe等待终端变成steam>
,然后输入login anonymous
,执行好后再输入app_update 2394010 validate
,更新完就可以退出了,然后重新打开palserver.exe就行
LINUX
进入Steam文件夹cd ~/Steam
,执行./steamcmd.sh
,等待终端变为steam>
。紧接着输入:login anonymous
等待执行完成。还是在steam>
下app_update 2394010 validate
,下载完成后quit
退出。
然后重新去运行pal就可以了(进入Pal目录cd ~/Steam/steamapps/common/PalServer
,运行Pal./PalServer.sh
)。
Palserver 设置项
一、设置服务器名称、密码等基础设置
Windows配置文件位置
steamapps/common/PalServer/Pal/Saved/Config/WindowsServer/PalWorldSettings.ini
Linux配置文件位置
steamapps/common/PalServer/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini
默认设置:
; This configuration file is a sample of the default server settings.
; Changes to this file will NOT be reflected on the server.
; To change the server settings, modify Pal/Saved/Config/WindowsServer/PalWorldSettings.ini.
[/Script/Pal.PalGameWorldSettings]
OptionSettings=(Difficulty=None,DayTimeSpeedRate=1.000000,NightTimeSpeedRate=1.000000,ExpRate=1.000000,PalCaptureRate=1.000000,PalSpawnNumRate=1.000000,PalDamageRateAttack=1.000000,PalDamageRateDefense=1.000000,PlayerDamageRateAttack=1.000000,PlayerDamageRateDefense=1.000000,PlayerStomachDecreaceRate=1.000000,PlayerStaminaDecreaceRate=1.000000,PlayerAutoHPRegeneRate=1.000000,PlayerAutoHpRegeneRateInSleep=1.000000,PalStomachDecreaceRate=1.000000,PalStaminaDecreaceRate=1.000000,PalAutoHPRegeneRate=1.000000,PalAutoHpRegeneRateInSleep=1.000000,BuildObjectDamageRate=1.000000,BuildObjectDeteriorationDamageRate=1.000000,CollectionDropRate=1.000000,CollectionObjectHpRate=1.000000,CollectionObjectRespawnSpeedRate=1.000000,EnemyDropItemRate=1.000000,DeathPenalty=All,bEnablePlayerToPlayerDamage=False,bEnableFriendlyFire=False,bEnableInvaderEnemy=True,bActiveUNKO=False,bEnableAimAssistPad=True,bEnableAimAssistKeyboard=False,DropItemMaxNum=3000,DropItemMaxNum_UNKO=100,BaseCampMaxNum=128,BaseCampWorkerMaxNum=15,DropItemAliveMaxHours=1.000000,bAutoResetGuildNoOnlinePlayers=False,AutoResetGuildTimeNoOnlinePlayers=72.000000,GuildPlayerMaxNum=20,PalEggDefaultHatchingTime=72.000000,WorkSpeedRate=1.000000,bIsMultiplay=False,bIsPvP=False,bCanPickupOtherGuildDeathPenaltyDrop=False,bEnableNonLoginPenalty=True,bEnableFastTravel=True,bIsStartLocationSelectByMap=True,bExistPlayerAfterLogout=False,bEnableDefenseOtherGuildPlayer=False,CoopPlayerMaxNum=4,ServerPlayerMaxNum=32,ServerName="Default Palworld Server",ServerDescription="",AdminPassword="",ServerPassword="",PublicPort=8211,PublicIP="",RCONEnabled=False,RCONPort=25575,Region="",bUseAuth=True,BanListURL="https://api.palworldgame.com/api/banlist.txt")
比如要修改服务器名称,最后找到(ctrl+f查找)ServerName="神奇宝贝大师"
添加管理员密码和服务器密码是紧随其后的两个:AdminPassword="",ServerPassword=""
大家英文基础比我高,看着改就可以。
目前无论我们做的是什么参数修改,都要先关掉pal服务,再修改保存文件。重新运行PalServer.exe文件。Linux则是重新运行pal服务;./PalServer
二、官方提供的配置参数,平衡游戏
配置名称(查找此列) | 配置介绍 | 谷歌翻译 |
---|---|---|
Difficulty | Difficulty | 难度(不用修改,直接改其他值即可) |
DayTimeSpeedRate | Day time speed | 白天流逝速度 |
NightTimeSpeedRate | Night time speed | 夜晚流逝速度 |
ExpRate | EXP rate | 经验值倍率 |
PalCaptureRate | Pal capture rate | 捕获概率倍率 |
PalSpawnNumRate | Pal appearance rate | 帕鲁出现数量倍率(会导致游戏性能下降) |
PalDamageRateAttack | Damage from pals multipiler | 帕鲁攻击伤害倍率 |
PalDamageRateDefense | Damage to pals multipiler | 帕鲁承受伤害倍率 |
PlayerDamageRateAttack | Damage from player multipiler | 玩家攻击伤害倍率 |
PlayerDamageRateDefense | Damage to player multipiler | 玩家承受伤害倍率 |
PlayerStomachDecreaceRate | Player hunger depletion rate | 玩家饱食度降低倍率 |
PlayerStaminaDecreaceRate | Player stamina reduction rate | 玩家耐力降低倍率 |
PlayerAutoHPRegeneRate | Player auto HP regeneration rate | 玩家HP自动恢复倍率 |
PlayerAutoHpRegeneRateInSleep | Player sleep HP regeneration rate | 玩家睡眠HP自动恢复倍率 |
PalStomachDecreaceRate | Pal hunger depletion rate | 帕鲁饱食度降低倍率 |
PalStaminaDecreaceRate | Pal stamina reduction rate | 帕鲁耐力降低倍率 |
PalAutoHPRegeneRate | Pal auto HP regeneration rate | 帕鲁HP自动恢复倍率 |
PalAutoHpRegeneRateInSleep | Pal sleep health regeneration rate (in Palbox) | 帕鲁睡眠HP恢复倍率(终端里) |
BuildObjectDamageRate | Damage to structure multipiler | 对建筑伤害倍率 |
BuildObjectDeteriorationDamageRate | Structure determination rate | 建筑物的劣化速度倍率 |
CollectionDropRate | Getherable items multipiler | 道具采集量倍率 |
CollectionObjectHpRate | Getherable objects HP multipiler | 可采集物品生命值倍率 |
CollectionObjectRespawnSpeedRate | Getherable objects respawn interval | 可采集物品刷新间隔 |
EnemyDropItemRate | Dropped Items Multipiler | 道具掉落量倍率 |
DeathPenalty | Death penalty None : No lost, Item : Lost item without equipment, ItemAndEquipment : Lost item and equipment, All : Lost All item, equipment, pal(in inventory) | 死亡掉落None : 不掉落任何, Item : 掉落装备以外的道具, ItemAndEquipment : 掉落所有道具, All : 掉落所有物品、帕鲁 |
GuildPlayerMaxNum | Max player of Guild | 公会人数上限 |
PalEggDefaultHatchingTime | Time(h) to incubate massive egg | 帕鲁蛋孵化时间(h) |
ServerPlayerMaxNum | Maximum number of people who can join the server | 服务器最多可加入的人数 |
ServerName | Server name | 主机名字 |
ServerDescription | Server description | 主机描述 |
AdminPassword | AdminPassword | 管理员密码 |
ServerPassword | Set the server password. | 服务器密码 |
PublicPort | Public port number | 公共端口号 |
PublicIP | Public IP | 公共ip |
RCONEnabled | Enable RCON | 启用RCON |
RCONPort | Port number for RCON | RCON 的端口号 |
三、管理员服务器命令
我们上面设置的AdminPassword
这里要派上用场了,通过在游戏内输入/AdminPassword 你的密码
后可以看到左边有提示。下面可以执行服务器管理员操作了,比如封禁玩家,踢出玩家,传送到指定玩家位置等。
管理员命令 | 命令描述 | 谷歌翻译 |
---|---|---|
/Shutdown {Seconds} {MessageText} | The server is shut down after the number of Seconds Will be notified of your MessageText. | 服务器在秒数后关闭将收到您的消息文本通知。 |
/DoExit | Force stop the server. | 强制停止服务器。 |
/Broadcast {MessageText} | Send message to all player in the server. | 向服务器中的所有玩家发送消息。 |
/KickPlayer {SteamID} | Kick player from the server. | 将玩家从服务器中踢出。 |
/BanPlayer {SteamID} | BAN player from the server. | 从服务器禁止玩家。 |
/TeleportToPlayer {SteamID} | Teleport to current location of target player. | 传送到目标玩家的当前位置。 |
/TeleportToMe {SteamID} | Target player teleport to your current location | 目标玩家传送到您当前的位置 |
/ShowPlayers | Show information on all connected players. | 显示所有已连接玩家的信息。 |
/Info | Show server information. | 显示服务器信息。 |
/Save | Save the world data. | 保存世界数据。 |
参考文档:
- https://tech.palworldgame.com/dedicated-server-guide
- https://developer.valvesoftware.com/wiki/SteamCMD
幻兽帕鲁修改器
风灵月影:
!!内存泄漏高CPU负载修复!!
Linux
先停掉pal服务
- 我们cd进入你的:/home/steam/Steam/steamapps/common/PalServer/Pal/Binaries/Linux文件夹
- 然后备份PalServer-Linux-Test文件:
mv PalServer-Linux-Test PalServer-Linux-Test.bak
- 下载大佬修复过的原文件:
wget
https://hub.fgit.cf/VeroFess/PalWorld-Server-Unoffical-Fix/releases/download/1.3.0-Update-3/PalServer-Linux-Test-Patch-Update-3
(这里使用的github镜像网站hub.fgit.cf
,因为国内服务器可能连不上) - 重命名刚才下载的文件为正确文件名:
mv PalServer-Linux-Test-Patch-Update-3 PalServer-Linux-Test
- 我们现在再去运行palserver就行了