diff --git a/.gitignore b/.gitignore index 620f8f6..8f7e003 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ # will have compiled files and executables debug/ target/ +ai_fighter/Package/ # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html diff --git a/ai_fighter/AI_Fight_Sim/.vsconfig b/ai_fighter/AI_Fight_Sim/.vsconfig index b3c233d..6d42036 100644 --- a/ai_fighter/AI_Fight_Sim/.vsconfig +++ b/ai_fighter/AI_Fight_Sim/.vsconfig @@ -9,6 +9,7 @@ "Microsoft.VisualStudio.Component.Windows11SDK.22621", "Microsoft.VisualStudio.Workload.CoreEditor", "Microsoft.VisualStudio.Workload.ManagedDesktop", + "Microsoft.VisualStudio.Workload.NativeCrossPlat", "Microsoft.VisualStudio.Workload.NativeDesktop", "Microsoft.VisualStudio.Workload.NativeGame" ] diff --git a/ai_fighter/AI_Fight_Sim/BuildConfiguration.xml b/ai_fighter/AI_Fight_Sim/BuildConfiguration.xml new file mode 100644 index 0000000..7b21e10 --- /dev/null +++ b/ai_fighter/AI_Fight_Sim/BuildConfiguration.xml @@ -0,0 +1,9 @@ + + + + + -fopenmp + -fopenmp + + + \ No newline at end of file diff --git a/ai_fighter/AI_Fight_Sim/Plugins/NeuralNetworkAIController/Source/NeuralNetworkAIController/NeuralNetworkAIController.Build.cs b/ai_fighter/AI_Fight_Sim/Plugins/NeuralNetworkAIController/Source/NeuralNetworkAIController/NeuralNetworkAIController.Build.cs index 9a5dd92..832f851 100644 --- a/ai_fighter/AI_Fight_Sim/Plugins/NeuralNetworkAIController/Source/NeuralNetworkAIController/NeuralNetworkAIController.Build.cs +++ b/ai_fighter/AI_Fight_Sim/Plugins/NeuralNetworkAIController/Source/NeuralNetworkAIController/NeuralNetworkAIController.Build.cs @@ -1,59 +1,79 @@ // Copyright Epic Games, Inc. All Rights Reserved. +using System.Collections.Generic; using System.IO; using UnrealBuildTool; public class NeuralNetworkAIController : ModuleRules { - public NeuralNetworkAIController(ReadOnlyTargetRules Target) : base(Target) - { - PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; - - PublicIncludePaths.AddRange( - new string[] { - // ... add public include paths required here ... - Path.Combine(ModuleDirectory, "ThirdParty", "FANN", "include") + public NeuralNetworkAIController(ReadOnlyTargetRules Target) : base(Target) + { + PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; + + PublicIncludePaths.AddRange( + new string[] { + Path.Combine(ModuleDirectory, "ThirdParty", "FANN", "include") } - ); - PublicSystemLibraryPaths.Add(Path.Combine(ModuleDirectory, "ThirdParty", "FANN", "include")); - - - PrivateIncludePaths.AddRange( - new string[] { - // ... add other private include paths required here ... - } - ); - - - PublicDependencyModuleNames.AddRange( - new string[] - { - "Core", - // ... add other public dependencies that you statically link with here ... - } - ); - - - PrivateDependencyModuleNames.AddRange( - new string[] - { - "CoreUObject", - "Engine", - "Slate", - "SlateCore", - // ... add private dependencies that you statically link with here ... - } - ); - - - DynamicallyLoadedModuleNames.AddRange( - new string[] - { - // ... add any modules that your module loads dynamically here ... - //Path.Combine(ModuleDirectory, "ThirdParty", "FANN", "bin", "fann.dll") - } - ); + ); + + PrivateIncludePaths.AddRange( + new string[] { + // ... add other private include paths required here ... + } + ); + + PublicDependencyModuleNames.AddRange( + new string[] + { + "Core", + // ... add other public dependencies that you statically link with here ... + } + ); + + PrivateDependencyModuleNames.AddRange( + new string[] + { + "CoreUObject", + "Engine", + "Slate", + "SlateCore", + // ... add private dependencies that you statically link with here ... + } + ); + + DynamicallyLoadedModuleNames.AddRange( + new string[] + { + // ... add any modules that your module loads dynamically here ... + } + ); - PublicAdditionalLibraries.Add(Path.Combine(ModuleDirectory, "ThirdParty", "FANN", "lib", "fann.lib")); + // FANN Library configuration - MULTI-PLATFORM SUPPORT + string FannPath = Path.Combine(ModuleDirectory, "ThirdParty", "FANN"); + string IncludePath = Path.Combine(FannPath, "include"); + string LibraryPath = Path.Combine(FannPath, "lib"); + + PublicIncludePaths.Add(IncludePath); + + if (Target.Platform == UnrealTargetPlatform.Win64) + { + // Windows linking + PublicAdditionalLibraries.Add(Path.Combine(LibraryPath, "fann.lib")); + + // Add runtime dependencies for Windows DLLs + string DllPath = Path.Combine(FannPath, "bin", "fann.dll"); + RuntimeDependencies.Add(DllPath); + } + else if (Target.Platform == UnrealTargetPlatform.Linux) + { + // Linux linking - using static library (recommended) + string LinuxLibraryPath = Path.Combine(LibraryPath, "Linux", "x86_64-unknown-linux-gnu"); + PublicAdditionalLibraries.Add(Path.Combine(LinuxLibraryPath, "libfann.a")); + + // Alternative: If using shared library (.so) + // string SoPath = Path.Combine(LinuxLibraryPath, "libfann.so"); + //PublicAdditionalLibraries.Add(SoPath); + //RuntimeDependencies.Add("$(BinaryOutputDir)/libfann.so", SoPath); + } } -} +} \ No newline at end of file diff --git a/ai_fighter/AI_Fight_Sim/Source/AI_Fight_Sim.Target.cs b/ai_fighter/AI_Fight_Sim/Source/AI_Fight_Sim.Target.cs index d0f5e77..9b9d2ab 100644 --- a/ai_fighter/AI_Fight_Sim/Source/AI_Fight_Sim.Target.cs +++ b/ai_fighter/AI_Fight_Sim/Source/AI_Fight_Sim.Target.cs @@ -8,8 +8,10 @@ public class AI_Fight_SimTarget : TargetRules public AI_Fight_SimTarget(TargetInfo Target) : base(Target) { Type = TargetType.Game; - DefaultBuildSettings = BuildSettingsVersion.V2; + DefaultBuildSettings = BuildSettingsVersion.V5; + IncludeOrderVersion = EngineIncludeOrderVersion.Latest; + CppStandard = CppStandardVersion.Cpp20; - ExtraModuleNames.AddRange( new string[] { "AI_Fight_Sim" } ); + ExtraModuleNames.AddRange( new string[] { "AI_Fight_Sim" } ); } } diff --git a/ai_fighter/AI_Fight_Sim/Source/AI_Fight_Sim/Public/NeuralNetworkCommandLineParsing.h b/ai_fighter/AI_Fight_Sim/Source/AI_Fight_Sim/Public/NeuralNetworkCommandLineParsing.h index c7fa58c..26c803a 100644 --- a/ai_fighter/AI_Fight_Sim/Source/AI_Fight_Sim/Public/NeuralNetworkCommandLineParsing.h +++ b/ai_fighter/AI_Fight_Sim/Source/AI_Fight_Sim/Public/NeuralNetworkCommandLineParsing.h @@ -1,7 +1,7 @@ #include "CoreMinimal.h" #include "Engine/GameInstance.h" #include "Misc/FileHelper.h" -#include "HAL/PlatformFilemanager.h" +#include "HAL/PlatformFileManager.h" #include "NeuralNetworkCommandLineParsing.generated.h" UCLASS()