Rename the game to Emberwild (data copied from the old folder)

This commit is contained in:
Paul Bailey
2026-11-04 15:45:10 +00:00
parent ae2592822e
commit d489bb57ed
7 changed files with 67 additions and 8 deletions

View File

@@ -33,7 +33,7 @@ server/run_server.sh --server-name "Paul's island" --password secret --port 2424
It checks the Godot version, imports a fresh copy, then starts the server on It checks the Godot version, imports a fresh copy, then starts the server on
UDP 24242 with no window. Settings live in `server.json` (its path is printed UDP 24242 with no window. Settings live in `server.json` (its path is printed
at start-up; on macOS it's under at start-up; on macOS it's under
`~/Library/Application Support/Godot/app_userdata/Valheimlike/server/`). `~/Library/Application Support/Godot/app_userdata/Emberwild/server/`).
Stop it with Ctrl+C. Players join with **Join Game** on the title screen. Over Stop it with Ctrl+C. Players join with **Join Game** on the title screen. Over
Tailscale, use the server machine's 100.x address or its machine name. See Tailscale, use the server machine's 100.x address or its machine name. See
`docs/MULTIPLAYER_PLAN.md` for all the options. `docs/MULTIPLAYER_PLAN.md` for all the options.
@@ -71,10 +71,16 @@ godot --headless --path . --script res://tests/test_survival_stats.gd
## Save files ## Save files
Worlds are per machine, under Worlds are per machine, under
`~/Library/Application Support/Godot/app_userdata/Valheimlike/worlds/` on `~/Library/Application Support/Godot/app_userdata/Emberwild/worlds/` on
macOS (`%APPDATA%\Godot\app_userdata\Valheimlike\worlds\` on Windows). Copy a macOS (`%APPDATA%\Godot\app_userdata\Emberwild\worlds\` on Windows). Copy a
world's folder across to move it to another machine. world's folder across to move it to another machine.
The game used to be called Valheimlike, and its data lived in
`app_userdata/Valheimlike/`. The first time Emberwild starts it copies worlds,
your identity and server settings across to `app_userdata/Emberwild/`
(`scripts/core/boot.gd`). The old folder is left alone as a backup, and you
can delete it once you're happy.
## 2. Get the project onto the machine ## 2. Get the project onto the machine
You have the folder (from the zip, or a git remote). Then: You have the folder (from the zip, or a git remote). Then:

View File

@@ -275,7 +275,7 @@ small Diet bars, and a low group blinks.
- **Autosave** every 2 minutes, on Save & Quit (to the title or desktop) and - **Autosave** every 2 minutes, on Save & Quit (to the title or desktop) and
when the window is closed. when the window is closed.
- Saves live in `user://worlds/<id>/` (on macOS: - Saves live in `user://worlds/<id>/` (on macOS:
`~/Library/Application Support/Godot/app_userdata/Valheimlike/worlds/`) as `~/Library/Application Support/Godot/app_userdata/Emberwild/worlds/`) as
`meta.json` + `world.json`. Writes are atomic, and the previous save is `meta.json` + `world.json`. Writes are atomic, and the previous save is
kept as `world.json.bak`. kept as `world.json.bak`.
- A save stores only what the player changed: player position and look, - A save stores only what the player changed: player position and look,

View File

@@ -14,7 +14,7 @@ compatibility/default_parent_skeleton_in_mesh_instance_3d=true
[application] [application]
config/name="Valheimlike" config/name="Emberwild"
config/description="Low-poly survival game — Valheim look, Rust depth, self-hosted, moddable." config/description="Low-poly survival game — Valheim look, Rust depth, self-hosted, moddable."
run/main_scene="res://scenes/title.tscn" run/main_scene="res://scenes/title.tscn"
config/features=PackedStringArray("4.7", "Forward Plus") config/features=PackedStringArray("4.7", "Forward Plus")
@@ -22,6 +22,7 @@ config/icon="res://icon.svg"
[autoload] [autoload]
Boot="*res://scripts/core/boot.gd"
ItemDB="*res://scripts/core/item_db.gd" ItemDB="*res://scripts/core/item_db.gd"
Actions="*res://scripts/core/actions.gd" Actions="*res://scripts/core/actions.gd"
Saves="*res://scripts/core/saves.gd" Saves="*res://scripts/core/saves.gd"

