Compare commits

..

No commits in common. "master" and "physicsOverhaul4" have entirely different histories.

2053 changed files with 41968 additions and 181556 deletions

39
.gitignore vendored
View File

@ -6,17 +6,13 @@
/build
/launcher/launcher.exe
/src/launcher/launcher.exe
/dependency-reduced-pom.xml
/nb-configuration.xml
/Telephone-*.jar
/NetArranger*.jar
/lwjglx-debug-*.jar
/NetArranger-*.jar
/hs_err_pid*
/replay_pid*
/trace.log
.classpath
.project
@ -33,13 +29,8 @@
/docs/~$NetworkFlow.drawio.dtmp
#saves
/saves/arena
/saves/random_sp_world
/saves/defaultLevel*
/saves/generation_testing
/saves/World name*
#screenshots
/assets/Screenshots
#debug
/netmonitor
@ -47,30 +38,8 @@
#vscode
.settings
#testing cache
.testcache
#docs
/docs-dist
/docs/DoxygenWarningLog.txt
/docs-dist/**
#imgui local layout
/imgui.ini
#script engine related
/assets/Scripts/compiler/typescript.js
#spreadsheet stuff
*/~$*.xlsx
#General cache for the engine
/.cache
#Memory debug files
/heap.dump
/heap.dump.hwcache
/tmp
#native libraries
/shared-folder
/out
/imgui.ini

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "src/fluid/lib/stb"]
path = src/main/c/lib/stb
url = https://github.com/nothings/stb.git

View File

@ -1,21 +0,0 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**",
"C:/Program Files/Eclipse Adoptium/jdk-21.0.5.11-hotspot/include/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"compilerPath": "C:\\ProgramData\\mingw64\\mingw64\\bin\\gcc.exe",
"cStandard": "c17",
"cppStandard": "gnu++17",
"intelliSenseMode": "windows-gcc-x64"
}
],
"version": 4
}

View File

@ -1,11 +0,0 @@
{
"recommendations": [
"redhat.java",
"vscjava.vscode-java-debug",
"slevesque.shader",
"vscjava.vscode-java-test",
"dtoplak.vscode-glsllint",
"ms-vscode.cpptools-extension-pack",
"13xforever.language-x86-64-assembly"
]
}

57
.vscode/launch.json vendored
View File

@ -1,31 +1,22 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Launch Current File",
"request": "launch",
"mainClass": "${file}",
"vmArgs": "-Xmx6G -Xms1024m -Djava.library.path=./shared-folder -XX:+UseZGC -XX:SoftMaxHeapSize=5G -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=\"./tmp/heap.hprof\"",
"preLaunchTask": "Install Native Lib"
"mainClass": "${file}"
},
{
"type": "java",
"name": "Launch Main",
"request": "launch",
"mainClass": "electrosphere.engine.Main",
"vmArgs": "-Xmx6G -Xms1024m -Djava.library.path=./shared-folder -XX:+UseZGC -XX:SoftMaxHeapSize=5G -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=\"./tmp/heap.hprof\"",
"projectName": "Renderer",
"preLaunchTask": "Install Native Lib"
},
{
"type": "java",
"name": "Launch Main (Debug Memory)",
"request": "launch",
"mainClass": "electrosphere.engine.Main",
"vmArgs": "-Xmx6G -Xms1024m -Djava.library.path=./shared-folder -XX:+UseZGC -XX:SoftMaxHeapSize=5G -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=\"./tmp/heap.hprof\" -javaagent:./lwjglx-debug-1.0.0.jar=t;o=trace.log",
"projectName": "Renderer",
"preLaunchTask": "Install Native Lib"
"vmArgs": "-Xmx2G -Xms100m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=\"/tmp\"",
"projectName": "Renderer"
},
{
"type": "java",
@ -33,9 +24,9 @@
"request": "launch",
"mainClass": "electrosphere.engine.Main",
"env": {
"ALSOFT_LOGLEVEL": 4
"ALSOFT_LOGLEVEL": 4,
},
"vmArgs": "-Xmx6G -Xms1024m -Djava.library.path=./shared-folder -XX:+UseZGC -XX:SoftMaxHeapSize=5G -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=\"./tmp/heap.hprof\"",
"vmArgs": "-Xmx2G -Xms100m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=\"/tmp\"",
"projectName": "Renderer"
},
{
@ -52,35 +43,15 @@
"request": "launch",
"mainClass": "electrosphere.engine.Main",
"projectName": "Renderer",
"args": "--headless"
"args" : "--headless"
},
{
"name": "C/C++: gcc.exe build and debug active file",
"type": "cppdbg",
"type": "java",
"name": "Launch Simulation Only",
"request": "launch",
"program": "${cwd}/out/build/test_runner.exe",
"args": [
"${cmake.testArgs}"
],
"stopAtEntry": false,
"cwd": "${cmake.testWorkingDirectory}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:\\ProgramData\\mingw64\\mingw64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "CMake: clean rebuild"
"mainClass": "electrosphere.engine.Main",
"projectName": "Renderer",
"args" : "--simulate"
}
]
}

58
.vscode/settings.json vendored
View File

@ -4,61 +4,5 @@
"**/.git/objects/**": true,
"**/node_modules/**": true
},
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable",
"javascript.preferences.importModuleSpecifier": "non-relative",
"typescript.preferences.importModuleSpecifier": "non-relative",
"files.associations": {
"electrosphere_fluidsim.h": "c",
"jni.h": "c",
"electrosphere_server_fluid_simulator_fluidacceleratedsimulator.h": "c",
"utilities.h": "c",
"simulation.h": "c",
"chunk.h": "c",
"chunkmask.h": "c",
"metadatacalc.h": "c",
"immintrin.h": "c",
"stdint.h": "c",
"electrosphere_server_fluid_manager_serverfluidchunk.h": "c",
"stdio.h": "c",
"cstdlib": "c",
"pool.h": "c",
"mainfunctions.h": "c",
"solver_consts.h": "c",
"public.h": "c",
"islandsolver.h": "c",
"stb_ds.h": "c",
"test.h": "c",
"stdlib.h": "c",
"chunk_test_utils.h": "c",
"sparsesimulator.h": "c",
"environment.h": "c",
"simulator.h": "c",
"dispatcher.h": "c",
"cellular.h": "c",
"limits": "c",
"boundsolver.h": "c",
"randutils.h": "c",
"mathutils.h": "c",
"velocity.h": "c",
"density.h": "c",
"grid2.h": "c",
"math.h": "c",
"multigrid.h": "c",
"gauss_seidel.h": "c",
"ode_utils.h": "c",
"util.h": "c",
"conjugate_gradient.h": "c",
"flux.h": "c",
"diffusion_ode.h": "c",
"pressurecell.h": "c",
"pressure.h": "c",
"tracking.h": "c",
"multigrid_navier_stokes.h": "c",
"navier_stokes.h": "c",
"electrosphere_client_fluid_cache_fluidchunkdata.h": "c",
"normalization.h": "c",
"bounds.h": "c",
"electrosphere_server_physics_fluid_manager_serverfluidchunk.h": "c",
"electrosphere_server_physics_fluid_simulator_fluidacceleratedsimulator.h": "c"
}
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable"
}

39
.vscode/tasks.json vendored
View File

@ -1,39 +0,0 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "Install Native Lib",
"command": "cp ./out/build/libStormEngine.* ./shared-folder",
"group": "build",
"detail": "Installs the native lib locally",
"dependsOn": [
"CMake: build"
]
},
{
"type": "cmake",
"label": "CMake: build",
"command": "build",
"targets": [
"all"
],
"preset": "${command:cmake.activeBuildPresetName}",
"group": "build",
"problemMatcher": [],
"detail": "CMake template build task"
},
{
"type": "cmake",
"label": "CMake: clean rebuild",
"command": "cleanRebuild",
"targets": [
"all"
],
"preset": "${command:cmake.activeBuildPresetName}",
"group": "build",
"problemMatcher": [],
"detail": "CMake template clean rebuild task"
}
]
}

View File

@ -1,95 +0,0 @@
cmake_minimum_required(VERSION 3.20.0)
project(StormEngine VERSION 0.1.0 LANGUAGES C)
# include and enable testing
include(CTest)
enable_testing()
# set shared library output dir
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/out/build)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/out/build)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/out/build)
#include project folders
add_subdirectory(src/main/c/src)
add_subdirectory(src/test/c)
# Find sources
# file(GLOB_RECURSE SOURCES src/main/c/src/**.c)
# # include jni
# set(JAVA_AWT_LIBRARY NotNeeded)
# if(EXISTS "/tmp/jni/jdk/include")
# include_directories(/tmp/jni/jdk/include)
# include_directories(/tmp/jni/jdk/include/linux)
# else()
# find_package(JNI REQUIRED)
# include_directories(${JNI_INCLUDE_DIRS})
# endif()
# # Create shared library
# add_library(StormEngine SHARED ${SOURCES})
# # include public dirs
# target_include_directories(StormEngine PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/main/c/includes)
# # set props for the lib
# target_compile_options(StormEngine PRIVATE -m64 -mavx -mavx2)
# set shared library output dir
# set_target_properties(StormEngine PROPERTIES
# CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/out/build
# )
# # include and enable testing
# include(CTest)
# enable_testing()
# # Grab test files
# file(GLOB_RECURSE TEST_FILES ${CMAKE_SOURCE_DIR}/test/c/**.c)
# set(TEST_DRIVER test_driver.c)
# # preprocess the test files to use relative paths
# set(TEST_SOURCES "")
# foreach(TEST_FILE ${TEST_FILES})
# file(RELATIVE_PATH REL_TEST_FILE ${CMAKE_SOURCE_DIR} ${TEST_FILE})
# # get_filename_component (TEST_NAME ${TEST_FILE} NAME)
# list(APPEND TEST_SOURCES ${REL_TEST_FILE})
# endforeach()
# # Add test sources
# create_test_sourcelist(TEST_SOURCE_LIST ${TEST_DRIVER} ${TEST_SOURCES})
# # Create test executable
# add_executable(test_runner ${TEST_SOURCE_LIST})
# # emit test driver to outdir
# set_target_properties(test_runner PROPERTIES
# CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/out/build
# )
# # include header files
# target_include_directories(test_runner PRIVATE ${PROJECT_SOURCE_DIR}/src/main/c/includes)
# # link the library to the test executable
# target_link_libraries(test_runner PRIVATE StormEngine)
# # find_library(STORM_ENGINE_NAME StormEngine PATHS ${PROJECT_SOURCE_DIR}/shared-folder)
# # if(STORM_ENGINE_NAME)
# # target_link_libraries(test_runner PRIVATE ${STORM_ENGINE_NAME})
# # target_include_directories(test_runner PRIVATE src/main/c/includes)
# # else()
# # message("Library not found!")
# # message(${STORM_ENGINE_NAME})
# # message(FATAL_ERROR ${PROJECT_SOURCE_DIR}/shared-folder)
# # endif()
# # add tests for each test source file
# foreach (TEST_FILE ${TEST_SOURCES})
# get_filename_component (TEST_NAME ${TEST_FILE} NAME_WE)
# get_filename_component (TEST_PATH ${TEST_FILE} DIRECTORY)
# add_test(NAME ${TEST_NAME} COMMAND test_runner ${TEST_PATH}/${TEST_NAME})
# endforeach ()
# # make test runner depend on library
# add_dependencies(test_runner StormEngine)

View File

@ -1,17 +0,0 @@
{
"version": 6,
"configurePresets": [
{
"name": "default",
"displayName": "Default",
"description": "Sets Ninja generator, build and install directory",
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_TOOLCHAIN_FILE": "",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install"
}
}
]
}

View File

