Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 11 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[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
[submodule "unreal-cpp-benchmark/Plugins/Ecsact"]
path = unreal-cpp-benchmark/Plugins/Ecsact
url = [email protected]:ecsact-dev/ecsact_unreal.git
Comment on lines +1 to +11
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should be removed

99 changes: 99 additions & 0 deletions unreal-cpp-benchmark/.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
78 changes: 78 additions & 0 deletions unreal-cpp-benchmark/.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
84 changes: 84 additions & 0 deletions unreal-cpp-benchmark/BuildSystemImpls.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#!/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
}

$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/EcsactBenchmark/EcsactBenchmark.ecsact"
)

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

$GeneratedOutDir = "$ProjectDir/SystemImpls/generated"

# TODO: don't hard set generated sources
$GeneratedSources = @(
"$ProjectDir/SystemImpls/generated/EcsactBenchmark.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"

Write-Host "Building $WasmOutputFilePath ..."

# 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}"
}


Write-Host "Uploading $WasmOutputFilePath to Ecsact Net ..."

11 changes: 11 additions & 0 deletions unreal-cpp-benchmark/Config/DefaultEcsact.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[/Script/Ecsact.EcsactSettings]
bEnableBuild=True
CustomEcsactRuntimeLibraryPath=
BuildReportFilter=None
+Recipes=rt_entt
+Recipes=si_wasmer
Runner=Custom
CustomRunnerClass=None
bAutoCollectBlueprintRunnerSubsystems=True
+RunnerSubsystems=/Game/Blueprints/BP_EcsactBenchmarkMassSpawner.BP_EcsactBenchmarkMassSpawner_C

Empty file.
93 changes: 93 additions & 0 deletions unreal-cpp-benchmark/Config/DefaultEngine.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@


[/Script/EngineSettings.GameMapsSettings]
GameDefaultMap=/Game/Maps/Benchmark.Benchmark
EditorStartupMap=/Game/Maps/Benchmark.Benchmark

[/Script/Engine.RendererSettings]
r.AllowStaticLighting=False

r.GenerateMeshDistanceFields=True

r.DynamicGlobalIlluminationMethod=1

r.ReflectionMethod=1

r.SkinCache.CompileShaders=True

r.RayTracing=True

r.Shadow.Virtual.Enable=1

r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange=True

r.DefaultFeature.LocalExposure.HighlightContrastScale=0.8

r.DefaultFeature.LocalExposure.ShadowContrastScale=0.8

[/Script/WindowsTargetPlatform.WindowsTargetSettings]
DefaultGraphicsRHI=DefaultGraphicsRHI_DX12
DefaultGraphicsRHI=DefaultGraphicsRHI_DX12
-D3D12TargetedShaderFormats=PCD3D_SM5
+D3D12TargetedShaderFormats=PCD3D_SM6
-D3D11TargetedShaderFormats=PCD3D_SM5
+D3D11TargetedShaderFormats=PCD3D_SM5
Compiler=Default
AudioSampleRate=48000
AudioCallbackBufferFrameSize=1024
AudioNumBuffersToEnqueue=1
AudioMaxChannels=0
AudioNumSourceWorkers=4
SpatializationPlugin=
SourceDataOverridePlugin=
ReverbPlugin=
OcclusionPlugin=
CompressionOverrides=(bOverrideCompressionTimes=False,DurationThreshold=5.000000,MaxNumRandomBranches=0,SoundCueQualityIndex=0)
CacheSizeKB=65536
MaxChunkSizeOverrideKB=0
bResampleForDevice=False
MaxSampleRate=48000.000000
HighSampleRate=32000.000000
MedSampleRate=24000.000000
LowSampleRate=12000.000000
MinSampleRate=8000.000000
CompressionQualityModifier=1.000000
AutoStreamingThreshold=0.000000
SoundCueCookQualityIndex=-1

[/Script/LinuxTargetPlatform.LinuxTargetSettings]
-TargetedRHIs=SF_VULKAN_SM5
+TargetedRHIs=SF_VULKAN_SM6

[/Script/HardwareTargeting.HardwareTargetingSettings]
TargetedHardwareClass=Desktop
AppliedTargetedHardwareClass=Desktop
DefaultGraphicsPerformance=Maximum
AppliedDefaultGraphicsPerformance=Maximum

[/Script/WorldPartitionEditor.WorldPartitionEditorSettings]
CommandletClass=Class'/Script/UnrealEd.WorldPartitionConvertCommandlet'

[/Script/Engine.UserInterfaceSettings]
bAuthorizeAutomaticWidgetVariableCreation=False
FontDPIPreset=Standard
FontDPI=72

[/Script/Engine.Engine]
+ActiveGameNameRedirects=(OldGameName="TP_Blank",NewGameName="/Script/EcsactBenchmark")
+ActiveGameNameRedirects=(OldGameName="/Script/TP_Blank",NewGameName="/Script/EcsactBenchmark")

[/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings]
bEnablePlugin=True
bAllowNetworkConnection=True
SecurityToken=636BE87843D087D62604C5917E6F5CA0
bIncludeInShipping=False
bAllowExternalStartInShipping=False
bCompileAFSProject=False
bUseCompression=False
bLogFiles=False
bReportStats=False
ConnectionType=USBOnly
bUseManualIPAddress=False
ManualIPAddress=

3 changes: 3 additions & 0 deletions unreal-cpp-benchmark/Config/DefaultGame.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

[/Script/EngineSettings.GeneralProjectSettings]
ProjectID=96F09A7E4BCF19A5F9C692A8E6975C7C
Loading