2023-05-12 17:30:58 +03:00
parent e0769c9b30
commit b5ec0b86b2
16 changed files with 128 additions and 112 deletions

View File

@@ -151,6 +151,9 @@ namespace Game
audioSource.Name += ", vol: " + volume;
if (pitch != 1f)
audioSource.Name += ", pitch: " + pitch;
if (pitch != 0f)
audioSource.Name += ", delay: " + randomDelay;
Console.Print("playing sound " + audioSource.Name);
if (channel > 0)
actorChannels.channelSources[channel] = audioSource;

View File

@@ -329,17 +329,20 @@ namespace Game
boolValue = valueFloat != 0f;
AssetManager.Globals.SetValue("Scene Lighting", boolValue);
//AmbientOcclusion = value;
AmbientOcclusion = AmbientOcclusion;
GlobalIllumination = GlobalIllumination;
//GlobalIllumination = value;
}
}
private static bool _AmbientOcclusion;
[ConsoleVariable("r_ambientocclusion")]
public static string AmbientOcclusion
{
get
{
return Graphics.PostProcessSettings.AmbientOcclusion.Enabled ? "1" : "0";
return _AmbientOcclusion ? "1" : "0";//Graphics.PostProcessSettings.AmbientOcclusion.Enabled ? "1" : "0";
}
set
{
@@ -349,16 +352,19 @@ namespace Game
else if (float.TryParse(value, out float valueFloat))
boolValue = valueFloat != 0f;
_AmbientOcclusion = boolValue;
PostProcessSettings postProcessSettings = Graphics.PostProcessSettings;
AmbientOcclusionSettings aoSettings = postProcessSettings.AmbientOcclusion;
/*aoSettings.OverrideFlags = (aoSettings.OverrideFlags & ~AmbientOcclusionSettingsOverride.Enabled) |
(boolValue
? AmbientOcclusionSettingsOverride.Enabled
: 0 & AmbientOcclusionSettingsOverride.Enabled);*/
(boolValue
? AmbientOcclusionSettingsOverride.Enabled
: 0 & AmbientOcclusionSettingsOverride.Enabled);*/
aoSettings.Enabled = boolValue;
aoSettings.Enabled = boolValue && SceneLighting == "1";
postProcessSettings.AmbientOcclusion = aoSettings;
Graphics.PostProcessSettings = postProcessSettings;
}
}
@@ -382,12 +388,14 @@ namespace Game
}
}
private static bool _GlobalIllumination;
[ConsoleVariable("r_gi")]
public static string GlobalIllumination
{
get
{
return Graphics.PostProcessSettings.GlobalIllumination.Mode == GlobalIlluminationMode.DDGI ? "1" : "0";
return _GlobalIllumination ? "1" : "0";//Graphics.PostProcessSettings.GlobalIllumination.Mode == GlobalIlluminationMode.DDGI ? "1" : "0";
}
set
{
@@ -397,10 +405,12 @@ namespace Game
else if (float.TryParse(value, out float valueFloat))
boolValue = valueFloat != 0f;
_GlobalIllumination = boolValue;
PostProcessSettings postProcessSettings = Graphics.PostProcessSettings;
GlobalIlluminationSettings giSettings = postProcessSettings.GlobalIllumination;
giSettings.Mode = boolValue ? GlobalIlluminationMode.DDGI : GlobalIlluminationMode.None;
giSettings.Mode = (boolValue && SceneLighting == "1") ? GlobalIlluminationMode.DDGI : GlobalIlluminationMode.None;
postProcessSettings.GlobalIllumination = giSettings;
Graphics.PostProcessSettings = postProcessSettings;

View File

@@ -38,6 +38,8 @@ public class Game : GameModule
//options.ScriptingAPI.FileReferences.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "DotNet", "Newtonsoft.Json.dll"));
options.ScriptingAPI.FileReferences.Add(@"C:\dev\GoatBot\ThirdParty\DSharpPlus\DSharpPlus\bin\Debug\netstandard2.0\DSharpPlus.dll");
#if COMPILE_WITH_DLSS
DLSS.ConditionalImport(options, options.PrivateDependencies);
options.ScriptingAPI.Defines.Add("COMPILE_WITH_DLSS");

View File

@@ -402,7 +402,7 @@ namespace Game
//Assert.IsTrue(reportedFrame >= lastReceivedServerFrame);
if (reportedPlayerId == NetworkManager.LocalPlayerClientId && reportedFrame < lastReceivedServerFrame)
{
Console.Print($"packet wrong order, last received: {lastReceivedServerFrame}, new: {reportedFrame}");
//Console.Print($"packet wrong order, last received: {lastReceivedServerFrame}, new: {reportedFrame}");
break;
}

View File

@@ -488,7 +488,11 @@ namespace Game
//else
// FlaxEngine.Debug.Log("No WorldSpawn, loading map");
FlaxEngine.Debug.Log("Loading map");
bool oneMesh = false;
bool useStaticBatching = StaticBatching;
bool convexMesh = true;
FlaxEngine.Debug.Log("Loading map, static batching: " + useStaticBatching);
{
string matBasePath = Path.Combine(AssetManager.ContentPath, "Materials");
string assetPath = Path.Combine(matBasePath, "missing.flax");
@@ -497,9 +501,7 @@ namespace Game
ConcurrentBag<Model> sdfModels = new ConcurrentBag<Model>();
bool oneMesh = false;
bool useStaticBatching = StaticBatching;
bool convexMesh = true;
if (worldSpawnActor == null)
{

View File

@@ -77,6 +77,8 @@ namespace Game
meshCollider = GetChild<MeshCollider>();
//playerRigidBody = FindActor<RigidBody>();
//Console.Print("OnBeginPlay playerid: " + PlayerId.ToString());

View File

@@ -271,6 +271,7 @@ namespace Game
{
//input.OnUpdate();
if (input is PlayerInputDemo /*&& currentInputFrame2 >= currentInputFrame*/)
return;
@@ -1405,6 +1406,20 @@ namespace Game
{
AudioManager.PlaySoundDelayed(secondStepDelayRange, "jumpland", Actor, 0, rootActor.Position, volume2,
pitchRange);
/*AudioManager.PlaySoundDelayed(secondStepDelayRange, "jumpland", Actor, 0, rootActor.Position, volume2,
pitchRange);
AudioManager.PlaySoundDelayed(secondStepDelayRange, "jumpland", Actor, 0, rootActor.Position, volume2,
pitchRange);
AudioManager.PlaySoundDelayed(secondStepDelayRange, "jumpland", Actor, 0, rootActor.Position, volume2,
pitchRange);
AudioManager.PlaySoundDelayed(secondStepDelayRange, "jumpland", Actor, 0, rootActor.Position, volume2,
pitchRange);
AudioManager.PlaySoundDelayed(secondStepDelayRange, "jumpland", Actor, 0, rootActor.Position, volume2,
pitchRange);
AudioManager.PlaySoundDelayed(secondStepDelayRange, "jumpland", Actor, 0, rootActor.Position, volume2,
pitchRange);
AudioManager.PlaySoundDelayed(secondStepDelayRange, "jumpland", Actor, 0, rootActor.Position, volume2,
pitchRange);*/
}
}

View File

@@ -43,7 +43,7 @@ public class GameTarget : GameProjectTarget
if (options.Configuration == TargetConfiguration.Development || options.Configuration == TargetConfiguration.Debug)
options.OutputFolder = Path.Combine(FolderPath, "..", "Output", "WindowsDevelopment");
else if (options.Configuration == TargetConfiguration.Release)
options.OutputFolder = Path.Combine(FolderPath, "..", "Output", "WindowsRelease");
options.OutputFolder = Path.Combine(FolderPath, "..", "Output", "WindowsDevelopment");//options.OutputFolder = Path.Combine(FolderPath, "..", "Output", "WindowsRelease");
}
return base.GetOutputFilePath(options, outputType);

View File

@@ -17,16 +17,19 @@ public class GoakeTestsTarget : Target
IsPreBuilt = false;
Type = TargetType.DotNet;
OutputType = TargetOutputType.Library;
/*Platforms = new[]
Platforms = new[]
{
Flax.Build.Platform.BuildPlatform.Target,
};
Configurations = new[]
{
TargetConfiguration.Debug,
TargetConfiguration.Release,
};*/
//TargetConfiguration.Release,
};
CustomExternalProjectFilePath = System.IO.Path.Combine("Tests/GoakeTests.csproj");
//Modules.Add("Game");
}
}