Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game settings via command-line arguments #56

Closed
Twinki14 opened this issue Jan 22, 2024 · 9 comments · Fixed by #175
Closed

Game settings via command-line arguments #56

Twinki14 opened this issue Jan 22, 2024 · 9 comments · Fixed by #175
Labels
enhancement New feature or request

Comments

@Twinki14
Copy link
Contributor

Twinki14 commented Jan 22, 2024

This came up in #40 (comment)

Since Palworld uses UE, instead of modifying the PalWorldSettings.ini directly, we should be able to pass in arguments in the start script

This would offer a FAR better alternative than modifying PalWorldSettings.ini directly, and would only really require a new environment variable and documentation, such as INI_ARGS or ARGS

chrome_DIrmpoSWKK

@thijsvanloef
Copy link
Owner

Trying that now!

@thijsvanloef thijsvanloef added the enhancement New feature or request label Jan 22, 2024
@xHyperElectric
Copy link
Contributor

Trying that now!

Any update on if this works?

@thijsvanloef
Copy link
Owner

@xHyperElectric Have not been able to get it working sadly, but I haven't had the time to work on it much.

@MSpreckels
Copy link
Contributor

MSpreckels commented Jan 25, 2024

Hey @thijsvanloef @Twinki14,

I've now been trying all kinds of different versions of the argument for around 2.5hours.

