Linuxgsm: RustServer: Random seed not random

Created on 3 Jun 2020  ·  6Comments  ·  Source: GameServerManagers/LinuxGSM

OS: Ubuntu server 18.04
latest version of LGSM

I have a rust server well 4, none of which will generate a random seed is I leave seed to “” I just gens the same map over and over.
./rustserver wipe and ./rustserver wipeall does not change the map seed

`##################################
######## Instance Settings ########
##################################

PLACE INSTANCE SETTINGS HERE
These settings will apply to a specific instance
Server Settings
Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters
More settings available after install in serverfiles/server/rust-server/server.cfg
ip=“69.69.69.69”
port=“28023”
rconport=“28024”
rconpassword=“nope”
rconweb=“1” # Value is: 1 for Facepunch’s web panel; 0 for RCON tools like Rusty or Rustadmin
servername=“Test Server”
maxplayers=“2”

Advanced Start Settings
seed="" # default random; range : 1 to 2147483647 ; used to change or reproduce a procedural map
salt="" # default random; range : unknown range ; used to recover a known setting from an existing map
worldsize=“1000” # default 3000; range : 1000 to 6000 ; map size in meters
saveinterval=“300” # Auto-save in seconds
tickrate=“100” # default 30; range : 15 to 100

Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
fn_parms(){

Specific to Rust
if [ -n “${seed}” ]; then
# If set, then add to start parms
conditionalseed="+server.seed ${seed}"
else
# Keep randomness of the number if not set
conditionalseed=""
fi
if [ -n “${salt}” ]; then
# If set, then add to start parms
conditionalsalt="+server.salt ${salt}"
else
# Keep randomness of the number if not set
conditionalsalt=""
fi
parms="-batchmode +server.ip ${ip} +server.port ${port} +server.tickrate ${tickrate} +server.hostname "${servername$
}

LinuxGSM Settings
Notification Alerts
(on|off)
Display IP | https://docs.linuxgsm.com/alerts#display-ip
displayip=""

More info | https://docs.linuxgsm.com/alerts#more-info
postalert=“off”
postdays=“7”
posttarget=“https://hastebin.com”

Discord Alerts | https://docs.linuxgsm.com/alerts/discord
discordalert=“off”
discordwebhook=“webhook”

Email Alerts | https://docs.linuxgsm.com/alerts/email
emailalert=“off”`
Atomic Rust bug

Most helpful comment

there is a workaround:
put this into command_wipe.sh

newseed=$((1 + RANDOM*RANDOM % 2147483647))
sed -i -e ‘17c\seed="’"$newseed"’"’ /home/rustserver/lgsm/config-lgsm/rustserver/rustserver.cfg

just remove the seed section from your rustserver.cfg.
this script will add a new random seed then update to a new random seed when you ./rustserver wipe.

updating LGSM may overwrite this workaround so be aware of that.

All 6 comments

Issue-Label Bot is automatically applying the label type: bug to this issue, with a confidence of 0.78. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

Note: this has never worked properly.

Feature for consideration: log/save previous/new seed numbers so we can go back in an emergency or if players liked a previous map.

there is a workaround:
put this into command_wipe.sh

newseed=$((1 + RANDOM*RANDOM % 2147483647))
sed -i -e ‘17c\seed="’"$newseed"’"’ /home/rustserver/lgsm/config-lgsm/rustserver/rustserver.cfg

just remove the seed section from your rustserver.cfg.
this script will add a new random seed then update to a new random seed when you ./rustserver wipe.

updating LGSM may overwrite this workaround so be aware of that.

Related to #1332

I will be doing this for the next release

has this already been added? if so i might update.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Septembers picture Septembers  ·  3Comments

n0x-io picture n0x-io  ·  3Comments

Frisasky picture Frisasky  ·  3Comments

BarbieQ1 picture BarbieQ1  ·  4Comments

Frisasky picture Frisasky  ·  3Comments