Skip to content

Commit

Permalink
Merge pull request #176 from V-Sekai/update-planner
Browse files Browse the repository at this point in the history
Update planner
  • Loading branch information
fire committed Jul 21, 2024
2 parents 87dfbfb + 62f80ee commit c82063c
Show file tree
Hide file tree
Showing 2,467 changed files with 8,537 additions and 562,197 deletions.
9 changes: 9 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,14 @@
"program": "${workspaceFolder}/19_godot/bin/godot.macos.editor.double.arm64",
"preLaunchTask": "Godot Engine"
},
{
"name": "Run the editor with V-Sekai planner windows",
"type": "lldb",
"request": "launch",
"args": ["--path", "${workspaceFolder}/14_planner", "-e"],
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/19_godot/bin/godot.windows.editor.double.x86_64.llvm.console.exe",
"preLaunchTask": "Godot Engine"
},
]
}
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
},
"command": [
"scons werror=no compiledb=yes dev_build=no use_mingw=yes use_llvm=yes generate_bundle=no precision=double compiledb=yes target=editor tests=yes debug_symbols=yes vsproj=yes vsproj_gen_only=yes"
"scons werror=no compiledb=yes dev_build=no generate_bundle=no precision=double target=editor tests=yes debug_symbols=yes"
],
},
]
Expand Down
6 changes: 3 additions & 3 deletions 11_vsekai_game/addons/entity_manager/runtime_entity.gd
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,9 @@ func _threaded_instance_setup(p_instance_id: int, p_network_reader: RefCounted)
if not has_method("_threaded_instance_setup"):
return

if simulation_logic_node:
if simulation_logic_node and simulation_logic_node.has_method("_threaded_instance_setup"):
simulation_logic_node._threaded_instance_setup(p_instance_id, p_network_reader)
if network_logic_node:
if network_logic_node and network_logic_node.has_method("_threaded_instance_setup"):
network_logic_node._threaded_instance_setup(p_instance_id, p_network_reader)
if network_identity_node:
if network_identity_node and network_identity_node.has_method("_threaded_instance_setup"):
network_identity_node._threaded_instance_setup(p_instance_id, p_network_reader)
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion 11_vsekai_game/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ run/main_run_args.macos="--xr-mode off"

[editor_plugins]

enabled=PackedStringArray("res://addons/Godot-MToon-Shader/plugin.cfg", "res://addons/background_loader/plugin.cfg", "res://addons/canvas_plane/plugin.cfg", "res://addons/emote_theme/plugin.cfg", "res://addons/entity_manager/plugin.cfg", "res://addons/extended_kinematic_body/plugin.cfg", "res://addons/fade_manager/plugin.cfg", "res://addons/flat_viewport/plugin.cfg", "res://addons/gd_util/plugin.cfg", "res://addons/godot_speech/plugin.cfg", "res://addons/godot_uro/plugin.cfg", "res://addons/input_manager/plugin.cfg", "res://addons/line_renderer/plugin.cfg", "res://addons/math_util/plugin.cfg", "res://addons/navigation_controller/plugin.cfg", "res://addons/network_manager/plugin.cfg", "res://addons/sar1_mocap_manager/plugin.cfg", "res://addons/sar1_screenshot_manager/plugin.cfg", "res://addons/sar1_vr_manager/plugin.cfg", "res://addons/smoothing/plugin.cfg", "res://addons/spatial_game_viewport_manager/plugin.cfg", "res://addons/textureRectUrl/plugin.cfg", "res://addons/vrm/plugin.cfg", "res://addons/vsk_avatar/plugin.cfg", "res://addons/vsk_editor/plugin.cfg", "res://addons/vsk_entities/plugin.cfg", "res://addons/vsk_importer_exporter/plugin.cfg", "res://addons/vsk_manager/plugin.cfg", "res://addons/vsk_map/plugin.cfg", "res://addons/vsk_menu/plugin.cfg", "res://addons/vsk_version/plugin.cfg", "res://addons/vsk_vrm_avatar_tool/plugin.cfg", "res://addons/xr_vignette/plugin.cfg")
enabled=PackedStringArray("res://addons/Godot-MToon-Shader/plugin.cfg", "res://addons/background_loader/plugin.cfg", "res://addons/canvas_plane/plugin.cfg", "res://addons/emote_theme/plugin.cfg", "res://addons/entity_manager/plugin.cfg", "res://addons/extended_kinematic_body/plugin.cfg", "res://addons/fade_manager/plugin.cfg", "res://addons/flat_viewport/plugin.cfg", "res://addons/gd_util/plugin.cfg", "res://addons/godot_speech/plugin.cfg", "res://addons/godot_uro/plugin.cfg", "res://addons/input_manager/plugin.cfg", "res://addons/line_renderer/plugin.cfg", "res://addons/math_util/plugin.cfg", "res://addons/navigation_controller/plugin.cfg", "res://addons/network_manager/plugin.cfg", "res://addons/runtime_debug_tools/plugin.cfg", "res://addons/sar1_mocap_manager/plugin.cfg", "res://addons/sar1_screenshot_manager/plugin.cfg", "res://addons/sar1_vr_manager/plugin.cfg", "res://addons/smoothing/plugin.cfg", "res://addons/spatial_game_viewport_manager/plugin.cfg", "res://addons/textureRectUrl/plugin.cfg", "res://addons/vrm/plugin.cfg", "res://addons/vsk_avatar/plugin.cfg", "res://addons/vsk_editor/plugin.cfg", "res://addons/vsk_entities/plugin.cfg", "res://addons/vsk_importer_exporter/plugin.cfg", "res://addons/vsk_manager/plugin.cfg", "res://addons/vsk_map/plugin.cfg", "res://addons/vsk_menu/plugin.cfg", "res://addons/vsk_version/plugin.cfg", "res://addons/vsk_vrm_avatar_tool/plugin.cfg", "res://addons/xr_vignette/plugin.cfg")

[entities]

Expand Down
File renamed without changes.
File renamed without changes.
16 changes: 0 additions & 16 deletions 14_planner/Planner/Tests/long_cat_domain.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ extends Domain
class_name LongCatDomain

func _init():
add_task_methods("care_for_pet", [task_care_for_pet])
add_task_methods("walk_pet", [walk_pet])
add_task_methods("release_pet", [release_pet])
add_unigoal_methods("hunger", [method_feed_pet])
Expand Down Expand Up @@ -60,18 +59,3 @@ func method_release_pet(p_state, p_pet, p_location):
if p_pet in p_state["pets"] and p_location in p_state["locations"] and p_state["location"][p_pet] != "neighborhood":
return [["release_pet", p_pet]]
return false

func task_care_for_pet(p_state, p_pet):
var goals: Dictionary = p_state.duplicate(true)
if p_state["hunger"][p_pet] > 5:
goals["nutrition"][p_pet] = 5
if p_state["thirst"][p_pet] > 5:
goals["hydration"][p_pet] = 5
if p_state["exercise"][p_pet] < 5:
goals["exercise"][p_pet] = 5
if p_state["location"][p_pet] != "neighborhood":
goals["location"][p_pet] = "neighborhood"
var multigoal = Multigoal.new()
multigoal.resource_name = "multigoal_care_for_pet"
multigoal.state = goals
return [multigoal]
16 changes: 14 additions & 2 deletions 14_planner/Planner/Tests/test_long_cat.gd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,19 @@ func test_ready() -> void:
"happiness": {"longcat": 50},
}

var task: Array = [["care_for_pet", "longcat"]]
var result = planner.find_plan(state, task)
var pet = "longcat";
var goals: Dictionary = state.duplicate(true)
if goals["hunger"][pet] > 5:
goals["nutrition"][pet] = 5
if goals["thirst"][pet] > 5:
goals["hydration"][pet] = 5
if goals["exercise"][pet] < 5:
goals["exercise"][pet] = 5
if goals["location"][pet] != "neighborhood":
goals["location"][pet] = "neighborhood"
var multigoal = Multigoal.new()
multigoal.resource_name = "multigoal_care_for_pet"
multigoal.state = goals
var result = planner.find_plan(state, [multigoal])
gut.p(result)
assert_eq_deep(result, [["release_pet", "longcat"], ["walk_pet", "longcat"], ["walk_pet", "longcat"], ["walk_pet", "longcat"], ["walk_pet", "longcat"], ["walk_pet", "longcat"]])
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Setup Godot build cache
description: Setup Godot build cache.
name: Restore Godot build cache
description: Restore Godot build cache.
inputs:
cache-name:
description: The cache base name (job name by default).
Expand All @@ -10,9 +10,8 @@ inputs:
runs:
using: "composite"
steps:
# Upload cache on completion and check it out now.
- name: Load SCons cache directory
uses: actions/cache@v4
- name: Restore SCons cache directory
uses: actions/cache/restore@v4
with:
path: ${{inputs.scons-cache}}
key: ${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
Expand Down
17 changes: 17 additions & 0 deletions 19_godot/.github/actions/godot-cache-save/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Save Godot build cache
description: Save Godot build cache.
inputs:
cache-name:
description: The cache base name (job name by default).
default: "${{github.job}}"
scons-cache:
description: The SCons cache path.
default: "${{github.workspace}}/.scons-cache/"
runs:
using: "composite"
steps:
- name: Save SCons cache directory
uses: actions/cache/save@v4
with:
path: ${{inputs.scons-cache}}
key: ${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
10 changes: 8 additions & 2 deletions 19_godot/.github/workflows/android_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ jobs:
distribution: temurin
java-version: 17

- name: Setup Godot build cache
uses: ./.github/actions/godot-cache
- name: Restore Godot build cache
uses: ./.github/actions/godot-cache-restore
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
Expand All @@ -66,6 +66,12 @@ jobs:
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}

- name: Save Godot build cache
uses: ./.github/actions/godot-cache-save
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true

- name: Generate Godot templates
if: matrix.target == 'template_release'
run: |
Expand Down
8 changes: 6 additions & 2 deletions 19_godot/.github/workflows/ios_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
with:
submodules: recursive

- name: Setup Godot build cache
uses: ./.github/actions/godot-cache
- name: Restore Godot build cache
uses: ./.github/actions/godot-cache-restore
continue-on-error: true

- name: Setup Python and SCons
Expand All @@ -37,5 +37,9 @@ jobs:
target: template_release
tests: false

- name: Save Godot build cache
uses: ./.github/actions/godot-cache-save
continue-on-error: true

- name: Upload artifact
uses: ./.github/actions/upload-artifact
21 changes: 14 additions & 7 deletions 19_godot/.github/workflows/linux_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,18 @@ jobs:
- name: Template w/ Mono (target=template_release)
cache-name: linux-template-mono
target: template_release
sconsflags: module_mono_enabled=yes
sconsflags: module_mono_enabled=yes tests=yes
bin: "./bin/godot.linuxbsd.template_release.x86_64.mono"
build-mono: false
tests: false
tests: true
artifact: true

- name: Minimal template (target=template_release, everything disabled)
cache-name: linux-template-minimal
target: template_release
sconsflags: modules_enabled_by_default=no disable_3d=yes disable_advanced_gui=yes deprecated=no minizip=no
tests: false
sconsflags: modules_enabled_by_default=no disable_3d=yes disable_advanced_gui=yes deprecated=no minizip=no tests=yes
bin: "./bin/godot.linuxbsd.template_release.x86_64"
tests: true
artifact: true

steps:
Expand Down Expand Up @@ -111,8 +113,8 @@ jobs:
sudo rm -rf /usr/local/lib/android
echo "Disk usage after:" && df -h
- name: Setup Godot build cache
uses: ./.github/actions/godot-cache
- name: Restore Godot build cache
uses: ./.github/actions/godot-cache-restore
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
Expand Down Expand Up @@ -140,6 +142,12 @@ jobs:
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}

