Saturday, 31 December 2016

Multiplayer dedicated server setup notes

To start off, use this guide http://empyrion.gamepedia.com/Dedicated_Server_Setup

Some notes also here https://steamcommunity.com/sharedfiles/filedetails/?id=621554476

I am moderating for a server, more details here, but this page is for learning how it all works.
bit.ly/CasualPVE
The shortlink to the challenge infos is http://bit.ly/MasperonChallenge

Steps

Copied dedicated.yml to server.yaml file and changed:

    Srv_Name: Masperon Challenge
    Srv_Password: xxxxxxx
    Srv_MaxPlayers: 4

    Srv_Description: "Post here [url=http://bit.ly/MasperonChallenge]Masperon Challenge[/url] to get a password."

    Srv_StopPeriod: 12

    Tel_Enabled: true   # Activate Telnet server
    Tel_Port: 30004
    Tel_Pwd: xxxxx




    MaxAllowedSizeClass: 5

    Seed: 470786         # The seed determines how the world is procedurally generated - the same seed means the same world

    DiffEscapePodContent: Hard        # Easy, Medium, Hard --- Determines the content of the Escape Pod when you crash land on the planet
    DiffAmountOfOre: Poor             # Rich, Normal, Poor --- Influences the average amount of ore that a deposit contains
    DiffNumberOfDeposits: Few        # Plenty, Normal, Few --- Influences the average number of deposits per planet
    DiffDroneBaseAttack: Hard         # Easy, Medium, Hard, Off --- Influences the difficulty of the drone base attacks (infinite waves, number of waves etc.)
    DiffDronePresence: High           # Low, Normal, High, Off --- Influences the overall number of drones that are present on a planet    DiffConstrCraftTime: Normal         # Faster, Normal, Slower --- Influences the overall craft speed of constructors


The part I'm struggling with next is telnet connection port 30004. For some reason I had to kill the EmpyrionDedicated process and start the server again before it starts to listen on port 30004

I made my server name "Masperon Challenge", but it's not in the server browser even though I can connect locally.

Saturday, 10 December 2016

Empyrion Galactic Survival blueprint swapper

I wrote a little script to swap blueprints from BA to CV. Sometimes you design a base as a CV, then at the end you spawn your artwork in space and too late realise that in order for a CV to land on it in space it has to be a BA, whoops. So I wrote a script to swap the BP types around.

This standalone script does not require anything else to download so long as you are running a Fully updated Windows 7 or Newer Windows. It runs native in Windows without any binaries. Before I share the script, here are the instructions:
1. Type "powershell" in the start menu
2. When it comes up, select run as Administrator.
3. Go to the folder you saved this file to and type as below:

4. Just run the script, it will find your blueprint folder (unless you installed steam on another drive to c:\ or 2 people play EGS on this computer, then it will error. If this happens, send me a message.)

Download the script here: http://pastebin.com/9bGH88jx
# If you see an error:
#     .\Toggle-Blueprint.ps1 : File Toggle-Blueprint.ps1 cannot be loaded. The
#     file Toggle-Blueprint.ps1 is not digitally signed. You cannot run this
#     script on the current system. For more information about running scripts and setting execution policy, see
#     about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.
# Then open powershell using RunAs Administrator, and type in
# PS:\> set-executionpolicy Bypass
#
# Converts a CV to a BA blueprint or back (or HV to a SV)
# Optionally provide the name of a blueprint (without the file extension)
# Will not overwrite an existing BP
# Help: 
[cmdletbinding()]
Param($inputFile="", $outputFile="", [switch]$flatten)
Set-strictmode -version 2
$erroractionpreference = 'stop' 

$basePath = @(ls 'C:\Program Files (x86)\Steam\steamapps\common\Empyrion - Galactic Survival\Saves\Blueprints' -recurse -include 'Workshop.data')[0] | split-path -parent
if ([string]::Isnullorempty($inputFile)) {
 $list = ls $basePath -exclude 'workshop.data'
 [int]$i=0
 foreach ($file in $list) {
  $fname = join-path $file.fullname ($file.name + '.epb')
  write-host "$i $($file.name) [$((get-item $fname).length)]" -foregroundcolor cyan
  $i+=1
 }
 $inputfile = $list[ (Read-host "choice?") ].name
}
if ([string]::Isnullorempty($outputFile)) {
 $outputFile = $inputfile +'(1)'
}
Write-host "Loading: $inputfile"

$fname = join-path (join-path $basepath  $inputfile) ($inputfile + '.epb')
$bytes = [System.IO.File]::ReadAllBytes($fname)
# read some basic stats
$newClass = 0
$entityClass = switch ($bytes[8]) { # (0x02 = BA, 0x04 = SV, 0x08 = CV, 0x10 = HV)
 16 {$msg = 'HV to SV?'; 'HV'; $newClass=4}
 4  {$msg = 'SV to HV?'; 'SV'; $newClass=16}
 8  {$msg = 'CV to BA?'; 'CV'; $newClass=2}
 2  {$msg = 'BA to CV?'; 'BA'; $newClass=8}
 default {'unknown'}
}
$entityWidth = [bitconverter]::ToInt16( $Bytes,9)
$entityHeight = [bitconverter]::ToInt16( $Bytes,13)
$entityDepth = [bitconverter]::ToInt16( $Bytes,17)
$terrainFlag = $bytes[33];
0..40 | %{write-verbose "$_ $($bytes[$_])"}
write-host "type [Width, Height, Depth] Flatten"
write-host "$entityclass   [   $entityWidth,     $entityHeight,    $entityDepth]      $terrainFlag"
if (($flatten) -and ($entityClass -eq 'BA')) {
 # todo make it a toggle
 $msg = "Flatten Terrain? ($terrainFlag)" 
 write-warning "The flatten terrain option does not always work, test it a few times before sharing the results"
} else {
 $msg = "Convert " + $msg
}
$ans = Read-Host $msg
if (('Y' -eq $ans.ToUpper()) -and (($newClass) -or ($flatten))) {
 if ('Y' -eq (Read-Host "Are you sure?").ToUpper()) {
  if (($flatten) -and ($entityClass -eq 'BA')) {
   # todo make it a toggle
   $bytes[4] = 1
   $bytes[33] = 1
  } else {
   $bytes[8] = $newClass
  }
  $newProjectName = $outputFile
  mkdir (join-path $basePath $newProjectName) | out-null
  $newProjectPath = join-path (join-path $basePath $newProjectName) ($newProjectName + '.epb')
  write-host "Saving $newProjectPath ..."
  [io.file]::WriteAllBytes($newProjectPath, $bytes)
 }
}
 

And a clip of the script being used ( seek to 13:06 )
References:
https://github.com/Getty/p5-empyrion/blob/master/lib/Empyrion/Blueprint.pm
https://github.com/Riebart/EmpyrionGSTools

Multiplayer game RP - Star Wars themed Roleplay in EGS

Tiny signwriter font http://www.1001fonts.com/chlorenuf-font.html#character-map Chlorenuf
 Larger SW font http://www.dafont.com/star-jedi.font