Improve performance, fix grass issue
This commit is contained in:
parent
988d2077a2
commit
79e95e2083
@ -20,6 +20,8 @@
|
|||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<ConsolePause>false</ConsolePause>
|
<ConsolePause>false</ConsolePause>
|
||||||
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<DebugType>none</DebugType>
|
<DebugType>none</DebugType>
|
||||||
@ -28,6 +30,16 @@
|
|||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<ConsolePause>false</ConsolePause>
|
<ConsolePause>false</ConsolePause>
|
||||||
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Optimized Debug|AnyCPU' ">
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Optimized Debug</OutputPath>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<DefineConstants>DEBUG;</DefineConstants>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<RootNamespace>TrueCraft.Client</RootNamespace>
|
<RootNamespace>TrueCraft.Client</RootNamespace>
|
||||||
<AssemblyName>TrueCraft.Client</AssemblyName>
|
<AssemblyName>TrueCraft.Client</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
|
||||||
<NoWin32Manifest>False</NoWin32Manifest>
|
<NoWin32Manifest>False</NoWin32Manifest>
|
||||||
<SignAssembly>False</SignAssembly>
|
<SignAssembly>False</SignAssembly>
|
||||||
<DelaySign>False</DelaySign>
|
<DelaySign>False</DelaySign>
|
||||||
@ -22,6 +21,7 @@
|
|||||||
<DebugType>Full</DebugType>
|
<DebugType>Full</DebugType>
|
||||||
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
|
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
<DefineConstants>$(DefineConstants);WINDOWS</DefineConstants>
|
<DefineConstants>$(DefineConstants);WINDOWS</DefineConstants>
|
||||||
@ -47,6 +47,26 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<Commandlineparameters>localhost TestUser</Commandlineparameters>
|
<Commandlineparameters>localhost TestUser</Commandlineparameters>
|
||||||
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
|
<DebugType>
|
||||||
|
</DebugType>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||||
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||||
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Optimized Debug|AnyCPU' ">
|
||||||
|
<DebugType>
|
||||||
|
</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Optimized Debug</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;</DefineConstants>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Ionic.Zip.Reduced">
|
<Reference Include="Ionic.Zip.Reduced">
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<ConsolePause>false</ConsolePause>
|
<ConsolePause>false</ConsolePause>
|
||||||
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
@ -28,6 +29,12 @@
|
|||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<ConsolePause>false</ConsolePause>
|
<ConsolePause>false</ConsolePause>
|
||||||
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Optimized Debug|AnyCPU' ">
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Optimized Debug</OutputPath>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
@ -5,6 +5,7 @@ using TrueCraft.API.Logic;
|
|||||||
using TrueCraft.API;
|
using TrueCraft.API;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using TrueCraft.Profiling;
|
||||||
|
|
||||||
namespace TrueCraft.Core.Lighting
|
namespace TrueCraft.Core.Lighting
|
||||||
{
|
{
|
||||||
@ -113,12 +114,14 @@ namespace TrueCraft.Core.Lighting
|
|||||||
var chunk = World.FindChunk((Coordinates3D)op.Box.Center, generate: false);
|
var chunk = World.FindChunk((Coordinates3D)op.Box.Center, generate: false);
|
||||||
if (chunk == null || !chunk.TerrainPopulated)
|
if (chunk == null || !chunk.TerrainPopulated)
|
||||||
return;
|
return;
|
||||||
|
Profiler.Start("lighting.box");
|
||||||
for (int x = (int)op.Box.Min.X; x < (int)op.Box.Max.X; x++)
|
for (int x = (int)op.Box.Min.X; x < (int)op.Box.Max.X; x++)
|
||||||
for (int z = (int)op.Box.Min.Z; z < (int)op.Box.Max.Z; z++)
|
for (int z = (int)op.Box.Min.Z; z < (int)op.Box.Max.Z; z++)
|
||||||
for (int y = (int)op.Box.Max.Y - 1; y >= (int)op.Box.Min.Y; y--)
|
for (int y = (int)op.Box.Max.Y - 1; y >= (int)op.Box.Min.Y; y--)
|
||||||
{
|
{
|
||||||
LightVoxel(x, y, z, op);
|
LightVoxel(x, y, z, op);
|
||||||
}
|
}
|
||||||
|
Profiler.Done();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -161,6 +164,8 @@ namespace TrueCraft.Core.Lighting
|
|||||||
if (chunk == null || !chunk.TerrainPopulated) // Move on if this chunk is empty
|
if (chunk == null || !chunk.TerrainPopulated) // Move on if this chunk is empty
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Profiler.Start("lighting.voxel");
|
||||||
|
|
||||||
var id = World.GetBlockID(coords);
|
var id = World.GetBlockID(coords);
|
||||||
var provider = BlockRepository.GetBlockProvider(id);
|
var provider = BlockRepository.GetBlockProvider(id);
|
||||||
|
|
||||||
@ -235,6 +240,7 @@ namespace TrueCraft.Core.Lighting
|
|||||||
if (z + 1 >= op.Box.Max.Z)
|
if (z + 1 >= op.Box.Max.Z)
|
||||||
PropegateLightEvent(x, y, z + 1, propegated, op);
|
PropegateLightEvent(x, y, z + 1, propegated, op);
|
||||||
}
|
}
|
||||||
|
Profiler.Done();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TryLightNext()
|
public bool TryLightNext()
|
||||||
|
@ -104,9 +104,10 @@ namespace TrueCraft.Core.Logic.Blocks
|
|||||||
var _block = world.GetBlockLight(candidate + Coordinates3D.Up);
|
var _block = world.GetBlockLight(candidate + Coordinates3D.Up);
|
||||||
if (_sky < 4 && _block < 4)
|
if (_sky < 4 && _block < 4)
|
||||||
continue;
|
continue;
|
||||||
IChunk chunk = world.FindChunk(candidate);
|
IChunk chunk;
|
||||||
|
var _candidate = world.FindBlockPosition(candidate, out chunk);
|
||||||
bool grow = true;
|
bool grow = true;
|
||||||
for (int y = candidate.Y; y < chunk.GetHeight((byte)candidate.X, (byte)candidate.Z); y++)
|
for (int y = candidate.Y; y < chunk.GetHeight((byte)_candidate.X, (byte)_candidate.Z); y++)
|
||||||
{
|
{
|
||||||
var b = world.GetBlockID(new Coordinates3D(candidate.X, y, candidate.Z));
|
var b = world.GetBlockID(new Coordinates3D(candidate.X, y, candidate.Z));
|
||||||
var p = world.BlockRepository.GetBlockProvider(b);
|
var p = world.BlockRepository.GetBlockProvider(b);
|
||||||
@ -116,10 +117,13 @@ namespace TrueCraft.Core.Logic.Blocks
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (grow)
|
||||||
|
{
|
||||||
world.SetBlockID(candidate, GrassBlock.BlockID);
|
world.SetBlockID(candidate, GrassBlock.BlockID);
|
||||||
server.Scheduler.ScheduleEvent("grass", chunk,
|
server.Scheduler.ScheduleEvent("grass", chunk,
|
||||||
TimeSpan.FromSeconds(MathHelper.Random.Next(MinGrowthTime, MaxGrowthTime)),
|
TimeSpan.FromSeconds(MathHelper.Random.Next(MinGrowthTime, MaxGrowthTime)),
|
||||||
s => TrySpread(candidate, world, server));
|
s => TrySpread(candidate, world, server));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,13 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<ConsolePause>false</ConsolePause>
|
<ConsolePause>false</ConsolePause>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Optimized Debug|AnyCPU' ">
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Optimized Debug</OutputPath>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<DefineConstants>DEBUG;</DefineConstants>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="Ionic.Zip.Reduced">
|
<Reference Include="Ionic.Zip.Reduced">
|
||||||
@ -358,6 +365,10 @@
|
|||||||
<Project>{4488498D-976D-4DA3-BF72-109531AF0488}</Project>
|
<Project>{4488498D-976D-4DA3-BF72-109531AF0488}</Project>
|
||||||
<Name>fNbt</Name>
|
<Name>fNbt</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\TrueCraft.Profiling\TrueCraft.Profiling.csproj">
|
||||||
|
<Project>{BCA0E139-CF47-43B3-9DC9-D4611C0A2AAD}</Project>
|
||||||
|
<Name>TrueCraft.Profiling</Name>
|
||||||
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ProjectExtensions>
|
<ProjectExtensions>
|
||||||
<MonoDevelop>
|
<MonoDevelop>
|
||||||
|
@ -5,6 +5,7 @@ using TrueCraft.API.Logging;
|
|||||||
using TrueCraft.API;
|
using TrueCraft.API;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using TrueCraft.Core.Logging;
|
using TrueCraft.Core.Logging;
|
||||||
|
using TrueCraft;
|
||||||
|
|
||||||
namespace TrueCraft.Launcher.Singleplayer
|
namespace TrueCraft.Launcher.Singleplayer
|
||||||
{
|
{
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<ConsolePause>false</ConsolePause>
|
<ConsolePause>false</ConsolePause>
|
||||||
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<DebugType>none</DebugType>
|
<DebugType>none</DebugType>
|
||||||
@ -28,6 +30,8 @@
|
|||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<ConsolePause>false</ConsolePause>
|
<ConsolePause>false</ConsolePause>
|
||||||
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
@ -115,4 +119,12 @@ copy $(SolutionDir)packages\MonoGame.Framework.Linux.3.4.0.459\lib\net40\MonoGam
|
|||||||
copy $(SolutionDir)packages\MonoGame.Framework.WindowsGL.3.4.0.459\lib\net40\MonoGame.Framework.dll $(TargetDir)MonoGame.Framework.Windows.dll
|
copy $(SolutionDir)packages\MonoGame.Framework.WindowsGL.3.4.0.459\lib\net40\MonoGame.Framework.dll $(TargetDir)MonoGame.Framework.Windows.dll
|
||||||
copy $(SolutionDir)packages\MonoGame.Framework.MacOS.3.4.0.459\lib\net40\MonoGame.Framework.dll $(TargetDir)MonoGame.Framework.MacOS.dll </PostBuildEvent>
|
copy $(SolutionDir)packages\MonoGame.Framework.MacOS.3.4.0.459\lib\net40\MonoGame.Framework.dll $(TargetDir)MonoGame.Framework.MacOS.dll </PostBuildEvent>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Optimized Debug|AnyCPU' ">
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Optimized Debug</OutputPath>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<DefineConstants>DEBUG;</DefineConstants>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -12,6 +12,7 @@ namespace TrueCraft.Profiling
|
|||||||
Stopwatch = new Stopwatch();
|
Stopwatch = new Stopwatch();
|
||||||
EnabledBuckets = new List<string>();
|
EnabledBuckets = new List<string>();
|
||||||
ActiveTimers = new Stack<ActiveTimer>();
|
ActiveTimers = new Stack<ActiveTimer>();
|
||||||
|
LogLag = false;
|
||||||
Stopwatch.Start();
|
Stopwatch.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -19,6 +20,8 @@ namespace TrueCraft.Profiling
|
|||||||
private static List<string> EnabledBuckets { get; set; }
|
private static List<string> EnabledBuckets { get; set; }
|
||||||
private static Stack<ActiveTimer> ActiveTimers { get; set; }
|
private static Stack<ActiveTimer> ActiveTimers { get; set; }
|
||||||
|
|
||||||
|
public static bool LogLag { get; set; }
|
||||||
|
|
||||||
private struct ActiveTimer
|
private struct ActiveTimer
|
||||||
{
|
{
|
||||||
public long Started, Finished;
|
public long Started, Finished;
|
||||||
@ -49,21 +52,23 @@ namespace TrueCraft.Profiling
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Conditional("DEBUG")]
|
[Conditional("DEBUG")]
|
||||||
public static void Done()
|
public static void Done(long lag = -1)
|
||||||
{
|
{
|
||||||
if (ActiveTimers.Count > 0)
|
if (ActiveTimers.Count > 0)
|
||||||
{
|
{
|
||||||
var timer = ActiveTimers.Pop();
|
var timer = ActiveTimers.Pop();
|
||||||
timer.Finished = Stopwatch.ElapsedTicks;
|
timer.Finished = Stopwatch.ElapsedTicks;
|
||||||
|
double elapsed = (timer.Finished - timer.Started) / 10000.0;
|
||||||
for (int i = 0; i < EnabledBuckets.Count; i++)
|
for (int i = 0; i < EnabledBuckets.Count; i++)
|
||||||
{
|
{
|
||||||
if (Match(EnabledBuckets[i], timer.Bucket))
|
if (Match(EnabledBuckets[i], timer.Bucket))
|
||||||
{
|
{
|
||||||
Console.WriteLine("{0} took {1}ms", timer.Bucket,
|
Console.WriteLine("{0} took {1}ms", timer.Bucket, elapsed);
|
||||||
(timer.Finished - timer.Started) / 10000.0);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (LogLag && lag != -1 && elapsed > lag)
|
||||||
|
Console.WriteLine("{0} is lagging by {1}ms", timer.Bucket, elapsed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<ConsolePause>false</ConsolePause>
|
<ConsolePause>false</ConsolePause>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
@ -27,6 +28,15 @@
|
|||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<ConsolePause>false</ConsolePause>
|
<ConsolePause>false</ConsolePause>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Optimized Debug|AnyCPU' ">
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Optimized Debug</OutputPath>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<DefineConstants>DEBUG;</DefineConstants>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
@ -23,38 +23,55 @@ Global
|
|||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
|
Optimized Debug|Any CPU = Optimized Debug|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{4488498D-976D-4DA3-BF72-109531AF0488}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{4488498D-976D-4DA3-BF72-109531AF0488}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{4488498D-976D-4DA3-BF72-109531AF0488}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{4488498D-976D-4DA3-BF72-109531AF0488}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{4488498D-976D-4DA3-BF72-109531AF0488}.Optimized Debug|Any CPU.ActiveCfg = Optimized Debug|Any CPU
|
||||||
|
{4488498D-976D-4DA3-BF72-109531AF0488}.Optimized Debug|Any CPU.Build.0 = Optimized Debug|Any CPU
|
||||||
{4488498D-976D-4DA3-BF72-109531AF0488}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{4488498D-976D-4DA3-BF72-109531AF0488}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{4488498D-976D-4DA3-BF72-109531AF0488}.Release|Any CPU.Build.0 = Release|Any CPU
|
{4488498D-976D-4DA3-BF72-109531AF0488}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{6604F17A-552E-405D-B327-37C8B1648C86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{6604F17A-552E-405D-B327-37C8B1648C86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{6604F17A-552E-405D-B327-37C8B1648C86}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{6604F17A-552E-405D-B327-37C8B1648C86}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{6604F17A-552E-405D-B327-37C8B1648C86}.Optimized Debug|Any CPU.ActiveCfg = Optimized Debug|Any CPU
|
||||||
|
{6604F17A-552E-405D-B327-37C8B1648C86}.Optimized Debug|Any CPU.Build.0 = Optimized Debug|Any CPU
|
||||||
{6604F17A-552E-405D-B327-37C8B1648C86}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{6604F17A-552E-405D-B327-37C8B1648C86}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{6604F17A-552E-405D-B327-37C8B1648C86}.Release|Any CPU.Build.0 = Release|Any CPU
|
{6604F17A-552E-405D-B327-37C8B1648C86}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{A6516869-A2FB-4E31-85C8-2285490CB32C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{A6516869-A2FB-4E31-85C8-2285490CB32C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{A6516869-A2FB-4E31-85C8-2285490CB32C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{A6516869-A2FB-4E31-85C8-2285490CB32C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{A6516869-A2FB-4E31-85C8-2285490CB32C}.Optimized Debug|Any CPU.ActiveCfg = Optimized Debug|Any CPU
|
||||||
|
{A6516869-A2FB-4E31-85C8-2285490CB32C}.Optimized Debug|Any CPU.Build.0 = Optimized Debug|Any CPU
|
||||||
{A6516869-A2FB-4E31-85C8-2285490CB32C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{A6516869-A2FB-4E31-85C8-2285490CB32C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{A6516869-A2FB-4E31-85C8-2285490CB32C}.Release|Any CPU.Build.0 = Release|Any CPU
|
{A6516869-A2FB-4E31-85C8-2285490CB32C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{BCA0E139-CF47-43B3-9DC9-D4611C0A2AAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{BCA0E139-CF47-43B3-9DC9-D4611C0A2AAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{BCA0E139-CF47-43B3-9DC9-D4611C0A2AAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{BCA0E139-CF47-43B3-9DC9-D4611C0A2AAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{BCA0E139-CF47-43B3-9DC9-D4611C0A2AAD}.Optimized Debug|Any CPU.ActiveCfg = Optimized Debug|Any CPU
|
||||||
|
{BCA0E139-CF47-43B3-9DC9-D4611C0A2AAD}.Optimized Debug|Any CPU.Build.0 = Optimized Debug|Any CPU
|
||||||
{BCA0E139-CF47-43B3-9DC9-D4611C0A2AAD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{BCA0E139-CF47-43B3-9DC9-D4611C0A2AAD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{BCA0E139-CF47-43B3-9DC9-D4611C0A2AAD}.Release|Any CPU.Build.0 = Release|Any CPU
|
{BCA0E139-CF47-43B3-9DC9-D4611C0A2AAD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{BCFDCD93-C23E-49E6-9767-A887B3C2A709}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{BCFDCD93-C23E-49E6-9767-A887B3C2A709}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{BCFDCD93-C23E-49E6-9767-A887B3C2A709}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{BCFDCD93-C23E-49E6-9767-A887B3C2A709}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{BCFDCD93-C23E-49E6-9767-A887B3C2A709}.Optimized Debug|Any CPU.ActiveCfg = Optimized Debug|Any CPU
|
||||||
|
{BCFDCD93-C23E-49E6-9767-A887B3C2A709}.Optimized Debug|Any CPU.Build.0 = Optimized Debug|Any CPU
|
||||||
{BCFDCD93-C23E-49E6-9767-A887B3C2A709}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{BCFDCD93-C23E-49E6-9767-A887B3C2A709}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{BCFDCD93-C23E-49E6-9767-A887B3C2A709}.Release|Any CPU.Build.0 = Release|Any CPU
|
{BCFDCD93-C23E-49E6-9767-A887B3C2A709}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{C1C47EF5-2D8A-4231-AAA8-F651F52F480E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{C1C47EF5-2D8A-4231-AAA8-F651F52F480E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{C1C47EF5-2D8A-4231-AAA8-F651F52F480E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{C1C47EF5-2D8A-4231-AAA8-F651F52F480E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{C1C47EF5-2D8A-4231-AAA8-F651F52F480E}.Optimized Debug|Any CPU.ActiveCfg = Optimized Debug|Any CPU
|
||||||
|
{C1C47EF5-2D8A-4231-AAA8-F651F52F480E}.Optimized Debug|Any CPU.Build.0 = Optimized Debug|Any CPU
|
||||||
{C1C47EF5-2D8A-4231-AAA8-F651F52F480E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{C1C47EF5-2D8A-4231-AAA8-F651F52F480E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{C1C47EF5-2D8A-4231-AAA8-F651F52F480E}.Release|Any CPU.Build.0 = Release|Any CPU
|
{C1C47EF5-2D8A-4231-AAA8-F651F52F480E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{FA4BE9A3-DBF0-4380-BA2B-FFAA71C4706D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{FA4BE9A3-DBF0-4380-BA2B-FFAA71C4706D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{FA4BE9A3-DBF0-4380-BA2B-FFAA71C4706D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{FA4BE9A3-DBF0-4380-BA2B-FFAA71C4706D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{FA4BE9A3-DBF0-4380-BA2B-FFAA71C4706D}.Optimized Debug|Any CPU.ActiveCfg = Optimized Debug|Any CPU
|
||||||
|
{FA4BE9A3-DBF0-4380-BA2B-FFAA71C4706D}.Optimized Debug|Any CPU.Build.0 = Optimized Debug|Any CPU
|
||||||
{FA4BE9A3-DBF0-4380-BA2B-FFAA71C4706D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{FA4BE9A3-DBF0-4380-BA2B-FFAA71C4706D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{FA4BE9A3-DBF0-4380-BA2B-FFAA71C4706D}.Release|Any CPU.Build.0 = Release|Any CPU
|
{FA4BE9A3-DBF0-4380-BA2B-FFAA71C4706D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{FEE55B54-91B0-4325-A2C3-D576C0B7A81F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{FEE55B54-91B0-4325-A2C3-D576C0B7A81F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{FEE55B54-91B0-4325-A2C3-D576C0B7A81F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{FEE55B54-91B0-4325-A2C3-D576C0B7A81F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{FEE55B54-91B0-4325-A2C3-D576C0B7A81F}.Optimized Debug|Any CPU.ActiveCfg = Optimized Debug|Any CPU
|
||||||
|
{FEE55B54-91B0-4325-A2C3-D576C0B7A81F}.Optimized Debug|Any CPU.Build.0 = Optimized Debug|Any CPU
|
||||||
{FEE55B54-91B0-4325-A2C3-D576C0B7A81F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{FEE55B54-91B0-4325-A2C3-D576C0B7A81F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{FEE55B54-91B0-4325-A2C3-D576C0B7A81F}.Release|Any CPU.Build.0 = Release|Any CPU
|
{FEE55B54-91B0-4325-A2C3-D576C0B7A81F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
|
@ -86,9 +86,11 @@ namespace TrueCraft
|
|||||||
}
|
}
|
||||||
if (e.When > start)
|
if (e.When > start)
|
||||||
break; // List is sorted, we can exit early
|
break; // List is sorted, we can exit early
|
||||||
|
if (start > Stopwatch.ElapsedTicks + 200000)
|
||||||
|
break; // We're falling behind
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Profiler.Done();
|
Profiler.Done(20);
|
||||||
}
|
}
|
||||||
|
|
||||||
private struct ScheduledEvent
|
private struct ScheduledEvent
|
||||||
|
@ -221,16 +221,18 @@ namespace TrueCraft
|
|||||||
{
|
{
|
||||||
int _x = chunk.Coordinates.X * Chunk.Width;
|
int _x = chunk.Coordinates.X * Chunk.Width;
|
||||||
int _z = chunk.Coordinates.Z * Chunk.Depth;
|
int _z = chunk.Coordinates.Z * Chunk.Depth;
|
||||||
|
Coordinates3D coords, _coords;
|
||||||
for (byte x = 0; x < Chunk.Width; x++)
|
for (byte x = 0; x < Chunk.Width; x++)
|
||||||
{
|
{
|
||||||
for (byte z = 0; z < Chunk.Depth; z++)
|
for (byte z = 0; z < Chunk.Depth; z++)
|
||||||
{
|
{
|
||||||
for (int y = 0; y < chunk.GetHeight(x, z); y++)
|
for (int y = 0; y < chunk.GetHeight(x, z); y++)
|
||||||
{
|
{
|
||||||
var coords = new Coordinates3D(_x + x, y, _z + z);
|
_coords.X = x; _coords.Y = y; _coords.Z = z;
|
||||||
var id = world.GetBlockID(coords);
|
var id = chunk.GetBlockID(_coords);
|
||||||
if (id == 0)
|
if (id == 0)
|
||||||
continue;
|
continue;
|
||||||
|
coords.X = _x + x; coords.Y = y; coords.Z = _z + z;
|
||||||
var provider = BlockRepository.GetBlockProvider(id);
|
var provider = BlockRepository.GetBlockProvider(id);
|
||||||
provider.BlockLoadedFromChunk(coords, this, world);
|
provider.BlockLoadedFromChunk(coords, this, world);
|
||||||
}
|
}
|
||||||
@ -398,7 +400,7 @@ namespace TrueCraft
|
|||||||
ScheduleUpdatesForChunk(t.Item1, t.Item2);
|
ScheduleUpdatesForChunk(t.Item1, t.Item2);
|
||||||
Profiler.Done();
|
Profiler.Done();
|
||||||
|
|
||||||
Profiler.Done();
|
Profiler.Done(MillisecondsPerTick);
|
||||||
|
|
||||||
EnvironmentWorker.Change(MillisecondsPerTick, 0);
|
EnvironmentWorker.Change(MillisecondsPerTick, 0);
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,9 @@ namespace TrueCraft
|
|||||||
|
|
||||||
[YamlMember(Alias = "buckets")]
|
[YamlMember(Alias = "buckets")]
|
||||||
public string Buckets { get; set; }
|
public string Buckets { get; set; }
|
||||||
|
|
||||||
|
[YamlMember(Alias = "lag")]
|
||||||
|
public bool Lag { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public DebugConfiguration()
|
public DebugConfiguration()
|
||||||
|
@ -18,11 +18,23 @@
|
|||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<ConsolePause>false</ConsolePause>
|
<ConsolePause>false</ConsolePause>
|
||||||
<DefineConstants>DEBUG;</DefineConstants>
|
<DefineConstants>DEBUG;</DefineConstants>
|
||||||
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\Release</OutputPath>
|
<OutputPath>bin\Release</OutputPath>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Optimized Debug|AnyCPU' ">
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Optimized Debug</OutputPath>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<DefineConstants>DEBUG;</DefineConstants>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
Reference in New Issue
Block a user