From 96bd2a49c923b03ef81f4a9365fa8e2c9bf1bdff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Blomberg?= Date: Thu, 16 Oct 2025 11:03:44 +0200 Subject: [PATCH] Update README and project files for Windows export process and SDK version upgrade --- README.md | 56 ++++++++++++++++++++++++++++++------- TheGame.csproj | 6 ++-- TheGame.csproj.old | 9 ++++++ icon.svg.import | 43 ++++++++++++++++++++++++++++ project.godot | 7 +---- scripts/Game.cs.uid | 1 + scripts/GameState.cs.uid | 1 + scripts/LoadGameMenu.cs.uid | 1 + scripts/MainMenu.cs.uid | 1 + scripts/PauseMenu.cs.uid | 1 + scripts/SaveManager.cs.uid | 1 + 11 files changed, 107 insertions(+), 20 deletions(-) create mode 100644 TheGame.csproj.old create mode 100644 icon.svg.import create mode 100644 scripts/Game.cs.uid create mode 100644 scripts/GameState.cs.uid create mode 100644 scripts/LoadGameMenu.cs.uid create mode 100644 scripts/MainMenu.cs.uid create mode 100644 scripts/PauseMenu.cs.uid create mode 100644 scripts/SaveManager.cs.uid diff --git a/README.md b/README.md index ad3301b..7180927 100644 --- a/README.md +++ b/README.md @@ -51,22 +51,58 @@ Projektet använder följande .NET dependencies: 2. Tryck **F5** eller klicka på "Play"-knappen 3. Första gången kommer du behöva välja `scenes/MainMenu.tscn` som main scene -### Bygga för Distribution -1. I Godot editorn, gå till **Project → Export** -2. Lägg till en export template för din målplattform (Windows, Linux, macOS) -3. Konfigurera export-inställningar -4. Klicka **Export Project** för att skapa en körbar fil +### Skapa EXE-fil (Windows) + +#### Steg 1: Förbered Export Templates +1. Öppna projektet i Godot 4.5 +2. Gå till **Editor → Manage Export Templates** +3. Klicka **Download and Install** för att ladda ner templates för Godot 4.5 + +#### Steg 2: Konfigurera Windows Export +1. I Godot editorn, gå till **Project → Export...** +2. Klicka **Add...** och välj **Windows Desktop** +3. Konfigurera följande inställningar: + - **Export Path**: `TheGame.exe` (eller valfritt namn) + - **Runnable**: ✅ (aktiverad) + - **Dedicated Server**: ❌ (inaktiverad) + +#### Steg 3: C# Specifika Inställningar +Under **Dotnet** sektionen: + - **Include Scripts Compilation**: ✅ (aktiverad) + - **Include Debug Symbols**: ❌ (inaktiverad för release) + +#### Steg 4: Exportera EXE +1. Klicka **Export Project** +2. Välj destination och filnamn (t.ex. `TheGame.exe`) +3. Klicka **Save** + +#### Steg 5: Testa EXE-filen +- Den skapade `.exe` filen kan köras direkt på Windows +- `saves/` mappen kommer att skapas bredvid exe-filen automatiskt + +### Felsökning Export Problem + +**Problem: "Export templates not found"** +- Lösning: Installera export templates via Editor → Manage Export Templates + +**Problem: "Failed to export project"** +- Kontrollera att alla scripts kompilerar utan fel först +- Kör `dotnet build` i projektmappen för att verifiera + +**Problem: "C# assemblies missing in export"** +- Se till att "Include Scripts Compilation" är aktiverad +- Kontrollera att .NET 8.0 runtime finns installerad på målmaskinen ### Alternativ Kompilering via Terminal -```bash +```powershell # Navigera till projektmappen cd c:\Repo\TheGame -# Bygg projektet -dotnet build +# Bygg C# projektet +dotnet build --configuration Release -# Kör Godot projekt från kommandoraden (kräver Godot i PATH) -godot --path . scenes/MainMenu.tscn +# Exportera via kommandoraden (kräver Godot i PATH) +godot --headless --export-release "Windows Desktop" TheGame.exe ``` ## Projektstruktur diff --git a/TheGame.csproj b/TheGame.csproj index 391a824..c1ba0f0 100644 --- a/TheGame.csproj +++ b/TheGame.csproj @@ -1,8 +1,6 @@ - + - net6.0 - net7.0 - net8.0 + net8.0 true TheGame diff --git a/TheGame.csproj.old b/TheGame.csproj.old new file mode 100644 index 0000000..391a824 --- /dev/null +++ b/TheGame.csproj.old @@ -0,0 +1,9 @@ + + + net6.0 + net7.0 + net8.0 + true + TheGame + + \ No newline at end of file diff --git a/icon.svg.import b/icon.svg.import new file mode 100644 index 0000000..5c68ced --- /dev/null +++ b/icon.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bcat1nya502fb" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/project.godot b/project.godot index 94fc3e1..a56cb0e 100644 --- a/project.godot +++ b/project.godot @@ -12,19 +12,14 @@ config_version=5 config/name="TheGame" run/main_scene="res://scenes/MainMenu.tscn" -config/features=PackedStringArray("4.2", "C#", "Forward Plus") +config/features=PackedStringArray("4.5", "C#", "Forward Plus") config/icon="res://icon.svg" [display] window/size/viewport_width=1280 window/size/viewport_height=720 -window/size/resizable=true [dotnet] project/assembly_name="TheGame" - -[rendering] - -renderer/rendering_method="forward_plus" \ No newline at end of file diff --git a/scripts/Game.cs.uid b/scripts/Game.cs.uid new file mode 100644 index 0000000..de949ea --- /dev/null +++ b/scripts/Game.cs.uid @@ -0,0 +1 @@ +uid://b58rkdlq5w21m diff --git a/scripts/GameState.cs.uid b/scripts/GameState.cs.uid new file mode 100644 index 0000000..4893ff1 --- /dev/null +++ b/scripts/GameState.cs.uid @@ -0,0 +1 @@ +uid://bj2vys8c8nvvg diff --git a/scripts/LoadGameMenu.cs.uid b/scripts/LoadGameMenu.cs.uid new file mode 100644 index 0000000..ecf0b86 --- /dev/null +++ b/scripts/LoadGameMenu.cs.uid @@ -0,0 +1 @@ +uid://dt0pqnx0paqkj diff --git a/scripts/MainMenu.cs.uid b/scripts/MainMenu.cs.uid new file mode 100644 index 0000000..eb37a36 --- /dev/null +++ b/scripts/MainMenu.cs.uid @@ -0,0 +1 @@ +uid://cq88pp73k3b4 diff --git a/scripts/PauseMenu.cs.uid b/scripts/PauseMenu.cs.uid new file mode 100644 index 0000000..d595db1 --- /dev/null +++ b/scripts/PauseMenu.cs.uid @@ -0,0 +1 @@ +uid://cre1pwcc5y5u3 diff --git a/scripts/SaveManager.cs.uid b/scripts/SaveManager.cs.uid new file mode 100644 index 0000000..44fbec8 --- /dev/null +++ b/scripts/SaveManager.cs.uid @@ -0,0 +1 @@ +uid://ci407hx25v6nb