From dfe888a918f0a17aaf4473847d23f008aff439a8 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Wed, 29 Jan 2025 12:25:26 +0100 Subject: [PATCH] Move the real player authority to server - Add rust bindings for the server player controller - Implement reconciliation loop for checking the player state - Place spawners on the test map - Add Containerfile and helm chart --- .gdextension | 0 .gdignore | 3 + .gitignore | 1 + .woodpecker.yaml | 26 + Containerfile | 39 ++ .../dark/texture_01.png.import | 5 +- .../dark/texture_02.png.import | 5 +- .../dark/texture_03.png.import | 5 +- .../dark/texture_04.png.import | 5 +- .../dark/texture_06.png.import | 5 +- .../dark/texture_07.png.import | 5 +- .../dark/texture_08.png.import | 5 +- .../dark/texture_09.png.import | 5 +- .../dark/texture_10.png.import | 5 +- .../dark/texture_11.png.import | 5 +- .../dark/texture_12.png.import | 5 +- .../green/texture_01.png.import | 5 +- .../green/texture_02.png.import | 5 +- .../green/texture_04.png.import | 5 +- .../light/texture_01.png.import | 5 +- .../light/texture_02.png.import | 5 +- .../orange/texture_01.png.import | 5 +- .../orange/texture_02.png.import | 5 +- .../orange/texture_09.png.import | 5 +- .../orange/texture_10.png.import | 5 +- .../orange/texture_13.png.import | 5 +- .../purple/texture_02.png.import | 5 +- .../red/texture_02.png.import | 5 +- .../M9_Bayonet_M9_Bayonet.png.import | 4 +- assets/models/maps/el_test_Image_0.png.import | 4 +- assets/models/maps/el_test_Image_1.png.import | 4 +- assets/models/maps/el_test_Image_2.png.import | 4 +- export_presets.cfg | 548 ++++++++++++++++++ helm/.helmignore | 23 + helm/Chart.lock | 6 + helm/Chart.yaml | 15 + helm/charts/helm-library-0.2.1.tgz | Bin 0 -> 7763 bytes helm/charts/helm-library/.helmignore | 23 + helm/charts/helm-library/Chart.lock | 6 + helm/charts/helm-library/Chart.yaml | 12 + helm/charts/helm-library/templates/_chart.tpl | 57 ++ .../charts/helm-library/templates/_errors.tpl | 15 + .../templates/components/_crd.tpl | 17 + .../templates/components/_environment.tpl | 46 ++ .../components/_extra_templates.yaml | 16 + .../templates/components/_files.tpl | 64 ++ .../templates/components/_ingress.tpl | 33 ++ .../templates/components/_service.tpl | 42 ++ .../templates/components/_storage.tpl | 35 ++ .../templates/components/_workloads.yaml | 65 +++ .../templates/core/_configmap.yaml | 18 + .../templates/core/_deployment.yaml | 78 +++ .../helm-library/templates/core/_ingress.tpl | 20 + .../helm-library/templates/core/_pod.tpl | 117 ++++ .../helm-library/templates/core/_pvc.tpl | 21 + .../helm-library/templates/core/_secret.yaml | 16 + .../helm-library/templates/core/_service.tpl | 21 + .../templates/core/pod/_container.tpl | 214 +++++++ .../helm-library/templates/helpers/_chart.tpl | 31 + .../templates/helpers/_converter.tpl | 11 + .../helm-library/templates/helpers/_hash.tpl | 31 + .../templates/helpers/_lookup.tpl | 32 + .../templates/metadata/_metadata.tpl | 46 ++ helm/charts/helm-library/values.yaml | 5 + helm/templates/install.yaml | 4 + helm/values.yaml | 25 + project.godot | 3 +- rust/Cargo.lock | 265 +++++++++ rust/Cargo.toml | 10 + rust/src/lib.rs | 7 + rust/src/player/client_node.rs | 1 + rust/src/player/mod.rs | 2 + rust/src/player/server_node.rs | 95 +++ rust_bindings.gdextension | 14 + scenes/characters/blue/dummy.gd | 2 - scenes/characters/blue/dummy.tscn | 48 +- scenes/characters/placeholder.tscn | 33 +- scenes/characters/player_input_controller.gd | 35 ++ scenes/maps/base/map_loader.gd | 18 +- .../base/player_spawner/player_spawner.gd | 20 +- .../base/player_spawner/player_spawner.tscn | 2 +- scenes/maps/base/spawn_controller.gd | 3 - scenes/maps/maps/lowpoly_tdm_2.tscn | 28 +- scenes/player/placeholder.gd | 115 ++++ scenes/player/placeholder.tscn | 224 +++++++ scenes/player/player_input_controller.gd | 146 +++++ scenes/player/server_player_controller.gd | 48 ++ scenes/utils/menu.gd | 1 - scenes/utils/menus/main/main_menu.gd | 44 +- scenes/weapon/bullet.gd | 1 - scenes/weapon/misc/bullet_trail_generic.tscn | 1 + scripts/character_controller.gd | 1 - scripts/game_server_manager.gd | 34 +- scripts/player/player_input_controller.gd | 32 +- 94 files changed, 3002 insertions(+), 144 deletions(-) create mode 100644 .gdextension create mode 100644 .gdignore create mode 100644 .woodpecker.yaml create mode 100644 Containerfile create mode 100644 export_presets.cfg create mode 100644 helm/.helmignore create mode 100644 helm/Chart.lock create mode 100644 helm/Chart.yaml create mode 100644 helm/charts/helm-library-0.2.1.tgz create mode 100644 helm/charts/helm-library/.helmignore create mode 100644 helm/charts/helm-library/Chart.lock create mode 100644 helm/charts/helm-library/Chart.yaml create mode 100644 helm/charts/helm-library/templates/_chart.tpl create mode 100644 helm/charts/helm-library/templates/_errors.tpl create mode 100644 helm/charts/helm-library/templates/components/_crd.tpl create mode 100644 helm/charts/helm-library/templates/components/_environment.tpl create mode 100644 helm/charts/helm-library/templates/components/_extra_templates.yaml create mode 100644 helm/charts/helm-library/templates/components/_files.tpl create mode 100644 helm/charts/helm-library/templates/components/_ingress.tpl create mode 100644 helm/charts/helm-library/templates/components/_service.tpl create mode 100644 helm/charts/helm-library/templates/components/_storage.tpl create mode 100644 helm/charts/helm-library/templates/components/_workloads.yaml create mode 100644 helm/charts/helm-library/templates/core/_configmap.yaml create mode 100644 helm/charts/helm-library/templates/core/_deployment.yaml create mode 100644 helm/charts/helm-library/templates/core/_ingress.tpl create mode 100644 helm/charts/helm-library/templates/core/_pod.tpl create mode 100644 helm/charts/helm-library/templates/core/_pvc.tpl create mode 100644 helm/charts/helm-library/templates/core/_secret.yaml create mode 100644 helm/charts/helm-library/templates/core/_service.tpl create mode 100644 helm/charts/helm-library/templates/core/pod/_container.tpl create mode 100644 helm/charts/helm-library/templates/helpers/_chart.tpl create mode 100644 helm/charts/helm-library/templates/helpers/_converter.tpl create mode 100644 helm/charts/helm-library/templates/helpers/_hash.tpl create mode 100644 helm/charts/helm-library/templates/helpers/_lookup.tpl create mode 100644 helm/charts/helm-library/templates/metadata/_metadata.tpl create mode 100644 helm/charts/helm-library/values.yaml create mode 100644 helm/templates/install.yaml create mode 100644 helm/values.yaml create mode 100644 rust/Cargo.lock create mode 100644 rust/Cargo.toml create mode 100644 rust/src/lib.rs create mode 100644 rust/src/player/client_node.rs create mode 100644 rust/src/player/mod.rs create mode 100644 rust/src/player/server_node.rs create mode 100644 rust_bindings.gdextension create mode 100644 scenes/characters/player_input_controller.gd create mode 100644 scenes/player/placeholder.gd create mode 100644 scenes/player/placeholder.tscn create mode 100644 scenes/player/player_input_controller.gd create mode 100644 scenes/player/server_player_controller.gd diff --git a/.gdextension b/.gdextension new file mode 100644 index 0000000..e69de29 diff --git a/.gdignore b/.gdignore new file mode 100644 index 0000000..3a48128 --- /dev/null +++ b/.gdignore @@ -0,0 +1,3 @@ +Containerfile +helm +rust/src diff --git a/.gitignore b/.gitignore index 4709183..0ca4e28 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ # Godot 4+ specific ignores .godot/ +rust/target diff --git a/.woodpecker.yaml b/.woodpecker.yaml new file mode 100644 index 0000000..fc217f3 --- /dev/null +++ b/.woodpecker.yaml @@ -0,0 +1,26 @@ +--- +when: + event: + - push + +steps: + - name: Build and push a container image + image: zot.badhouseplants.net/badhouseplants/badhouseplants-builder:latest + environment: + BUILDAH_REG: zot.badhouseplants.net/badhouseplants/open-strike + privileged: true + secrets: + - registry_token + commands: + - build-container + backend_options: + kubernetes: + resources: + requests: + memory: 700Mi + cpu: 1000m + limits: + cpu: 1000m + securityContext: + privileged: true + diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..d57449d --- /dev/null +++ b/Containerfile @@ -0,0 +1,39 @@ +FROM rust:1.84.1 AS lib_builder +RUN apt-get update -y && apt-get install -y gcc musl-dev build-essential pkg-config cmake +RUN rustup toolchain install stable +WORKDIR /src +COPY rust/ . +RUN cargo build + +FROM ghcr.io/allanger/dumb-downloader as dudo +RUN apt-get update -y && apt-get install unzip -y +ENV RUST_LOG=info +ENV GODOT_VERSION=4.3 +WORKDIR /out +RUN dudo -l "https://github.com/godotengine/godot/releases/download/{{ version }}-stable/Godot_v{{ version }}-stable_{{ os }}.{{ arch }}.zip" -d /tmp/godot.zip -p $GODOT_VERSION +RUN cd /tmp && unzip godot.zip && rm -f godot.zip +RUN sh -c 'find /tmp -type f -print0 -name "Godot*" | xargs --null -I{} mv {} godot' + +RUN dudo -l "https://github.com/godotengine/godot/releases/download/{{ version }}-stable/Godot_v{{ version }}-stable_export_templates.tpz" -d /tmp/export_templates.zip -p $GODOT_VERSION +RUN cd /tmp && unzip export_templates.zip && rm -f export_templates.zip +RUN ls /tmp +RUN mkdir -p /out/templates +RUN sh -c 'cd /tmp && find . -type f -print0 -name "Godot*" | xargs --null -I{} mv {} /out/{}' +RUN chmod +x /out/godot + +FROM ubuntu as builder +RUN apt-get update -y && apt-get install fontconfig -y +WORKDIR /src +COPY --from=dudo /out/godot /usr/bin/godot +COPY --from=lib_builder /src/target/debug/libopen_strike_2.so /src/rust/target/debug/libopen_strike_2.so +RUN mkdir -p /root/.local/share/godot/export_templates/4.3.stable/ +COPY --from=dudo /out/templates /root/.local/share/godot/export_templates/4.3.stable +COPY . . +RUN mkdir /out +RUN godot --verbose --headless --export-debug "[Dedicated Server] Linux" /out/open_strike + +FROM ubuntu +RUN apt-get update -y && apt-get install fontconfig -y +WORKDIR /app +COPY --from=builder /out . +CMD ["/app/open_strike.sh"] diff --git a/addons/kenney_prototype_textures/dark/texture_01.png.import b/addons/kenney_prototype_textures/dark/texture_01.png.import index 1675cb3..6154790 100644 --- a/addons/kenney_prototype_textures/dark/texture_01.png.import +++ b/addons/kenney_prototype_textures/dark/texture_01.png.import @@ -4,15 +4,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://dmge3tk7w0b1n" path.s3tc="res://.godot/imported/texture_01.png-60e3b3d3143b179c069dbcbff77ff160.s3tc.ctex" +path.etc2="res://.godot/imported/texture_01.png-60e3b3d3143b179c069dbcbff77ff160.etc2.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } [deps] source_file="res://addons/kenney_prototype_textures/dark/texture_01.png" -dest_files=["res://.godot/imported/texture_01.png-60e3b3d3143b179c069dbcbff77ff160.s3tc.ctex"] +dest_files=["res://.godot/imported/texture_01.png-60e3b3d3143b179c069dbcbff77ff160.s3tc.ctex", "res://.godot/imported/texture_01.png-60e3b3d3143b179c069dbcbff77ff160.etc2.ctex"] [params] diff --git a/addons/kenney_prototype_textures/dark/texture_02.png.import b/addons/kenney_prototype_textures/dark/texture_02.png.import index b1e82df..e465feb 100644 --- a/addons/kenney_prototype_textures/dark/texture_02.png.import +++ b/addons/kenney_prototype_textures/dark/texture_02.png.import @@ -4,15 +4,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://bawho1fs8uowk" path.s3tc="res://.godot/imported/texture_02.png-814d4f515892bb8274d285748f4a73a0.s3tc.ctex" +path.etc2="res://.godot/imported/texture_02.png-814d4f515892bb8274d285748f4a73a0.etc2.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } [deps] source_file="res://addons/kenney_prototype_textures/dark/texture_02.png" -dest_files=["res://.godot/imported/texture_02.png-814d4f515892bb8274d285748f4a73a0.s3tc.ctex"] +dest_files=["res://.godot/imported/texture_02.png-814d4f515892bb8274d285748f4a73a0.s3tc.ctex", "res://.godot/imported/texture_02.png-814d4f515892bb8274d285748f4a73a0.etc2.ctex"] [params] diff --git a/addons/kenney_prototype_textures/dark/texture_03.png.import b/addons/kenney_prototype_textures/dark/texture_03.png.import index 6ffa424..6b73f73 100644 --- a/addons/kenney_prototype_textures/dark/texture_03.png.import +++ b/addons/kenney_prototype_textures/dark/texture_03.png.import @@ -4,15 +4,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://kijtpalgio4q" path.s3tc="res://.godot/imported/texture_03.png-eef45c22e5a84c5df22e7f80e41112c6.s3tc.ctex" +path.etc2="res://.godot/imported/texture_03.png-eef45c22e5a84c5df22e7f80e41112c6.etc2.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } [deps] source_file="res://addons/kenney_prototype_textures/dark/texture_03.png" -dest_files=["res://.godot/imported/texture_03.png-eef45c22e5a84c5df22e7f80e41112c6.s3tc.ctex"] +dest_files=["res://.godot/imported/texture_03.png-eef45c22e5a84c5df22e7f80e41112c6.s3tc.ctex", "res://.godot/imported/texture_03.png-eef45c22e5a84c5df22e7f80e41112c6.etc2.ctex"] [params] diff --git a/addons/kenney_prototype_textures/dark/texture_04.png.import b/addons/kenney_prototype_textures/dark/texture_04.png.import index 0624d64..44ab4c5 100644 --- a/addons/kenney_prototype_textures/dark/texture_04.png.import +++ b/addons/kenney_prototype_textures/dark/texture_04.png.import @@ -4,15 +4,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://e4nd8b6f0tw7" path.s3tc="res://.godot/imported/texture_04.png-af505c12b2a7903458bb29299e718506.s3tc.ctex" +path.etc2="res://.godot/imported/texture_04.png-af505c12b2a7903458bb29299e718506.etc2.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } [deps] source_file="res://addons/kenney_prototype_textures/dark/texture_04.png" -dest_files=["res://.godot/imported/texture_04.png-af505c12b2a7903458bb29299e718506.s3tc.ctex"] +dest_files=["res://.godot/imported/texture_04.png-af505c12b2a7903458bb29299e718506.s3tc.ctex", "res://.godot/imported/texture_04.png-af505c12b2a7903458bb29299e718506.etc2.ctex"] [params] diff --git a/addons/kenney_prototype_textures/dark/texture_06.png.import b/addons/kenney_prototype_textures/dark/texture_06.png.import index 8d1dc4f..7ae42ad 100644 --- a/addons/kenney_prototype_textures/dark/texture_06.png.import +++ b/addons/kenney_prototype_textures/dark/texture_06.png.import @@ -4,15 +4,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://du0f7hc4skged" path.s3tc="res://.godot/imported/texture_06.png-004ed3d5b88361cdfb83a20714e917e7.s3tc.ctex" +path.etc2="res://.godot/imported/texture_06.png-004ed3d5b88361cdfb83a20714e917e7.etc2.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } [deps] source_file="res://addons/kenney_prototype_textures/dark/texture_06.png" -dest_files=["res://.godot/imported/texture_06.png-004ed3d5b88361cdfb83a20714e917e7.s3tc.ctex"] +dest_files=["res://.godot/imported/texture_06.png-004ed3d5b88361cdfb83a20714e917e7.s3tc.ctex", "res://.godot/imported/texture_06.png-004ed3d5b88361cdfb83a20714e917e7.etc2.ctex"] [params] diff --git a/addons/kenney_prototype_textures/dark/texture_07.png.import b/addons/kenney_prototype_textures/dark/texture_07.png.import index 66f733e..affd62e 100644 --- a/addons/kenney_prototype_textures/dark/texture_07.png.import +++ b/addons/kenney_prototype_textures/dark/texture_07.png.import @@ -4,15 +4,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://bg7hbu285xx3c" path.s3tc="res://.godot/imported/texture_07.png-7c77ff22e41b4a54319073cb71530d81.s3tc.ctex" +path.etc2="res://.godot/imported/texture_07.png-7c77ff22e41b4a54319073cb71530d81.etc2.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } [deps] source_file="res://addons/kenney_prototype_textures/dark/texture_07.png" -dest_files=["res://.godot/imported/texture_07.png-7c77ff22e41b4a54319073cb71530d81.s3tc.ctex"] +dest_files=["res://.godot/imported/texture_07.png-7c77ff22e41b4a54319073cb71530d81.s3tc.ctex", "res://.godot/imported/texture_07.png-7c77ff22e41b4a54319073cb71530d81.etc2.ctex"] [params] diff --git a/addons/kenney_prototype_textures/dark/texture_08.png.import b/addons/kenney_prototype_textures/dark/texture_08.png.import index 4cf77b0..28b2cd3 100644 --- a/addons/kenney_prototype_textures/dark/texture_08.png.import +++ b/addons/kenney_prototype_textures/dark/texture_08.png.import @@ -4,15 +4,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://o0rxfy5dvpsb" path.s3tc="res://.godot/imported/texture_08.png-5883ddd047173c8b118ead887054e6fc.s3tc.ctex" +path.etc2="res://.godot/imported/texture_08.png-5883ddd047173c8b118ead887054e6fc.etc2.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } [deps] source_file="res://addons/kenney_prototype_textures/dark/texture_08.png" -dest_files=["res://.godot/imported/texture_08.png-5883ddd047173c8b118ead887054e6fc.s3tc.ctex"] +dest_files=["res://.godot/imported/texture_08.png-5883ddd047173c8b118ead887054e6fc.s3tc.ctex", "res://.godot/imported/texture_08.png-5883ddd047173c8b118ead887054e6fc.etc2.ctex"] [params] diff --git a/addons/kenney_prototype_textures/dark/texture_09.png.import b/addons/kenney_prototype_textures/dark/texture_09.png.import index 81c72f1..e990591 100644 --- a/addons/kenney_prototype_textures/dark/texture_09.png.import +++ b/addons/kenney_prototype_textures/dark/texture_09.png.import @@ -4,15 +4,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://cxj3qslcw455r" path.s3tc="res://.godot/imported/texture_09.png-8e25cd5657e2d326068eb27bfa1aacec.s3tc.ctex" +path.etc2="res://.godot/imported/texture_09.png-8e25cd5657e2d326068eb27bfa1aacec.etc2.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } [deps] source_file="res://addons/kenney_prototype_textures/dark/texture_09.png" -dest_files=["res://.godot/imported/texture_09.png-8e25cd5657e2d326068eb27bfa1aacec.s3tc.ctex"] +dest_files=["res://.godot/imported/texture_09.png-8e25cd5657e2d326068eb27bfa1aacec.s3tc.ctex", "res://.godot/imported/texture_09.png-8e25cd5657e2d326068eb27bfa1aacec.etc2.ctex"] [params] diff --git a/addons/kenney_prototype_textures/dark/texture_10.png.import b/addons/kenney_prototype_textures/dark/texture_10.png.import index 53c3f21..1d9b18a 100644 --- a/addons/kenney_prototype_textures/dark/texture_10.png.import +++ b/addons/kenney_prototype_textures/dark/texture_10.png.import @@ -4,15 +4,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://n25a1tlc20r2" path.s3tc="res://.godot/imported/texture_10.png-1e788999a192eabd201c3b3435475799.s3tc.ctex" +path.etc2="res://.godot/imported/texture_10.png-1e788999a192eabd201c3b3435475799.etc2.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } [deps] source_file="res://addons/kenney_prototype_textures/dark/texture_10.png" -dest_files=["res://.godot/imported/texture_10.png-1e788999a192eabd201c3b3435475799.s3tc.ctex"] +dest_files=["res://.godot/imported/texture_10.png-1e788999a192eabd201c3b3435475799.s3tc.ctex", "res://.godot/imported/texture_10.png-1e788999a192eabd201c3b3435475799.etc2.ctex"] [params] diff --git a/addons/kenney_prototype_textures/dark/texture_11.png.import b/addons/kenney_prototype_textures/dark/texture_11.png.import index c32fe65..b075afd 100644 --- a/addons/kenney_prototype_textures/dark/texture_11.png.import +++ b/addons/kenney_prototype_textures/dark/texture_11.png.import @@ -4,15 +4,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://ciwwbgcpode0d" path.s3tc="res://.godot/imported/texture_11.png-f61ad46caf1a41d85454e490ec43c8ec.s3tc.ctex" +path.etc2="res://.godot/imported/texture_11.png-f61ad46caf1a41d85454e490ec43c8ec.etc2.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } [deps] source_file="res://addons/kenney_prototype_textures/dark/texture_11.png" -dest_files=["res://.godot/imported/texture_11.png-f61ad46caf1a41d85454e490ec43c8ec.s3tc.ctex"] +dest_files=["res://.godot/imported/texture_11.png-f61ad46caf1a41d85454e490ec43c8ec.s3tc.ctex", "res://.godot/imported/texture_11.png-f61ad46caf1a41d85454e490ec43c8ec.etc2.ctex"] [params] diff --git a/addons/kenney_prototype_textures/dark/texture_12.png.import b/addons/kenney_prototype_textures/dark/texture_12.png.import index 504e71c..3037408 100644 --- a/addons/kenney_prototype_textures/dark/texture_12.png.import +++ b/addons/kenney_prototype_textures/dark/texture_12.png.import @@ -4,15 +4,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://dsf0exq5n4glb" path.s3tc="res://.godot/imported/texture_12.png-aa893b2c5354267551e55ec14bb1999b.s3tc.ctex" +path.etc2="res://.godot/imported/texture_12.png-aa893b2c5354267551e55ec14bb1999b.etc2.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } [deps] source_file="res://addons/kenney_prototype_textures/dark/texture_12.png" -dest_files=["res://.godot/imported/texture_12.png-aa893b2c5354267551e55ec14bb1999b.s3tc.ctex"] +dest_files=["res://.godot/imported/texture_12.png-aa893b2c5354267551e55ec14bb1999b.s3tc.ctex", "res://.godot/imported/texture_12.png-aa893b2c5354267551e55ec14bb1999b.etc2.ctex"] [params] diff --git a/addons/kenney_prototype_textures/green/texture_01.png.import b/addons/kenney_prototype_textures/green/texture_01.png.import index ed305ab..55ac8d2 100644 --- a/addons/kenney_prototype_textures/green/texture_01.png.import +++ b/addons/kenney_prototype_textures/green/texture_01.png.import @@ -4,15 +4,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://brf3u1fddrxlq" path.s3tc="res://.godot/imported/texture_01.png-94ebd82494c839e91a05b9e1cc2750ca.s3tc.ctex" +path.etc2="res://.godot/imported/texture_01.png-94ebd82494c839e91a05b9e1cc2750ca.etc2.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } [deps] source_file="res://addons/kenney_prototype_textures/green/texture_01.png" -dest_files=["res://.godot/imported/texture_01.png-94ebd82494c839e91a05b9e1cc2750ca.s3tc.ctex"] +dest_files=["res://.godot/imported/texture_01.png-94ebd82494c839e91a05b9e1cc2750ca.s3tc.ctex", "res://.godot/imported/texture_01.png-94ebd82494c839e91a05b9e1cc2750ca.etc2.ctex"] [params] diff --git a/addons/kenney_prototype_textures/green/texture_02.png.import b/addons/kenney_prototype_textures/green/texture_02.png.import index 7b4c3f1..b07b3b1 100644 --- a/addons/kenney_prototype_textures/green/texture_02.png.import +++ b/addons/kenney_prototype_textures/green/texture_02.png.import @@ -4,15 +4,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://yg2714dns88k" path.s3tc="res://.godot/imported/texture_02.png-aa1bb055b55bdc7c20e196b7286eebdf.s3tc.ctex" +path.etc2="res://.godot/imported/texture_02.png-aa1bb055b55bdc7c20e196b7286eebdf.etc2.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } [deps] source_file="res://addons/kenney_prototype_textures/green/texture_02.png" -dest_files=["res://.godot/imported/texture_02.png-aa1bb055b55bdc7c20e196b7286eebdf.s3tc.ctex"] +dest_files=["res://.godot/imported/texture_02.png-aa1bb055b55bdc7c20e196b7286eebdf.s3tc.ctex", "res://.godot/imported/texture_02.png-aa1bb055b55bdc7c20e196b7286eebdf.etc2.ctex"] [params] diff --git a/addons/kenney_prototype_textures/green/texture_04.png.import b/addons/kenney_prototype_textures/green/texture_04.png.import index 8cc8d31..12252ed 100644 --- a/addons/kenney_prototype_textures/green/texture_04.png.import +++ b/addons/kenney_prototype_textures/green/texture_04.png.import @@ -4,15 +4,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://kbyfceu4geke" path.s3tc="res://.godot/imported/texture_04.png-4678cc1dfb831f775bdc30cfd7f78769.s3tc.ctex" +path.etc2="res://.godot/imported/texture_04.png-4678cc1dfb831f775bdc30cfd7f78769.etc2.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } [deps] source_file="res://addons/kenney_prototype_textures/green/texture_04.png" -dest_files=["res://.godot/imported/texture_04.png-4678cc1dfb831f775bdc30cfd7f78769.s3tc.ctex"] +dest_files=["res://.godot/imported/texture_04.png-4678cc1dfb831f775bdc30cfd7f78769.s3tc.ctex", "res://.godot/imported/texture_04.png-4678cc1dfb831f775bdc30cfd7f78769.etc2.ctex"] [params] diff --git a/addons/kenney_prototype_textures/light/texture_01.png.import b/addons/kenney_prototype_textures/light/texture_01.png.import index 4232cf2..895ef6a 100644 --- a/addons/kenney_prototype_textures/light/texture_01.png.import +++ b/addons/kenney_prototype_textures/light/texture_01.png.import @@ -4,15 +4,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://dkaygit5l83nq" path.s3tc="res://.godot/imported/texture_01.png-e10423e44834e1b4a90c3134e446b32d.s3tc.ctex" +path.etc2="res://.godot/imported/texture_01.png-e10423e44834e1b4a90c3134e446b32d.etc2.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } [deps] source_file="res://addons/kenney_prototype_textures/light/texture_01.png" -dest_files=["res://.godot/imported/texture_01.png-e10423e44834e1b4a90c3134e446b32d.s3tc.ctex"] +dest_files=["res://.godot/imported/texture_01.png-e10423e44834e1b4a90c3134e446b32d.s3tc.ctex", "res://.godot/imported/texture_01.png-e10423e44834e1b4a90c3134e446b32d.etc2.ctex"] [params] diff --git a/addons/kenney_prototype_textures/light/texture_02.png.import b/addons/kenney_prototype_textures/light/texture_02.png.import index dfcf621..2f6c05c 100644 --- a/addons/kenney_prototype_textures/light/texture_02.png.import +++ b/addons/kenney_prototype_textures/light/texture_02.png.import @@ -4,15 +4,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://bpgpb8fitgael" path.s3tc="res://.godot/imported/texture_02.png-ffde4d38b35463525c3815b255790206.s3tc.ctex" +path.etc2="res://.godot/imported/texture_02.png-ffde4d38b35463525c3815b255790206.etc2.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } [deps] source_file="res://addons/kenney_prototype_textures/light/texture_02.png" -dest_files=["res://.godot/imported/texture_02.png-ffde4d38b35463525c3815b255790206.s3tc.ctex"] +dest_files=["res://.godot/imported/texture_02.png-ffde4d38b35463525c3815b255790206.s3tc.ctex", "res://.godot/imported/texture_02.png-ffde4d38b35463525c3815b255790206.etc2.ctex"] [params] diff --git a/addons/kenney_prototype_textures/orange/texture_01.png.import b/addons/kenney_prototype_textures/orange/texture_01.png.import index 1a524ca..d903d10 100644 --- a/addons/kenney_prototype_textures/orange/texture_01.png.import +++ b/addons/kenney_prototype_textures/orange/texture_01.png.import @@ -4,15 +4,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://dydo6bjsqw3fq" path.s3tc="res://.godot/imported/texture_01.png-2bf7db98e09b5b5073e8e8ca66419718.s3tc.ctex" +path.etc2="res://.godot/imported/texture_01.png-2bf7db98e09b5b5073e8e8ca66419718.etc2.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } [deps] source_file="res://addons/kenney_prototype_textures/orange/texture_01.png" -dest_files=["res://.godot/imported/texture_01.png-2bf7db98e09b5b5073e8e8ca66419718.s3tc.ctex"] +dest_files=["res://.godot/imported/texture_01.png-2bf7db98e09b5b5073e8e8ca66419718.s3tc.ctex", "res://.godot/imported/texture_01.png-2bf7db98e09b5b5073e8e8ca66419718.etc2.ctex"] [params] diff --git a/addons/kenney_prototype_textures/orange/texture_02.png.import b/addons/kenney_prototype_textures/orange/texture_02.png.import index 5ffbaf0..455fb1a 100644 --- a/addons/kenney_prototype_textures/orange/texture_02.png.import +++ b/addons/kenney_prototype_textures/orange/texture_02.png.import @@ -4,15 +4,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://beclpsa6h0k4g" path.s3tc="res://.godot/imported/texture_02.png-4eab4e19c2171e5b0668b65373b74c6d.s3tc.ctex" +path.etc2="res://.godot/imported/texture_02.png-4eab4e19c2171e5b0668b65373b74c6d.etc2.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } [deps] source_file="res://addons/kenney_prototype_textures/orange/texture_02.png" -dest_files=["res://.godot/imported/texture_02.png-4eab4e19c2171e5b0668b65373b74c6d.s3tc.ctex"] +dest_files=["res://.godot/imported/texture_02.png-4eab4e19c2171e5b0668b65373b74c6d.s3tc.ctex", "res://.godot/imported/texture_02.png-4eab4e19c2171e5b0668b65373b74c6d.etc2.ctex"] [params] diff --git a/addons/kenney_prototype_textures/orange/texture_09.png.import b/addons/kenney_prototype_textures/orange/texture_09.png.import index 796e535..ce0ae38 100644 --- a/addons/kenney_prototype_textures/orange/texture_09.png.import +++ b/addons/kenney_prototype_textures/orange/texture_09.png.import @@ -4,15 +4,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://c5uytbu1wc1bq" path.s3tc="res://.godot/imported/texture_09.png-d3e0d0da868b68102c983480f9cde71d.s3tc.ctex" +path.etc2="res://.godot/imported/texture_09.png-d3e0d0da868b68102c983480f9cde71d.etc2.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } [deps] source_file="res://addons/kenney_prototype_textures/orange/texture_09.png" -dest_files=["res://.godot/imported/texture_09.png-d3e0d0da868b68102c983480f9cde71d.s3tc.ctex"] +dest_files=["res://.godot/imported/texture_09.png-d3e0d0da868b68102c983480f9cde71d.s3tc.ctex", "res://.godot/imported/texture_09.png-d3e0d0da868b68102c983480f9cde71d.etc2.ctex"] [params] diff --git a/addons/kenney_prototype_textures/orange/texture_10.png.import b/addons/kenney_prototype_textures/orange/texture_10.png.import index bd6ab0f..8483047 100644 --- a/addons/kenney_prototype_textures/orange/texture_10.png.import +++ b/addons/kenney_prototype_textures/orange/texture_10.png.import @@ -4,15 +4,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://fn1k1ebe2uhx" path.s3tc="res://.godot/imported/texture_10.png-6f0f09db66c0562f01b2d2954722e3af.s3tc.ctex" +path.etc2="res://.godot/imported/texture_10.png-6f0f09db66c0562f01b2d2954722e3af.etc2.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } [deps] source_file="res://addons/kenney_prototype_textures/orange/texture_10.png" -dest_files=["res://.godot/imported/texture_10.png-6f0f09db66c0562f01b2d2954722e3af.s3tc.ctex"] +dest_files=["res://.godot/imported/texture_10.png-6f0f09db66c0562f01b2d2954722e3af.s3tc.ctex", "res://.godot/imported/texture_10.png-6f0f09db66c0562f01b2d2954722e3af.etc2.ctex"] [params] diff --git a/addons/kenney_prototype_textures/orange/texture_13.png.import b/addons/kenney_prototype_textures/orange/texture_13.png.import index d9c3a08..463f3f5 100644 --- a/addons/kenney_prototype_textures/orange/texture_13.png.import +++ b/addons/kenney_prototype_textures/orange/texture_13.png.import @@ -4,15 +4,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://d1nfjip21kjpu" path.s3tc="res://.godot/imported/texture_13.png-a11a0cfe132bc07bf4c480fd4334a284.s3tc.ctex" +path.etc2="res://.godot/imported/texture_13.png-a11a0cfe132bc07bf4c480fd4334a284.etc2.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } [deps] source_file="res://addons/kenney_prototype_textures/orange/texture_13.png" -dest_files=["res://.godot/imported/texture_13.png-a11a0cfe132bc07bf4c480fd4334a284.s3tc.ctex"] +dest_files=["res://.godot/imported/texture_13.png-a11a0cfe132bc07bf4c480fd4334a284.s3tc.ctex", "res://.godot/imported/texture_13.png-a11a0cfe132bc07bf4c480fd4334a284.etc2.ctex"] [params] diff --git a/addons/kenney_prototype_textures/purple/texture_02.png.import b/addons/kenney_prototype_textures/purple/texture_02.png.import index 320c1f5..4a3e0f7 100644 --- a/addons/kenney_prototype_textures/purple/texture_02.png.import +++ b/addons/kenney_prototype_textures/purple/texture_02.png.import @@ -4,15 +4,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://dx31pblshvnjw" path.s3tc="res://.godot/imported/texture_02.png-fcb52d424cd62d43221e4153fa3176f8.s3tc.ctex" +path.etc2="res://.godot/imported/texture_02.png-fcb52d424cd62d43221e4153fa3176f8.etc2.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } [deps] source_file="res://addons/kenney_prototype_textures/purple/texture_02.png" -dest_files=["res://.godot/imported/texture_02.png-fcb52d424cd62d43221e4153fa3176f8.s3tc.ctex"] +dest_files=["res://.godot/imported/texture_02.png-fcb52d424cd62d43221e4153fa3176f8.s3tc.ctex", "res://.godot/imported/texture_02.png-fcb52d424cd62d43221e4153fa3176f8.etc2.ctex"] [params] diff --git a/addons/kenney_prototype_textures/red/texture_02.png.import b/addons/kenney_prototype_textures/red/texture_02.png.import index b6e0636..da27c8c 100644 --- a/addons/kenney_prototype_textures/red/texture_02.png.import +++ b/addons/kenney_prototype_textures/red/texture_02.png.import @@ -4,15 +4,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://coqym2otrhygu" path.s3tc="res://.godot/imported/texture_02.png-bb6eefc15212ba5b8098e9e672c21f12.s3tc.ctex" +path.etc2="res://.godot/imported/texture_02.png-bb6eefc15212ba5b8098e9e672c21f12.etc2.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } [deps] source_file="res://addons/kenney_prototype_textures/red/texture_02.png" -dest_files=["res://.godot/imported/texture_02.png-bb6eefc15212ba5b8098e9e672c21f12.s3tc.ctex"] +dest_files=["res://.godot/imported/texture_02.png-bb6eefc15212ba5b8098e9e672c21f12.s3tc.ctex", "res://.godot/imported/texture_02.png-bb6eefc15212ba5b8098e9e672c21f12.etc2.ctex"] [params] diff --git a/assets/models/low_poly_weapon/M9_Bayonet_M9_Bayonet.png.import b/assets/models/low_poly_weapon/M9_Bayonet_M9_Bayonet.png.import index 2973521..b8de0f0 100644 --- a/assets/models/low_poly_weapon/M9_Bayonet_M9_Bayonet.png.import +++ b/assets/models/low_poly_weapon/M9_Bayonet_M9_Bayonet.png.import @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6f437a2a35441d67e1b7dd399dc5efbefb68d5ad8e35a5b1f0340531d88122bf -size 941 +oid sha256:42ee40f7d9746ed4720b15122c3ed43c224100aed57057bfc4021b406e9b56f1 +size 1151 diff --git a/assets/models/maps/el_test_Image_0.png.import b/assets/models/maps/el_test_Image_0.png.import index 2ecc121..dff863f 100644 --- a/assets/models/maps/el_test_Image_0.png.import +++ b/assets/models/maps/el_test_Image_0.png.import @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cb95a680ea14d3b14c4c21c936092592b18e1f2612ce71f0e58d3cb494ad721b -size 912 +oid sha256:f5956a6f0ce4b074e8c041b4f241d6216939e259d181a73d860392a57b747744 +size 1110 diff --git a/assets/models/maps/el_test_Image_1.png.import b/assets/models/maps/el_test_Image_1.png.import index 4e471b2..0628ed4 100644 --- a/assets/models/maps/el_test_Image_1.png.import +++ b/assets/models/maps/el_test_Image_1.png.import @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:33d661dd2502095dd1701100629225ecbfdeb94e6d66b58e896d4e26c397a4ce -size 913 +oid sha256:d6a3a96d7372090a9bd934992812823efe671b4a4de72cf0e671c7d32d2e3e30 +size 1111 diff --git a/assets/models/maps/el_test_Image_2.png.import b/assets/models/maps/el_test_Image_2.png.import index 9c3349b..835ccb0 100644 --- a/assets/models/maps/el_test_Image_2.png.import +++ b/assets/models/maps/el_test_Image_2.png.import @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:61ab462102e7ed00253e326bf2259d181ca1fb7df2c4a19c93d954c8012ec015 -size 912 +oid sha256:1c1268afe56914c6fe16703f84683540bec0b872b7c3d73aad0b525db2d6609f +size 1110 diff --git a/export_presets.cfg b/export_presets.cfg new file mode 100644 index 0000000..95a556d --- /dev/null +++ b/export_presets.cfg @@ -0,0 +1,548 @@ +[preset.0] + +name="[Dedicated Server] MacOS" +platform="macOS" +runnable=true +advanced_options=false +dedicated_server=true +custom_features="" +export_filter="customized" +customized_files={ +"res://": "strip" +} +include_filter="" +exclude_filter="" +export_path="./Open Strike.dmg" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false +script_export_mode=2 + +[preset.0.options] + +export/distribution_type=0 +binary_format/architecture="universal" +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +application/icon="" +application/icon_interpolation=4 +application/bundle_identifier="test" +application/signature="" +application/app_category="Games" +application/short_version="" +application/version="" +application/copyright="" +application/copyright_localized={} +application/min_macos_version="10.12" +application/export_angle=0 +display/high_res=true +application/additional_plist_content="" +xcode/platform_build="14C18" +xcode/sdk_version="13.1" +xcode/sdk_build="22C55" +xcode/sdk_name="macosx13.1" +xcode/xcode_version="1420" +xcode/xcode_build="14C18" +codesign/codesign=3 +codesign/installer_identity="" +codesign/apple_team_id="" +codesign/identity="" +codesign/entitlements/custom_file="" +codesign/entitlements/allow_jit_code_execution=false +codesign/entitlements/allow_unsigned_executable_memory=false +codesign/entitlements/allow_dyld_environment_variables=false +codesign/entitlements/disable_library_validation=false +codesign/entitlements/audio_input=false +codesign/entitlements/camera=false +codesign/entitlements/location=false +codesign/entitlements/address_book=false +codesign/entitlements/calendars=false +codesign/entitlements/photos_library=false +codesign/entitlements/apple_events=false +codesign/entitlements/debugging=false +codesign/entitlements/app_sandbox/enabled=false +codesign/entitlements/app_sandbox/network_server=false +codesign/entitlements/app_sandbox/network_client=false +codesign/entitlements/app_sandbox/device_usb=false +codesign/entitlements/app_sandbox/device_bluetooth=false +codesign/entitlements/app_sandbox/files_downloads=0 +codesign/entitlements/app_sandbox/files_pictures=0 +codesign/entitlements/app_sandbox/files_music=0 +codesign/entitlements/app_sandbox/files_movies=0 +codesign/entitlements/app_sandbox/files_user_selected=0 +codesign/entitlements/app_sandbox/helper_executables=[] +codesign/custom_options=PackedStringArray() +notarization/notarization=0 +privacy/microphone_usage_description="" +privacy/microphone_usage_description_localized={} +privacy/camera_usage_description="" +privacy/camera_usage_description_localized={} +privacy/location_usage_description="" +privacy/location_usage_description_localized={} +privacy/address_book_usage_description="" +privacy/address_book_usage_description_localized={} +privacy/calendar_usage_description="" +privacy/calendar_usage_description_localized={} +privacy/photos_library_usage_description="" +privacy/photos_library_usage_description_localized={} +privacy/desktop_folder_usage_description="" +privacy/desktop_folder_usage_description_localized={} +privacy/documents_folder_usage_description="" +privacy/documents_folder_usage_description_localized={} +privacy/downloads_folder_usage_description="" +privacy/downloads_folder_usage_description_localized={} +privacy/network_volumes_usage_description="" +privacy/network_volumes_usage_description_localized={} +privacy/removable_volumes_usage_description="" +privacy/removable_volumes_usage_description_localized={} +privacy/tracking_enabled=false +privacy/tracking_domains=PackedStringArray() +privacy/collected_data/name/collected=false +privacy/collected_data/name/linked_to_user=false +privacy/collected_data/name/used_for_tracking=false +privacy/collected_data/name/collection_purposes=0 +privacy/collected_data/email_address/collected=false +privacy/collected_data/email_address/linked_to_user=false +privacy/collected_data/email_address/used_for_tracking=false +privacy/collected_data/email_address/collection_purposes=0 +privacy/collected_data/phone_number/collected=false +privacy/collected_data/phone_number/linked_to_user=false +privacy/collected_data/phone_number/used_for_tracking=false +privacy/collected_data/phone_number/collection_purposes=0 +privacy/collected_data/physical_address/collected=false +privacy/collected_data/physical_address/linked_to_user=false +privacy/collected_data/physical_address/used_for_tracking=false +privacy/collected_data/physical_address/collection_purposes=0 +privacy/collected_data/other_contact_info/collected=false +privacy/collected_data/other_contact_info/linked_to_user=false +privacy/collected_data/other_contact_info/used_for_tracking=false +privacy/collected_data/other_contact_info/collection_purposes=0 +privacy/collected_data/health/collected=false +privacy/collected_data/health/linked_to_user=false +privacy/collected_data/health/used_for_tracking=false +privacy/collected_data/health/collection_purposes=0 +privacy/collected_data/fitness/collected=false +privacy/collected_data/fitness/linked_to_user=false +privacy/collected_data/fitness/used_for_tracking=false +privacy/collected_data/fitness/collection_purposes=0 +privacy/collected_data/payment_info/collected=false +privacy/collected_data/payment_info/linked_to_user=false +privacy/collected_data/payment_info/used_for_tracking=false +privacy/collected_data/payment_info/collection_purposes=0 +privacy/collected_data/credit_info/collected=false +privacy/collected_data/credit_info/linked_to_user=false +privacy/collected_data/credit_info/used_for_tracking=false +privacy/collected_data/credit_info/collection_purposes=0 +privacy/collected_data/other_financial_info/collected=false +privacy/collected_data/other_financial_info/linked_to_user=false +privacy/collected_data/other_financial_info/used_for_tracking=false +privacy/collected_data/other_financial_info/collection_purposes=0 +privacy/collected_data/precise_location/collected=false +privacy/collected_data/precise_location/linked_to_user=false +privacy/collected_data/precise_location/used_for_tracking=false +privacy/collected_data/precise_location/collection_purposes=0 +privacy/collected_data/coarse_location/collected=false +privacy/collected_data/coarse_location/linked_to_user=false +privacy/collected_data/coarse_location/used_for_tracking=false +privacy/collected_data/coarse_location/collection_purposes=0 +privacy/collected_data/sensitive_info/collected=false +privacy/collected_data/sensitive_info/linked_to_user=false +privacy/collected_data/sensitive_info/used_for_tracking=false +privacy/collected_data/sensitive_info/collection_purposes=0 +privacy/collected_data/contacts/collected=false +privacy/collected_data/contacts/linked_to_user=false +privacy/collected_data/contacts/used_for_tracking=false +privacy/collected_data/contacts/collection_purposes=0 +privacy/collected_data/emails_or_text_messages/collected=false +privacy/collected_data/emails_or_text_messages/linked_to_user=false +privacy/collected_data/emails_or_text_messages/used_for_tracking=false +privacy/collected_data/emails_or_text_messages/collection_purposes=0 +privacy/collected_data/photos_or_videos/collected=false +privacy/collected_data/photos_or_videos/linked_to_user=false +privacy/collected_data/photos_or_videos/used_for_tracking=false +privacy/collected_data/photos_or_videos/collection_purposes=0 +privacy/collected_data/audio_data/collected=false +privacy/collected_data/audio_data/linked_to_user=false +privacy/collected_data/audio_data/used_for_tracking=false +privacy/collected_data/audio_data/collection_purposes=0 +privacy/collected_data/gameplay_content/collected=false +privacy/collected_data/gameplay_content/linked_to_user=false +privacy/collected_data/gameplay_content/used_for_tracking=false +privacy/collected_data/gameplay_content/collection_purposes=0 +privacy/collected_data/customer_support/collected=false +privacy/collected_data/customer_support/linked_to_user=false +privacy/collected_data/customer_support/used_for_tracking=false +privacy/collected_data/customer_support/collection_purposes=0 +privacy/collected_data/other_user_content/collected=false +privacy/collected_data/other_user_content/linked_to_user=false +privacy/collected_data/other_user_content/used_for_tracking=false +privacy/collected_data/other_user_content/collection_purposes=0 +privacy/collected_data/browsing_history/collected=false +privacy/collected_data/browsing_history/linked_to_user=false +privacy/collected_data/browsing_history/used_for_tracking=false +privacy/collected_data/browsing_history/collection_purposes=0 +privacy/collected_data/search_hhistory/collected=false +privacy/collected_data/search_hhistory/linked_to_user=false +privacy/collected_data/search_hhistory/used_for_tracking=false +privacy/collected_data/search_hhistory/collection_purposes=0 +privacy/collected_data/user_id/collected=false +privacy/collected_data/user_id/linked_to_user=false +privacy/collected_data/user_id/used_for_tracking=false +privacy/collected_data/user_id/collection_purposes=0 +privacy/collected_data/device_id/collected=false +privacy/collected_data/device_id/linked_to_user=false +privacy/collected_data/device_id/used_for_tracking=false +privacy/collected_data/device_id/collection_purposes=0 +privacy/collected_data/purchase_history/collected=false +privacy/collected_data/purchase_history/linked_to_user=false +privacy/collected_data/purchase_history/used_for_tracking=false +privacy/collected_data/purchase_history/collection_purposes=0 +privacy/collected_data/product_interaction/collected=false +privacy/collected_data/product_interaction/linked_to_user=false +privacy/collected_data/product_interaction/used_for_tracking=false +privacy/collected_data/product_interaction/collection_purposes=0 +privacy/collected_data/advertising_data/collected=false +privacy/collected_data/advertising_data/linked_to_user=false +privacy/collected_data/advertising_data/used_for_tracking=false +privacy/collected_data/advertising_data/collection_purposes=0 +privacy/collected_data/other_usage_data/collected=false +privacy/collected_data/other_usage_data/linked_to_user=false +privacy/collected_data/other_usage_data/used_for_tracking=false +privacy/collected_data/other_usage_data/collection_purposes=0 +privacy/collected_data/crash_data/collected=false +privacy/collected_data/crash_data/linked_to_user=false +privacy/collected_data/crash_data/used_for_tracking=false +privacy/collected_data/crash_data/collection_purposes=0 +privacy/collected_data/performance_data/collected=false +privacy/collected_data/performance_data/linked_to_user=false +privacy/collected_data/performance_data/used_for_tracking=false +privacy/collected_data/performance_data/collection_purposes=0 +privacy/collected_data/other_diagnostic_data/collected=false +privacy/collected_data/other_diagnostic_data/linked_to_user=false +privacy/collected_data/other_diagnostic_data/used_for_tracking=false +privacy/collected_data/other_diagnostic_data/collection_purposes=0 +privacy/collected_data/environment_scanning/collected=false +privacy/collected_data/environment_scanning/linked_to_user=false +privacy/collected_data/environment_scanning/used_for_tracking=false +privacy/collected_data/environment_scanning/collection_purposes=0 +privacy/collected_data/hands/collected=false +privacy/collected_data/hands/linked_to_user=false +privacy/collected_data/hands/used_for_tracking=false +privacy/collected_data/hands/collection_purposes=0 +privacy/collected_data/head/collected=false +privacy/collected_data/head/linked_to_user=false +privacy/collected_data/head/used_for_tracking=false +privacy/collected_data/head/collection_purposes=0 +privacy/collected_data/other_data_types/collected=false +privacy/collected_data/other_data_types/linked_to_user=false +privacy/collected_data/other_data_types/used_for_tracking=false +privacy/collected_data/other_data_types/collection_purposes=0 +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="#!/usr/bin/env bash +unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\" +open \"{temp_dir}/{exe_name}.app\" --args {cmd_args}" +ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash +kill $(pgrep -x -f \"{temp_dir}/{exe_name}.app/Contents/MacOS/{exe_name} {cmd_args}\") +rm -rf \"{temp_dir}\"" + +[preset.1] + +name="macOS" +platform="macOS" +runnable=false +advanced_options=false +dedicated_server=true +custom_features="" +export_filter="customized" +customized_files={ +"res://": "strip" +} +include_filter="" +exclude_filter="" +export_path="" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false +script_export_mode=2 + +[preset.1.options] + +export/distribution_type=0 +binary_format/architecture="universal" +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +application/icon="" +application/icon_interpolation=4 +application/bundle_identifier="test" +application/signature="" +application/app_category="Games" +application/short_version="" +application/version="" +application/copyright="" +application/copyright_localized={} +application/min_macos_version="10.12" +application/export_angle=0 +display/high_res=true +application/additional_plist_content="" +xcode/platform_build="14C18" +xcode/sdk_version="13.1" +xcode/sdk_build="22C55" +xcode/sdk_name="macosx13.1" +xcode/xcode_version="1420" +xcode/xcode_build="14C18" +codesign/codesign=3 +codesign/installer_identity="" +codesign/apple_team_id="" +codesign/identity="" +codesign/entitlements/custom_file="" +codesign/entitlements/allow_jit_code_execution=false +codesign/entitlements/allow_unsigned_executable_memory=false +codesign/entitlements/allow_dyld_environment_variables=false +codesign/entitlements/disable_library_validation=false +codesign/entitlements/audio_input=false +codesign/entitlements/camera=false +codesign/entitlements/location=false +codesign/entitlements/address_book=false +codesign/entitlements/calendars=false +codesign/entitlements/photos_library=false +codesign/entitlements/apple_events=false +codesign/entitlements/debugging=false +codesign/entitlements/app_sandbox/enabled=false +codesign/entitlements/app_sandbox/network_server=false +codesign/entitlements/app_sandbox/network_client=false +codesign/entitlements/app_sandbox/device_usb=false +codesign/entitlements/app_sandbox/device_bluetooth=false +codesign/entitlements/app_sandbox/files_downloads=0 +codesign/entitlements/app_sandbox/files_pictures=0 +codesign/entitlements/app_sandbox/files_music=0 +codesign/entitlements/app_sandbox/files_movies=0 +codesign/entitlements/app_sandbox/files_user_selected=0 +codesign/entitlements/app_sandbox/helper_executables=[] +codesign/custom_options=PackedStringArray() +notarization/notarization=0 +privacy/microphone_usage_description="" +privacy/microphone_usage_description_localized={} +privacy/camera_usage_description="" +privacy/camera_usage_description_localized={} +privacy/location_usage_description="" +privacy/location_usage_description_localized={} +privacy/address_book_usage_description="" +privacy/address_book_usage_description_localized={} +privacy/calendar_usage_description="" +privacy/calendar_usage_description_localized={} +privacy/photos_library_usage_description="" +privacy/photos_library_usage_description_localized={} +privacy/desktop_folder_usage_description="" +privacy/desktop_folder_usage_description_localized={} +privacy/documents_folder_usage_description="" +privacy/documents_folder_usage_description_localized={} +privacy/downloads_folder_usage_description="" +privacy/downloads_folder_usage_description_localized={} +privacy/network_volumes_usage_description="" +privacy/network_volumes_usage_description_localized={} +privacy/removable_volumes_usage_description="" +privacy/removable_volumes_usage_description_localized={} +privacy/tracking_enabled=false +privacy/tracking_domains=PackedStringArray() +privacy/collected_data/name/collected=false +privacy/collected_data/name/linked_to_user=false +privacy/collected_data/name/used_for_tracking=false +privacy/collected_data/name/collection_purposes=0 +privacy/collected_data/email_address/collected=false +privacy/collected_data/email_address/linked_to_user=false +privacy/collected_data/email_address/used_for_tracking=false +privacy/collected_data/email_address/collection_purposes=0 +privacy/collected_data/phone_number/collected=false +privacy/collected_data/phone_number/linked_to_user=false +privacy/collected_data/phone_number/used_for_tracking=false +privacy/collected_data/phone_number/collection_purposes=0 +privacy/collected_data/physical_address/collected=false +privacy/collected_data/physical_address/linked_to_user=false +privacy/collected_data/physical_address/used_for_tracking=false +privacy/collected_data/physical_address/collection_purposes=0 +privacy/collected_data/other_contact_info/collected=false +privacy/collected_data/other_contact_info/linked_to_user=false +privacy/collected_data/other_contact_info/used_for_tracking=false +privacy/collected_data/other_contact_info/collection_purposes=0 +privacy/collected_data/health/collected=false +privacy/collected_data/health/linked_to_user=false +privacy/collected_data/health/used_for_tracking=false +privacy/collected_data/health/collection_purposes=0 +privacy/collected_data/fitness/collected=false +privacy/collected_data/fitness/linked_to_user=false +privacy/collected_data/fitness/used_for_tracking=false +privacy/collected_data/fitness/collection_purposes=0 +privacy/collected_data/payment_info/collected=false +privacy/collected_data/payment_info/linked_to_user=false +privacy/collected_data/payment_info/used_for_tracking=false +privacy/collected_data/payment_info/collection_purposes=0 +privacy/collected_data/credit_info/collected=false +privacy/collected_data/credit_info/linked_to_user=false +privacy/collected_data/credit_info/used_for_tracking=false +privacy/collected_data/credit_info/collection_purposes=0 +privacy/collected_data/other_financial_info/collected=false +privacy/collected_data/other_financial_info/linked_to_user=false +privacy/collected_data/other_financial_info/used_for_tracking=false +privacy/collected_data/other_financial_info/collection_purposes=0 +privacy/collected_data/precise_location/collected=false +privacy/collected_data/precise_location/linked_to_user=false +privacy/collected_data/precise_location/used_for_tracking=false +privacy/collected_data/precise_location/collection_purposes=0 +privacy/collected_data/coarse_location/collected=false +privacy/collected_data/coarse_location/linked_to_user=false +privacy/collected_data/coarse_location/used_for_tracking=false +privacy/collected_data/coarse_location/collection_purposes=0 +privacy/collected_data/sensitive_info/collected=false +privacy/collected_data/sensitive_info/linked_to_user=false +privacy/collected_data/sensitive_info/used_for_tracking=false +privacy/collected_data/sensitive_info/collection_purposes=0 +privacy/collected_data/contacts/collected=false +privacy/collected_data/contacts/linked_to_user=false +privacy/collected_data/contacts/used_for_tracking=false +privacy/collected_data/contacts/collection_purposes=0 +privacy/collected_data/emails_or_text_messages/collected=false +privacy/collected_data/emails_or_text_messages/linked_to_user=false +privacy/collected_data/emails_or_text_messages/used_for_tracking=false +privacy/collected_data/emails_or_text_messages/collection_purposes=0 +privacy/collected_data/photos_or_videos/collected=false +privacy/collected_data/photos_or_videos/linked_to_user=false +privacy/collected_data/photos_or_videos/used_for_tracking=false +privacy/collected_data/photos_or_videos/collection_purposes=0 +privacy/collected_data/audio_data/collected=false +privacy/collected_data/audio_data/linked_to_user=false +privacy/collected_data/audio_data/used_for_tracking=false +privacy/collected_data/audio_data/collection_purposes=0 +privacy/collected_data/gameplay_content/collected=false +privacy/collected_data/gameplay_content/linked_to_user=false +privacy/collected_data/gameplay_content/used_for_tracking=false +privacy/collected_data/gameplay_content/collection_purposes=0 +privacy/collected_data/customer_support/collected=false +privacy/collected_data/customer_support/linked_to_user=false +privacy/collected_data/customer_support/used_for_tracking=false +privacy/collected_data/customer_support/collection_purposes=0 +privacy/collected_data/other_user_content/collected=false +privacy/collected_data/other_user_content/linked_to_user=false +privacy/collected_data/other_user_content/used_for_tracking=false +privacy/collected_data/other_user_content/collection_purposes=0 +privacy/collected_data/browsing_history/collected=false +privacy/collected_data/browsing_history/linked_to_user=false +privacy/collected_data/browsing_history/used_for_tracking=false +privacy/collected_data/browsing_history/collection_purposes=0 +privacy/collected_data/search_hhistory/collected=false +privacy/collected_data/search_hhistory/linked_to_user=false +privacy/collected_data/search_hhistory/used_for_tracking=false +privacy/collected_data/search_hhistory/collection_purposes=0 +privacy/collected_data/user_id/collected=false +privacy/collected_data/user_id/linked_to_user=false +privacy/collected_data/user_id/used_for_tracking=false +privacy/collected_data/user_id/collection_purposes=0 +privacy/collected_data/device_id/collected=false +privacy/collected_data/device_id/linked_to_user=false +privacy/collected_data/device_id/used_for_tracking=false +privacy/collected_data/device_id/collection_purposes=0 +privacy/collected_data/purchase_history/collected=false +privacy/collected_data/purchase_history/linked_to_user=false +privacy/collected_data/purchase_history/used_for_tracking=false +privacy/collected_data/purchase_history/collection_purposes=0 +privacy/collected_data/product_interaction/collected=false +privacy/collected_data/product_interaction/linked_to_user=false +privacy/collected_data/product_interaction/used_for_tracking=false +privacy/collected_data/product_interaction/collection_purposes=0 +privacy/collected_data/advertising_data/collected=false +privacy/collected_data/advertising_data/linked_to_user=false +privacy/collected_data/advertising_data/used_for_tracking=false +privacy/collected_data/advertising_data/collection_purposes=0 +privacy/collected_data/other_usage_data/collected=false +privacy/collected_data/other_usage_data/linked_to_user=false +privacy/collected_data/other_usage_data/used_for_tracking=false +privacy/collected_data/other_usage_data/collection_purposes=0 +privacy/collected_data/crash_data/collected=false +privacy/collected_data/crash_data/linked_to_user=false +privacy/collected_data/crash_data/used_for_tracking=false +privacy/collected_data/crash_data/collection_purposes=0 +privacy/collected_data/performance_data/collected=false +privacy/collected_data/performance_data/linked_to_user=false +privacy/collected_data/performance_data/used_for_tracking=false +privacy/collected_data/performance_data/collection_purposes=0 +privacy/collected_data/other_diagnostic_data/collected=false +privacy/collected_data/other_diagnostic_data/linked_to_user=false +privacy/collected_data/other_diagnostic_data/used_for_tracking=false +privacy/collected_data/other_diagnostic_data/collection_purposes=0 +privacy/collected_data/environment_scanning/collected=false +privacy/collected_data/environment_scanning/linked_to_user=false +privacy/collected_data/environment_scanning/used_for_tracking=false +privacy/collected_data/environment_scanning/collection_purposes=0 +privacy/collected_data/hands/collected=false +privacy/collected_data/hands/linked_to_user=false +privacy/collected_data/hands/used_for_tracking=false +privacy/collected_data/hands/collection_purposes=0 +privacy/collected_data/head/collected=false +privacy/collected_data/head/linked_to_user=false +privacy/collected_data/head/used_for_tracking=false +privacy/collected_data/head/collection_purposes=0 +privacy/collected_data/other_data_types/collected=false +privacy/collected_data/other_data_types/linked_to_user=false +privacy/collected_data/other_data_types/used_for_tracking=false +privacy/collected_data/other_data_types/collection_purposes=0 +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="#!/usr/bin/env bash +unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\" +open \"{temp_dir}/{exe_name}.app\" --args {cmd_args}" +ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash +kill $(pgrep -x -f \"{temp_dir}/{exe_name}.app/Contents/MacOS/{exe_name} {cmd_args}\") +rm -rf \"{temp_dir}\"" + +[preset.2] + +name="[Dedicated Server] Linux" +platform="Linux" +runnable=true +advanced_options=false +dedicated_server=true +custom_features="" +export_filter="customized" +customized_files={ +"res://": "strip" +} +include_filter="" +exclude_filter="" +export_path="./Open Strike.x86_64" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false +script_export_mode=2 + +[preset.2.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=false +texture_format/s3tc_bptc=true +texture_format/etc2_astc=false +binary_format/architecture="x86_64" +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="#!/usr/bin/env bash +export DISPLAY=:0 +unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\" +\"{temp_dir}/{exe_name}\" {cmd_args}" +ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash +kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\") +rm -rf \"{temp_dir}\"" diff --git a/helm/.helmignore b/helm/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/helm/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/helm/Chart.lock b/helm/Chart.lock new file mode 100644 index 0000000..c4551e7 --- /dev/null +++ b/helm/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: helm-library + repository: oci://ghcr.io/allanger/allangers-helm-library + version: 0.2.1 +digest: sha256:1a2c38771fede69ddcb6fa6da8927780f1dc36e1f0f92233d747e943cd76dedb +generated: "2025-01-13T14:09:55.344423+01:00" diff --git a/helm/Chart.yaml b/helm/Chart.yaml new file mode 100644 index 0000000..0b3e8a8 --- /dev/null +++ b/helm/Chart.yaml @@ -0,0 +1,15 @@ +apiVersion: v2 +name: open-strike-2 +type: application +version: 0.1.0 +appVersion: 0.1.0 +maintainers: + - name: allanger + email: allanger@zohomail.com + url: https://badhouseplants.net +dependencies: + - name: helm-library + version: 0.2.1 + repository: oci://ghcr.io/allanger/allangers-helm-library +annotations: + allowed_workload_kinds: "Deployment" diff --git a/helm/charts/helm-library-0.2.1.tgz b/helm/charts/helm-library-0.2.1.tgz new file mode 100644 index 0000000000000000000000000000000000000000..6dd144c51fb9ca44066301baba66ea28be4ce5d5 GIT binary patch literal 7763 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, + jumping: bool, + input_direction: Vector2, + input_rotation: Vector3, +} + +const JUMP_VELOCITY: f32 = 4.5; +const SPEED: f32 = 5.0; + +#[godot_api] +impl ICharacterBody3D for PlayerServerNode { + fn init(base: Base) -> Self { + Self { + base, + jumping: false, + input_direction: Vector2::new(0.0, 0.0), + input_rotation: Vector3::new(0.0, 0.0, 0.0), + } + } + + fn ready(&mut self) {} + + fn physics_process(&mut self, delta: f64) { + if !self.base().is_on_floor() { + let new_gravity = self.base().get_gravity() * delta as f32; + let new_velocity = self.base().get_velocity() + new_gravity; + self.base_mut().set_velocity(new_velocity); + } + + if self.base().is_on_floor() && self.jumping { + let mut new_velocity = self.base().get_velocity(); + new_velocity.y = JUMP_VELOCITY; + self.base_mut().set_velocity(new_velocity); + } + self.jumping = false; + + if self.base().is_on_floor() { + let direction = self.base().get_transform().basis + * Vector3::new(self.input_direction.x, 0.0, self.input_direction.y); + if direction.length() > 0.0 { + let direction = direction.normalized(); + let new_velocity = Vector3::new( + direction.x * SPEED, + self.base().get_velocity().y, + direction.z * SPEED, + ); + self.base_mut().set_velocity(new_velocity); + } else { + let moved = self + .base() + .get_velocity() + .clone() + .move_toward(Vector3::new(0.0, 0.0, 0.0), SPEED); + let new_velocity = Vector3::new(moved.x, self.base().get_velocity().y, moved.z); + self.base_mut().set_velocity(new_velocity); + } + } + + self.base_mut().move_and_slide(); + } +} + +#[godot_api] +impl PlayerServerNode { + #[rpc(any_peer, call_local, unreliable_ordered)] + fn jump(&mut self) { + self.jumping = true + } + + #[rpc(any_peer, call_local, unreliable_ordered)] + fn set_input_direction(&mut self, new_input_direction: Vector2) { + self.input_direction = new_input_direction; + } + + #[rpc(any_peer, call_local, unreliable_ordered)] + fn set_rotation_x(&mut self, x: f32) { + let mut new_rotation = self.base().get_rotation(); + new_rotation.x = x; + self.base_mut().set_rotation(new_rotation); + } + + #[rpc(any_peer, call_local, unreliable_ordered)] + fn set_rotation_y(&mut self, y: f32) { + let mut new_rotation = self.base().get_rotation(); + new_rotation.y = y; + self.base_mut().set_rotation(new_rotation); + } +} diff --git a/rust_bindings.gdextension b/rust_bindings.gdextension new file mode 100644 index 0000000..62184d8 --- /dev/null +++ b/rust_bindings.gdextension @@ -0,0 +1,14 @@ +[configuration] +entry_symbol = "gdext_rust_init" +compatibility_minimum = 4.1 +reloadable = true + +[libraries] +linux.debug.x86_64 = "res://rust/target/debug/libopen_strike_2.so" +linux.release.x86_64 = "res://rust/target/release/libopen_strike_2.so" +windows.debug.x86_64 = "res://rust/target/debug/open_strike_2.dll" +windows.release.x86_64 = "res://rust/target/release/open_strike_2.dll" +macos.debug = "res://rust/target/debug/libopen_strike_2.dylib" +macos.release = "res://rust/target/release/libopen_strike_2.dylib" +macos.debug.arm64 = "res://rust/target/debug/libopen_strike_2.dylib" +macos.release.arm64 = "res://rust/target/release/libopen_strike_2.dylib" diff --git a/scenes/characters/blue/dummy.gd b/scenes/characters/blue/dummy.gd index 9ce37fb..aabd963 100644 --- a/scenes/characters/blue/dummy.gd +++ b/scenes/characters/blue/dummy.gd @@ -15,8 +15,6 @@ func _process(delta: float) -> void: func _on_head_collision_body_part_hit(dam: Variant) -> void: - #print("head is hit" + str(dam)) - #print(owner_placeholder) #if owner_placeholder.has_method("take_damage"): if owner_placeholder: owner_placeholder.take_damage(dam) diff --git a/scenes/characters/blue/dummy.tscn b/scenes/characters/blue/dummy.tscn index 5b46334..7e2291b 100644 --- a/scenes/characters/blue/dummy.tscn +++ b/scenes/characters/blue/dummy.tscn @@ -1419,12 +1419,12 @@ shape = SubResource("SphereShape3D_axep3") [node name="PhysicalBoneSimulator3D" type="PhysicalBoneSimulator3D" parent="Body/Armature/Skeleton3D"] [node name="Physical Bone mixamorig_Hips" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"] -transform = Transform3D(82.5044, -54.0559, -16.4615, 55.0482, 83.4649, 1.8195, 12.756, -10.5629, 98.619, 1.31498, 0.290624, -87.4646) +transform = Transform3D(82.5044, -54.0559, -16.4615, 55.0482, 83.4649, 1.8195, 12.756, -10.5629, 98.619, 1.31498, 0.290625, -87.4646) collision_layer = 4 collision_mask = 4 joint_type = 1 -joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8.35312e-08, -5.58794e-09, 0.0499956) -body_offset = Transform3D(100, -0.0695305, -0.00860751, -1.19209e-05, 12.2744, -99.2438, 0.0700493, 99.2438, 12.2744, 0.00043869, 4.96175, -0.613665) +joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.11306e-07, -5.58794e-09, 0.0499956) +body_offset = Transform3D(100, -0.0695305, -0.00860918, -1.4782e-05, 12.2744, -99.2438, 0.0700493, 99.2438, 12.2744, 0.000441551, 4.96175, -0.613665) mass = 20.0 bone_name = "mixamorig_Hips" joint_constraints/bias = 0.3 @@ -1436,12 +1436,12 @@ transform = Transform3D(0.01, 0, 0, 0, -4.37114e-10, 0.01, 0, -0.01, -4.37114e-1 shape = SubResource("CapsuleShape3D_0ptuo") [node name="Physical Bone mixamorig_Spine" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"] -transform = Transform3D(80.9412, -58.546, -4.56913, 57.6046, 80.6695, -13.1964, 11.4119, 8.0493, 99.0201, 2.40599, 0.973749, -98.2036) +transform = Transform3D(80.9412, -58.546, -4.56913, 57.6046, 80.6695, -13.1964, 11.4119, 8.04929, 99.0201, 2.40599, 0.973749, -98.2036) collision_layer = 4 collision_mask = 4 joint_type = 1 -joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.2222e-09, 2.2377e-09, 0.05866) -body_offset = Transform3D(100, 7.62939e-06, 9.05991e-06, 4.76837e-06, -1.90735e-06, -100, -1.52588e-05, 100, -3.8147e-06, -9.53674e-07, 5.866, 0) +joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.10332e-09, 5.59426e-10, 0.05866) +body_offset = Transform3D(100, 7.62939e-06, 1.09673e-05, 4.76837e-06, 0, -100, -1.52588e-05, 100, -9.53674e-07, -9.53674e-07, 5.866, 0) mass = 20.0 bone_name = "mixamorig_Spine" joint_constraints/bias = 0.3 @@ -1457,8 +1457,8 @@ transform = Transform3D(-97.8019, 4.47329, 20.366, -15.8369, -79.4709, -58.5966, collision_layer = 4 collision_mask = 4 joint_type = 1 -joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.90306e-08, -1.39698e-07, 0.0981531) -body_offset = Transform3D(-100, -0.00220013, -0.000778198, -5.24521e-06, 33.8066, -94.1122, 0.00232792, -94.1122, -33.8066, 7.24792e-05, 9.23741, 3.31821) +joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7.71765e-08, -1.39698e-07, 0.0981531) +body_offset = Transform3D(-100, -0.00220013, -0.000778198, -5.24521e-06, 33.8066, -94.1122, 0.00232792, -94.1122, -33.8066, 6.86646e-05, 9.23741, 3.31821) mass = 7.0 bone_name = "mixamorig_Head" joint_constraints/bias = 0.3 @@ -1470,12 +1470,12 @@ transform = Transform3D(0.01, 0, 0, 0, -4.37114e-10, 0.01, 0, -0.01, -4.37114e-1 shape = SubResource("CapsuleShape3D_1gw5y") [node name="Physical Bone mixamorig_LeftArm" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"] -transform = Transform3D(86.1165, 14.0252, -48.8594, -45.4995, 64.1262, -61.787, 22.6659, 75.4396, 61.6046, 16.1942, 31.0309, -132.592) +transform = Transform3D(86.1165, 14.0252, -48.8594, -45.4995, 64.1262, -61.787, 22.6659, 75.4395, 61.6046, 16.1942, 31.0309, -132.592) collision_layer = 4 collision_mask = 4 joint_type = 1 -joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.65892e-08, 2.39336e-07, 0.137023) -body_offset = Transform3D(100, -3.05176e-05, -2.67029e-05, 2.09808e-05, 100, -7.62939e-06, 1.71661e-05, -3.8147e-06, 100, 0, -2.28882e-05, -13.7023) +joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.17137e-09, 2.34109e-07, 0.137023) +body_offset = Transform3D(100, -4.19617e-05, -2.47955e-05, 2.86102e-05, 100, -3.8147e-06, 1.71661e-05, -3.8147e-06, 100, 3.8147e-06, -2.28882e-05, -13.7023) mass = 3.0 bone_name = "mixamorig_LeftArm" joint_constraints/bias = 0.3 @@ -1487,12 +1487,12 @@ transform = Transform3D(0.01, 0, 0, 0, 0.00997432, -0.000716193, 0, 0.000716193, shape = SubResource("CapsuleShape3D_krlof") [node name="Physical Bone mixamorig_LeftForeArm" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"] -transform = Transform3D(-48.2566, -12.058, 86.752, -78.7312, -37.4258, -48.997, 38.3757, -91.9452, 8.56699, 1.36485, 46.9033, -104.66) +transform = Transform3D(-48.2566, -12.058, 86.752, -78.7312, -37.4258, -48.997, 38.3757, -91.9452, 8.56699, 1.36484, 46.9033, -104.66) collision_layer = 4 collision_mask = 4 joint_type = 1 -joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.47239e-07, 6.31263e-08, 0.138072) -body_offset = Transform3D(100, 3.05176e-05, -4.19617e-05, -3.8147e-05, 0, -100, -3.8147e-06, 100, 9.53674e-06, 3.05176e-05, 13.8072, -7.62939e-06) +joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.99827e-07, 6.04928e-08, 0.138072) +body_offset = Transform3D(100, 3.05176e-05, -4.19617e-05, -3.8147e-05, 0, -100, -3.8147e-06, 100, 1.14441e-05, 4.57764e-05, 13.8072, -7.62939e-06) mass = 3.0 bone_name = "mixamorig_LeftForeArm" joint_constraints/bias = 0.3 @@ -1541,8 +1541,8 @@ transform = Transform3D(24.3552, 37.4063, 89.4852, -25.0101, 91.5653, -31.4688, collision_layer = 4 collision_mask = 4 joint_type = 1 -joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.40737e-07, -2.80688e-08, 0.138072) -body_offset = Transform3D(100, -1.14441e-05, 8.58307e-06, -3.8147e-06, 100, 9.53674e-06, 5.72205e-06, -5.72205e-06, 100, -1.52588e-05, 1.49012e-06, -13.8072) +joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.40737e-07, -5.19106e-08, 0.138072) +body_offset = Transform3D(100, -1.14441e-05, 8.58307e-06, -3.8147e-06, 100, 9.53674e-06, 5.72205e-06, -5.72205e-06, 100, -1.52588e-05, 3.8743e-06, -13.8072) mass = 3.0 bone_name = "mixamorig_RightForeArm" joint_constraints/bias = 0.3 @@ -1558,8 +1558,8 @@ transform = Transform3D(89.0767, -24.8074, -38.0781, 5.05123, 88.6726, -45.9527, collision_layer = 4 collision_mask = 4 joint_type = 1 -joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.86265e-08, 2.31434e-07, 0.0264903) -body_offset = Transform3D(-58.5197, -57.9893, -56.6805, -1.19209e-05, 69.8991, -71.5131, 81.0891, -41.8492, -40.9048, 1.5015, 1.89439, 1.08359) +joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.86265e-08, 2.30502e-07, 0.0264903) +body_offset = Transform3D(-58.5197, -57.9893, -56.6805, -1.33514e-05, 69.8991, -71.5131, 81.0891, -41.8492, -40.9048, 1.5015, 1.89439, 1.08359) bone_name = "mixamorig_RightHand" joint_constraints/bias = 0.3 joint_constraints/damping = 1.0 @@ -1575,7 +1575,7 @@ collision_layer = 4 collision_mask = 4 joint_type = 1 joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.78612e-08, -7.74374e-09, 0.202997) -body_offset = Transform3D(100, -2.86102e-05, 9.53674e-06, 7.62939e-06, 7.62939e-06, -100, 3.71933e-05, 100, 3.8147e-06, -5.72205e-06, 20.2997, 0) +body_offset = Transform3D(100, -4.3869e-05, 9.53674e-06, 9.53674e-06, 7.62939e-06, -100, 4.673e-05, 100, 3.8147e-06, -5.72205e-06, 20.2997, 0) mass = 5.0 bone_name = "mixamorig_LeftUpLeg" joint_constraints/bias = 0.3 @@ -1604,12 +1604,12 @@ transform = Transform3D(0.01, 0, 0, 0, -4.37114e-10, 0.01, 0, -0.01, -4.37114e-1 shape = SubResource("CapsuleShape3D_vwdij") [node name="Physical Bone mixamorig_LeftFoot" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"] -transform = Transform3D(-93.6712, -34.5296, 5.78095, -34.9451, 91.207, -21.4506, 2.13418, -22.1132, -97.501, 11.7385, 3.12728, -14.5678) +transform = Transform3D(-93.6712, -34.5296, 5.78095, -34.9451, 91.207, -21.4506, 2.13419, -22.1132, -97.501, 11.7385, 3.12728, -14.5678) collision_layer = 4 collision_mask = 4 joint_type = 1 -joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7.66258e-09, 5.6483e-08, 0.078608) -body_offset = Transform3D(100, 5.72205e-06, -2.38419e-06, -2.86102e-06, -1.52588e-05, -100, -5.72205e-06, 100, -3.24249e-05, 9.53674e-07, 7.8608, -3.09944e-06) +joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8.41225e-09, 7.07881e-08, 0.078608) +body_offset = Transform3D(100, 5.72205e-06, -1.43051e-06, -9.53674e-07, -1.52588e-05, -100, -5.72205e-06, 100, -3.24249e-05, 9.53674e-07, 7.8608, -4.52995e-06) bone_name = "mixamorig_LeftFoot" joint_constraints/bias = 0.3 joint_constraints/damping = 1.0 @@ -1641,8 +1641,8 @@ transform = Transform3D(-91.8175, -23.5086, -31.8888, -36.0103, 83.0805, 42.437, collision_layer = 4 collision_mask = 4 joint_type = 1 -joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.27453e-09, -2.4944e-07, 0.210495) -body_offset = Transform3D(100, -1.71661e-05, 1.33514e-05, -9.53674e-07, 4.19617e-05, -100, 1.90735e-05, 100, 6.86646e-05, -3.33786e-06, 21.0495, 1.04904e-05) +joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.48112e-08, -2.68514e-07, 0.210495) +body_offset = Transform3D(100, -1.71661e-05, 1.33514e-05, -9.53674e-07, 4.19617e-05, -100, 1.90735e-05, 100, 6.86646e-05, -4.29153e-06, 21.0495, 1.23978e-05) mass = 5.0 bone_name = "mixamorig_RightLeg" joint_constraints/bias = 0.3 diff --git a/scenes/characters/placeholder.tscn b/scenes/characters/placeholder.tscn index 0de9c44..a7696d3 100644 --- a/scenes/characters/placeholder.tscn +++ b/scenes/characters/placeholder.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=11 format=3 uid="uid://b10lpwfjgxds4"] +[gd_scene load_steps=13 format=3 uid="uid://b10lpwfjgxds4"] [ext_resource type="Script" path="res://scripts/player/player_input_controller.gd" id="1_q75ai"] [ext_resource type="Texture2D" uid="uid://oopj5mj1vdp0" path="res://assets/crosshairs/crosshair_default.png" id="2_lsd7c"] +[ext_resource type="Script" path="res://scenes/characters/player_input_controller.gd" id="3_n3epd"] [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_jc50w"] margin = 0.5 @@ -10,14 +11,20 @@ height = 1.6 [sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_tl74a"] properties/0/path = NodePath(".:position") -properties/0/spawn = false +properties/0/spawn = true properties/0/replication_mode = 1 properties/1/path = NodePath(".:rotation") -properties/1/spawn = false +properties/1/spawn = true properties/1/replication_mode = 1 properties/2/path = NodePath(".:health") -properties/2/spawn = false +properties/2/spawn = true properties/2/replication_mode = 2 +properties/3/path = NodePath(".:velocity") +properties/3/spawn = true +properties/3/replication_mode = 1 +properties/4/path = NodePath(".:owner_id") +properties/4/spawn = true +properties/4/replication_mode = 1 [sub_resource type="Animation" id="Animation_falg4"] length = 0.001 @@ -83,11 +90,23 @@ font_size = 70 font_size = 100 font_color = Color(0.756874, 0, 0.223924, 1) +[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_eour5"] +properties/0/path = NodePath(".:input_direction") +properties/0/spawn = false +properties/0/replication_mode = 2 +properties/1/path = NodePath(".:jumping") +properties/1/spawn = false +properties/1/replication_mode = 2 + [node name="CharacterPlaceholder" type="CharacterBody3D"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.799455, 0) collision_layer = 9 collision_mask = 9 script = ExtResource("1_q75ai") +health = null +owner_id = null +jump_height = null +camera_sens = null [node name="Collision" type="CollisionShape3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0150437, 0) @@ -118,6 +137,7 @@ libraries = { } [node name="HUD" type="Control" parent="FirstPersonCameraMount"] +visible = false layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -163,3 +183,8 @@ label_settings = SubResource("LabelSettings_1j1uq") [node name="ModelMount" type="Node3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.790262, 0) + +[node name="PlayerInput" type="MultiplayerSynchronizer" parent="."] +root_path = NodePath(".") +replication_config = SubResource("SceneReplicationConfig_eour5") +script = ExtResource("3_n3epd") diff --git a/scenes/characters/player_input_controller.gd b/scenes/characters/player_input_controller.gd new file mode 100644 index 0000000..d62ba3b --- /dev/null +++ b/scenes/characters/player_input_controller.gd @@ -0,0 +1,35 @@ +extends MultiplayerSynchronizer + +@export var jumping := false +@export var input_direction := Vector2() + +@onready var camera_mount = $"../FirstPersonCameraMount" +@onready var placeholder = $".." + +func _ready() -> void: + pass + #set_process(get_multiplayer_authority() == multiplayer.get_unique_id()) + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + # Add the gravity. + if multiplayer.get_unique_id() == get_multiplayer_authority(): + input_direction = Input.get_vector("move_left", "move_right", "move_forward", "move_backwards") + set_input_direction.rpc(input_direction) + if Input.is_action_just_pressed("jump"): + jump.rpc_id(1) + +var camera_sens: float = 0.002 +func _input(event): + if multiplayer.get_unique_id() == get_multiplayer_authority(): + if event is InputEventMouseMotion and Input.mouse_mode == Input.MOUSE_MODE_CAPTURED: + placeholder.rotate_y(-event.relative.x * camera_sens) + + +@rpc("any_peer", "call_local", "reliable") +func set_input_direction(direction: Vector2): + input_direction = direction + +@rpc("any_peer", "call_local", "reliable") +func jump(): + jumping = true diff --git a/scenes/maps/base/map_loader.gd b/scenes/maps/base/map_loader.gd index 69ebadf..4ddf7b2 100644 --- a/scenes/maps/base/map_loader.gd +++ b/scenes/maps/base/map_loader.gd @@ -20,30 +20,34 @@ func _ready() -> void: err = _add_player_spawner() if err != OK: - print("Couldn't load player spawner") + push_error("Couldn't load player spawner") err = _add_object_spawner() if err != OK: - print("Couldn't load object spawner") + push_error("Couldn't load object spawner") # add objects spawner - if multiplayer.is_server(): - _spawn_player(1) - else: + if not OS.has_feature("dedicated_server"): _request_spawn.rpc_id(1, multiplayer.get_unique_id()) pass # Replace with function body. # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: - pass + if multiplayer.is_server(): + var active_players = player_spawner._get_root().get_children() + for n in active_players: + if not GameServerManager.players.has(n.owner_id): + _remove_player(n.owner_id) @rpc("call_local", "reliable", "any_peer") func _request_spawn(id: int): _spawn_player(id) func _spawn_player(id: int): - var char : Node3D = null player_spawner.spawn_players(spawn_locations, id) +func _remove_player(id: int): + player_spawner.remove_player(id) + func _add_player_spawner() -> Error : if not ResourceLoader.exists(PLAYER_SPAWNER): return ERR_DOES_NOT_EXIST diff --git a/scenes/maps/base/player_spawner/player_spawner.gd b/scenes/maps/base/player_spawner/player_spawner.gd index cb5eaaa..c6ca1a0 100644 --- a/scenes/maps/base/player_spawner/player_spawner.gd +++ b/scenes/maps/base/player_spawner/player_spawner.gd @@ -21,13 +21,21 @@ func spawn_players(spawn_location: SpawnController, id: int) -> Error: if multiplayer.is_server(): var char : Node3D = null var player_data: PlayerState = GameServerManager.players[id] - char = ResourceLoader.load("res://scenes/characters/placeholder.tscn").instantiate() + char = ResourceLoader.load("res://scenes/player/placeholder.tscn").instantiate() char.name = "PlayerPlaceholder_" + str(player_data.id) - print(player_data) - var position = spawn_location.get_spawner(SpawnController.Sides.BLUE) - char.global_position = position - char.global_position = position - #_get_spawner().spawn(char) + char.owner_id = id + var position: Vector3 = spawn_location.get_spawner(SpawnController.Sides.BLUE) + char.set_server_position(position) _get_root().add_child(char) return OK return ERR_UNAUTHORIZED + +func remove_player(id: int) -> Error: + if multiplayer.is_server(): + var found_childen: Array[Node] =_get_root().get_children() + for found_child in found_childen: + if found_child.owner_id: + if found_child.owner_id == id: + found_child.queue_free() + return OK + return ERR_UNAUTHORIZED diff --git a/scenes/maps/base/player_spawner/player_spawner.tscn b/scenes/maps/base/player_spawner/player_spawner.tscn index 2fea67d..8c3c34b 100644 --- a/scenes/maps/base/player_spawner/player_spawner.tscn +++ b/scenes/maps/base/player_spawner/player_spawner.tscn @@ -6,7 +6,7 @@ script = ExtResource("1_2hsyd") [node name="MultiplayerSpawner" type="MultiplayerSpawner" parent="."] -_spawnable_scenes = PackedStringArray("res://scenes/characters/placeholder.tscn") +_spawnable_scenes = PackedStringArray("res://scenes/characters/placeholder.tscn", "res://scenes/player/placeholder.tscn") spawn_path = NodePath("../Players") spawn_limit = 10 diff --git a/scenes/maps/base/spawn_controller.gd b/scenes/maps/base/spawn_controller.gd index 91e4beb..21ae968 100644 --- a/scenes/maps/base/spawn_controller.gd +++ b/scenes/maps/base/spawn_controller.gd @@ -31,9 +31,7 @@ func _get_available_spawn(spawn_set: Node3D) -> Node3D: for spawn: Node3D in spawn_set.get_children(): if not spawn.busy: spawns.push_back(spawn) - print(spawns.size()) var random_index: int = randi_range(0, spawns.size() - 1) - print(random_index) return spawns[random_index] return null @@ -47,6 +45,5 @@ func get_spawner(team: Sides) -> Vector3: print("red") return Vector3(0,0,0) _: - print("хз") return Vector3(0,0,0) # Get all spawners for each team diff --git a/scenes/maps/maps/lowpoly_tdm_2.tscn b/scenes/maps/maps/lowpoly_tdm_2.tscn index 8a03531..825e6c9 100644 --- a/scenes/maps/maps/lowpoly_tdm_2.tscn +++ b/scenes/maps/maps/lowpoly_tdm_2.tscn @@ -961,13 +961,37 @@ script = ExtResource("2_1ss1b") [node name="Blue" type="Node3D" parent="SpawnLocations"] +[node name="Spawn4" type="Node3D" parent="SpawnLocations/Blue"] +transform = Transform3D(-0.332276, 0, 0.943182, 0, 1, 0, -0.943182, 0, -0.332276, 53.1487, -0.0093751, -8.68195) + [node name="Spawn1" type="Node3D" parent="SpawnLocations/Blue"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.234959, 25.2818, 2.12756) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 52.9098, -0.00937462, 10.3532) [node name="Spawn2" type="Node3D" parent="SpawnLocations/Blue"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 29.4253, 15.2112, 4.25512) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 52.8486, -0.00937653, 4.25512) + +[node name="Spawn3" type="Node3D" parent="SpawnLocations/Blue"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 53.6493, -0.00937504, -4.34097) + +[node name="Spawn5" type="Node3D" parent="SpawnLocations/Blue"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 51.5453, -0.0187502, -17.3639) [node name="Red" type="Node3D" parent="SpawnLocations"] +[node name="Spawn4" type="Node3D" parent="SpawnLocations/Red"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -40.9916, -0.0093751, -8.68195) + +[node name="Spawn1" type="Node3D" parent="SpawnLocations/Red"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -41.2305, -0.00937462, 10.3532) + +[node name="Spawn2" type="Node3D" parent="SpawnLocations/Red"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -41.2917, -0.00937653, 4.25512) + +[node name="Spawn3" type="Node3D" parent="SpawnLocations/Red"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -40.491, -0.00937504, -4.34097) + +[node name="Spawn5" type="Node3D" parent="SpawnLocations/Red"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -42.595, -0.0187502, -17.3639) + [node name="WorldEnvironment" type="WorldEnvironment" parent="."] environment = SubResource("Environment_3ha0j") diff --git a/scenes/player/placeholder.gd b/scenes/player/placeholder.gd new file mode 100644 index 0000000..6a7dcb8 --- /dev/null +++ b/scenes/player/placeholder.gd @@ -0,0 +1,115 @@ +extends Node3D +class_name PlayerPlaceholder + +@export var owner_id: int = 0 +@export var initial_position: Vector3 = Vector3(0, 0, 0) +# -- Components +@onready var client_node: CharacterBody3D = $PlayerControlledNode +@onready var server_node: PlayerServerNode = $ServerControlledNode +@export var character_speed: int = 5 + + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + set_multiplayer_authority(1) + client_node.set_multiplayer_authority(owner_id) + $PlayerControlledNode/CameraMount.set_multiplayer_authority(owner_id) + switch_players_camera.rpc_id(owner_id) + server_node.global_position = initial_position + client_node.global_position = server_node.global_position + client_node.rotation.y = server_node.rotation.y + client_node.rotation.x = server_node.rotation.x + + if multiplayer.is_server(): + $Timer.start() + if owner_id != multiplayer.get_unique_id(): + client_node.queue_free() + else: + pass + #client_node._add_legs_to_first_view() + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + #if desired_player_state.globa_position != real_player_state.globa_position: + #desired_player_state.globa_position = real_player_state.globa_position + + pass + +func _physics_process(delta: float) -> void: + pass + +@rpc("authority", "call_local", "reliable") +func switch_players_camera(): + $PlayerControlledNode/CameraMount/Camera3D.make_current() + +func set_server_position(position: Vector3): + initial_position = position + + +func _on_Timer_timeout(): + $Timer.start() + + +func _on_timer_timeout() -> void: + if multiplayer.is_server(): + verify_position.rpc_id(owner_id) + verify_rotation.rpc_id(owner_id) + $Timer.start() + + pass # Replace with function body. + +@rpc("authority", "call_local") +func verify_position(): + var desired_position: Vector3 = client_node.global_position + send_position.rpc_id(1, desired_position.x, desired_position.y, desired_position.z) + +@rpc("any_peer", "call_local") +func send_position(x: float, y: float, z: float): + var desired_position: Vector3 = Vector3(x, y, z) + if multiplayer.is_server(): + var real_position: Vector3 = server_node.global_position + var difference: Vector3 = desired_position - real_position + if is_vector_a_lower_than_b(difference, Vector3(0.3, 0.3, 0.3)): + server_node.global_position = desired_position + else: + var new_position: Vector3 = desired_position.lerp(real_position, 0.5) + adjust_position.rpc_id(owner_id, new_position.x, new_position.y, new_position.z) + +@rpc("authority", "call_local") +func adjust_position(x: float, y: float, z: float): + var desired_position: Vector3 = Vector3(x, y, z) + if owner_id == multiplayer.get_unique_id(): + push_warning("player position is not valid, adjusting") + client_node.global_position = desired_position + + +@rpc("authority", "call_local") +func verify_rotation(): + var desired_rotation: Vector3 = client_node.rotation + send_rotation.rpc_id(1, desired_rotation.x, desired_rotation.y, desired_rotation.z) + +@rpc("any_peer", "call_local") +func send_rotation(x: float, y: float, z: float): + var desired_rotation: Vector3 = Vector3(x, y, z) + if multiplayer.is_server(): + var real_rotation: Vector3 = server_node.rotation + var difference: Vector3 = desired_rotation - real_rotation + if is_vector_a_lower_than_b(difference, Vector3(0.3, 0.3, 0.3)): + server_node.rotation = desired_rotation + else: + var new_rotation: Vector3 = desired_rotation.lerp(real_rotation, 0.5) + adjust_rotation.rpc_id(owner_id, new_rotation.x, new_rotation.y, new_rotation.z) + +@rpc("any_peer", "call_local") +func adjust_rotation(x: float, y: float, z: float): + var desired_rotation: Vector3 = Vector3(x, y, z) + if owner_id == multiplayer.get_unique_id(): + push_warning("player rotation is not valid, adjusting") + client_node.rotation = desired_rotation + + + +func is_vector_a_lower_than_b(vec_a: Vector3, vec_b: Vector3) -> bool: + return vec_a.x < vec_b.x and vec_a.y < vec_b.y and vec_a.z < vec_b.z diff --git a/scenes/player/placeholder.tscn b/scenes/player/placeholder.tscn new file mode 100644 index 0000000..00b76bf --- /dev/null +++ b/scenes/player/placeholder.tscn @@ -0,0 +1,224 @@ +[gd_scene load_steps=15 format=3 uid="uid://bmm3brgvr4d86"] + +[ext_resource type="Script" path="res://scenes/player/player_input_controller.gd" id="1_m6tul"] +[ext_resource type="Script" path="res://scenes/player/placeholder.gd" id="1_ts455"] +[ext_resource type="Texture2D" uid="uid://oopj5mj1vdp0" path="res://assets/crosshairs/crosshair_default.png" id="3_8ulsx"] +[ext_resource type="Script" path="res://scenes/player/server_player_controller.gd" id="3_f1bhn"] +[ext_resource type="PackedScene" uid="uid://dtvo21mk1webd" path="res://scenes/weapon/guns/ak/with_hands.tscn" id="3_xxv4y"] +[ext_resource type="PackedScene" uid="uid://1txob6jskn5s" path="res://scenes/characters/blue/dummy.tscn" id="6_e3cnh"] + +[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_taqso"] +radius = 0.4 +height = 1.6 + +[sub_resource type="LabelSettings" id="LabelSettings_3bk8i"] +font_size = 70 + +[sub_resource type="LabelSettings" id="LabelSettings_adbcb"] +font_size = 100 +font_color = Color(0.756874, 0, 0.223924, 1) + +[sub_resource type="Animation" id="Animation_falg4"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:position") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0.125), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector3(0, 0, 0)] +} + +[sub_resource type="Animation" id="Animation_mkk0p"] +resource_name = "move" +length = 0.5 +loop_mode = 2 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:position") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.125, 0.25, 0.375, 0.5), +"transitions": PackedFloat32Array(1, 2, 1, 2, 1), +"update": 0, +"values": [Vector3(0, 0, 0), Vector3(-0.1, 0.1, -0.1), Vector3(0, 0, 0), Vector3(-0.1, 0.1, -0.1), Vector3(0, 0, 0)] +} + +[sub_resource type="Animation" id="Animation_ah507"] +resource_name = "shooting" +length = 0.2 +loop_mode = 1 +step = 0.1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:position") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.1, 0.2), +"transitions": PackedFloat32Array(1, 0.233258, 8.57419), +"update": 0, +"values": [Vector3(0, 0, 0), Vector3(0, -0.01, -0.01), Vector3(0, 0, 0)] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_u1b6p"] +_data = { +"RESET": SubResource("Animation_falg4"), +"move": SubResource("Animation_mkk0p"), +"shooting": SubResource("Animation_ah507") +} + +[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_7vlrn"] +properties/0/path = NodePath("ServerControlledNode:position") +properties/0/spawn = true +properties/0/replication_mode = 1 +properties/1/path = NodePath(".:owner_id") +properties/1/spawn = true +properties/1/replication_mode = 2 +properties/2/path = NodePath("ServerControlledNode:rotation") +properties/2/spawn = true +properties/2/replication_mode = 1 +properties/3/path = NodePath(".:initial_position") +properties/3/spawn = true +properties/3/replication_mode = 2 + +[node name="Placeholder" type="Node3D"] +script = ExtResource("1_ts455") + +[node name="PlayerControlledNode" type="CharacterBody3D" parent="."] +collision_layer = 2 +script = ExtResource("1_m6tul") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="PlayerControlledNode"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.786919, 0) +shape = SubResource("CapsuleShape3D_taqso") + +[node name="CameraMount" type="Node3D" parent="PlayerControlledNode"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.29568, -0.412934) + +[node name="Camera3D" type="Camera3D" parent="PlayerControlledNode/CameraMount"] +cull_mask = 524287 + +[node name="HUD" type="Control" parent="PlayerControlledNode/CameraMount/Camera3D"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 8.0 +offset_right = 8.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 + +[node name="TextureRect" type="TextureRect" parent="PlayerControlledNode/CameraMount/Camera3D/HUD"] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -36.0 +offset_top = -36.0 +offset_right = 36.0 +offset_bottom = 36.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("3_8ulsx") + +[node name="HealthIndicator" type="Label" parent="PlayerControlledNode/CameraMount/Camera3D/HUD"] +layout_mode = 1 +anchors_preset = 2 +anchor_top = 1.0 +anchor_bottom = 1.0 +offset_top = -23.0 +offset_right = 40.0 +grow_vertical = 0 +text = "100" +label_settings = SubResource("LabelSettings_3bk8i") + +[node name="FPS" type="Label" parent="PlayerControlledNode/CameraMount/Camera3D/HUD" groups=["player_placeholder"]] +layout_mode = 1 +offset_right = 40.0 +offset_bottom = 23.0 +text = "0" +label_settings = SubResource("LabelSettings_adbcb") + +[node name="SubViewportContainer" type="SubViewportContainer" parent="PlayerControlledNode/CameraMount/Camera3D/HUD"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +stretch = true + +[node name="SubViewport" type="SubViewport" parent="PlayerControlledNode/CameraMount/Camera3D/HUD/SubViewportContainer"] +transparent_bg = true +handle_input_locally = false +msaa_2d = 1 +msaa_3d = 1 +canvas_cull_mask = 4294443008 +size = Vector2i(1920, 1964) +render_target_update_mode = 4 + +[node name="Camera3D" type="Camera3D" parent="PlayerControlledNode/CameraMount/Camera3D/HUD/SubViewportContainer/SubViewport"] +cull_mask = 524288 +fov = 40.0 + +[node name="GunMount" type="Node3D" parent="PlayerControlledNode/CameraMount/Camera3D/HUD/SubViewportContainer/SubViewport/Camera3D"] + +[node name="AnimationPlayer" type="AnimationPlayer" parent="PlayerControlledNode/CameraMount/Camera3D/HUD/SubViewportContainer/SubViewport/Camera3D/GunMount"] +active = false +libraries = { +"": SubResource("AnimationLibrary_u1b6p") +} + +[node name="WithHands" parent="PlayerControlledNode/CameraMount/Camera3D/HUD/SubViewportContainer/SubViewport/Camera3D/GunMount" instance=ExtResource("3_xxv4y")] +transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0.51335, -0.655058, -1.67097) +visible = false + +[node name="BulletStartingPoint" type="Node3D" parent="PlayerControlledNode/CameraMount"] +transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, -0.42185) + +[node name="AimRay" type="RayCast3D" parent="PlayerControlledNode/CameraMount/BulletStartingPoint"] +target_position = Vector3(0, 0, 1000) +hit_from_inside = true +collide_with_areas = true + +[node name="Node3D" type="Node3D" parent="PlayerControlledNode"] + +[node name="ServerControlledNodeBak" type="CharacterBody3D" parent="."] +collision_layer = 4 +script = ExtResource("3_f1bhn") + +[node name="Dummy" parent="ServerControlledNodeBak" instance=ExtResource("6_e3cnh")] +visible = false + +[node name="CollisionShape3D" type="CollisionShape3D" parent="ServerControlledNodeBak"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.57384, 0) +shape = SubResource("CapsuleShape3D_taqso") + +[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."] +replication_config = SubResource("SceneReplicationConfig_7vlrn") + +[node name="Timer" type="Timer" parent="."] +wait_time = 0.1 + +[node name="ServerControlledNode" type="PlayerServerNode" parent="."] +collision_layer = 4 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="ServerControlledNode"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.786919, 0) +shape = SubResource("CapsuleShape3D_taqso") + +[node name="CSGBox3D" type="CSGBox3D" parent="ServerControlledNode"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.47058, 0) + +[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"] diff --git a/scenes/player/player_input_controller.gd b/scenes/player/player_input_controller.gd new file mode 100644 index 0000000..9b39e57 --- /dev/null +++ b/scenes/player/player_input_controller.gd @@ -0,0 +1,146 @@ +# --------------------------------------------------------------------- +# --------------------------------------------------------------------- +# This script is supposed to control the node that is rendered on the +# client side, and send the changes to the server node +# --------------------------------------------------------------------- + +extends CharacterBody3D + +@export var jumping := false +@export var input_direction := Vector2() + +@onready var camera_mount = $CameraMount +@onready var camera = $CameraMount/Camera3D +@onready var placeholder: Node3D = $'..' +var paused := false +const JUMP_VELOCITY = 4.5 + + +#func _ready() -> void: +var current_gun: String = "ak" +@onready var gun_mount: Node3D = $CameraMount/Camera3D/HUD/SubViewportContainer/SubViewport/Camera3D/GunMount +@onready var gun_mount_anim: AnimationPlayer = $CameraMount/Camera3D/HUD/SubViewportContainer/SubViewport/Camera3D/GunMount/AnimationPlayer +var gun_with_hands: Node3D = null +@onready var bullet_starting_point: Node3D = $CameraMount/BulletStartingPoint +@onready var aim_ray: RayCast3D = $CameraMount/BulletStartingPoint/AimRay +@onready var gun_camera: Camera3D = $CameraMount/Camera3D/HUD/SubViewportContainer/SubViewport/Camera3D +var current_weapon_damage: int +var current_weapon_bullet_speed: int +var current_weapon_cooldown_interwal: float +var look_dir: Vector2 +func _ready() -> void: + global_position = $"..".initial_position + # -- TODO: It should not be hardcoded + # Define a format string with placeholder '%s' + var path_tmpl := "res://scenes/weapon/guns/%s/with_hands.tscn" + var path := path_tmpl % current_gun + var scene: PackedScene = ResourceLoader.load(path) + var node: Node3D = scene.instantiate() + node.scale = Vector3(0.5,0.5,0.5) + node.position = Vector3(0.5, -0.5, -1.5) + current_weapon_bullet_speed = node.bullet_speed + current_weapon_cooldown_interwal = node.cooldown + current_weapon_damage = node.damage + gun_with_hands = node + gun_mount.add_child(node) + +func _input(event): + if multiplayer.get_unique_id() == get_multiplayer_authority(): + if Input.is_action_just_pressed("jump"): jumping = true + + if event is InputEventMouseMotion and Input.mouse_mode == Input.MOUSE_MODE_CAPTURED: + look_dir = event.relative * 1 + rotation.y -= look_dir.x * camera_sens * 1.0 + camera_mount.rotation.x = clamp(camera_mount.rotation.x - look_dir.y * camera_sens * 1.0, -1.5, 1.5) + server_node.set_rotation_y.rpc_id(1, rotation.y) + server_node.set_rotation_x.rpc_id(1, rotation.x) + #server_node.set_input_direction.rpc_id(1, rotation.x, rotation.y) + +@onready var server_node: PlayerServerNode = $"../ServerControlledNode" +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _physics_process(delta: float) -> void: + if multiplayer.get_unique_id() == get_multiplayer_authority(): + if !paused: + Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) + input_direction = Input.get_vector("move_left", "move_right", "move_forward", "move_backwards") + server_node.set_input_direction.rpc_id(1, input_direction) + if Input.is_action_just_pressed("jump"): + server_node.jump.rpc_id(1) + if Input.is_action_pressed("shot"): _shoot() + if multiplayer.get_unique_id() == get_multiplayer_authority(): + if not is_on_floor(): + velocity += get_gravity() * delta + if is_on_floor() && jumping: + velocity.y = JUMP_VELOCITY + jumping = false + var direction := (transform.basis * Vector3(input_direction.x, 0, input_direction.y)).normalized() + if is_on_floor(): + if direction: + #first_view_legs_anim.play("Run Forward") + gun_mount_anim.play("move") + velocity.x = direction.x * placeholder.character_speed + velocity.z = direction.z * placeholder.character_speed + else: + velocity.x = move_toward(velocity.x, 0, placeholder.character_speed) + velocity.z = move_toward(velocity.z, 0, placeholder.character_speed) +func _process(delta: float) -> void: + move_and_slide() + + +var cant_shoot: bool = false +func _shoot(): + if not cant_shoot: + gun_with_hands.shoot() + cant_shoot = true + await get_tree().create_timer(current_weapon_cooldown_interwal).timeout + cant_shoot = false + +#func _physics_process(delta: float) -> void: + #if multiplayer.get_unique_id() == get_multiplayer_authority(): + #if not is_on_floor(): + #velocity += get_gravity() * delta + #if is_on_floor() && jumping: + #velocity.y = JUMP_VELOCITY + #jumping = false + #var direction := (transform.basis * Vector3(input_direction.x, 0, input_direction.y)).normalized() + #if is_on_floor(): + #if direction: + #velocity.x = direction.x * placeholder.character_speed + #velocity.z = direction.z * placeholder.character_speed + #else: + #velocity.x = move_toward(velocity.x, 0, placeholder.character_speed) + #velocity.z = move_toward(velocity.z, 0, placeholder.character_speed) + #move_and_slide() +var first_view_legs_anim: AnimationPlayer = null +func _add_legs_to_first_view() -> Error : + # -- TODO: It should not be hardcoded + var path := "res://scenes/characters/blue/dummy.tscn" + if not ResourceLoader.exists(path): + return ERR_DOES_NOT_EXIST + var scene: PackedScene = ResourceLoader.load(path) + if not scene.can_instantiate(): + return ERR_CANT_OPEN + var node: Node3D = scene.instantiate() + var skeleton: Skeleton3D = node.find_child("Skeleton3D") + var bone := skeleton.find_bone("mixamorig_Spine") + if bone != -1: + skeleton.set_bone_pose_scale(bone, Vector3(0, 0, 0)) + add_child(node) + var animation_node: AnimationPlayer = node.find_child("AnimationPlayer") + if animation_node != null: + first_view_legs_anim = animation_node + return OK + +var camera_sens: float = 0.002 + +@rpc("authority", "reliable") +func set_current_rotation(rotation: Vector3): + rotation = rotation + +@rpc("any_peer", "reliable") +func set_current_position(x: float, y: float, z: float): + global_position = Vector3(x, y ,z) + +@rpc("any_peer", "call_local", "reliable") +func jump(): + jumping = true diff --git a/scenes/player/server_player_controller.gd b/scenes/player/server_player_controller.gd new file mode 100644 index 0000000..0a41285 --- /dev/null +++ b/scenes/player/server_player_controller.gd @@ -0,0 +1,48 @@ +class_name ServerControlledPlayer +extends CharacterBody3D +const JUMP_VELOCITY = 4.5 + +func _ready() -> void: + pass + +@export_category("ServerControlledPlayer") +@onready var placeholder: Node3D = $'..' + +var input_direction := Vector2() +var input_rotation_y + +@rpc("call_local", "any_peer", "unreliable_ordered") +func set_input_direction(new_input_direction: Vector2): + input_direction = new_input_direction + +@rpc("call_local", "any_peer", "unreliable_ordered") +func set_rotation_y(new_rotation_y: float): + rotation.y = new_rotation_y + +@rpc("call_local", "any_peer", "unreliable_ordered") +func set_rotation_x(new_rotation_x: float): + rotation.x = new_rotation_x + +@rpc("call_local", "any_peer", "unreliable_ordered") +func jump(): + jumping = true + +var jumping := false +func _process(delta: float) -> void: + if not is_on_floor(): + velocity += get_gravity() * delta + if is_on_floor() && jumping: + velocity.y = JUMP_VELOCITY + jumping = false + if is_on_floor(): + var direction := (transform.basis * Vector3(input_direction.x, 0, input_direction.y)).normalized() + #if is_on_floor(): + if direction: + velocity.x = direction.x * placeholder.character_speed + velocity.z = direction.z * placeholder.character_speed + else: + velocity.x = move_toward(velocity.x, 0, placeholder.character_speed) + velocity.z = move_toward(velocity.z, 0, placeholder.character_speed) + +func _physics_process(delta: float) -> void: + move_and_slide() diff --git a/scenes/utils/menu.gd b/scenes/utils/menu.gd index 8f7f77f..aabab56 100644 --- a/scenes/utils/menu.gd +++ b/scenes/utils/menu.gd @@ -60,7 +60,6 @@ func remove_multiplayer_peer(): func load_game(): var chosen_map_index = $Maps.get_selected_items()[0] var chosen_map = $Maps.get_item_text(chosen_map_index) - print(chosen_map) var path_tmpl := "res://scenes/maps/maps/%s" var path := path_tmpl % chosen_map get_tree().change_scene_to_file(path) diff --git a/scenes/utils/menus/main/main_menu.gd b/scenes/utils/menus/main/main_menu.gd index bb9b2d1..a493bed 100644 --- a/scenes/utils/menus/main/main_menu.gd +++ b/scenes/utils/menus/main/main_menu.gd @@ -4,14 +4,24 @@ var player_manager: PlayerManager = PlayerManager.new() # Called when the node enters the scene tree for the first time. func _ready() -> void: - var map_dir := DirAccess.open("res://scenes/maps/maps/") - - if map_dir: - map_dir.list_dir_begin() - var file_name = map_dir.get_next() - while file_name != "": - $UI/CreateServer/Maps.add_item(file_name) - file_name = map_dir.get_next() + if OS.has_feature("dedicated_server"): + var chosen_map = "lowpoly_tdm_2.tscn" + var path_tmpl := "res://scenes/maps/maps/%s" + var path := path_tmpl % chosen_map + GameServerManager.current_map = path + var err := GameServerManager.create_server(player_manager) + if err != OK: + push_error("couldn't create a server") + change_level.call_deferred(path) + print(get_tree().get_root()) + else: + var map_dir := DirAccess.open("res://scenes/maps/maps/") + if map_dir: + map_dir.list_dir_begin() + var file_name = map_dir.get_next() + while file_name != "": + $UI/CreateServer/Maps.add_item(file_name) + file_name = map_dir.get_next() # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: @@ -34,20 +44,28 @@ func _on_create_button_pressed() -> void: GameServerManager.current_map = path var err := GameServerManager.create_server(player_manager) if err != OK: - print("couldn't create a server") + push_error("couldn't create a server") $UI.hide() - change_level.call_deferred(load(path)) + change_level.call_deferred(path) # Call this function deferred and only on the main authority (server). -func change_level(scene: PackedScene): - +func change_level(path: String): # Remove old level if any. var level = $LevelLoader/CurrentLevel + print("cleaning up the mount node") for c in level.get_children(): level.remove_child(c) c.queue_free() # Add new level. - level.add_child(scene.instantiate()) + if not ResourceLoader.exists(path): + print(ERR_DOES_NOT_EXIST) + var scene: PackedScene = ResourceLoader.load(path) + if scene.can_instantiate(): + var node: Node3D = scene.instantiate() + print("loading map: " + node.name) + level.add_child(node) + else: + print("Can't initialize") func _on_text_edit_text_changed() -> void: diff --git a/scenes/weapon/bullet.gd b/scenes/weapon/bullet.gd index a25d24a..b3f1a3a 100644 --- a/scenes/weapon/bullet.gd +++ b/scenes/weapon/bullet.gd @@ -30,7 +30,6 @@ func _process(delta): rigid_body_3d.visible = false particles.emitting = true #if ray.get_collider().is_in_group("body"): - #print("head") await get_tree().create_timer(1.0).timeout queue_free() diff --git a/scenes/weapon/misc/bullet_trail_generic.tscn b/scenes/weapon/misc/bullet_trail_generic.tscn index b077075..186f0de 100644 --- a/scenes/weapon/misc/bullet_trail_generic.tscn +++ b/scenes/weapon/misc/bullet_trail_generic.tscn @@ -11,6 +11,7 @@ emission_energy_multiplier = 16.0 distance_fade_min_distance = 2.0 [node name="BulletTrailGeneric" type="MeshInstance3D"] +layers = 524288 material_override = SubResource("StandardMaterial3D_ybqvs") visibility_range_end = 1891.27 script = ExtResource("1_k8eg1") diff --git a/scripts/character_controller.gd b/scripts/character_controller.gd index 4c41396..92ad340 100644 --- a/scripts/character_controller.gd +++ b/scripts/character_controller.gd @@ -39,7 +39,6 @@ func _ready() -> void: add_child(dummy) enable_camera() capture_mouse() - #print("I am " + str(multiplayer.get_unique_id()) + "I'm controling " + str($"../MultiplayerSynchronizer".get_multiplayer_authority())) func _unhandled_input(event: InputEvent) -> void: if event is InputEventMouseMotion: diff --git a/scripts/game_server_manager.gd b/scripts/game_server_manager.gd index ddff5cd..37e7c70 100644 --- a/scripts/game_server_manager.gd +++ b/scripts/game_server_manager.gd @@ -16,20 +16,31 @@ func _on_connected_ok(): @rpc("any_peer", "reliable", "call_remote") func register_player(id: int, name: String): - var player_state := PlayerState.new() - player_state.id = id - player_state.name = name - players[multiplayer.get_remote_sender_id()] = player_state + if multiplayer.is_server(): + var player_state := PlayerState.new() + player_state.id = id + player_state.name = name + players[multiplayer.get_remote_sender_id()] = player_state +@rpc("any_peer", "reliable", "call_local") +func remove_player(id: int): + if multiplayer.is_server(): + if players.has(id): + players.erase(id) + + + +func _on_player_disconnected(id): + remove_player.rpc_id(1, id) + func _on_player_connected(id): - pass - #if multiplayer.is_server(): - #GameServerManager.load_map.rpc_id(id, GameServerManager.current_map) + if multiplayer.is_server(): + print("Player is connected with id: " + str(id)) func _ready() -> void: multiplayer.peer_connected.connect(_on_player_connected) + multiplayer.peer_disconnected.connect(_on_player_disconnected) multiplayer.connected_to_server.connect(_on_connected_ok) - print("started") pass # Replace with function body. # Called every frame. 'delta' is the elapsed time since the previous frame. @@ -42,10 +53,10 @@ func set_map(name: String): func create_server(player_data: PlayerManager) -> Error: var peer = ENetMultiplayerPeer.new() var err = peer.create_server(27015, 30) + multiplayer.multiplayer_peer = peer if err: return err - multiplayer.multiplayer_peer = peer - if DisplayServer.get_name() != "headless": + if not OS.has_feature("dedicated_server"): var player_state := PlayerState.new() player_state.id = 1 player_state.name = player_data.name @@ -54,7 +65,8 @@ func create_server(player_data: PlayerManager) -> Error: func join_server(player_data: PlayerManager, ip: String, port: int) -> Error: var peer = ENetMultiplayerPeer.new() - var err = peer.create_client("127.0.0.1", 27015) + print("trying to connect to: " + ip + ":" + str(port)) + var err = peer.create_client(ip, port) if err != OK: return err player_state_global.id = multiplayer.get_remote_sender_id() diff --git a/scripts/player/player_input_controller.gd b/scripts/player/player_input_controller.gd index 17930f4..3020145 100644 --- a/scripts/player/player_input_controller.gd +++ b/scripts/player/player_input_controller.gd @@ -22,14 +22,17 @@ var model: Node3D = null # -- This node is supposed to be spawned per player, and since each # -- player has an id, it is used for giving a node a name. So we can # -- use it here to tell a controlled node from the rest models -@onready var owner_id: int = str($".".name).to_int() +@onready var owner_id_detected: int = str($".".name).to_int() +@export var owner_id: int = 0 var multiplayer_id: int = 0 # -- Character state var alive: bool = true func _ready() -> void: - player_synchronizer.set_multiplayer_authority(owner_id) + owner_id = owner_id_detected + $PlayerInput.set_multiplayer_authority(owner_id) + player_synchronizer.set_multiplayer_authority(1) multiplayer_id = multiplayer.get_unique_id() # -- Separate logic for player and other models that are controlled # -- by other players on the server @@ -39,19 +42,19 @@ func _ready() -> void: if _is_current_player(): var err := _add_first_view_model() if err != OK: - print("Error occured: " + str(err)) + push_error("Error occured: " + str(err)) err = _add_legs_to_first_view() if err != OK: - print("Error occured: " + str(err)) + push_error("Error occured: " + str(err)) var world_model := _add_world_model() if world_model == null: - print("Error occured: " + "couldn't load the world model") + push_error("Error occured: " + "couldn't load the world model") _enable_camera() else: var world_model := _add_world_model() if world_model == null: - print("Error occured: " + "couldn't load the world model") + push_error("Error occured: " + "couldn't load the world model") _hide_camera_mount() _capture_mouse() @@ -182,10 +185,17 @@ func _unhandled_input(event: InputEvent) -> void: #if Input.is_action_just_pressed("reload"): $Body/UpperTorso/CameraMount/Camera.reload() func _rotate_camera(sens_mod: float = 1.0) -> void: + pass #if str($"..".name).to_int() == multiplayer.get_unique_id(): rotation.y -= look_dir.x * camera_sens * sens_mod first_view_camera_mount.rotation.x = clamp(first_view_camera_mount.rotation.x - look_dir.y * camera_sens * sens_mod, -1.5, 1.5) +#@export var player := 1: + #set(id): + #player = id + #$PlayerInput.set_multiplayer_authority(id) + +@onready var input = $PlayerInput @onready var hud = $FirstPersonCameraMount/HUD @onready var health_indicator = $FirstPersonCameraMount/HUD/HealthIndicator @onready var fps_indicator = $FirstPersonCameraMount/HUD/FPS @@ -209,16 +219,15 @@ func _physics_process(delta: float) -> void: velocity += get_gravity() * delta # Handle jump. - if Input.is_action_just_pressed("jump") and is_on_floor(): + if input.jumping and is_on_floor(): velocity.y = JUMP_VELOCITY - + input.jumping = false # Get the input direction and handle the movement/deceleration. # As good practice, you should replace UI actions with custom gameplay actions. #var input_dir := Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down") # -- It shouldn't be possible to change direction during the jumps if is_on_floor(): - var input_dir := Input.get_vector("move_left", "move_right", "move_forward", "move_backwards") - var direction := (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized() + var direction := (transform.basis * Vector3(input.input_direction.x, 0, input.input_direction.y)).normalized() if direction: gun_mount_anim.play("move") if first_view_legs_anim != null: @@ -274,7 +283,6 @@ func _get_camera_collision(): var intersection = get_world_3d().direct_space_state.intersect_ray(new_intersection) if not intersection.is_empty(): var collision_point = intersection.position - print("gotcha") return collision_point else: return ray_end @@ -286,12 +294,10 @@ func _hit_scan_collision(collision_point): var new_intersection = PhysicsRayQueryParameters3D.create(ray_origin, ray_end) var bullet_collision = get_world_3d().direct_space_state.intersect_ray(new_intersection) if bullet_collision: - print(bullet_collision) _hit_scan_damage(bullet_collision.collider) func _hit_scan_damage(Collider): #if Collider.is_in_group("target") and Collider.has_method("take_damage"): - print("damaged") func take_damage(dam: int): var new_health = health - dam