diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..424a82d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,13 @@ +# UE file types +*.uasset filter=lfs diff=lfs merge=lfs -text +*.umap filter=lfs diff=lfs merge=lfs -text +# Raw Content types +*.fbx filter=lfs diff=lfs merge=lfs -text +*.3ds filter=lfs diff=lfs merge=lfs -text +*.psd filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.mp3 filter=lfs diff=lfs merge=lfs -text +*.wav filter=lfs diff=lfs merge=lfs -text +*.xcf filter=lfs diff=lfs merge=lfs -text +*.jpg filter=lfs diff=lfs merge=lfs -text + diff --git a/BigMarbleWorld.uproject b/BigMarbleWorld.uproject new file mode 100644 index 0000000..40c8024 --- /dev/null +++ b/BigMarbleWorld.uproject @@ -0,0 +1,25 @@ +{ + "FileVersion": 3, + "EngineAssociation": "5.8", + "Category": "", + "Description": "", + "Modules": [ + { + "Name": "BigMarbleWorld", + "Type": "Runtime", + "LoadingPhase": "Default", + "AdditionalDependencies": [ + "Engine" + ] + } + ], + "Plugins": [ + { + "Name": "ModelingToolsEditorMode", + "Enabled": true, + "TargetAllowList": [ + "Editor" + ] + } + ] +} \ No newline at end of file diff --git a/Config/DefaultEditor.ini b/Config/DefaultEditor.ini new file mode 100644 index 0000000..e69de29 diff --git a/Config/DefaultEngine.ini b/Config/DefaultEngine.ini new file mode 100644 index 0000000..e53a133 --- /dev/null +++ b/Config/DefaultEngine.ini @@ -0,0 +1,269 @@ + + +[/Script/EngineSettings.GameMapsSettings] +GameDefaultMap=/Game/Maps/Playground/Playground.Playground +EditorStartupMap=/Game/Maps/Playground/Playground.Playground +GlobalDefaultGameMode=/Script/Engine.GameModeBase + +[/Script/Engine.RendererSettings] +r.Mobile.ShadingPath=1 +r.Mobile.ExtendedGBuffer=False +r.Mobile.AntiAliasing=2 +r.Mobile.FloatPrecisionMode=0 +r.Mobile.AllowDitheredLODTransition=False +r.DiscardUnusedQuality=False +r.AllowOcclusionQueries=True +r.MinScreenRadiusForLights=0.030000 +r.MinScreenRadiusForDepthPrepass=0.030000 +r.PrecomputedVisibilityWarning=False +r.TextureStreaming=True +Compat.UseDXT5NormalMaps=False +r.VirtualTextures=True +r.VirtualTexturedLightmaps=False +r.VT.TileSize=128 +r.VT.TileBorderSize=4 +r.VT.AnisotropicFiltering=False +r.VT.EnableAutoImport=False +bEnableVirtualTextureOpacityMask=False +r.MeshPaintVirtualTexture.Support=True +r.MeshPaintVirtualTexture.TileSize=32 +r.MeshPaintVirtualTexture.TileBorderSize=2 +r.MeshPaintVirtualTexture.UseCompression=True +r.StaticMesh.DefaultMeshPaintTextureSupport=True +r.MeshPaintVirtualTexture.DefaultTexelsPerVertex=4 +r.MeshPaintVirtualTexture.MaxTextureSize=4096 +r.vt.rvt.EnableBaseColor=True +r.vt.rvt.EnableBaseColorRoughness=True +r.vt.rvt.EnableBaseColorSpecular=True +r.vt.rvt.EnableMask4=True +r.vt.rvt.EnableWorldHeight=True +r.vt.rvt.EnableDisplacement=True +r.vt.rvt.HighQualityPerPixelHeight=True +WorkingColorSpaceChoice=sRGB +RedChromaticityCoordinate=(X=0.640000,Y=0.330000) +GreenChromaticityCoordinate=(X=0.300000,Y=0.600000) +BlueChromaticityCoordinate=(X=0.150000,Y=0.060000) +WhiteChromaticityCoordinate=(X=0.312700,Y=0.329000) +r.LegacyLuminanceFactors=False +r.ClearCoatNormal=False +r.DynamicGlobalIlluminationMethod=1 +r.ReflectionMethod=1 +r.ReflectionCaptureResolution=128 +r.ReflectionEnvironmentLightmapMixBasedOnRoughness=True +r.Lumen.HardwareRayTracing=True +r.Lumen.HardwareRayTracing.LightingMode=0 +r.Lumen.TranslucencyReflections.FrontLayer.EnableForProject=False +r.Lumen.TraceMeshSDFs=0 +r.Lumen.ScreenTracingSource=0 +r.Lumen.Reflections.HardwareRayTracing.Translucent.Refraction.EnableForProject=True +r.MegaLights.EnableForProject=False +r.MegaLights.FrontLayerTranslucency.EnableForProject=True +r.RayTracing.Shadows=False +r.Shadow.Virtual.Enable=1 +r.RayTracing=True +r.RayTracing.RayTracingProxies.ProjectEnabled=True +r.RayTracing.UseTextureLod=False +r.PathTracing=True +r.GenerateMeshDistanceFields=True +r.DistanceFields.DefaultVoxelDensity=0.200000 +r.Nanite.ProjectEnabled=True +r.AllowStaticLighting=False +r.NormalMapsForStaticLighting=False +r.ForwardShading=False +r.VertexFoggingForOpaque=True +r.SeparateTranslucency=True +r.TranslucentSortPolicy=0 +TranslucentSortAxis=(X=0.000000,Y=-1.000000,Z=0.000000) +r.LocalFogVolume.ApplyOnTranslucent=False +xr.VRS.FoveationLevel=0 +xr.VRS.DynamicFoveation=False +r.CustomDepth=1 +r.CustomDepthTemporalAAJitter=True +r.PostProcessing.PropagateAlpha=False +r.Deferred.SupportPrimitiveAlphaHoldout=False +r.DefaultFeature.Bloom=True +r.DefaultFeature.AmbientOcclusion=True +r.DefaultFeature.AmbientOcclusionStaticFraction=True +r.DefaultFeature.AutoExposure=False +r.DefaultFeature.AutoExposure.Method=0 +r.DefaultFeature.AutoExposure.Bias=1.000000 +r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange=True +r.DefaultFeature.LocalExposure.HighlightContrastScale=0.800000 +r.DefaultFeature.LocalExposure.ShadowContrastScale=0.800000 +r.DefaultFeature.MotionBlur=False +r.DefaultFeature.LensFlare=False +r.TemporalAA.Upsampling=True +r.AntiAliasingMethod=0 +r.MSAACount=4 +r.DefaultFeature.LightUnits=1 +r.DefaultBackBufferPixelFormat=4 +r.ScreenPercentage.Default=100.000000 +r.ScreenPercentage.Default.Desktop.Mode=1 +r.ScreenPercentage.Default.Mobile.Mode=0 +r.ScreenPercentage.Default.VR.Mode=0 +r.ScreenPercentage.Default.PathTracer.Mode=0 +r.Shadow.UnbuiltPreviewInGame=True +r.StencilForLODDither=False +r.EarlyZPass=3 +r.EarlyZPassOnlyMaterialMasking=True +r.Shadow.CSMCaching=False +r.DBuffer=True +r.ClearSceneMethod=1 +r.VelocityOutputPass=0 +r.Water.SingleLayer.DepthPrepass=True +r.Water.SingleLayer.VelocityOutputPass=1 +r.Velocity.EnableVertexDeformation=2 +r.SelectiveBasePassOutputs=False +bDefaultParticleCutouts=False +fx.GPUSimulationTextureSizeX=1024 +fx.GPUSimulationTextureSizeY=1024 +r.AllowGlobalClipPlane=False +r.GBufferFormat=1 +r.MorphTarget.Mode=True +r.MorphTarget.MaxBlendWeight=5.000000 +r.SupportSkyAtmosphere=True +r.SupportSkyAtmosphereAffectsHeightFog=True +r.SupportExpFogMatchesVolumetricFog=False +r.SupportLocalFogVolumes=True +r.SupportCloudShadowOnForwardLitTranslucent=False +r.ClusteredDeferredShading.EnableForProject=True +r.LightFunctionAtlas.Format=0 +r.VolumetricFog.LightFunction=True +r.Deferred.UsesLightFunctionAtlas=True +r.SingleLayerWater.UsesLightFunctionAtlas=False +r.Translucent.UsesLightFunctionAtlas=False +r.Translucent.UsesIESProfiles=False +r.Translucent.UsesRectLights=False +r.Translucent.UsesShadowedLocalLights=False +r.GPUCrashDebugging=False +vr.InstancedStereo=False +r.MobileHDR=True +vr.MobileMultiView=False +r.Mobile.UseHWsRGBEncoding=False +vr.RoundRobinOcclusion=False +r.MeshStreaming=False +r.HeterogeneousVolumes=True +r.HeterogeneousVolumes.Shadows=False +r.Translucency.HeterogeneousVolumes=False +r.WireframeCullThreshold=5.000000 +r.SupportStationarySkylight=True +r.SupportLowQualityLightmaps=True +r.SupportPointLightWholeSceneShadows=True +r.Shadow.TranslucentPerObject.ProjectEnabled=False +r.Water.SingleLayerWater.SupportCloudShadow=False +r.Substrate=True +r.Substrate.ProjectGBufferFormat=0 +r.Substrate.ProjectClosuresPerPixel=4 +r.Substrate.ProjectClosuresPerPixelOverride=0 +r.Substrate.BytesPerPixel=80 +r.Substrate.OpaqueMaterialRoughRefraction=False +r.Refraction.Blur=True +r.Substrate.Debug.AdvancedVisualizationShaders=False +r.Substrate.EnableLayerSupport=False +r.Material.RoughDiffuse=False +r.Material.EnergyConservation=False +r.Material.DefaultAutoMaterialUsage=True +r.OIT.SortedPixels=False +r.HairStrands.LODMode=True +r.VRS.Support=True +r.Mobile.EnableStaticAndCSMShadowReceivers=True +r.Mobile.EnableMovableLightCSMShaderCulling=True +r.Mobile.Forward.EnableLocalLights=1 +r.Mobile.Forward.EnableClusteredReflections=False +r.Mobile.AllowDistanceFieldShadows=True +r.Mobile.EnableMovableSpotlightsShadow=False +r.GPUSkin.Limit2BoneInfluences=False +r.SupportDepthOnlyIndexBuffers=False +r.SupportReversedIndexBuffers=False +slate.MaterialShaderMode=0 +r.Mobile.AmbientOcclusion=False +r.Mobile.ScreenSpaceReflections=False +r.Mobile.DBuffer=False +r.Mobile.PropagateAlpha=False +r.GPUSkin.UnlimitedBoneInfluences=False +r.GPUSkin.AlwaysUseDeformerForUnlimitedBoneInfluences=False +r.GPUSkin.UnlimitedBoneInfluencesThreshold=8 +DefaultBoneInfluenceLimit=(Default=0,PerPlatform=()) +r.SkinCache.CompileShaders=1 +r.SkinCache.DefaultBehavior=1 +r.Nanite.Foliage=False +bNaniteStreamableBulkDataOptional=(Default=False,PerPlatform=()) +bStreamSkeletalMeshLODs=(Default=False,PerPlatform=()) +bDiscardSkeletalMeshOptionalLODs=(Default=False,PerPlatform=()) +VisualizeCalibrationColorMaterialPath=/Engine/EngineMaterials/PPM_DefaultCalibrationColor.PPM_DefaultCalibrationColor +VisualizeCalibrationCustomMaterialPath=None +VisualizeCalibrationGrayscaleMaterialPath=/Engine/EngineMaterials/PPM_DefaultCalibrationGrayscale.PPM_DefaultCalibrationGrayscale +r.PSOPrecache.ProxyCreationStrategy=1 +PSOPrecacheFallbackMaterial=None + +[/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/MacTargetPlatform.MacTargetSettings] +-TargetedRHIs=SF_METAL_SM5 ++TargetedRHIs=SF_METAL_SM6 + + +[/Script/HardwareTargeting.HardwareTargetingSettings] +TargetedHardwareClass=Desktop +AppliedTargetedHardwareClass=Desktop +DefaultGraphicsPerformance=Scalable +AppliedDefaultGraphicsPerformance=Scalable + +[/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/BigMarbleWorld") ++ActiveGameNameRedirects=(OldGameName="/Script/TP_Blank",NewGameName="/Script/BigMarbleWorld") + +[/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings] +bEnablePlugin=True +bAllowNetworkConnection=True +SecurityToken=01A03558572D7F629657BD74440AF7AB +bIncludeInShipping=False +bAllowExternalStartInShipping=False +bCompileAFSProject=False +bUseCompression=False +bLogFiles=False +bReportStats=False +ConnectionType=USBOnly +bUseManualIPAddress=False +ManualIPAddress= + diff --git a/Config/DefaultGame.ini b/Config/DefaultGame.ini new file mode 100644 index 0000000..c1311a3 --- /dev/null +++ b/Config/DefaultGame.ini @@ -0,0 +1,11 @@ + +[/Script/CommonUI.CommonUISettings] +CommonButtonAcceptKeyHandling=TriggerClick + +[ConsoleVariables] +CommonUI.CheckKeyboardFocusAndParentage=1 +CommonUI.DisallowUserFocusedWidgetForPendingFocusRecipient=1 +CommonUI.FallbackToDesiredOnAutoRestoreFailure=1 + +[/Script/EngineSettings.GeneralProjectSettings] +ProjectID=01A035574B9475648F0FF7583091327A diff --git a/Config/DefaultInput.ini b/Config/DefaultInput.ini new file mode 100644 index 0000000..a919105 --- /dev/null +++ b/Config/DefaultInput.ini @@ -0,0 +1,84 @@ +[/Script/Engine.InputSettings] +-AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) +-AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) +-AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) +-AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) +-AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) +-AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) +-AxisConfig=(AxisKeyName="Mouse2D",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) ++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="Mouse2D",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="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="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="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_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 +bEnableLegacyInputScales=True +bEnableMotionControls=True +bFilterInputByPlatformUser=False +bShouldFlushPressedKeysOnViewportFocusLost=True +bAlwaysShowTouchInterface=False +bShowConsoleOnFourFingerTap=True +bEnableGestureRecognizer=False +bUseAutocorrect=False +DefaultViewportMouseCaptureMode=CapturePermanently_IncludingInitialMouseDown +DefaultViewportMouseLockMode=LockOnCapture +FOVScale=0.011110 +DoubleClickTime=0.200000 +DefaultPlayerInputClass=/Script/EnhancedInput.EnhancedPlayerInput +DefaultInputComponentClass=/Script/EnhancedInput.EnhancedInputComponent +DefaultTouchInterface=/Engine/MobileResources/HUD/DefaultVirtualJoysticks.DefaultVirtualJoysticks +-ConsoleKeys=Tilde ++ConsoleKeys=Tilde + diff --git a/Content/Blueprints/Game/GM_Playground.uasset b/Content/Blueprints/Game/GM_Playground.uasset new file mode 100644 index 0000000..5755e14 --- /dev/null +++ b/Content/Blueprints/Game/GM_Playground.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:97ec68b1c789f91811aa1af3c4ca59497cf80fadcd646778cff9e53006a2d1ad +size 21171 diff --git a/Content/Blueprints/Marble/BP_MarblePawn.uasset b/Content/Blueprints/Marble/BP_MarblePawn.uasset new file mode 100644 index 0000000..c2f4c30 --- /dev/null +++ b/Content/Blueprints/Marble/BP_MarblePawn.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e3a430e798df544bdb97fdbd6ba5cfe8ae7a8de6cf5e48ccd33f3acd9939624c +size 5062 diff --git a/Content/Blueprints/Marble/BP_PlayerMarblePawn.uasset b/Content/Blueprints/Marble/BP_PlayerMarblePawn.uasset new file mode 100644 index 0000000..5cc290f --- /dev/null +++ b/Content/Blueprints/Marble/BP_PlayerMarblePawn.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:20b5d0986dc04c9d7c5a7df2d4ab6f9bee82ad5d2fb52f2f5db2b9f05d5fc300 +size 69874 diff --git a/Content/Blueprints/Tools/BP_LocationDebuger.uasset b/Content/Blueprints/Tools/BP_LocationDebuger.uasset new file mode 100644 index 0000000..c107ab3 --- /dev/null +++ b/Content/Blueprints/Tools/BP_LocationDebuger.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5af22e86862516666cfba7d6b95734f079b47dd34823a997c8530af7897c8bff +size 66940 diff --git a/Content/Inputs/IA_Jump.uasset b/Content/Inputs/IA_Jump.uasset new file mode 100644 index 0000000..ef81222 --- /dev/null +++ b/Content/Inputs/IA_Jump.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:03072bb1425a6cd780d0b91eec169fd06e26d7e5eb211a8502012592d31046dc +size 1646 diff --git a/Content/Inputs/IA_Look.uasset b/Content/Inputs/IA_Look.uasset new file mode 100644 index 0000000..329d9cf --- /dev/null +++ b/Content/Inputs/IA_Look.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ece19ef7f60441f9df197874df1327575277a712d42e9e819dfd5cb575197c39 +size 1336 diff --git a/Content/Inputs/IA_Move.uasset b/Content/Inputs/IA_Move.uasset new file mode 100644 index 0000000..40aabf2 --- /dev/null +++ b/Content/Inputs/IA_Move.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a548ab907c862115e727e0e2eb7bb87e371f36ee1e82131af243a5461a3efee9 +size 1336 diff --git a/Content/Inputs/IMC_MarbleInputs.uasset b/Content/Inputs/IMC_MarbleInputs.uasset new file mode 100644 index 0000000..a1d6891 --- /dev/null +++ b/Content/Inputs/IMC_MarbleInputs.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7eb303821fe912031ed0ebc41348b8e82b5088d3b27d1e91ea4cbd653358e46 +size 6639 diff --git a/Content/Maps/Playground/Playground.umap b/Content/Maps/Playground/Playground.umap new file mode 100644 index 0000000..95fdd68 --- /dev/null +++ b/Content/Maps/Playground/Playground.umap @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a104c5fe775435f79fd9826ac118efc256dd27e1cb5ca2656e2231693bef8b86 +size 70996 diff --git a/Source/BigMarbleWorld.Target.cs b/Source/BigMarbleWorld.Target.cs new file mode 100644 index 0000000..52a0593 --- /dev/null +++ b/Source/BigMarbleWorld.Target.cs @@ -0,0 +1,15 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +using UnrealBuildTool; +using System.Collections.Generic; + +public class BigMarbleWorldTarget : TargetRules +{ + public BigMarbleWorldTarget(TargetInfo Target) : base(Target) + { + Type = TargetType.Game; + DefaultBuildSettings = BuildSettingsVersion.V7; + IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_8; + ExtraModuleNames.Add("BigMarbleWorld"); + } +} diff --git a/Source/BigMarbleWorld/BigMarbleWorld.Build.cs b/Source/BigMarbleWorld/BigMarbleWorld.Build.cs new file mode 100644 index 0000000..edc4bca --- /dev/null +++ b/Source/BigMarbleWorld/BigMarbleWorld.Build.cs @@ -0,0 +1,23 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +using UnrealBuildTool; + +public class BigMarbleWorld : ModuleRules +{ + public BigMarbleWorld(ReadOnlyTargetRules Target) : base(Target) + { + PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; + + PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "EnhancedInput" }); + + 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/BigMarbleWorld/BigMarbleWorld.cpp b/Source/BigMarbleWorld/BigMarbleWorld.cpp new file mode 100644 index 0000000..131b73b --- /dev/null +++ b/Source/BigMarbleWorld/BigMarbleWorld.cpp @@ -0,0 +1,6 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "BigMarbleWorld.h" +#include "Modules/ModuleManager.h" + +IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, BigMarbleWorld, "BigMarbleWorld" ); diff --git a/Source/BigMarbleWorld/BigMarbleWorld.h b/Source/BigMarbleWorld/BigMarbleWorld.h new file mode 100644 index 0000000..677c8e2 --- /dev/null +++ b/Source/BigMarbleWorld/BigMarbleWorld.h @@ -0,0 +1,6 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "CoreMinimal.h" + diff --git a/Source/BigMarbleWorld/Private/Marble/MarbleController.cpp b/Source/BigMarbleWorld/Private/Marble/MarbleController.cpp new file mode 100644 index 0000000..c1dd89d --- /dev/null +++ b/Source/BigMarbleWorld/Private/Marble/MarbleController.cpp @@ -0,0 +1,38 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "Marble/MarbleController.h" + +#include "EnhancedInputSubsystems.h" + +void AMarbleController::BeginPlay() +{ + Super::BeginPlay(); + + bShowMouseCursor = false; + SetInputMode(FInputModeGameOnly()); + + if (PlayerCameraManager) + { + PlayerCameraManager->ViewPitchMin = -60.0f; + PlayerCameraManager->ViewPitchMax = 20.0f; + } +} + +void AMarbleController::SetupInputComponent() +{ + Super::SetupInputComponent(); + + // only add IMCs for local player controllers + if (IsLocalPlayerController()) + { + // Add Input Mapping Contexts + if (UEnhancedInputLocalPlayerSubsystem* Subsystem = ULocalPlayer::GetSubsystem(GetLocalPlayer())) + { + for (UInputMappingContext* CurrentContext : DefaultMappingContexts) + { + Subsystem->AddMappingContext(CurrentContext, 0); + } + } + } +} diff --git a/Source/BigMarbleWorld/Private/Marble/MarbleMovementComponent.cpp b/Source/BigMarbleWorld/Private/Marble/MarbleMovementComponent.cpp new file mode 100644 index 0000000..5f4c085 --- /dev/null +++ b/Source/BigMarbleWorld/Private/Marble/MarbleMovementComponent.cpp @@ -0,0 +1,196 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "Marble/MarbleMovementComponent.h" + +#include "Components/SphereComponent.h" +#include "DataWrappers/ChaosVDJointDataWrappers.h" +#include "Math/UnitConversion.h" +#include "Sound/SoundWaveProxyPlayer.h" + + +// Sets default values for this component's properties +UMarbleMovementComponent::UMarbleMovementComponent() +{ + // Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features + // off to improve performance if you don't need them. + PrimaryComponentTick.bCanEverTick = true; + PrimaryComponentTick.TickInterval = 1.0f / 30.0f; + + SetIsReplicatedByDefault(true); +} + +void UMarbleMovementComponent::SetMoveDirection(FVector WorldDirection) +{ + WorldDirection.Z = 0.0f; + WorldDirection = WorldDirection.GetClampedToMaxSize(1.0f); + + CachedMoveDirection = WorldDirection; +} + +void UMarbleMovementComponent::BeginJump() +{ + if (!PhysicsSphere || !IsLocallyControlling() || !IsGrounded()) + return; + + bIsJumping = true; + JumpHoldElapsed = 0.0f; + PhysicsSphere->AddImpulse(FVector::UpVector * JumpInitialImpulse, NAME_None, true); +} + +void UMarbleMovementComponent::EndJump() +{ + bIsJumping = false; +} + +bool UMarbleMovementComponent::IsGrounded() const +{ + if (!PhysicsSphere) + { + return false; + } + + const float Radius = PhysicsSphere->GetScaledSphereRadius(); + const FVector Start = PhysicsSphere->GetComponentLocation(); + const FVector End = Start - FVector::UpVector * (Radius + GroundCheckDistance); + + FCollisionQueryParams Params; + Params.AddIgnoredActor(GetOwner()); + + FHitResult Hit; + return GetWorld()->LineTraceSingleByChannel(Hit, Start, End, ECC_Visibility, Params); +} + +// Called when the game starts +void UMarbleMovementComponent::BeginPlay() +{ + Super::BeginPlay(); + + if (!IsValid(PhysicsSphere)) + PhysicsSphere = Cast(GetOwner()->GetRootComponent()); + ensureMsgf(PhysicsSphere, TEXT("Owner must have a sphere component as root")); +} + +// Called every frame +void UMarbleMovementComponent::TickComponent(float DeltaTime, ELevelTick TickType, + FActorComponentTickFunction* ThisTickFunction) +{ + Super::TickComponent(DeltaTime, TickType, ThisTickFunction); + + if (!PhysicsSphere) + return; + + if (IsLocallyControlling()) + TickControlling(DeltaTime); + else + TickProxy(DeltaTime); +} + +void UMarbleMovementComponent::ServerSyncTransform_Implementation( + FVector_NetQuantize100 Location, + FRotator Rotation, + FVector_NetQuantize100 LinearVel, + FVector_NetQuantize100 AngularVel) +{ + MulticastSyncTransform(Location, Rotation, LinearVel, AngularVel); +} + +void UMarbleMovementComponent::MulticastSyncTransform_Implementation( + FVector_NetQuantize100 Location, + FRotator Rotation, + FVector_NetQuantize100 LinearVel, + FVector_NetQuantize100 AngularVel) +{ + if (IsLocallyControlling()) + return; + + ProxyTargetLocation = Location; + ProxyTargetRotation = Rotation; + ProxyTargetLinearVel = LinearVel; + ProxyTargetAngularVel = AngularVel; + bHasProxyTarget = true; +} + +void UMarbleMovementComponent::ServerSetMoveDirection_Implementation(FVector WorldDirection) +{ + CachedMoveDirection = WorldDirection; +} + +bool UMarbleMovementComponent::IsLocallyControlling() const +{ + const APawn* OwningPawn = Cast(GetOwner()); + return IsValid(OwningPawn) && OwningPawn->IsLocallyControlled(); +} + +void UMarbleMovementComponent::TickControlling(float DeltaTime) +{ + if (!CachedMoveDirection.IsNearlyZero()) + { + const FVector Direction = CachedMoveDirection.GetSafeNormal(); + const float Speed = CachedMoveDirection.Size(); + + const FVector TorqueAxis = FVector::CrossProduct(FVector::UpVector, Direction); + if (PhysicsSphere->GetPhysicsAngularVelocityInRadians().Size() < MaxAngularSpeed) + PhysicsSphere->AddTorqueInRadians(TorqueAxis * RollForce * Speed, NAME_None, true); + + if (IsGrounded()) + { + if (PhysicsSphere->GetPhysicsLinearVelocity().Size() < MaxLinearSpeed) + PhysicsSphere->AddForce(Direction * MoveForce * Speed, NAME_None, true); + } + else + { + if (PhysicsSphere->GetPhysicsLinearVelocity().Size() < MaxLinearSpeed * AerialControlFactor) + PhysicsSphere->AddForce(Direction * MoveForce * AerialControlFactor * Speed, NAME_None, true); + } + } + if (bIsJumping) + { + JumpHoldElapsed += DeltaTime; + if (JumpHoldElapsed <= MaxJumpHoldDuration) + { + PhysicsSphere->AddForce(FVector::UpVector * JumpHoldForce, NAME_None, true); + } + else + { + bIsJumping = false; + } + } + + SyncTimer += DeltaTime; + const float SyncInterval = 1.0f / FMath::Max(1.0f, SyncSendRate); + if (SyncTimer >= SyncInterval) + { + SyncTimer = 0.0f; + + const FVector_NetQuantize100 Location = PhysicsSphere->GetComponentLocation(); + const FRotator Rotation = PhysicsSphere->GetComponentRotation(); + const FVector_NetQuantize100 LinearVel = PhysicsSphere->GetPhysicsLinearVelocity(); + const FVector_NetQuantize100 AngularVel = PhysicsSphere->GetPhysicsAngularVelocityInDegrees(); + + if (GetOwnerRole() == ROLE_Authority) + { + MulticastSyncTransform(Location, Rotation, LinearVel, AngularVel); + } + else + { + ServerSyncTransform(Location, Rotation, LinearVel, AngularVel); + } + } +} + +void UMarbleMovementComponent::TickProxy(float DeltaTime) +{ + if (!bHasProxyTarget || !IsValid(PhysicsSphere)) + return; + + const FVector CurrentLocation = PhysicsSphere->GetComponentLocation(); + const FVector NewLocation = FMath::VInterpTo(CurrentLocation, FVector(ProxyTargetLocation), DeltaTime, ProxyCorrectionSpeed); + + const FRotator CurrentRotation = PhysicsSphere->GetComponentRotation(); + const FRotator NewRotation = FMath::RInterpTo(CurrentRotation, FRotator(ProxyTargetRotation), DeltaTime, ProxyCorrectionSpeed); + + PhysicsSphere->SetWorldLocationAndRotation(NewLocation, NewRotation, false, nullptr, ETeleportType::TeleportPhysics); + PhysicsSphere->SetPhysicsLinearVelocity(FVector(ProxyTargetLinearVel)); + PhysicsSphere->SetPhysicsAngularVelocityInDegrees(FVector(ProxyTargetAngularVel)); +} diff --git a/Source/BigMarbleWorld/Private/Marble/MarblePawn.cpp b/Source/BigMarbleWorld/Private/Marble/MarblePawn.cpp new file mode 100644 index 0000000..076a8c6 --- /dev/null +++ b/Source/BigMarbleWorld/Private/Marble/MarblePawn.cpp @@ -0,0 +1,39 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "Marble/MarblePawn.h" + +#include "Components/SphereComponent.h" +#include "Marble/MarbleMovementComponent.h" + +// Sets default values +AMarblePawn::AMarblePawn() +{ + // Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it. + PrimaryActorTick.bCanEverTick = false; + + bReplicates = true; + SetReplicatingMovement(false); // custom sync in movement component + + Collider = CreateDefaultSubobject(TEXT("Collider")); + RootComponent = Collider; + Collider->InitSphereRadius(50.f); + Collider->SetSimulatePhysics(true); + Collider->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics); + Collider->SetCollisionObjectType(ECC_Pawn); + Collider->SetLinearDamping(0.1f); + Collider->SetAngularDamping(0.3f); + Collider->SetNotifyRigidBodyCollision(true); + + Mesh = CreateDefaultSubobject(TEXT("Mesh")); + Mesh->SetupAttachment(Collider); + Mesh->SetCollisionEnabled(ECollisionEnabled::NoCollision); + + MovementComponent = CreateDefaultSubobject(TEXT("MovementComponent")); +} + +void AMarblePawn::BeginPlay() +{ + Super::BeginPlay(); + +} diff --git a/Source/BigMarbleWorld/Private/Marble/MarblePlayerInputComponent.cpp b/Source/BigMarbleWorld/Private/Marble/MarblePlayerInputComponent.cpp new file mode 100644 index 0000000..ebf0d74 --- /dev/null +++ b/Source/BigMarbleWorld/Private/Marble/MarblePlayerInputComponent.cpp @@ -0,0 +1,92 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "Marble/MarblePlayerInputComponent.h" + +#include "EnhancedInputComponent.h" +#include "EnhancedInputSubsystems.h" +#include "Camera/CameraComponent.h" +#include "Marble/MarbleMovementComponent.h" + + +// Sets default values for this component's properties +UMarblePlayerInputComponent::UMarblePlayerInputComponent() +{ + // Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features + // off to improve performance if you don't need them. + PrimaryComponentTick.bCanEverTick = false; + +} + +void UMarblePlayerInputComponent::BindInput(UInputComponent* InputComponent) +{ + if (APlayerController* PC = Cast(GetOwner()->GetInstigatorController())) + { + if (UEnhancedInputLocalPlayerSubsystem* Subsystem = + ULocalPlayer::GetSubsystem(PC->GetLocalPlayer())) + { + Subsystem->AddMappingContext(DefaultMappingContext, 0); + } + } + + if (UEnhancedInputComponent* EIC = Cast(InputComponent)) + { + EIC->BindAction(MoveAction, ETriggerEvent::Triggered, this, &ThisClass::OnMove); + EIC->BindAction(MoveAction, ETriggerEvent::Completed, this, &ThisClass::OnMove); + EIC->BindAction(MoveAction, ETriggerEvent::Canceled, this, &ThisClass::OnMove); + + EIC->BindAction(LookAction, ETriggerEvent::Triggered, this, &ThisClass::OnLook); + + EIC->BindAction(JumpAction, ETriggerEvent::Started, this, &ThisClass::OnJumpStarted); + EIC->BindAction(JumpAction, ETriggerEvent::Completed, this, &ThisClass::OnJumpReleased); + EIC->BindAction(JumpAction, ETriggerEvent::Canceled, this, &ThisClass::OnJumpReleased); + } +} + +// Called when the game starts +void UMarblePlayerInputComponent::BeginPlay() +{ + Super::BeginPlay(); + + if (!IsValid(MovementComponent)) + MovementComponent = GetOwner()->FindComponentByClass(); + if (!IsValid(CameraComponent)) + CameraComponent = GetOwner()->FindComponentByClass(); +} + +void UMarblePlayerInputComponent::OnMove(const FInputActionValue& Value) +{ + if (!IsValid(MovementComponent) || !IsValid(CameraComponent)) + return; + + const FVector2D Input = Value.Get(); + const FRotator YawRot(0.0f, CameraComponent->GetComponentRotation().Yaw, 0.0f); + const FVector Forward = FRotationMatrix(YawRot).GetUnitAxis(EAxis::X); + const FVector Right = FRotationMatrix(YawRot).GetUnitAxis(EAxis::Y); + + MovementComponent->SetMoveDirection(Forward * Input.Y + Right * Input.X); +} + +void UMarblePlayerInputComponent::OnLook(const FInputActionValue& Value) +{ + APawn* OwningPawn = Cast(GetOwner()); + if (!IsValid(OwningPawn)) + return; + + const FVector2D Input = Value.Get(); + + OwningPawn->AddControllerYawInput(Input.X * LookYawRate); + OwningPawn->AddControllerPitchInput(-Input.Y * LookPitchRate); +} + +void UMarblePlayerInputComponent::OnJumpStarted(const FInputActionValue& Value) +{ + if (IsValid(MovementComponent)) + MovementComponent->BeginJump(); +} + +void UMarblePlayerInputComponent::OnJumpReleased(const FInputActionValue& Value) +{ + if (IsValid(MovementComponent)) + MovementComponent->EndJump(); +} diff --git a/Source/BigMarbleWorld/Private/Marble/PlayerMarblePawn.cpp b/Source/BigMarbleWorld/Private/Marble/PlayerMarblePawn.cpp new file mode 100644 index 0000000..0558a75 --- /dev/null +++ b/Source/BigMarbleWorld/Private/Marble/PlayerMarblePawn.cpp @@ -0,0 +1,34 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "Marble/PlayerMarblePawn.h" + +#include "Camera/CameraComponent.h" +#include "GameFramework/SpringArmComponent.h" +#include "Marble/MarblePlayerInputComponent.h" + + +// Sets default values +APlayerMarblePawn::APlayerMarblePawn() +{ + SpringArm = CreateDefaultSubobject(TEXT("SpringArm")); + SpringArm->SetupAttachment(RootComponent); + SpringArm->TargetArmLength = 650.0f; + SpringArm->bDoCollisionTest = true; + SpringArm->bEnableCameraLag = true; + SpringArm->CameraLagSpeed = 6.0f; + SpringArm->bUsePawnControlRotation = true; + + Camera = CreateDefaultSubobject(TEXT("Camera")); + Camera->SetupAttachment(SpringArm, USpringArmComponent::SocketName); + + MarbleInputComponent = CreateDefaultSubobject(TEXT("PlayerInputComponent")); +} + +// Called to bind functionality to input +void APlayerMarblePawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) +{ + Super::SetupPlayerInputComponent(PlayerInputComponent); + + MarbleInputComponent->BindInput(PlayerInputComponent); +} diff --git a/Source/BigMarbleWorld/Public/Marble/MarbleController.h b/Source/BigMarbleWorld/Public/Marble/MarbleController.h new file mode 100644 index 0000000..6124832 --- /dev/null +++ b/Source/BigMarbleWorld/Public/Marble/MarbleController.h @@ -0,0 +1,31 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/PlayerController.h" +#include "MarbleController.generated.h" + +class UInputMappingContext; + +/** + * + */ +UCLASS() +class BIGMARBLEWORLD_API AMarbleController : public APlayerController +{ + GENERATED_BODY() + +protected: + + /** Input Mapping Contexts */ + UPROPERTY(EditAnywhere, Category ="Input|Input Mappings") + TArray DefaultMappingContexts; + + /** Gameplay initialization */ + virtual void BeginPlay() override; + + /** Input mapping context setup */ + virtual void SetupInputComponent() override; + +}; diff --git a/Source/BigMarbleWorld/Public/Marble/MarbleMovementComponent.h b/Source/BigMarbleWorld/Public/Marble/MarbleMovementComponent.h new file mode 100644 index 0000000..ffb6bca --- /dev/null +++ b/Source/BigMarbleWorld/Public/Marble/MarbleMovementComponent.h @@ -0,0 +1,118 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "Components/ActorComponent.h" +#include "MarbleMovementComponent.generated.h" + +class USphereComponent; + +UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent)) +class BIGMARBLEWORLD_API UMarbleMovementComponent : public UActorComponent +{ + GENERATED_BODY() + +public: + // Sets default values for this component's properties + UMarbleMovementComponent(); + + UFUNCTION(BlueprintCallable, Category = "Marble|Movement") + void SetMoveDirection(FVector WorldDirection); + + UFUNCTION(BlueprintCallable, Category = "Marble|Movement") + void BeginJump(); + + UFUNCTION(BlueprintCallable, Category = "Marble|Jump") + void EndJump(); + + UFUNCTION(BlueprintCallable, Category = "Marble|State") + bool IsGrounded() const; + + // Called when the game starts + virtual void BeginPlay() override; + + // Called every frame + virtual void TickComponent(float DeltaTime, ELevelTick TickType, + FActorComponentTickFunction* ThisTickFunction) override; + + UFUNCTION(BlueprintCallable, Category = "Marble|Network") + bool IsLocallyControlling() const; + +protected: + + UFUNCTION(Server, Unreliable) + void ServerSetMoveDirection(FVector WorldDirection); + + UFUNCTION(Server, Unreliable) + void ServerSyncTransform( + FVector_NetQuantize100 Location, + FRotator Rotation, + FVector_NetQuantize100 LinearVel, + FVector_NetQuantize100 AngularVel + ); + + UFUNCTION(NetMulticast, Unreliable) + void MulticastSyncTransform( + FVector_NetQuantize100 Location, + FRotator Rotation, + FVector_NetQuantize100 LinearVel, + FVector_NetQuantize100 AngularVel + ); + + UPROPERTY(EditAnywhere, Category = "Marble|Movement") + float RollForce = 1200.0f; + + UPROPERTY(EditAnywhere, Category = "Marble|Movement") + float MaxAngularSpeed = 8.0f; + + UPROPERTY(EditAnywhere, Category = "Marble|Movement") + float MoveForce = 400.0f; + + UPROPERTY(EditAnywhere, Category = "Marble|Movement") + float MaxLinearSpeed = 1200.0f; + + UPROPERTY(EditAnywhere, Category = "Marble|Movement") + float AerialControlFactor = 0.3f; + + UPROPERTY(EditAnywhere, Category = "Marble|Jump") + float JumpInitialImpulse = 350.0f; + + UPROPERTY(EditAnywhere, Category = "Marble|Jump") + float JumpHoldForce = 1800.0f; + + UPROPERTY(EditAnywhere, Category = "Marble|Jump") + float MaxJumpHoldDuration = 0.3f; + + UPROPERTY(EditAnywhere, Category = "Marble|Jump") + float GroundCheckDistance = 5.0f; + + UPROPERTY(EditAnywhere, Category = "Marble|Network") + float SyncSendRate = 20.0f; + + UPROPERTY(EditAnywhere, Category = "Marble|Network") + float ProxyCorrectionSpeed = 10.0f; + +private: + + UPROPERTY(Transient) + TObjectPtr PhysicsSphere; // Resolved from owner + + UPROPERTY(BlueprintReadOnly, Category = "Marble|Movement", meta = (AllowPrivateAccess = "true")) + FVector CachedMoveDirection = FVector::ZeroVector; + + float SyncTimer = 0.0f; + + bool bIsJumping = false; + float JumpHoldElapsed = 0.0f; + + FVector_NetQuantize100 ProxyTargetLocation; + FRotator ProxyTargetRotation = FRotator::ZeroRotator; + FVector_NetQuantize100 ProxyTargetLinearVel; + FVector_NetQuantize100 ProxyTargetAngularVel; + bool bHasProxyTarget = false; + + void TickControlling(float DeltaTime); + void TickProxy(float DeltaTime); + +}; diff --git a/Source/BigMarbleWorld/Public/Marble/MarblePawn.h b/Source/BigMarbleWorld/Public/Marble/MarblePawn.h new file mode 100644 index 0000000..be02056 --- /dev/null +++ b/Source/BigMarbleWorld/Public/Marble/MarblePawn.h @@ -0,0 +1,37 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/Pawn.h" +#include "MarblePawn.generated.h" + +class USphereComponent; +class UStaticMeshComponent; +class UMarbleMovementComponent; + +UCLASS() +class BIGMARBLEWORLD_API AMarblePawn : public APawn +{ + GENERATED_BODY() + +public: + // Sets default values for this pawn's properties + AMarblePawn(); + + UMarbleMovementComponent* GetMarbleMovement() const { return MovementComponent; } + + void BeginPlay() override; + +protected: + + UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components") + TObjectPtr Collider; + + UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components") + TObjectPtr Mesh; + + UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components") + TObjectPtr MovementComponent; + +}; diff --git a/Source/BigMarbleWorld/Public/Marble/MarblePlayerInputComponent.h b/Source/BigMarbleWorld/Public/Marble/MarblePlayerInputComponent.h new file mode 100644 index 0000000..a64b810 --- /dev/null +++ b/Source/BigMarbleWorld/Public/Marble/MarblePlayerInputComponent.h @@ -0,0 +1,62 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "Components/ActorComponent.h" +#include "MarblePlayerInputComponent.generated.h" + + +class UCameraComponent; +class UMarbleMovementComponent; +struct FInputActionValue; +class UInputAction; +class UInputMappingContext; +class USpringArmComponent; + +UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent)) +class BIGMARBLEWORLD_API UMarblePlayerInputComponent : public UActorComponent +{ + GENERATED_BODY() + +public: + // Sets default values for this component's properties + UMarblePlayerInputComponent(); + + void BindInput(UInputComponent* InputComponent); + + // Called when the game starts + virtual void BeginPlay() override; + + UPROPERTY(EditDefaultsOnly, Category = "Input") + TObjectPtr DefaultMappingContext; + + UPROPERTY(EditDefaultsOnly, Category = "Input") + TObjectPtr MoveAction; + + UPROPERTY(EditDefaultsOnly, Category = "Input") + TObjectPtr LookAction; + + UPROPERTY(EditDefaultsOnly, Category = "Input") + TObjectPtr JumpAction; + + UPROPERTY(EditAnywhere, Category = "Input|Look") + float LookYawRate = 1.0f; + + UPROPERTY(EditAnywhere, Category = "Input|Look") + float LookPitchRate = 1.0f; + +private: + + void OnMove(const FInputActionValue& Value); + void OnLook(const FInputActionValue& Value); + void OnJumpStarted(const FInputActionValue& Value); + void OnJumpReleased(const FInputActionValue& Value); + + UPROPERTY(Transient) + TObjectPtr MovementComponent; + + UPROPERTY(Transient) + TObjectPtr CameraComponent; + +}; diff --git a/Source/BigMarbleWorld/Public/Marble/PlayerMarblePawn.h b/Source/BigMarbleWorld/Public/Marble/PlayerMarblePawn.h new file mode 100644 index 0000000..99d1ba5 --- /dev/null +++ b/Source/BigMarbleWorld/Public/Marble/PlayerMarblePawn.h @@ -0,0 +1,36 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "MarblePawn.h" +#include "PlayerMarblePawn.generated.h" + +class UCameraComponent; +class UMarblePlayerInputComponent; +class USpringArmComponent; + +UCLASS() +class BIGMARBLEWORLD_API APlayerMarblePawn : public AMarblePawn +{ + GENERATED_BODY() + +public: + // Sets default values for this pawn's properties + APlayerMarblePawn(); + +protected: + + // Called to bind functionality to input + virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override; + + UPROPERTY(VisibleAnywhere, Category = "Components") + TObjectPtr SpringArm; + + UPROPERTY(VisibleAnywhere, Category = "Components") + TObjectPtr Camera; + + UPROPERTY(VisibleAnywhere, Category = "Components") + TObjectPtr MarbleInputComponent; + +}; diff --git a/Source/BigMarbleWorldEditor.Target.cs b/Source/BigMarbleWorldEditor.Target.cs new file mode 100644 index 0000000..9f87f38 --- /dev/null +++ b/Source/BigMarbleWorldEditor.Target.cs @@ -0,0 +1,15 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +using UnrealBuildTool; +using System.Collections.Generic; + +public class BigMarbleWorldEditorTarget : TargetRules +{ + public BigMarbleWorldEditorTarget( TargetInfo Target) : base(Target) + { + Type = TargetType.Editor; + DefaultBuildSettings = BuildSettingsVersion.V7; + IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_8; + ExtraModuleNames.Add("BigMarbleWorld"); + } +}