52
scripts/core/boot.gd Normal file
View File

@@ -0,0 +1,52 @@
extends Node
## Autoload "Boot", first in the list: one-off start-up housekeeping that has
## to happen before anything reads user://.
##
## The game was called "Valheimlike" until it became "Emberwild". Godot names
## the user-data folder after the project, so the rename moved it from
## .../app_userdata/Valheimlike to .../app_userdata/Emberwild. The first time
## Emberwild starts, this copies saved worlds, your identity (key, name, look)
## and server settings across. It copies rather than moves, so the old folder
## stays as a backup, and it never overwrites anything already in the new
## folder. Test folders (test_*) and logs are skipped.
const OLD_NAME := "Valheimlike"
const MARKER := "migrated_from_valheimlike.txt"
const SKIP := ["logs", "shader_cache", "vulkan", "test_worlds", "test_net"]
var copied := 0
func _enter_tree() -> void:
migrate_user_data()
## Returns the number of files copied (0 if there was nothing to do).
func migrate_user_data() -> int:
var new_dir := OS.get_user_data_dir()
var old_dir := new_dir.get_base_dir().path_join(OLD_NAME)
if new_dir == old_dir or not DirAccess.dir_exists_absolute(old_dir):
return 0
if FileAccess.file_exists(new_dir.path_join(MARKER)):
return 0
copied = 0
_copy_tree(old_dir, new_dir)
var f := FileAccess.open(new_dir.path_join(MARKER), FileAccess.WRITE)
if f != null:
f.store_string("Copied %d files from %s on %s. The old folder was left as it was.\n" % [
copied, old_dir, Time.get_datetime_string_from_system()])
if copied > 0:
print("[boot] moved to the new name: copied %d files from %s" % [copied, old_dir])
return copied
func _copy_tree(from: String, to: String) -> void:
DirAccess.make_dir_recursive_absolute(to)
var da := DirAccess.open(from)
if da == null:
return
for f in da.get_files():
var dst := to.path_join(f)
if not FileAccess.file_exists(dst) and DirAccess.copy_absolute(from.path_join(f), dst) == OK:
copied += 1
for d in da.get_directories():
if d in SKIP or d.begins_with("test_"):
continue
_copy_tree(from.path_join(d), to.path_join(d))

View File

@@ -6,7 +6,7 @@ extends RefCounted
const DEFAULT_PATH := "user://server/server.json" const DEFAULT_PATH := "user://server/server.json"
const DEFAULTS := { const DEFAULTS := {
"server_name": "Valheimlike server", "server_name": "Emberwild server",
"motd": "Welcome!", "motd": "Welcome!",
"port": 24242, "port": 24242,
"max_players": 8, "max_players": 8,

View File

@@ -75,7 +75,7 @@ func _ready() -> void:
col.offset_right = 520 col.offset_right = 520
col.add_theme_constant_override("separation", 14) col.add_theme_constant_override("separation", 14)
root.add_child(col) root.add_child(col)
col.add_child(UITheme.label("VALHEIMLIKE", 54)) col.add_child(UITheme.label("EMBERWILD", 54))
col.add_child(UITheme.label("Survive the island. Build a home.", 18, UITheme.TEXT_DIM)) col.add_child(UITheme.label("Survive the island. Build a home.", 18, UITheme.TEXT_DIM))
var spacer := Control.new() var spacer := Control.new()
spacer.custom_minimum_size = Vector2(0, 24) spacer.custom_minimum_size = Vector2(0, 24)

View File

@@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
# Starts a dedicated Valheimlike server (no window, no local player). # Starts a dedicated Emberwild server (no window, no local player).
# #
# server/run_server.sh defaults from server.json # server/run_server.sh defaults from server.json
# server/run_server.sh --port 24242 --server-name "Paul's island" --password secret # server/run_server.sh --port 24242 --server-name "Paul's island" --password secret