This commit is contained in:
2024-04-26 20:06:38 +03:00
parent 0da7f2d93e
commit e023dfce69
21 changed files with 73 additions and 466 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,7 +1,7 @@
{
"ID": "194e05f445ece24ec5448d886e1334df",
"TypeName": "FlaxEngine.SceneAsset",
"EngineBuild": 65046,
"EngineBuild": 6601,
"Data": [
{
"ID": "194e05f445ece24ec5448d886e1334df",
@@ -51,7 +51,7 @@
}
},
"Data": {
"Text": "0 tris\n 0 drawcalls\n15fps2\n15fps"
"Text": "0 tris\n 0 drawcalls\r\n262fps2\r\n285fps"
}
},
{
@@ -68,13 +68,6 @@
"TypeName": "FlaxEngine.UIControl",
"ParentID": "ff6b6db54b5aa08e7286ef86246149ef",
"Name": "CrosshairWidget",
"Transform": {
"Translation": {
"X": 0.0,
"Y": 1.0,
"Z": 0.0
}
},
"Control": "FlaxEngine.GUI.Image",
"Data": {
"Brush": {
@@ -119,8 +112,8 @@
"Offsets": {
"Left": 0.0,
"Right": 0.0,
"Top": 1.0,
"Bottom": -1.0
"Top": 0.0,
"Bottom": 0.0
},
"Scale": {
"X": 1.0,

View File

@@ -1,107 +0,0 @@
{
"ID": "a916228c48fe3a0e89ff0985d4ad2fca",
"TypeName": "FlaxEngine.SceneAsset",
"EngineBuild": 65045,
"Data": [
{
"ID": "a916228c48fe3a0e89ff0985d4ad2fca",
"TypeName": "FlaxEngine.Scene",
"LightmapSettings": {
"IndirectLightingIntensity": 1.0,
"GlobalObjectsScale": 1.0,
"ChartsPadding": 3,
"AtlasSize": 1024,
"BounceCount": 1,
"CompressLightmaps": true,
"UseGeometryWithNoMaterials": true,
"Quality": 10
}
},
{
"ID": "6ee4b1e34ce62731b943e586b9864ae2",
"TypeName": "FlaxEngine.StaticModel",
"ParentID": "a916228c48fe3a0e89ff0985d4ad2fca",
"Name": "CubeFloor",
"Transform": {
"Translation": {
"X": 0.0,
"Y": 10.555465698242188,
"Z": 0.0
},
"Scale": {
"X": 3.7614870071411135,
"Y": 0.26607516407966616,
"Z": 3.4711759090423586
}
},
"Model": "b43f0f8f4aaba3f3156896a5a22ba493",
"Buffer": {
"Entries": [
{
"Material": "00000000000000000000000000000000",
"ShadowsMode": 3,
"Visible": true,
"ReceiveDecals": true
}
]
}
},
{
"ID": "88b1ed59418cb010695115991acaa790",
"TypeName": "FlaxEngine.BoxCollider",
"ParentID": "6ee4b1e34ce62731b943e586b9864ae2",
"Name": "BoxCollider"
},
{
"ID": "5aee089144314eac43865588f949cbe2",
"TypeName": "FlaxEngine.RigidBody",
"ParentID": "a916228c48fe3a0e89ff0985d4ad2fca",
"Name": "RigidBody",
"Transform": {
"Translation": {
"X": 0.0,
"Y": 92.45675659179688,
"Z": -42.916717529296878
}
},
"Mass": 27.00000762939453
},
{
"ID": "9a4e12084b6613849096a9b285b72c53",
"TypeName": "FlaxEngine.BoxCollider",
"ParentID": "5aee089144314eac43865588f949cbe2",
"Name": "BoxCollider",
"Transform": {
"Scale": {
"X": 0.30000001192092898,
"Y": 0.30000001192092898,
"Z": 0.30000001192092898
}
}
},
{
"ID": "6212e97240b1373f995b779a65a8a5f3",
"TypeName": "FlaxEngine.StaticModel",
"ParentID": "5aee089144314eac43865588f949cbe2",
"Name": "Cube",
"Transform": {
"Scale": {
"X": 0.30000001192092898,
"Y": 0.30000001192092898,
"Z": 0.30000001192092898
}
},
"Model": "b43f0f8f4aaba3f3156896a5a22ba493",
"Buffer": {
"Entries": [
{
"Material": "00000000000000000000000000000000",
"ShadowsMode": 3,
"Visible": true,
"ReceiveDecals": true
}
]
}
}
]
}

View File

@@ -1,107 +0,0 @@
{
"ID": "f749e5d141e1384c05e49abe92a4fb90",
"TypeName": "FlaxEngine.SceneAsset",
"EngineBuild": 65045,
"Data": [
{
"ID": "f749e5d141e1384c05e49abe92a4fb90",
"TypeName": "FlaxEngine.Scene",
"LightmapSettings": {
"IndirectLightingIntensity": 1.0,
"GlobalObjectsScale": 1.0,
"ChartsPadding": 3,
"AtlasSize": 1024,
"BounceCount": 1,
"CompressLightmaps": true,
"UseGeometryWithNoMaterials": true,
"Quality": 10
}
},
{
"ID": "8048c4f041c327d1bbd03ab890f73405",
"TypeName": "FlaxEngine.StaticModel",
"ParentID": "f749e5d141e1384c05e49abe92a4fb90",
"Name": "CubeFloor",
"Transform": {
"Translation": {
"X": 0.0,
"Y": 10.555465698242188,
"Z": 0.0
},
"Scale": {
"X": 3.7614870071411135,
"Y": 0.26607516407966616,
"Z": 3.4711759090423586
}
},
"Model": "b43f0f8f4aaba3f3156896a5a22ba493",
"Buffer": {
"Entries": [
{
"Material": "00000000000000000000000000000000",
"ShadowsMode": 3,
"Visible": true,
"ReceiveDecals": true
}
]
}
},
{
"ID": "c26bd5b24ea23e14a6bd77b1ff3e6a19",
"TypeName": "FlaxEngine.BoxCollider",
"ParentID": "8048c4f041c327d1bbd03ab890f73405",
"Name": "BoxCollider"
},
{
"ID": "3ebecf744a613387694b3b9432a576f5",
"TypeName": "FlaxEngine.RigidBody",
"ParentID": "f749e5d141e1384c05e49abe92a4fb90",
"Name": "RigidBody",
"Transform": {
"Translation": {
"X": 0.0,
"Y": 92.45675659179688,
"Z": -42.916717529296878
}
},
"Mass": 27.00000762939453
},
{
"ID": "3be79c2b48f15d4ab126fcbb34104efb",
"TypeName": "FlaxEngine.BoxCollider",
"ParentID": "3ebecf744a613387694b3b9432a576f5",
"Name": "BoxCollider",
"Transform": {
"Scale": {
"X": 0.30000001192092898,
"Y": 0.30000001192092898,
"Z": 0.30000001192092898
}
}
},
{
"ID": "8d3acad54ec87dc0bccd0c9b68bd09a8",
"TypeName": "FlaxEngine.StaticModel",
"ParentID": "3ebecf744a613387694b3b9432a576f5",
"Name": "Cube",
"Transform": {
"Scale": {
"X": 0.30000001192092898,
"Y": 0.30000001192092898,
"Z": 0.30000001192092898
}
},
"Model": "b43f0f8f4aaba3f3156896a5a22ba493",
"Buffer": {
"Entries": [
{
"Material": "00000000000000000000000000000000",
"ShadowsMode": 3,
"Visible": true,
"ReceiveDecals": true
}
]
}
}
]
}

View File

@@ -1,207 +0,0 @@
{
"ID": "5524fb9c40412196af3d79a9daae64cc",
"TypeName": "FlaxEngine.SceneAsset",
"EngineBuild": 65045,
"Data": [
{
"ID": "5524fb9c40412196af3d79a9daae64cc",
"TypeName": "FlaxEngine.Scene",
"LightmapSettings": {
"IndirectLightingIntensity": 1.0,
"GlobalObjectsScale": 1.0,
"ChartsPadding": 3,
"AtlasSize": 1024,
"BounceCount": 1,
"CompressLightmaps": true,
"UseGeometryWithNoMaterials": true,
"Quality": 10
}
},
{
"ID": "c95a3dab492c1b2046ce2191daa2b111",
"TypeName": "Game.Q3MapImporter",
"ParentID": "5524fb9c40412196af3d79a9daae64cc",
"V": {
"mapPath": "Assets/Maps/aerowalk.map",
"importLights": true,
"BrightnessMultiplier": 0.8227397,
"LightRadiusMultiplier": 9.458821,
"StaticBatching": true
}
},
{
"ID": "3a7aeb9c482dce809d729287977859be",
"TypeName": "Game.MultiSceneScript",
"ParentID": "5524fb9c40412196af3d79a9daae64cc",
"V": {}
},
{
"ID": "ff6b6db54b5aa08e7286ef86246149ef",
"PrefabID": "cb74184545f392e5c67815808bc63e58",
"PrefabObjectID": "9e1b61dc44338f962e69f78ecb3d0536",
"ParentID": "5524fb9c40412196af3d79a9daae64cc",
"IsActive": false,
"V": {}
},
{
"ID": "02119c7243cb3a4a4ffcd395ff07e23d",
"PrefabID": "cb74184545f392e5c67815808bc63e58",
"PrefabObjectID": "e94561104b27c841e6ab0bb479bde17a",
"ParentID": "ff6b6db54b5aa08e7286ef86246149ef",
"V": {}
},
{
"ID": "ad0c546649722a6c7a6b9aa8fdcac019",
"PrefabID": "cb74184545f392e5c67815808bc63e58",
"PrefabObjectID": "926bc11f416c9cef57d383875a480ded",
"ParentID": "ff6b6db54b5aa08e7286ef86246149ef",
"Transform": {
"Translation": {
"X": -101.0,
"Y": -22.0,
"Z": 0.0
}
},
"Data": {}
},
{
"ID": "35b34b0c4476f0ed43aa8fb4d5f2eebc",
"PrefabID": "cb74184545f392e5c67815808bc63e58",
"PrefabObjectID": "85ddca4e46ed0c030d063599ac716e96",
"ParentID": "ad0c546649722a6c7a6b9aa8fdcac019",
"V": {
"control": "ad0c546649722a6c7a6b9aa8fdcac019"
}
},
{
"ID": "2fe5467d4e92726e24227cbcbcbd2844",
"TypeName": "FlaxEngine.UIControl",
"ParentID": "ff6b6db54b5aa08e7286ef86246149ef",
"Name": "CrosshairWidget",
"Control": "FlaxEngine.GUI.Image",
"Data": {
"Brush": {
"$type": "FlaxEngine.GUI.MaterialBrush, FlaxEngine.CSharp",
"Material": "3f912eea48c6e2438fe49881210cb7d7"
},
"Margin": {
"Left": 0.0,
"Right": 0.0,
"Top": 0.0,
"Bottom": 0.0
},
"Color": {
"R": 1.0,
"G": 1.0,
"B": 1.0,
"A": 1.0
},
"MouseOverColor": {
"R": 1.0,
"G": 1.0,
"B": 1.0,
"A": 1.0
},
"DisabledTint": {
"R": 0.5019608,
"G": 0.5019608,
"B": 0.5019608,
"A": 1.0
},
"KeepAspectRatio": false,
"ClipChildren": true,
"CullChildren": true,
"AnchorMin": {
"X": 0.0,
"Y": 0.0
},
"AnchorMax": {
"X": 1.0,
"Y": 1.0
},
"Offsets": {
"Left": 0.0,
"Right": 0.0,
"Top": 0.0,
"Bottom": 0.0
},
"Scale": {
"X": 1.0,
"Y": 1.0
},
"Pivot": {
"X": 0.5,
"Y": 0.5
},
"Shear": {
"X": 0.0,
"Y": 0.0
},
"Rotation": 0.0,
"BackgroundColor": {
"R": 0.0,
"G": 0.0,
"B": 0.0,
"A": 0.0
},
"Enabled": true,
"Visible": true,
"AutoFocus": false
}
},
{
"ID": "e12c6b914501fde5098a14a350c2809c",
"TypeName": "Game.CrosshairWidget",
"ParentID": "2fe5467d4e92726e24227cbcbcbd2844",
"V": {}
},
{
"ID": "8736d067492170db415102997d187ff7",
"TypeName": "FlaxEngine.DirectionalLight",
"ParentID": "5524fb9c40412196af3d79a9daae64cc",
"IsActive": false,
"Name": "DirectionalLight",
"Transform": {
"Translation": {
"X": -370.8681335449219,
"Y": 191.241943359375,
"Z": -134.10745239257813
},
"Orientation": {
"X": 0.8119235038757324,
"Y": -7.162299908713976e-8,
"Z": -7.162299908713976e-8,
"W": 0.5837640166282654
}
},
"Brightness": 21.700000762939454,
"ViewDistance": 15400.0,
"ShadowsDistance": 9715.0,
"ShadowsFadeDistance": 5000.0
},
{
"ID": "6d29a4d44ce988b4b1844caa39c2a2bd",
"TypeName": "FlaxEngine.Camera",
"ParentID": "5524fb9c40412196af3d79a9daae64cc",
"Name": "Camera",
"Transform": {
"Translation": {
"X": 136.9144744873047,
"Y": 131.739990234375,
"Z": -495.9844665527344
},
"Orientation": {
"X": 0.09739881008863449,
"Y": -0.05181961879134178,
"Z": 0.005078235175460577,
"W": 0.9938824772834778
},
"Scale": {
"X": 1.0006136894226075,
"Y": 0.999918520450592,
"Z": 1.0005552768707276
}
}
}
]
}

View File

@@ -1,25 +1,26 @@
{
"ID": "4bd8a4cc460399b5f1975fbe0a668e3f",
"TypeName": "FlaxEditor.Content.Settings.PhysicsSettings",
"EngineBuild": 6331,
"EngineBuild": 6510,
"Data": {
"DefaultGravity": {
"X": 0.0,
"Y": -800.0,
"Z": 0.0
},
"QueriesHitTriggers": true,
"TriangleMeshTriangleMinAreaThreshold": 5.0,
"BounceThresholdVelocity": 200.0,
"FrictionCombineMode": 0,
"RestitutionCombineMode": 0,
"DisableCCD": false,
"EnableAdaptiveForce": false,
"BroadPhaseType": 3,
"SolverType": 0,
"MaxDeltaTime": 0.1,
"EnableSubstepping": false,
"SubstepDeltaTime": 1E-05,
"MaxSubsteps": 600,
"SupportCookingAtRuntime": true,
"TriangleMeshTriangleMinAreaThreshold": 5.0,
"QueriesHitTriggers": true,
"LayerMasks": [
4294967295,
4294967295,

View File

@@ -1,5 +1,5 @@
// comment
r_shadows 0
r_shadows 1
r_lighting 1
cl_maxfps 0
r_upscaling 0

View File

@@ -51,7 +51,7 @@ public class CameraRender : PostProcessEffect
public override void OnAwake()
{
viewModelHolder = Parent.Parent.Parent.Parent.GetChild("ViewModelHolder");
if (useMainCamera)
if (useMainCamera && viewModelHolder != null)
{
camera.IsActive = false;
void foo(Actor actor)

View File

@@ -204,6 +204,7 @@ public class ConsoleInstance : IDisposable
// Initializes the Console system.
internal void InitConsoleSubsystems()
{
return;
#if USE_NETCORE
var assemblies = Utils.GetAssemblies();
#else

View File

@@ -159,6 +159,9 @@ public class ConsoleScript : Script
+ " long line in repeat a very very very long long long 4 line in repeat");
Console.Print("another normal line");*/
//for (int i=0; i<10000; i++)
// Debug.Log("a very very very long long long line in repeat a very very very long long long line in");
Debug.Logger.LogHandler.SendLog += OnSendLog;
Debug.Logger.LogHandler.SendExceptionLog += OnSendExceptionLog;

View File

@@ -19,15 +19,7 @@ public static partial class NetworkManager
public static bool ConnectServer(string serverAddress = "localhost", bool listenServer = false)
{
if (!listenServer)
{
Cleanup();
//WorldStateManager.Init();
clientWorldStateManager = new WorldStateManager(isClient: true);
}
else
{
clientWorldStateManager = new WorldStateManager(isLocalClient: true);
}
ServerAddress = serverAddress;
//var driver = Object.New(typeof(ENetDriver));
@@ -56,6 +48,17 @@ public static partial class NetworkManager
Console.Print("Failed to connect to the server.");
return false;
}
Debug.Log("Connected...");
if (!listenServer)
{
//WorldStateManager.Init();
clientWorldStateManager = new WorldStateManager(isClient: true);
}
else
{
clientWorldStateManager = new WorldStateManager(isLocalClient: true);
}
Scripting.FixedUpdate += OnClientNetworkUpdate;
if (!listenServer)

View File

@@ -99,6 +99,8 @@ public class WorldStateManager
else
NetworkManager.RegisterClientMessageCallback(OnMessage);
Debug.Log($"WorldStateManager Init is server: {IsServer}");
Debug.Log($"WorldStateManager Init is local client: {IsLocalClient}");
PhysicsScene localPhysicsScene = Physics.FindOrCreateScene(IsLocalClient ? "ClientPhysicsScene" : "ServerPhysicsScene");
@@ -158,7 +160,7 @@ public class WorldStateManager
var importer = FlaxEngine.Object.New<Q3MapImporter>();
importer.mapPath = @"C:\dev\GoakeFlax\Assets\Maps\aerowalk.map";
importer.LoadCollidersOnly = false;//IsServer;
importer.LoadCollidersOnly = IsServer;
importer.Parent = scene;
//importer.Enabled = true;
@@ -182,6 +184,13 @@ public class WorldStateManager
{
FlaxEngine.Object.Destroy(player);
}
if (scene)
{
if (Level.UnloadScene(scene))
throw new Exception("Failed to unload scene");
scene = null;
}
}
private PlayerFrame GetPlayerFrame(uint playerIndex, ulong playerFrameIndex)
@@ -256,7 +265,9 @@ public class WorldStateManager
//PlayerInputState inputState = playerMovement.input.GetCurrentInputState();
var playerFrame = playerLastFrame[playerId];
if (!playerMovement.input.GetState(playerFrame, out var inputState, out var actorState))
Console.Print("send input failure to client");
{
//Console.Print("send input failure to client");
}
{
NetworkMessage message = NetworkManager.ServerBeginSendMessage();

View File

@@ -53,7 +53,7 @@ public class PerformanceWidget : Script
StringBuilder text = new StringBuilder(10);
#if false
#if true
long triangles = 0;
long drawCalls = 0;
@@ -67,7 +67,7 @@ public class PerformanceWidget : Script
#endif
text.AppendLine($"{triangles} tris\n {drawCalls} drawcalls");
text.AppendLine($"{(int)Math.Round(1.0f / updateTimeAvg2)}fps2\n");
text.AppendLine($"{(int)Math.Round(1.0f / updateTimeAvg2)}fps2");
#endif
text.Append($"{(int)Math.Round(1.0f / updateTimeAvg)}fps");

View File

@@ -512,7 +512,6 @@ public class Q3MapImporter : Script
bool useStaticBatching = StaticBatching && !LoadCollidersOnly;
bool convexMesh = true;
FlaxEngine.Debug.Log("Loading map, static batching: " + useStaticBatching);
{
string matBasePath = Path.Combine(AssetManager.ContentPath, "Materials");
@@ -1317,6 +1316,19 @@ public class Q3MapImporter : Script
Console.Print($"Generated level SDF in {sw2.Elapsed.TotalMilliseconds}ms");
});
}
//Content.AssetDisposing += Content_AssetDisposing;
//Content.AssetReloading += Content_AssetReloading;
}
private void Content_AssetReloading(Asset obj)
{
Debug.Log("asset reload: " + obj.Path + $" ({obj.TypeName})");
}
private void Content_AssetDisposing(Asset obj)
{
Debug.Log("asset disposing: " + obj.Path + $" ({obj.TypeName})");
}
private void ParseLight(MapEntity entity, ref int lightIndex)
@@ -1395,6 +1407,10 @@ public class Q3MapImporter : Script
light.ShadowsDistance = 500f;
light.ShadowsDepthBias = 0.027f;//0.005f;
#if FLAX_1_9_OR_NEWER
light.ShadowsUpdateRate = 0.0f;
#endif
int preset = 3;
if (preset == 0) // most accurate?, huge radius and low performance
{