I cannot get it to work. :(

Some of the arguments ive tried:

STARTCOMMAND="${STARTCOMMAND} -ini:Pal:[/Script/Pal.PalGameWorldSettings]:RCONEnabled=True"
STARTCOMMAND="${STARTCOMMAND} -ini:PalWorldSettings:[/Script/Pal.PalGameWorldSettings]:RCONEnabled=True"
STARTCOMMAND="${STARTCOMMAND} -ini:PalGameWorldSettings:[/Script/Pal.PalGameWorldSettings]:RCONEnabled=True"
STARTCOMMAND="${STARTCOMMAND} -ini:Pal.PalGameWorldSettings:[/Script/Pal.PalGameWorldSettings]:RCONEnabled=True"
STARTCOMMAND="${STARTCOMMAND} -ini:PalWorldSettings:RCONEnabled=True"
STARTCOMMAND="${STARTCOMMAND} -ini:PalGameWorldSettings:RCONEnabled=True"
STARTCOMMAND="${STARTCOMMAND} -ini:/palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini:RCONEnabled=True"
STARTCOMMAND="${STARTCOMMAND} -ini:/palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings:RCONEnabled=True"

STARTCOMMAND="${STARTCOMMAND} -ini:Pal:[/Script/Pal.PalGameWorldSettings]:ServerName=TEST_TEST"
STARTCOMMAND="${STARTCOMMAND} -ini:Game:[/Script/Pal.PalGameWorldSettings]:ServerName=TEST_TEST"
STARTCOMMAND="${STARTCOMMAND} -ini:Engine:[/Script/Pal.PalGameWorldSettings]:ServerName=TEST_TEST"
STARTCOMMAND="${STARTCOMMAND} -ini:GameUserSettings:[/Script/Pal.PalGameWorldSettings]:ServerName=TEST_TEST"
STARTCOMMAND="${STARTCOMMAND} -ini:RuntimeOptions:[/Script/Pal.PalGameWorldSettings]:ServerName=TEST_TEST"
STARTCOMMAND="${STARTCOMMAND} -ini:GameplayTags:[/Script/Pal.PalGameWorldSettings]:ServerName=TEST_TEST"
STARTCOMMAND="${STARTCOMMAND} -ini:[/Script/Pal.PalGameWorldSettings]:ServerName=TEST_TEST"
STARTCOMMAND="${STARTCOMMAND} -ini:palworld:[/Script/Pal.PalGameWorldSettings]:ServerName=TEST_TEST"
STARTCOMMAND="${STARTCOMMAND} -ini:/palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini:[/Script/Pal.PalGameWorldSettings]:ServerName=TEST_TEST"
STARTCOMMAND="${STARTCOMMAND} -ini:/palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings:[/Script/Pal.PalGameWorldSettings]:ServerName=TEST_TEST"
STARTCOMMAND="${STARTCOMMAND} -ini://Pal/Saved/Config/LinuxServer/PalWorldSettings.ini:[/Script/Pal.PalGameWorldSettings]:ServerName=TEST_TEST"
STARTCOMMAND="${STARTCOMMAND} -ini://PalWorldSettings:[/Script/Pal.PalGameWorldSettings]:ServerName=TEST_TEST"
STARTCOMMAND="${STARTCOMMAND} -ini:/palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini:ServerName=TEST_TEST"
STARTCOMMAND="${STARTCOMMAND} -ini:/palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings:ServerName=TEST_TEST"

@Twinki14
Copy link
Contributor Author

Hey @thijsvanloef @Twinki14,

I've now been trying all kinds of different versions of the argument for around 2.5hours.

I cannot get it to work. :(

Since the OptionSettings is a full object, try this

-ini:PalGameWorldSettings:[/Script/Pal.PalGameWorldSettings]:OptionSettings=(Difficulty=None,DayTimeSpeedRate=2.0,NightTimeSpeedRate=1.5,ExpRate=0.5,PalCaptureRate=1.2,PalSpawnNumRate=0.8,...)

@MSpreckels
Copy link
Contributor

Right..that would make sense. :D

I'll have a look again tomorrow after work

@MSpreckels
Copy link
Contributor

MSpreckels commented Jan 26, 2024

Hey, IT WORKS....kind of..

I can get it to work with one parameter but as soon as a add a second one or ALL (which made sense to me because thats basically the file via CLI) it will not work anymore.

Currently I've only tried using the RCONEnabled parameter. Next I wanna try to connect to my local server to see if other params are even set.

Here are some things i tried:

# using the default palworldsettings file
# does not work??
#PARAMS='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=True,RCONPort=25575,Region="",bUseAuth=True,BanListURL="https://api.palworldgame.com/api/banlist.txt"'

# works, i can run rcon-cli info
#PARAMS='RCONEnabled=True'

# works
#PARAMS='ServerPlayerMaxNum=1'

# rcon-cli info does not work anymore
#PARAMS='ServerName=Hello World,RCONEnabled=True'

# rcon-cli info does not work anymore
#PARAMS='ServerName="Hello World",RCONEnabled=True'

# rcon-cli info does not work anymore
#PARAMS='ServerName=\"Hello World\",RCONEnabled=True'

# thought it might be the ServerName but doesnt work either
#PARAMS='ServerPlayerMaxNum=1,RCONEnabled=True'

# this works but the ServerName is still "Default Palworld Server"
#STARTCOMMAND="${STARTCOMMAND} -ini:PalWorldSettings:[/Script/Pal.PalGameWorldSettings]:OptionSettings='(ServerName=\"Hello World\")'"
#STARTCOMMAND="${STARTCOMMAND} -ini:PalWorldSettings:[/Script/Pal.PalGameWorldSettings]:OptionSettings='(RCONEnabled=True)'"

edit: ive set ServerPlayerMaxNum=1 and its being applied. It seems that only one param can be set. Now that we have a discord maybe we can have a chat/call later on :)

@Twinki14
Copy link
Contributor Author

Twinki14 commented Jan 28, 2024

Hey, IT WORKS....kind of..

Might be a limitation with UE, interesting 🤔

I think for now the best thing to do would be to only support ini file editing & the few things we can pass via args, I thought perhaps this would offer us something solid and easy

OR we look into tools such as https://github.com/bitnami/ini-file / https://github.com/dbohdan/initool, feeding & reading environment variables into such a tool would be fairly simple, but providing default values would be harder (Assuming that if we set ANYTHING in the ini file, all defaults get overriden)

@MSpreckels
Copy link
Contributor

MSpreckels commented Jan 28, 2024

Another option would be to prefill the ini file with environment variable placeholders and use envsubst to set those.

You could set a default there.

-ini:PalGameWorldSettings:[/Script/Pal.PalGameWorldSettings]:OptionSettings=(Difficulty=${DIFFICULTY:-None},....

Link: https://stackoverflow.com/a/2013589

@thijsvanloef thijsvanloef linked a pull request Jan 28, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants