Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/entity mass #7

Open
wants to merge 71 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
1206419
feat: unreal ecsact net fps example
zaucy Oct 2, 2024
97e588a
chore: add ecsact net plugin
zaucy Oct 2, 2024
ac6ec84
chore: use main branch for ecsact and ecsact net
zaucy Oct 2, 2024
f9c4377
chore: add some config and missing deps
zaucy Oct 3, 2024
58d2b05
chore:Add ecsactneteditor to build file
Kelwan Oct 3, 2024
087f921
chore: use custom path
zaucy Oct 4, 2024
1d71b57
feat: add connect menu
zaucy Oct 9, 2024
23bc702
feat: main menu level
zaucy Oct 9, 2024
3792b82
fix: create initial entities on connect
zaucy Oct 9, 2024
e7df76a
fix: use open level instead
zaucy Oct 10, 2024
02bd1af
feat: manually specify subsystems
zaucy Oct 10, 2024
5ac8a2b
fix: disable input ui in fps level
zaucy Oct 11, 2024
6d9731b
fix: use weak ptrs instead of raw
zaucy Oct 12, 2024
9c1f811
fix: black font for connect menu
zaucy Oct 12, 2024
1f614c9
fix: don't access invalid player controllers
zaucy Oct 12, 2024
0a34beb
feat: use blueprint player spawner
zaucy Oct 12, 2024
eeea9ae
feat: Spawn player actors as a cube
Kelwan Oct 16, 2024
cf9ed20
feat: Entity Mass
Kelwan Oct 18, 2024
b58de98
fix: Remove wall change
Kelwan Oct 18, 2024
b94a8d7
chore: Add DefaultMass ini file
Kelwan Oct 18, 2024
3bb67ee
chore: Store save state of Mass Config
Kelwan Oct 18, 2024
71c3f7d
fix: remove bad include
zaucy Oct 18, 2024
6d7c612
chore: New map generated contents
Kelwan Oct 18, 2024
a49b76a
chore: Commit altered massconfig
Kelwan Oct 18, 2024
469dd56
chore: Update MassConfig
Kelwan Oct 19, 2024
cedce75
chore: Update MassConfig AGAIN
Kelwan Oct 19, 2024
596fb71
chore: Add movement fields to config
Kelwan Oct 19, 2024
e7b193d
chore:More config update
Kelwan Oct 19, 2024
a16e1f7
feat: Spawn entities that follow the player
Kelwan Oct 23, 2024
7978f62
feat: Add entity fragment and stream mass entities
Kelwan Oct 26, 2024
75d3aa6
chore: some more logs
zaucy Oct 26, 2024
556ab4c
feat: remove player controller when destroyed
zaucy Oct 26, 2024
039e9f1
fix: no check in destroy
zaucy Oct 26, 2024
404aa5e
feat: Mass spawn in random locations, avoidance working
Kelwan Oct 30, 2024
efbf5de
feat: Add ecsact traits, more fragments and allow streaming discretio…
Kelwan Oct 31, 2024
e13b6b1
chore: Update EM config
Kelwan Nov 1, 2024
da8f0cc
feat: Add push systems with impls and support toggle
Kelwan Nov 7, 2024
c44a307
chore: set node id and project id
zaucy Nov 7, 2024
d188941
chore: remove unused projectile stuff
zaucy Nov 7, 2024
f73c6a2
chore: delete fps stuff, moved some files around
zaucy Nov 7, 2024
aa6fa77
feat: top down third person perspective
zaucy Nov 7, 2024
d22d9db
feat: add 'pusher' mechanic
zaucy Nov 7, 2024
c37e2ad
fix: restore push binding
zaucy Nov 8, 2024
6119adc
chore: restore other system impls
zaucy Nov 8, 2024
9994502
chore: print emcc version in build systems script
zaucy Nov 8, 2024
7bb1c41
feat:Add idle state and adjust follow player for streams
Kelwan Nov 8, 2024
74626c3
fix: actually add expiry tag
zaucy Nov 8, 2024
7e6ccfa
fix: actually remove pusher at correct time
zaucy Nov 8, 2024
8b627b3
feat: spawn push explosion vfx
zaucy Nov 8, 2024
c8626ca
fix: forgot header
zaucy Nov 8, 2024
d324dfc
fix: update velocity in impls, tick processor changes and ecsact file
Kelwan Nov 8, 2024
b2eeda1
feat: player id in main menu
zaucy Nov 9, 2024
bd4c5e1
chore:comment out logs
Kelwan Nov 12, 2024
6115e60
chore: Remove Mass Processor position logs
Kelwan Nov 12, 2024
ba8414f
fix: moved controller assignment to local only
zaucy Nov 12, 2024
ceda9d9
chore: using new ecsact runner world api
zaucy Nov 12, 2024
01fa957
fix: add live code support to ps1 file
zaucy Nov 13, 2024
7fb4936
chore: update to use new ecsact plugin api
zaucy Nov 13, 2024
8573fed
feat: implicit system impls file
zaucy Dec 4, 2024
e1130a8
fix: remove unused param in system impls build step
zaucy Dec 4, 2024
2a2d6c5
feat: synchronized movement
zaucy Dec 4, 2024
ee10bed
feat: synchronizing movement animations with custom pawn/controller
zaucy Dec 4, 2024
6e739f4
feat: directional push
zaucy Dec 5, 2024
2b514a0
chore: remove starter content
zaucy Dec 5, 2024
6fd98c4
fix: use relative path for wasm files
zaucy Dec 5, 2024
8442bfd
chore: Update sdl-example deps
Kelwan Nov 22, 2024
cd8e7fa
feat: Mass Entities better state handling
Kelwan Dec 5, 2024
c47256c
fix: rebase adjustments
Kelwan Dec 5, 2024
249d59e
feat: Change toggle to update, add command and processor. Better prac…
Kelwan Dec 7, 2024
b9ea5a3
chore: slight adjustment on entities iteration for tick processor
zaucy Dec 12, 2024
d757997
chore: remove spammy log
zaucy Dec 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[submodule "unreal-cpp-net-fps/Plugins/Ecsact"]
path = unreal-cpp-net-fps/Plugins/Ecsact
url = https://github.com/ecsact-dev/ecsact_unreal
branch = main
[submodule "unreal-cpp-net-fps/Plugins/EcsactNet"]
path = unreal-cpp-net-fps/Plugins/EcsactNet
url = https://github.com/seaube/ecsact-net-unreal
branch = main
25 changes: 15 additions & 10 deletions noengine-cpp-sdl2/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
module(name = "ecsact-examples-noengine-cpp-sdl2")

bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_cc", version = "0.1.0")
bazel_dep(name = "sdl2")

bazel_dep(name = "toolchains_llvm", version = "1.0.0", dev_dependency = True)
bazel_dep(name = "hedron_compile_commands", dev_dependency = True)
bazel_dep(name = "ecsact_runtime", version = "0.6.2")
bazel_dep(name = "bazel_skylib", version = "1.6.1")
bazel_dep(name = "rules_ecsact", version = "0.5.2")
bazel_dep(name = "ecsact_cli", version = "0.3.7")
bazel_dep(name = "ecsact_lang_cpp", version = "0.4.1")

bazel_dep(name = "ecsact_runtime", version = "0.7.0")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_ecsact", version = "0.5.8")
bazel_dep(name = "ecsact_cli", version = "0.3.19")
bazel_dep(name = "ecsact_lang_cpp", version = "0.4.10")
bazel_dep(name = "boost.dll", version = "1.83.0.bzl.2")
bazel_dep(name = "boost.process", version = "1.83.0.bzl.2")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "ecsact_rt_entt", version = "0.3.2")
bazel_dep(name = "ecsact_rt_entt", version = "0.3.13")
bazel_dep(name = "cute_c2")
bazel_dep(name = "imgui")
bazel_dep(name = "tracy", version = "0.11.1")

archive_override(
module_name = "cute_c2",
Expand All @@ -27,15 +30,17 @@ git_override(
commit = "975821a9513e230601b358aea829b9659de13d11",
remote = "https://github.com/zaucy/imgui.git",
)

git_override(
module_name = "sdl2",
commit = "2c8acf0e46f14ebbafe3ec9cc05d7ee4b6d7609f",
remote = "https://github.com/zaucy/sdl.git",
)

git_override(
module_name = "ecsact_rt_entt",
commit = "5ed2115146a9f187dca3c0ff9f8c66fbea09bf23",
remote = "https://github.com/ecsact-dev/ecsact_rt_entt.git",
module_name = "tracy",
commit = "cc236c7d1cf57b7065dc2cb3faa6a9573b46481a",
remote = "git@github.com:seaube/tracy.git",
)

ecsact = use_extension("@rules_ecsact//ecsact:extensions.bzl", "ecsact", dev_dependency = True)
Expand Down
1 change: 1 addition & 0 deletions unity-csharp-basic/Assets/Scripts/Ecsact/example.ecsact
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ system GenerateBlock {
}
}


system RemoveQueueBlock {
removes QueueBlock;
}
99 changes: 99 additions & 0 deletions unreal-cpp-net-fps/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
AccessModifierOffset: -2
AlignAfterOpenBracket: BlockIndent
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Left
AlignOperands: DontAlign
AlignTrailingComments: false
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakAfterJavaFieldAnnotations: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma
BreakConstructorInitializersBeforeComma: false
BreakStringLiterals: true
ColumnLimit: 80
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 2
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
IncludeBlocks: Preserve
IncludeIsMainRegex: "(Test)?$"
IndentCaseLabels: true
IndentPPDirectives: AfterHash
IndentWidth: 2
IndentWrappedFunctionNames: false
InsertBraces: true
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ""
MacroBlockEnd: ""
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
PackConstructorInitializers: NextLine
PenaltyBreakAssignment: 10
PenaltyBreakBeforeFirstCallParameter: 30
PenaltyBreakComment: 10
PenaltyBreakFirstLessLess: 0
PenaltyBreakString: 10
PenaltyExcessCharacter: 400
PenaltyReturnTypeOnItsOwnLine: 350
PointerAlignment: Left
ReflowComments: true
RequiresClausePosition: OwnLine
SortIncludes: false
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: Never
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SeparateDefinitionBlocks: Always
Standard: Latest
TabWidth: 2
UseTab: ForContinuationAndIndentation
8 changes: 8 additions & 0 deletions unreal-cpp-net-fps/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_size = 4
indent_style = tab

78 changes: 78 additions & 0 deletions unreal-cpp-net-fps/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Visual Studio 2015 user specific files
.vs/

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
*.ipa

# These project files can be generated by the engine
*.xcodeproj
*.xcworkspace
*.sln
*.suo
*.opensdf
*.sdf
*.VC.db
*.VC.opendb

# Precompiled Assets
SourceArt/**/*.png
SourceArt/**/*.tga

# Binary Files
Binaries/*
Plugins/**/Binaries/*

# Builds
Build/*

# Whitelist PakBlacklist-<BuildConfiguration>.txt files
!Build/*/
Build/*/**
!Build/*/PakBlacklist*.txt

# Don't ignore icon files in Build
!Build/**/*.ico

# Built data for maps
*_BuiltData.uasset

# Configuration files generated by the Editor
Saved/*

# Compiled source files for the engine to use
Intermediate/*
Plugins/**/Intermediate/*

# Cache files for the editor to use
DerivedDataCache/*

# Clangd
.cache
compile_commands.json
13 changes: 13 additions & 0 deletions unreal-cpp-net-fps/.vsconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "1.0",
"components": [
"Microsoft.Net.Component.4.6.2.TargetingPack",
"Microsoft.VisualStudio.Component.VC.14.38.17.8.x86.x64",
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
"Microsoft.VisualStudio.Component.Windows10SDK.22621",
"Microsoft.VisualStudio.Workload.CoreEditor",
"Microsoft.VisualStudio.Workload.ManagedDesktop",
"Microsoft.VisualStudio.Workload.NativeDesktop",
"Microsoft.VisualStudio.Workload.NativeGame"
]
}
80 changes: 80 additions & 0 deletions unreal-cpp-net-fps/BuildSystemImpls.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!/usr/bin/env pwsh

# This is an example batch file for building your Ecsact system implementations
# with Emscripten. In a more sophisticated setup you will likely use a build
# system such as bazel, cmake, zig, etc.

param (
[Parameter(Mandatory)] $ProjectDir
)

if (${env:UE-ZenSubprocessDataPath})
{
Write-Host "Detected live coding enabled"
Write-Host "Skipping system impl re-build"
exit 0
}

Write-Output $env:UBT_COMPILE_LIVE_CODING

$ErrorActionPreference = 'Stop'

if(-not $env:EMSDK)
{
if (Test-Path -Path "C:\emsdk\emsdk_env.ps1" -PathType Leaf)
{
(. C:\emsdk\emsdk_env.ps1) 2> $null
}

if(-not $env:EMSDK)
{
throw "Unable to find the Emscripten SDK installed on your system"
}
}

$EcsactFiles = @(
"$ProjectDir/Source/EcsactUnrealFps/EcsactUnrealFps.ecsact"
)

$Sources = @(
"$ProjectDir/SystemImpls/EcsactSystemImpls.cpp"
)

$GeneratedOutDir ="$ProjectDir/SystemImpls/generated"

# TODO: don't hard set generated sources
$GeneratedSources = @(
"$ProjectDir/SystemImpls/generated/EcsactUnrealFps.ecsact.systems.cc"
)

$EcsactInc = (ecsact config include_dir)

ecsact codegen $EcsactFiles `
--plugin=cpp_header `
--plugin=systems_header `
--plugin=cpp_systems_header `
--plugin=cpp_systems_source `
--outdir=$GeneratedOutDir

emcc -v

mkdir -Force "$ProjectDir/Binaries" | Out-Null

$WasmOutputFilePath = "$ProjectDir/Binaries/SystemImpls.wasm"

# NOTE: PURE_WASI=1 removes emscripten_* functions that are not compatible with the Ecsact SI Wasm host
emcc -std=c++20 --no-entry -I"$EcsactInc" -I"SystemImpls/generated" `
-s ERROR_ON_UNDEFINED_SYMBOLS=0 `
-s WASM=1 `
-s STANDALONE_WASM=1 `
-s PURE_WASI=1 `
-O3 `
-Wno-js-compiler `
-o $WasmOutputFilePath `
$Sources `
$GeneratedSources

if(-not $?)
{
throw "emcc exited with code ${LastExitCode}"
}
14 changes: 14 additions & 0 deletions unreal-cpp-net-fps/Config/DefaultEcsact.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[/Script/Ecsact.EcsactSettings]
bEnableBuild=False
CustomEcsactRuntimeLibraryPath=Binaries/Win64/EcsactRuntime.dll
BuildReportFilter=None
+Recipes=rt_entt
+Recipes=async_reference
+Recipes=serialize_reference
Runner=Asynchronous
CustomRunnerClass=None
bAutoCollectBlueprintRunnerSubsystems=True
+RunnerSubsystems=/Game/EntityMass/BP_EcsactEntityMassSpawner.BP_EcsactEntityMassSpawner_C
+RunnerSubsystems=/Game/Blueprints/BP_EcsactPlayerSpawner.BP_EcsactPlayerSpawner_C
+RunnerSubsystems=/Game/Blueprints/AsyncConnectWidgetSubsystem.AsyncConnectWidgetSubsystem_C

7 changes: 7 additions & 0 deletions unreal-cpp-net-fps/Config/DefaultEcsactNet.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@


[/Script/EcsactNetEditor.EcsactNetSettings]
EndpointPrefix="http://localhost:51051"
ProjectID=67047b0f95a3782070685d12
NodeId=67047d57f3dd594aab300d73

3 changes: 3 additions & 0 deletions unreal-cpp-net-fps/Config/DefaultEcsactNetWasm.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[/Script/EcsactNetWasm.EcsactNetWasmSettings]
+SystemImplWasmFiles=(FilePath="Binaries/SystemImpls.wasm")

11 changes: 11 additions & 0 deletions unreal-cpp-net-fps/Config/DefaultEditor.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[UnrealEd.SimpleMap]
SimpleMapName=/Game/FirstPerson/Maps/FirstPersonExampleMap

[EditoronlyBP]
bAllowClassAndBlueprintPinMatching=true
bReplaceBlueprintWithClass= true
bDontLoadBlueprintOutsideEditor= true
bBlueprintIsNotBlueprintType= true

[/Script/AdvancedPreviewScene.SharedProfiles]

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[ContentBrowser]
ContentBrowserTab1.SelectedPaths=/Game/FirstPerson
Loading