commit 93926be25b8620f0a2d4e73c740874f65ee8f8c4 Author: Sara Montecino Date: Thu Nov 3 21:55:35 2022 -0700 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3f3c8c0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.vs/ +Binaries/ +enc_temp_folder/ +Intermediate/ +Saved/ diff --git a/Config/Android/AndroidEngine.ini b/Config/Android/AndroidEngine.ini new file mode 100755 index 0000000..32e2bdf --- /dev/null +++ b/Config/Android/AndroidEngine.ini @@ -0,0 +1,7 @@ +[/Script/AndroidRuntimeSettings.AndroidRuntimeSettings] +;AudioSampleRate=48000 +AudioMaxChannels=12 +;AudioCallbackBufferFrameSize=1024 +;AudioNumBuffersToEnqueue=2 +;AudioNumSourceWorkers=0 + diff --git a/Config/DefaultEditor.ini b/Config/DefaultEditor.ini new file mode 100755 index 0000000..e69de29 diff --git a/Config/DefaultEngine.ini b/Config/DefaultEngine.ini new file mode 100755 index 0000000..c3238f1 --- /dev/null +++ b/Config/DefaultEngine.ini @@ -0,0 +1,12 @@ +[/Script/Engine.RendererSettings] +r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange=True + +[/Script/HardwareTargeting.HardwareTargetingSettings] +TargetedHardwareClass=Desktop +AppliedTargetedHardwareClass=Desktop +DefaultGraphicsPerformance=Maximum +AppliedDefaultGraphicsPerformance=Maximum + +[/Script/EngineSettings.GameMapsSettings] +GlobalDefaultGameMode=/Game/GameModeBase_BP.GameModeBase_BP_C + diff --git a/Config/DefaultGame.ini b/Config/DefaultGame.ini new file mode 100755 index 0000000..ac36fe9 --- /dev/null +++ b/Config/DefaultGame.ini @@ -0,0 +1,2 @@ +[/Script/EngineSettings.GeneralProjectSettings] +ProjectID=ACC4683049BAA83CD626BA81B3543C3D diff --git a/Config/DefaultInput.ini b/Config/DefaultInput.ini new file mode 100755 index 0000000..c725b25 --- /dev/null +++ b/Config/DefaultInput.ini @@ -0,0 +1,94 @@ + +[/Script/Engine.InputSettings] ++AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MouseWheelAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_LeftTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_RightTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MotionController_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MotionController_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MotionController_Left_TriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MotionController_Left_Grip1Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MotionController_Left_Grip2Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MotionController_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MotionController_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MotionController_Right_TriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MotionController_Right_Grip1Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MotionController_Right_Grip2Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_Special_Left_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_Special_Left_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Daydream_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Daydream_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Daydream_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Daydream_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Vive_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Vive_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Vive_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Vive_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Vive_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Vive_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusGo_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusGo_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusGo_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusGo_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Right_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Grip_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Touch",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Grip_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +bAltEnterTogglesFullscreen=True +bF11TogglesFullscreen=True +bUseMouseForTouch=False +bEnableMouseSmoothing=True +bEnableFOVScaling=True +bCaptureMouseOnLaunch=True +bAlwaysShowTouchInterface=False +bShowConsoleOnFourFingerTap=True +bEnableGestureRecognizer=False +bUseAutocorrect=False +DefaultViewportMouseCaptureMode=CapturePermanently_IncludingInitialMouseDown +DefaultViewportMouseLockMode=LockOnCapture +FOVScale=0.011110 +DoubleClickTime=0.200000 ++AxisMappings=(AxisName="MoveForward",Scale=1.000000,Key=W) ++AxisMappings=(AxisName="MoveForward",Scale=-1.000000,Key=S) ++AxisMappings=(AxisName="MoveRight",Scale=1.000000,Key=D) ++AxisMappings=(AxisName="MoveRight",Scale=-1.000000,Key=A) +DefaultTouchInterface=/Engine/MobileResources/HUD/DefaultVirtualJoysticks.DefaultVirtualJoysticks ++ConsoleKeys=Tilde + + diff --git a/Config/IOS/IOSEngine.ini b/Config/IOS/IOSEngine.ini new file mode 100755 index 0000000..f1f7c4f --- /dev/null +++ b/Config/IOS/IOSEngine.ini @@ -0,0 +1,7 @@ +[/Script/IOSRuntimeSettings.IOSRuntimeSettings] +;AudioSampleRate=48000 +AudioMaxChannels=16 +;AudioCallbackBufferFrameSize=1024 +;AudioNumBuffersToEnqueue=2 +;AudioNumSourceWorkers=0 + diff --git a/Config/Linux/LinuxEngine.ini b/Config/Linux/LinuxEngine.ini new file mode 100755 index 0000000..cf3e2f1 --- /dev/null +++ b/Config/Linux/LinuxEngine.ini @@ -0,0 +1,7 @@ +[/Script/LinuxTargetPlatform.LinuxTargetSettings] +;AudioSampleRate=48000 +AudioMaxChannels=16 +;AudioCallbackBufferFrameSize=1024 +;AudioNumBuffersToEnqueue=2 +;AudioNumSourceWorkers=0 + diff --git a/Config/Mac/MacEngine.ini b/Config/Mac/MacEngine.ini new file mode 100755 index 0000000..fc00ff2 --- /dev/null +++ b/Config/Mac/MacEngine.ini @@ -0,0 +1,7 @@ +[/Script/MacTargetPlatform.MacTargetSettings] +;AudioSampleRate=48000 +;AudioMaxChannels=32 +;AudioCallbackBufferFrameSize=1024 +;AudioNumBuffersToEnqueue=2 +;AudioNumSourceWorkers=0 + diff --git a/Config/PS4/PS4Engine.ini b/Config/PS4/PS4Engine.ini new file mode 100755 index 0000000..763ef80 --- /dev/null +++ b/Config/PS4/PS4Engine.ini @@ -0,0 +1,7 @@ +[/Script/PS4PlatformEditor.PS4TargetSettings] +;AudioSampleRate=48000 +;AudioMaxChannels=32 +AudioCallbackBufferFrameSize=256 +AudioNumBuffersToEnqueue=7 +AudioNumSourceWorkers=4 + diff --git a/Config/Switch/SwitchEngine.ini b/Config/Switch/SwitchEngine.ini new file mode 100755 index 0000000..e806f99 --- /dev/null +++ b/Config/Switch/SwitchEngine.ini @@ -0,0 +1,7 @@ +[/Script/SwitchRuntimeSettings.SwitchRuntimeSettings] +;AudioSampleRate=48000 +AudioMaxChannels=16 +;AudioCallbackBufferFrameSize=1024 +;AudioNumBuffersToEnqueue=2 +;AudioNumSourceWorkers=0 + diff --git a/Config/Windows/WindowsEngine.ini b/Config/Windows/WindowsEngine.ini new file mode 100755 index 0000000..8e8694e --- /dev/null +++ b/Config/Windows/WindowsEngine.ini @@ -0,0 +1,7 @@ +[/Script/WindowsTargetPlatform.WindowsTargetSettings] +;AudioSampleRate=48000 +;AudioMaxChannels=32 +AudioCallbackBufferFrameSize=256 +AudioNumBuffersToEnqueue=7 +;AudioNumSourceWorkers=0 + diff --git a/Config/XboxOne/XboxOneEngine.ini b/Config/XboxOne/XboxOneEngine.ini new file mode 100755 index 0000000..7fcced8 --- /dev/null +++ b/Config/XboxOne/XboxOneEngine.ini @@ -0,0 +1,7 @@ +[/Script/XboxOnePlatformEditor.XboxOneTargetSettings] +;AudioSampleRate=48000 +;AudioMaxChannels=32 +AudioCallbackBufferFrameSize=256 +AudioNumBuffersToEnqueue=7 +;AudioNumSourceWorkers=0 + diff --git a/Content/BasePawn_BP.uasset b/Content/BasePawn_BP.uasset new file mode 100755 index 0000000..97886e2 Binary files /dev/null and b/Content/BasePawn_BP.uasset differ diff --git a/Content/GameModeBase_BP.uasset b/Content/GameModeBase_BP.uasset new file mode 100755 index 0000000..4a57dc4 Binary files /dev/null and b/Content/GameModeBase_BP.uasset differ diff --git a/Content/PlayerMaterial.uasset b/Content/PlayerMaterial.uasset new file mode 100755 index 0000000..349bc6d Binary files /dev/null and b/Content/PlayerMaterial.uasset differ diff --git a/Content/RoadMaterial.uasset b/Content/RoadMaterial.uasset new file mode 100755 index 0000000..732cc21 Binary files /dev/null and b/Content/RoadMaterial.uasset differ diff --git a/Content/TestMap.umap b/Content/TestMap.umap new file mode 100755 index 0000000..9fa5237 Binary files /dev/null and b/Content/TestMap.umap differ diff --git a/Content/TestMap_BuiltData.uasset b/Content/TestMap_BuiltData.uasset new file mode 100755 index 0000000..426f587 Binary files /dev/null and b/Content/TestMap_BuiltData.uasset differ diff --git a/PresidentsBrigade.sln b/PresidentsBrigade.sln new file mode 100755 index 0000000..7f8403e --- /dev/null +++ b/PresidentsBrigade.sln @@ -0,0 +1,87 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.28315.86 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Engine", "Engine", "{417AE356-0628-4071-8D33-40C078947CC9}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Games", "Games", "{CDA30B7C-8F9F-48AB-A6AA-CB3B41DCE083}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PresidentsBrigade", "Intermediate\ProjectFiles\PresidentsBrigade.vcxproj", "{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UE4", "Intermediate\ProjectFiles\UE4.vcxproj", "{B0F8FF12-D021-4217-B1B9-F5627A14FB59}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Visualizers", "Visualizers", "{1AC9C2E0-EF4E-4F8C-9F40-1C4BD6DECBCB}" + ProjectSection(SolutionItems) = preProject + D:\Games\Epic Games\UE_4.24\Engine\Extras\VisualStudioDebugging\UE4.natvis = D:\Games\Epic Games\UE_4.24\Engine\Extras\VisualStudioDebugging\UE4.natvis + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + DebugGame Editor|Android = DebugGame Editor|Android + DebugGame Editor|Win32 = DebugGame Editor|Win32 + DebugGame Editor|Win64 = DebugGame Editor|Win64 + DebugGame|Android = DebugGame|Android + DebugGame|Win32 = DebugGame|Win32 + DebugGame|Win64 = DebugGame|Win64 + Development Editor|Android = Development Editor|Android + Development Editor|Win32 = Development Editor|Win32 + Development Editor|Win64 = Development Editor|Win64 + Development|Android = Development|Android + Development|Win32 = Development|Win32 + Development|Win64 = Development|Win64 + Shipping|Android = Shipping|Android + Shipping|Win32 = Shipping|Win32 + Shipping|Win64 = Shipping|Win64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.DebugGame Editor|Android.ActiveCfg = Invalid|Win32 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.DebugGame Editor|Win32.ActiveCfg = Invalid|Win32 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.DebugGame Editor|Win64.ActiveCfg = DebugGame_Editor|x64 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.DebugGame Editor|Win64.Build.0 = DebugGame_Editor|x64 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.DebugGame|Android.ActiveCfg = Android_DebugGame|Win32 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.DebugGame|Android.Build.0 = Android_DebugGame|Win32 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.DebugGame|Win32.ActiveCfg = DebugGame|Win32 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.DebugGame|Win32.Build.0 = DebugGame|Win32 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.DebugGame|Win64.ActiveCfg = DebugGame|x64 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.DebugGame|Win64.Build.0 = DebugGame|x64 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Development Editor|Android.ActiveCfg = Invalid|Win32 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Development Editor|Win32.ActiveCfg = Invalid|Win32 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Development Editor|Win64.ActiveCfg = Development_Editor|x64 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Development Editor|Win64.Build.0 = Development_Editor|x64 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Development|Android.ActiveCfg = Android_Development|Win32 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Development|Android.Build.0 = Android_Development|Win32 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Development|Win32.ActiveCfg = Development|Win32 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Development|Win32.Build.0 = Development|Win32 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Development|Win64.ActiveCfg = Development|x64 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Development|Win64.Build.0 = Development|x64 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Shipping|Android.ActiveCfg = Android_Shipping|Win32 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Shipping|Android.Build.0 = Android_Shipping|Win32 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Shipping|Win32.ActiveCfg = Shipping|Win32 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Shipping|Win32.Build.0 = Shipping|Win32 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Shipping|Win64.ActiveCfg = Shipping|x64 + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Shipping|Win64.Build.0 = Shipping|x64 + {B0F8FF12-D021-4217-B1B9-F5627A14FB59}.DebugGame Editor|Android.ActiveCfg = BuiltWithUnrealBuildTool|Win32 + {B0F8FF12-D021-4217-B1B9-F5627A14FB59}.DebugGame Editor|Win32.ActiveCfg = BuiltWithUnrealBuildTool|Win32 + {B0F8FF12-D021-4217-B1B9-F5627A14FB59}.DebugGame Editor|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win32 + {B0F8FF12-D021-4217-B1B9-F5627A14FB59}.DebugGame|Android.ActiveCfg = BuiltWithUnrealBuildTool|Win32 + {B0F8FF12-D021-4217-B1B9-F5627A14FB59}.DebugGame|Win32.ActiveCfg = BuiltWithUnrealBuildTool|Win32 + {B0F8FF12-D021-4217-B1B9-F5627A14FB59}.DebugGame|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win32 + {B0F8FF12-D021-4217-B1B9-F5627A14FB59}.Development Editor|Android.ActiveCfg = BuiltWithUnrealBuildTool|Win32 + {B0F8FF12-D021-4217-B1B9-F5627A14FB59}.Development Editor|Win32.ActiveCfg = BuiltWithUnrealBuildTool|Win32 + {B0F8FF12-D021-4217-B1B9-F5627A14FB59}.Development Editor|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win32 + {B0F8FF12-D021-4217-B1B9-F5627A14FB59}.Development|Android.ActiveCfg = BuiltWithUnrealBuildTool|Win32 + {B0F8FF12-D021-4217-B1B9-F5627A14FB59}.Development|Win32.ActiveCfg = BuiltWithUnrealBuildTool|Win32 + {B0F8FF12-D021-4217-B1B9-F5627A14FB59}.Development|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win32 + {B0F8FF12-D021-4217-B1B9-F5627A14FB59}.Shipping|Android.ActiveCfg = BuiltWithUnrealBuildTool|Win32 + {B0F8FF12-D021-4217-B1B9-F5627A14FB59}.Shipping|Win32.ActiveCfg = BuiltWithUnrealBuildTool|Win32 + {B0F8FF12-D021-4217-B1B9-F5627A14FB59}.Shipping|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {B0F8FF12-D021-4217-B1B9-F5627A14FB59} = {417AE356-0628-4071-8D33-40C078947CC9} + {F2C85DE9-5426-412A-8D2E-10FE7F5CF11B} = {CDA30B7C-8F9F-48AB-A6AA-CB3B41DCE083} + EndGlobalSection +EndGlobal diff --git a/PresidentsBrigade.uproject b/PresidentsBrigade.uproject new file mode 100755 index 0000000..03982b9 --- /dev/null +++ b/PresidentsBrigade.uproject @@ -0,0 +1,16 @@ +{ + "FileVersion": 3, + "EngineAssociation": "4.24", + "Category": "", + "Description": "", + "Modules": [ + { + "Name": "PresidentsBrigade", + "Type": "Runtime", + "LoadingPhase": "Default", + "AdditionalDependencies": [ + "Engine" + ] + } + ] +} \ No newline at end of file diff --git a/Source/PresidentsBrigade.Target.cs b/Source/PresidentsBrigade.Target.cs new file mode 100755 index 0000000..734a6c0 --- /dev/null +++ b/Source/PresidentsBrigade.Target.cs @@ -0,0 +1,15 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +using UnrealBuildTool; +using System.Collections.Generic; + +public class PresidentsBrigadeTarget : TargetRules +{ + public PresidentsBrigadeTarget(TargetInfo Target) : base(Target) + { + Type = TargetType.Game; + DefaultBuildSettings = BuildSettingsVersion.V2; + + ExtraModuleNames.AddRange( new string[] { "PresidentsBrigade" } ); + } +} diff --git a/Source/PresidentsBrigade/BasePawn.cpp b/Source/PresidentsBrigade/BasePawn.cpp new file mode 100755 index 0000000..90b26b6 --- /dev/null +++ b/Source/PresidentsBrigade/BasePawn.cpp @@ -0,0 +1,122 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "BasePawn.h" +#include "Camera/CameraComponent.h" +#include "Components/StaticMeshComponent.h" + +// Sets default values +ABasePawn::ABasePawn(const FObjectInitializer &object_initializer): + APawn(object_initializer) +{ + // Create default components. + root_component = object_initializer.CreateDefaultSubobject(this, FName("Root")); + main_camera = object_initializer.CreateDefaultSubobject(this, FName("MainCamera")); + player_mesh = object_initializer.CreateDefaultSubobject(this, FName("PlayerMesh")); + movement_component = object_initializer.CreateDefaultSubobject(this, FName("MovementComponent")); + + // Setup component hierarchy. + RootComponent = root_component; + main_camera->SetupAttachment(root_component); + player_mesh->SetupAttachment(root_component); + movement_component->UpdatedComponent = player_mesh; + + PrimaryActorTick.bCanEverTick = true; + + // Set defaults. + accel_max_time = 0.25; + horizontal_speed_max = 100; + vertical_speed_max = 100; +} + +// Called when the game starts or when spawned +void ABasePawn::BeginPlay() +{ + Super::BeginPlay(); + +} + +UPawnMovementComponent* ABasePawn::GetMovementComponent() const +{ + return movement_component; +} + +// Called every frame +void ABasePawn::Tick(float DeltaTime) +{ + Super::Tick(DeltaTime); + + // Move the player. + //vertical_speed = vertical_accel.update(DeltaTime); + //horizontal_speed = horizontal_accel.update(DeltaTime); + + //// "X" is up, "Y" is right. + //const FVector location = player_mesh->GetComponentLocation(); + //const float new_vertical = (DeltaTime * vertical_speed) + location.X; + //const float new_horizontal = (DeltaTime * horizontal_speed) + location.Y; + //player_mesh->SetWorldLocation(FVector(new_vertical, new_horizontal, location.Z)); +} + +// Called to bind functionality to input +void ABasePawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) +{ + Super::SetupPlayerInputComponent(PlayerInputComponent); + + //PlayerInputComponent->BindAction("MoveUp", EInputEvent::IE_Pressed, this, &ABasePawn::handle_move_input, movement_t::UP, 1); + //PlayerInputComponent->BindAction("MoveUp", EInputEvent::IE_Released, this, &ABasePawn::handle_move_input, movement_t::UP, 0); + + //PlayerInputComponent->BindAction("MoveDown", EInputEvent::IE_Pressed, this, &ABasePawn::handle_move_input, movement_t::DOWN, -1); + //PlayerInputComponent->BindAction("MoveDown", EInputEvent::IE_Released, this, &ABasePawn::handle_move_input, movement_t::DOWN, 0); + + //PlayerInputComponent->BindAction("MoveRight", EInputEvent::IE_Pressed, this, &ABasePawn::handle_move_input, movement_t::RIGHT, 1); + //PlayerInputComponent->BindAction("MoveRight", EInputEvent::IE_Released, this, &ABasePawn::handle_move_input, movement_t::RIGHT, 0); + + //PlayerInputComponent->BindAction("MoveLeft", EInputEvent::IE_Pressed, this, &ABasePawn::handle_move_input, movement_t::LEFT, -1); + //PlayerInputComponent->BindAction("MoveLeft", EInputEvent::IE_Released, this, &ABasePawn::handle_move_input, movement_t::LEFT, 0); + + PlayerInputComponent->BindAxis("MoveForward", this, &ABasePawn::handle_move_forward); + PlayerInputComponent->BindAxis("MoveRight", this, &ABasePawn::handle_move_right); +} + +void ABasePawn::handle_move_forward(float axis) +{ + FRotator rotation = Controller->GetControlRotation(); + FRotator yaw(0.0f, rotation.Yaw, 0.0f); + + FVector forward = FRotationMatrix(yaw).GetUnitAxis(EAxis::X); + AddMovementInput(forward, axis); +} + +void ABasePawn::handle_move_right(float axis) +{ + FRotator rotation = Controller->GetControlRotation(); + FRotator yaw(0.0f, rotation.Yaw, 0.0f); + + FVector right = FRotationMatrix(yaw).GetUnitAxis(EAxis::Y); + AddMovementInput(right, axis); +} +//void ABasePawn::handle_move_input(const movement_t move_type, const int direction) +//{ +// if (move_type == movement_t::UP || move_type == movement_t::DOWN) +// { +// // Prevent two vertical inputs entered at the same time. +// if (vertical_accel.end != 0 && direction != 0) +// { +// return; +// } +// +// const float new_speed = direction * vertical_speed_max; +// vertical_accel.set(vertical_speed, new_speed, accel_max_time); +// } +// else +// { +// // Prevent two horizontal inputs entered at the same time. +// if (horizontal_accel.end != 0 && direction != 0) +// { +// return; +// } +// +// const float new_speed = direction * horizontal_speed_max; +// horizontal_accel.set(horizontal_speed, new_speed, accel_max_time); +// } +//} diff --git a/Source/PresidentsBrigade/BasePawn.h b/Source/PresidentsBrigade/BasePawn.h new file mode 100755 index 0000000..569bd68 --- /dev/null +++ b/Source/PresidentsBrigade/BasePawn.h @@ -0,0 +1,107 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/Pawn.h" +#include "Kismet/KismetMathLibrary.h" +#include "GameFramework/CharacterMovementComponent.h" +#include "GameFramework/FloatingPawnMovement.h" +#include "BasePawn.generated.h" + +class UCameraComponent; + +//enum movement_t : uint8 +//{ +// UP, +// DOWN, +// LEFT, +// RIGHT +//}; + +UCLASS() +class PRESIDENTSBRIGADE_API ABasePawn : public APawn +{ + GENERATED_BODY() + +public: + // Sets default values for this pawn's properties + ABasePawn(const FObjectInitializer &object_initializer); + + // Called every frame + virtual void Tick(float DeltaTime) override; + + // Called to bind functionality to input + virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override; +protected: + // Called when the game starts or when spawned + virtual void BeginPlay() override; + + virtual UPawnMovementComponent* GetMovementComponent() const; + + UPROPERTY(EditAnywhere, Category="Player") + UCameraComponent* main_camera; + + UPROPERTY(EditAnywhere, Category="Player") + UStaticMeshComponent* player_mesh; + + UPROPERTY(EditAnywhere, Category="Player") + UFloatingPawnMovement* movement_component; + + // Accel max time. + UPROPERTY(EditDefaultsOnly, Category="Gameplay") + float accel_max_time; + + // Maximum horizontal speed. + UPROPERTY(EditDefaultsOnly, Category="Gameplay") + float horizontal_speed_max; + + // Maximum vertical speed. + UPROPERTY(EditDefaultsOnly, Category="Gameplay") + float vertical_speed_max; + +private: + struct AccelerationAnim + { + float start; + float end; + float max_time; + + float time_elapsed; + + void set(float _start, float _end, float _max_time) + { + start = _start; + end = _end; + max_time = _max_time; + time_elapsed = 0; + }; + + float update(const float delta_time) + { + float percentage = time_elapsed / max_time; + + // Animation is complete. + if (time_elapsed > max_time) + { + percentage = 1; + } + + time_elapsed += delta_time; + return UKismetMathLibrary::Lerp(start, end, percentage); + }; + }; + + USceneComponent* root_component; + +// DECLARE_DELEGATE_TwoParams(FMovementDelegate, const movement_t, const int); +// void handle_move_input(const movement_t move_type, const int direction); + void handle_move_right(float axis); + void handle_move_forward(float axis); + + float horizontal_speed; + float vertical_speed; + + AccelerationAnim horizontal_accel; + AccelerationAnim vertical_accel; +}; diff --git a/Source/PresidentsBrigade/MyDefaultPawn.cpp b/Source/PresidentsBrigade/MyDefaultPawn.cpp new file mode 100755 index 0000000..19fc5ee --- /dev/null +++ b/Source/PresidentsBrigade/MyDefaultPawn.cpp @@ -0,0 +1,201 @@ +// Fill out your copyright notice in the Description page of Project Settings. +#include "MyDefaultPawn.h" + +#include "UObject/ConstructorHelpers.h" +#include "Engine/World.h" +#include "Components/StaticMeshComponent.h" +#include "GameFramework/PlayerController.h" +#include "Engine/CollisionProfile.h" +#include "Engine/StaticMesh.h" +#include "Components/SphereComponent.h" +#include "GameFramework/PawnMovementComponent.h" +#include "GameFramework/FloatingPawnMovement.h" +#include "GameFramework/CharacterMovementComponent.h" +#include "GameFramework/PlayerInput.h" + +FName AMyDefaultPawn::MovementComponentName(TEXT("MovementComponent0")); +FName AMyDefaultPawn::CollisionComponentName(TEXT("CollisionComponent0")); +FName AMyDefaultPawn::MeshComponentName(TEXT("MeshComponent0")); + + +AMyDefaultPawn::AMyDefaultPawn(const FObjectInitializer& ObjectInitializer) : APawn(ObjectInitializer) +{ + SetCanBeDamaged(true); + + SetRemoteRoleForBackwardsCompat(ROLE_SimulatedProxy); + bReplicates = true; + NetPriority = 3.0f; + + BaseEyeHeight = 0.0f; + bCollideWhenPlacing = false; + SpawnCollisionHandlingMethod = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; + + CollisionComponent = CreateDefaultSubobject(AMyDefaultPawn::CollisionComponentName); + CollisionComponent->InitSphereRadius(35.0f); + CollisionComponent->SetCollisionProfileName(UCollisionProfile::Pawn_ProfileName); + + CollisionComponent->CanCharacterStepUpOn = ECB_No; + CollisionComponent->SetShouldUpdatePhysicsVolume(true); + CollisionComponent->SetCanEverAffectNavigation(false); + CollisionComponent->bDynamicObstacle = true; + + RootComponent = CollisionComponent; + + MovementComponent = CreateDefaultSubobject(AMyDefaultPawn::MovementComponentName); + MovementComponent->UpdatedComponent = CollisionComponent; + + // Structure to hold one-time initialization + struct FConstructorStatics + { + ConstructorHelpers::FObjectFinder SphereMesh; + FConstructorStatics() + : SphereMesh(TEXT("/Engine/EngineMeshes/Sphere")) {} + }; + + static FConstructorStatics ConstructorStatics; + + MeshComponent = CreateOptionalDefaultSubobject(AMyDefaultPawn::MeshComponentName); + if (MeshComponent) + { + MeshComponent->SetStaticMesh(ConstructorStatics.SphereMesh.Object); + MeshComponent->AlwaysLoadOnClient = true; + MeshComponent->AlwaysLoadOnServer = true; + MeshComponent->bOwnerNoSee = true; + MeshComponent->bCastDynamicShadow = true; + MeshComponent->bAffectDynamicIndirectLighting = false; + MeshComponent->bAffectDistanceFieldLighting = false; + MeshComponent->bVisibleInRayTracing = false; + MeshComponent->PrimaryComponentTick.TickGroup = TG_PrePhysics; + MeshComponent->SetupAttachment(RootComponent); + MeshComponent->SetCollisionProfileName(UCollisionProfile::Pawn_ProfileName); + const float Scale = CollisionComponent->GetUnscaledSphereRadius() / 160.f; // @TODO: hardcoding known size of EngineMeshes.Sphere. Should use a unit sphere instead. + MeshComponent->SetRelativeScale3D(FVector(Scale)); + MeshComponent->SetGenerateOverlapEvents(false); + MeshComponent->SetCanEverAffectNavigation(false); + } + + // This is the default pawn class, we want to have it be able to move out of the box. + bAddDefaultMovementBindings = true; +} + +void InitializeDefaultPawnInputBindings() +{ + static bool bBindingsAdded = false; + if (!bBindingsAdded) + { + bBindingsAdded = true; + + UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveForward", EKeys::W, 1.f)); + UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveForward", EKeys::S, -1.f)); + UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveForward", EKeys::Up, 1.f)); + UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveForward", EKeys::Down, -1.f)); + UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveForward", EKeys::Gamepad_LeftY, 1.f)); + + UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveRight", EKeys::A, -1.f)); + UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveRight", EKeys::D, 1.f)); + UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveRight", EKeys::Gamepad_LeftX, 1.f)); + + // HACK: Android controller bindings in ini files seem to not work + // Direct overrides here some to work +#if !PLATFORM_ANDROID + UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveUp", EKeys::Gamepad_LeftThumbstick, 1.f)); + UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveUp", EKeys::Gamepad_RightThumbstick, -1.f)); + UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveUp", EKeys::Gamepad_FaceButton_Bottom, 1.f)); + UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveUp", EKeys::LeftControl, -1.f)); + UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveUp", EKeys::SpaceBar, 1.f)); + UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveUp", EKeys::C, -1.f)); + UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveUp", EKeys::E, 1.f)); + UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveUp", EKeys::Q, -1.f)); +#else + UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveUp", EKeys::Gamepad_LeftTriggerAxis, -0.5f)); + UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveUp", EKeys::Gamepad_RightTriggerAxis, 0.5f)); +#endif + + UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_TurnRate", EKeys::Gamepad_RightX, 1.f)); + UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_TurnRate", EKeys::Left, -1.f)); + UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_TurnRate", EKeys::Right, 1.f)); + UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_Turn", EKeys::MouseX, 1.f)); + + UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_LookUpRate", EKeys::Gamepad_RightY, 1.f)); + UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_LookUp", EKeys::MouseY, -1.f)); + } +} + +void AMyDefaultPawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) +{ + check(PlayerInputComponent); + + if (bAddDefaultMovementBindings) + { + InitializeDefaultPawnInputBindings(); + + PlayerInputComponent->BindAxis("DefaultPawn_MoveForward", this, &AMyDefaultPawn::MoveForward); + PlayerInputComponent->BindAxis("DefaultPawn_MoveRight", this, &AMyDefaultPawn::MoveRight); + PlayerInputComponent->BindAxis("DefaultPawn_MoveUp", this, &AMyDefaultPawn::MoveUp_World); + PlayerInputComponent->BindAxis("DefaultPawn_Turn", this, &AMyDefaultPawn::AddControllerYawInput); + PlayerInputComponent->BindAxis("DefaultPawn_TurnRate", this, &AMyDefaultPawn::TurnAtRate); + PlayerInputComponent->BindAxis("DefaultPawn_LookUp", this, &AMyDefaultPawn::AddControllerPitchInput); + PlayerInputComponent->BindAxis("DefaultPawn_LookUpRate", this, &AMyDefaultPawn::LookUpAtRate); + } +} + +void AMyDefaultPawn::UpdateNavigationRelevance() +{ + if (CollisionComponent) + { + CollisionComponent->SetCanEverAffectNavigation(bCanAffectNavigationGeneration); + } +} + +void AMyDefaultPawn::MoveRight(float Val) +{ + if (Val != 0.f) + { + if (Controller) + { + FRotator const ControlSpaceRot = Controller->GetControlRotation(); + + // transform to world space and add it + AddMovementInput(FRotationMatrix(ControlSpaceRot).GetScaledAxis(EAxis::Y), Val); + } + } +} + +void AMyDefaultPawn::MoveForward(float Val) +{ + if (Val != 0.f) + { + if (Controller) + { + FRotator const ControlSpaceRot = Controller->GetControlRotation(); + + // transform to world space and add it + AddMovementInput(FRotationMatrix(ControlSpaceRot).GetScaledAxis(EAxis::X), Val); + } + } +} + +void AMyDefaultPawn::MoveUp_World(float Val) +{ + if (Val != 0.f) + { + AddMovementInput(FVector::UpVector, Val); + } +} + +void AMyDefaultPawn::TurnAtRate(float Rate) +{ + // calculate delta for this frame from the rate information + AddControllerYawInput(Rate * GetWorld()->GetDeltaSeconds() * CustomTimeDilation); +} + +void AMyDefaultPawn::LookUpAtRate(float Rate) +{ + // calculate delta for this frame from the rate information + AddControllerPitchInput(Rate * GetWorld()->GetDeltaSeconds() * CustomTimeDilation); +} + +UPawnMovementComponent* AMyDefaultPawn::GetMovementComponent() const +{ + return MovementComponent; +} diff --git a/Source/PresidentsBrigade/MyDefaultPawn.h b/Source/PresidentsBrigade/MyDefaultPawn.h new file mode 100755 index 0000000..edabb28 --- /dev/null +++ b/Source/PresidentsBrigade/MyDefaultPawn.h @@ -0,0 +1,102 @@ +// Fill out your copyright notice in the Description page of Project Settings. +#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/Pawn.h" +#include "MyDefaultPawn.generated.h" + +class UInputComponent; +class UPawnMovementComponent; +class USphereComponent; +class UStaticMeshComponent; + +/** + * + */ +UCLASS(config = Game, Blueprintable, BlueprintType) +class PRESIDENTSBRIGADE_API AMyDefaultPawn : public APawn +{ + GENERATED_BODY() + + AMyDefaultPawn(const FObjectInitializer& ObjectInitializer); + + // Begin Pawn overrides + virtual UPawnMovementComponent* GetMovementComponent() const override; + virtual void SetupPlayerInputComponent(UInputComponent* InInputComponent) override; + virtual void UpdateNavigationRelevance() override; + + /** + * Input callback to move forward in local space (or backward if Val is negative). + * @param Val Amount of movement in the forward direction (or backward if negative). + * @see APawn::AddMovementInput() + */ + UFUNCTION(BlueprintCallable, Category = "Pawn") + virtual void MoveForward(float Val); + + /** + * Input callback to strafe right in local space (or left if Val is negative). + * @param Val Amount of movement in the right direction (or left if negative). + * @see APawn::AddMovementInput() + */ + UFUNCTION(BlueprintCallable, Category = "Pawn") + virtual void MoveRight(float Val); + + /** + * Input callback to move up in world space (or down if Val is negative). + * @param Val Amount of movement in the world up direction (or down if negative). + * @see APawn::AddMovementInput() + */ + UFUNCTION(BlueprintCallable, Category = "Pawn") + virtual void MoveUp_World(float Val); + + /** + * Called via input to turn at a given rate. + * @param Rate This is a normalized rate, i.e. 1.0 means 100% of desired turn rate + */ + UFUNCTION(BlueprintCallable, Category = "Pawn") + virtual void TurnAtRate(float Rate); + + /** + * Called via input to look up at a given rate (or down if Rate is negative). + * @param Rate This is a normalized rate, i.e. 1.0 means 100% of desired turn rate + */ + UFUNCTION(BlueprintCallable, Category = "Pawn") + virtual void LookUpAtRate(float Rate); + +public: + /** Name of the MovementComponent. Use this name if you want to use a different class (with ObjectInitializer.SetDefaultSubobjectClass). */ + static FName MovementComponentName; + +protected: + /** DefaultPawn movement component */ + UPROPERTY(Category = Pawn, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true")) + UPawnMovementComponent* MovementComponent; + +public: + /** Name of the CollisionComponent. */ + static FName CollisionComponentName; + +private: + /** DefaultPawn collision component */ + UPROPERTY(Category = Pawn, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true")) + USphereComponent* CollisionComponent; +public: + + /** Name of the MeshComponent. Use this name if you want to prevent creation of the component (with ObjectInitializer.DoNotCreateDefaultSubobject). */ + static FName MeshComponentName; + +private: + /** The mesh associated with this Pawn. */ + UPROPERTY(Category = Pawn, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true")) + UStaticMeshComponent* MeshComponent; +public: + + /** If true, adds default input bindings for movement and camera look. */ + UPROPERTY(Category = Pawn, EditAnywhere, BlueprintReadOnly) + uint32 bAddDefaultMovementBindings : 1; + + /** Returns CollisionComponent subobject **/ + USphereComponent* GetCollisionComponent() const { return CollisionComponent; } + /** Returns MeshComponent subobject **/ + UStaticMeshComponent* GetMeshComponent() const { return MeshComponent; } +}; diff --git a/Source/PresidentsBrigade/PresidentsBrigade.Build.cs b/Source/PresidentsBrigade/PresidentsBrigade.Build.cs new file mode 100755 index 0000000..b044664 --- /dev/null +++ b/Source/PresidentsBrigade/PresidentsBrigade.Build.cs @@ -0,0 +1,23 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +using UnrealBuildTool; + +public class PresidentsBrigade : ModuleRules +{ + public PresidentsBrigade(ReadOnlyTargetRules Target) : base(Target) + { + PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; + + PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" }); + + PrivateDependencyModuleNames.AddRange(new string[] { }); + + // Uncomment if you are using Slate UI + // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" }); + + // Uncomment if you are using online features + // PrivateDependencyModuleNames.Add("OnlineSubsystem"); + + // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true + } +} diff --git a/Source/PresidentsBrigade/PresidentsBrigade.cpp b/Source/PresidentsBrigade/PresidentsBrigade.cpp new file mode 100755 index 0000000..37f5894 --- /dev/null +++ b/Source/PresidentsBrigade/PresidentsBrigade.cpp @@ -0,0 +1,6 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#include "PresidentsBrigade.h" +#include "Modules/ModuleManager.h" + +IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, PresidentsBrigade, "PresidentsBrigade" ); diff --git a/Source/PresidentsBrigade/PresidentsBrigade.h b/Source/PresidentsBrigade/PresidentsBrigade.h new file mode 100755 index 0000000..c56eab6 --- /dev/null +++ b/Source/PresidentsBrigade/PresidentsBrigade.h @@ -0,0 +1,6 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" + diff --git a/Source/PresidentsBrigade/PresidentsBrigadeGameModeBase.cpp b/Source/PresidentsBrigade/PresidentsBrigadeGameModeBase.cpp new file mode 100755 index 0000000..0425168 --- /dev/null +++ b/Source/PresidentsBrigade/PresidentsBrigadeGameModeBase.cpp @@ -0,0 +1,10 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "PresidentsBrigadeGameModeBase.h" +#include "BasePawn.h" + +APresidentsBrigadeGameModeBase::APresidentsBrigadeGameModeBase() +{ +} + diff --git a/Source/PresidentsBrigade/PresidentsBrigadeGameModeBase.h b/Source/PresidentsBrigade/PresidentsBrigadeGameModeBase.h new file mode 100755 index 0000000..f86f369 --- /dev/null +++ b/Source/PresidentsBrigade/PresidentsBrigadeGameModeBase.h @@ -0,0 +1,19 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/GameModeBase.h" +#include "PresidentsBrigadeGameModeBase.generated.h" + +/** + * + */ +UCLASS() +class PRESIDENTSBRIGADE_API APresidentsBrigadeGameModeBase : public AGameModeBase +{ + GENERATED_BODY() + +public: + APresidentsBrigadeGameModeBase(); +}; diff --git a/Source/PresidentsBrigadeEditor.Target.cs b/Source/PresidentsBrigadeEditor.Target.cs new file mode 100755 index 0000000..0d20816 --- /dev/null +++ b/Source/PresidentsBrigadeEditor.Target.cs @@ -0,0 +1,15 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +using UnrealBuildTool; +using System.Collections.Generic; + +public class PresidentsBrigadeEditorTarget : TargetRules +{ + public PresidentsBrigadeEditorTarget(TargetInfo Target) : base(Target) + { + Type = TargetType.Editor; + DefaultBuildSettings = BuildSettingsVersion.V2; + + ExtraModuleNames.AddRange( new string[] { "PresidentsBrigade" } ); + } +}