EARTH DEFENSE FORCE 6

EARTH DEFENSE FORCE 6

View Stats:
Ohmz Jul 25, 2024 @ 3:38pm
Save game backups - PSA
Quick PSA - if you play online then get in the habit of backing up your saves frequently. I try to back them up before each session. With the previous games some people used cheats to forcibly unlock all weapons for all players in the room, and add armours etc. It takes the fun out of it IMO. I jumped back on EDF5 around a month ago and had this happen to me, and sadly had fallen out of the habit to backup saves.

So if you want to prevent cheaters from messing with your progression, then save your savegames! They are placed in this location: "C:\Users\<Useranme>\AppData\Local\EarthDefenceForce6\SAVE_DATA"


I made a quick PoSh script a while ago to do this automatically, and to prevent a buildup of potential duplicates the script records hashfiles so files are backed up only when a change is detected. Feel free to use it. Just save the below as a .ps1 file, in a folder of your choosing, and run. Feel free to use it for any game, just need to amend the 1st two lines - it'll create sub-folders in the root directory for each game, and slot the save game files in there (as a .zip).




$Game = "Earth Defense Force 6"
$SavePath = "C:\Users\<USERNAME>\AppData\Local\EarthDefenceForce6\SAVE_DATA"

function Get-FolderHash ($folder) {
dir $folder -Recurse | ?{!$_.psiscontainer} | %{[Byte[]]$contents += [System.IO.File]::ReadAllBytes($_.fullname)}
$hasher = [System.Security.Cryptography.SHA1]::Create()
[string]::Join("",$($hasher.ComputeHash($contents) | %{"{0:x2}" -f $_}))
}

$SaveHash = Get-FolderHash $SavePath
$TimeStamp = get-date -format "dd-MM-yyyy_HHmmss"
$SaveDest = "$($PSScriptRoot.Replace('\Save Scripts',''))\$($Game)"
$FileName = "$($Game.Replace(' ',''))_$($TimeStamp)"
$LogFile = "$($SaveDest)\$($Game.Replace(' ',''))-Saves.log"

if(!(Test-Path $SaveDest))
{
New-Item -ItemType Directory $SaveDest
}

if(!(Test-Path $LogFile))
{
New-Item -ItemType File $LogFile
} else {
$Logs = Get-Content $LogFile
}

Compress-Archive $SavePath "$($SaveDest)\$($FileName).zip"

$Backups = Get-ChildItem $SaveDest | Where{$_.Name -match ".zip"}

if($Backups.Count -gt 1)
{
$OldSaveHash = $logs[$Logs.Count-1].Split(':')[1].Replace(' ','')
if($SaveHash -eq $OldSaveHash)
{
Remove-Item $Backups[$Backups.Count-1].FullName
Add-Content $LogFile "$($FileName).zip was discarded as a duplicate. Save Hash: $($SaveHash)"
} else {
Add-Content $LogFile "$($FileName).zip was successfully backed up. Save Hash: $($SaveHash)"
}
} else {
Add-Content $LogFile "$($FileName).zip was successfully backed up. Save Hash: $($SaveHash)"
}
Date Posted: Jul 25, 2024 @ 3:38pm
Posts: 0