@ -1,24 +0,0 @@
# Dependencies
- [OpenSimplex2](https://github.com/KdotJPG/OpenSimplex2) --- [CC0](https://github.com/KdotJPG/OpenSimplex2/blob/master/LICENSE)
- [LWJGL 3](https://www.lwjgl.org/) --- [Modified BSD License](https://www.lwjgl.org/license)
- [Assimp](https://github.com/assimp/assimp) --- [assimp license](https://github.com/assimp/assimp/blob/master/LICENSE)
- [GLFW](https://github.com/glfw/glfw) --- [zlib license](https://github.com/glfw/glfw/blob/master/LICENSE.md)
- [OpenAL Soft](https://www.openal-soft.org/) --- [LGPL](https://www.openal-soft.org/)
- [STB](https://github.com/nothings/stb) --- [MIT](https://github.com/nothings/stb/blob/master/LICENSE)
- [Remotery](https://github.com/Celtoys/Remotery) --- [Apache 2](https://github.com/Celtoys/Remotery/blob/main/LICENSE)
- [par_shapes](https://github.com/prideout/par/blob/master/par_shapes.h) --- [MIT](https://github.com/prideout/par/blob/master/par_shapes.h)
- [JOML](https://github.com/JOML-CI/JOML) --- [MIT](https://github.com/JOML-CI/JOML/blob/main/LICENSE)
- [GSON](https://github.com/google/gson) --- [Apache 2](https://github.com/google/gson/blob/main/LICENSE)
- [ode4j](https://github.com/tzaeschke/ode4j) --- [LGPL or BSD-3](https://github.com/tzaeschke/ode4j/blob/master/ODE4J-LICENSE-BSD.TXT)
- [sqlite-jdbc](https://github.com/xerial/sqlite-jdbc) --- [Apache 2](https://github.com/xerial/sqlite-jdbc/blob/master/LICENSE)
- [junit 5](https://github.com/junit-team/junit5) --- [Eclipse 2](https://github.com/junit-team/junit5/blob/main/LICENSE.md)
- [mockito](https://github.com/mockito/mockito) --- [MIT](https://github.com/mockito/mockito/blob/main/LICENSE)
- [graaljs](https://github.com/oracle/graaljs) --- [UPL](https://github.com/oracle/graaljs/blob/master/LICENSE)
- [steamworks4j](https://github.com/code-disaster/steamworks4j) --- [MIT](https://github.com/code-disaster/steamworks4j/blob/master/LICENSE)
- [recast4j](https://github.com/recast4j/recast4j) --- [zlib](https://github.com/recast4j/recast4j/blob/main/License.txt)
- [imgui](https://github.com/ocornut/imgui) --- [MIT](https://github.com/ocornut/imgui/blob/master/LICENSE.txt)
- [yoga](https://github.com/facebook/yoga) --- [MIT](https://github.com/facebook/yoga/blob/main/LICENSE)
- [MathUtils](https://github.com/StudioRailgun/MathUtils) --- [MIT](https://github.com/StudioRailgun/MathUtils/blob/main/LICENSE)
- [DataStructures](https://github.com/StudioRailgun/DataStructures) --- [MIT](https://github.com/StudioRailgun/DataStructures/blob/main/LICENSE)
- [Typescript](https://github.com/microsoft/TypeScript) --- [Apache 2](https://github.com/microsoft/TypeScript/blob/main/LICENSE.txt)
- [JSoup](https://jsoup.org/) --- [MIT](https://github.com/jhy/jsoup/blob/master/LICENSE)

90
Jenkinsfile vendored
View File

@ -4,105 +4,21 @@ pipeline {
maven '3.9.6'
}
stages {
stage('Setup') {
steps {
sh "chmod +x -R ${env.WORKSPACE}"
sh "git submodule update --init --recursive" // make sure submodules are also checked out
}
}
stage ('Check Environment') {
stage('Build') {
steps {
sh 'mvn --version'
sh 'java -version'
sh 'echo $JAVA_HOME'
sh 'echo $JAVA_INCLUDE_PATH'
}
}
stage('Build (Engine)') {
steps {
sh 'mvn -B -DskipTests clean package'
}
}
stage('Build (Documentation)') {
steps {
sh 'cd ./docs && doxygen ./Doxyfile'
sh 'rm -rf /docs/*'
sh 'cd ./docs-dist/html && rm -f ./docs.tar.gz'
sh 'cd ./docs-dist/html && tar -czvf ./docs.tar.gz ./*'
sh 'cp ./docs-dist/html/docs.tar.gz /docs/docs.tar.gz && cd /docs/ && tar -xzvf ./docs.tar.gz'
}
}
stage('Test') {
steps {
wrap(
[
$class: 'Xvfb',
additionalOptions: '',
assignedLabels: '',
autoDisplayName: true,
debug: true,
displayNameOffset: 0,
installationName: 'Default',
parallelBuild: true,
screen: '1920x1080x24',
timeout: 25
]
) {
script {
sh 'rm -f ./testsuccess'
catchError {
//-fae "fail-at-end", tells maven to not fail the job until all tests have been run
sh 'mvn test -P integration -fae && touch ./testsuccess'
}
// sh 'if ! grep -q "Errors: 2" ./target/surefire-reports/*; then touch ./testsuccess; fi'
}
}
sh 'mvn test'
}
post {
always {
junit testResults: 'target/surefire-reports/*.xml', keepLongStdio: true, testDataPublishers: [[$class:'AttachmentPublisher']]
}
}
}
stage('DebugTests') {
when {
expression {
!fileExists('./testsuccess')
}
}
steps {
wrap(
[
$class: 'Xvfb',
additionalOptions: '',
assignedLabels: '',
autoDisplayName: true,
debug: true,
displayNameOffset: 0,
installationName: 'Default',
parallelBuild: true,
screen: '1920x1080x24',
timeout: 25
]
) {
script {
sh 'curl https://build.lwjgl.org/addons/lwjglx-debug/lwjglx-debug-1.0.0.jar -v -L > ./lwjglx-debug-1.0.0.jar'
sh 'mvn clean test -P integrationDebug -DmaxLogs -fae'
}
}
}
}
stage('Test (Native)') {
steps {
script {
catchError {
sh 'cd ./out/build && ctest --output-junit ./Testing/testRes.xml && cd ../..'
}
}
}
post {
always {
junit testResults: 'out/build/Testing/**.xml', keepLongStdio: true, testDataPublishers: [[$class:'AttachmentPublisher']]
junit 'target/surefire-reports/*.xml'
}
}
}

View File

@ -1,55 +0,0 @@
# Storm Engine
A multiplayer-focused game engine
## Building
### Cloning
When cloning the repo, make sure to grab all submodules with `git clone --recurse-submodules git@git.austinwhoover.com:studiorailgun/Renderer.git`
### Windows
1. Install
- [gitbash](https://git-scm.com/downloads)
- [choco](https://chocolatey.org/install)
- [Eclipse Temurin 17](https://adoptium.net/temurin/releases/)
- [maven](https://maven.apache.org/download.cgi)
- [7zip](https://www.7-zip.org/)
2. From choco install
- [mingw](https://community.chocolatey.org/packages/mingw)
- [make](https://community.chocolatey.org/packages/make)
- [cmake](https://community.chocolatey.org/packages/cmake)
- [ninja](https://community.chocolatey.org/packages/ninja)
3. Run build.sh
The build will be in `<Project Directory>/build`
### Alternate Build Profiles
Several build profiles are defined in maven to support different functions
- fast - Only runs the fast unit tests
- integration - Runs the integration tests
- integrationDebug - Runs the integration tests with the memory-debug jar linked
## Documentation
### Building
The documentation uses [Doxygen](https://github.com/doxygen/doxygen) to build.
On windows, it's recommended to use [Doxywizard](https://www.doxygen.nl/manual/doxywizard_usage.html) to build the documentation.
To build
- Open the file `<Project Directory>/docs/Doxyfile`
- Navigate to the `Run` tab
- Click `Run doxygen`
- Click `Show HTML output`

Binary file not shown.

BIN
assets/Audio/closeMenu.ogg Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More