- name: Save Godot build cache
uses: ./.github/actions/godot-cache-save
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true

- name: Generate C# glue
if: ${{ matrix.build-mono }}
run: |
Expand Down Expand Up @@ -168,7 +176,6 @@ jobs:
with:
bin: ${{ matrix.bin }}

# Execute unit tests for the editor
- name: Unit tests
if: ${{ matrix.tests }}
run: |
Expand Down
16 changes: 11 additions & 5 deletions 19_godot/.github/workflows/macos_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,17 @@ jobs:
- name: Template (target=template_release)
cache-name: macos-template
target: template_release
tests: false
sconsflags: debug_symbols=no
tests: true
sconsflags: debug_symbols=no tests=yes
bin: "./bin/godot.macos.template_release.universal"

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Godot build cache
uses: ./.github/actions/godot-cache
- name: Restore Godot build cache
uses: ./.github/actions/godot-cache-restore
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
Expand Down Expand Up @@ -66,6 +67,12 @@ jobs:
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}

- name: Save Godot build cache
uses: ./.github/actions/godot-cache-save
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true

- name: Prepare artifact
run: |
lipo -create ./bin/godot.macos.${{ matrix.target }}.x86_64 ./bin/godot.macos.${{ matrix.target }}.arm64 -output ./bin/godot.macos.${{ matrix.target }}.universal
Expand All @@ -78,7 +85,6 @@ jobs:
with:
name: ${{ matrix.cache-name }}

# Execute unit tests for the editor
- name: Unit tests
if: ${{ matrix.tests }}
run: |
Expand Down
10 changes: 8 additions & 2 deletions 19_godot/.github/workflows/web_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ jobs:
run: |
emcc -v
- name: Setup Godot build cache
uses: ./.github/actions/godot-cache
- name: Restore Godot build cache
uses: ./.github/actions/godot-cache-restore
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
Expand All @@ -69,6 +69,12 @@ jobs:
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}

- name: Save Godot build cache
uses: ./.github/actions/godot-cache-save
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true

- name: Upload artifact
uses: ./.github/actions/upload-artifact
if: ${{ matrix.artifact }}
Expand Down
16 changes: 11 additions & 5 deletions 19_godot/.github/workflows/windows_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,17 @@ jobs:
- name: Template (target=template_release)
cache-name: windows-template
target: template_release
tests: false
sconsflags: debug_symbols=no
tests: true
sconsflags: debug_symbols=no tests=yes
bin: "./bin/godot.windows.template_release.x86_64.console.exe"

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Godot build cache
uses: ./.github/actions/godot-cache
- name: Restore Godot build cache
uses: ./.github/actions/godot-cache-restore
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
Expand Down Expand Up @@ -76,6 +77,12 @@ jobs:
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}

- name: Save Godot build cache
uses: ./.github/actions/godot-cache-save
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true

- name: Prepare artifact
run: |
Remove-Item bin/* -Include *.exp,*.lib,*.pdb -Force
Expand All @@ -85,7 +92,6 @@ jobs:
with:
name: ${{ matrix.cache-name }}

# Execute unit tests for the editor
- name: Unit tests
if: ${{ matrix.tests }}
run: |
Expand Down
4 changes: 2 additions & 2 deletions 19_godot/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/V-Sekai/godot.git
branch = groups-staging-4.3
commit = 81797608edaa2355b9142b120686607285f00e6d
parent = a9ccee168e4a231f5c631992bc9a3c728e52e865
commit = 81393005daa4e86ca10302cadbabc22474acd977
parent = 05e4502bf0e9b0371ce7ef796e6c48c87300c8c9
method = merge
cmdver = 0.4.6
Loading

0 comments on commit c82063c

Please sign in to comment.