Dreaming381 / Latios-Framework-Documentation

Documentation and articles for the Latios Framework for Unity's ECS
61 stars 10 forks source link

Help wanted with Kinemation #1

Closed MRfantastic3DGamer closed 1 year ago

MRfantastic3DGamer commented 1 year ago

Hi, I was trying to simulate 1000s of npcs for a war scene in my game and started learning about ECS and trying to figure out how to animate i found this project. I also found Dmotion that works on top of this project but it doesn't work.

when trying to use the shader as explained in the tutorial step 2 , both Latios Vertex Skinning and Latios Deform give this warning

Shader [Shader Graphs/BasicUnitShader] on [Character] does not support skinning. This can result in incorrect rendering. Please see documentation for Linear Blend Skinning Node and Compute Deformation Node in Shader Graph.

Using Linear Blend Skinning removes this warning.

But still the animator baker and skinned mesh baker are also not running on the characters as they are shown in the image in step 2

Am i missing something here.

Dreaming381 commented 1 year ago

Hi!

That error suggests the wrong bakers are being run. Make sure you have a Latios Bootstrap installed that installs the Kinemation bakers.

MRfantastic3DGamer commented 1 year ago

Sorry for late response. I just wanted to check everything myself first so I don't waste your time. The baker that is baking skinned mesh is Unity.Rendering. SkinnedMeshRendererBaker I think this is the fault.

But how do I install Latinos Bootstrap. There is a txt file in that name but no actual c# file.

Dreaming381 commented 1 year ago

In your Project view in your Assets folder, right click, hover over Create and near the bottom there should be Latios which has the options for choosing the bootstrap you want to use.

MRfantastic3DGamer commented 1 year ago

thank you for replying. now i am seeing this error

System.IndexOutOfRangeException: Index {0} is out of range of '{1}' Length. This Exception was thrown from a job compiled with Burst, which has limited exception support. 0x00007ff839f1b8dd(40c1c19ba1fa9dedfef1cf40633f84e) Unity.Entities.JobChunkExtensions.JobChunkProducer`1.ExecuteInternal

Dreaming381 commented 1 year ago

Which version are you using? And can you show the full stack trace? In addition, can you show the full error message you get with Burst disabled? Also, is this exception in the editor or in play mode?

MRfantastic3DGamer commented 1 year ago

the error message in editor

image

also when i tried to run the game this error showed up and crashed unity image

Dreaming381 commented 1 year ago

That answers two out of the four of my questions. But what I really need to know is the version of the framework you are using, and I need you to disable Burst and then touch something in the Editor such that the error doesn't show {0} and {1}. Otherwise you'll have to send me a repro project.

MRfantastic3DGamer commented 1 year ago

the version is 0.7.4 i can't show you the log with burst disabled as after disabling it. unity crashed and now the project won't open.

I have added the project to github here.

Dreaming381 commented 1 year ago

Thank you! I will investigate before the end of this weekend.

Dreaming381 commented 1 year ago

Hi,

I have investigated the project and found several issues.

First, it appears the Latios Framework is installed via filepath instead of via git URL or package embedding. This could be the reason the project would not open again for you. You can fix this in the manifest.json by replacing the Latios Framework line with the following:

"com.latios.latiosframework": "https://github.com/Dreaming381/Latios-Framework.git",

Second, I did not observe the error you reported in SampleScene until entering play mode. I'll get to those errors, but I also had Unity crash. To help Unity be more stable, I suggest making the following two changes to the LatiosBootstrap.

// Add this line, which will cause systems to stop running after one of them encounters an exception.
// This will let you debug systems one by one without the error cascading and creating a mess of errors and overall instability.
world.zeroToleranceForExceptions = true

// Comment out Myri if you aren't using it, as Unity struggles with unused Myri for some reason.
//Latios.Myri.MyriBootstrap.InstallMyri(world);

Third, it appears you have a singleton error with NavigationGlobalProperties.

Fourth, it appears you are trying to use Unity Transforms in a project that has QVVS Transforms installed, as I am getting the following error in ECB Playback:

ArgumentException: A component with type:Unity.Transforms.LocalTransform has not been added to the entity.

This is NOT supported. If you wish to use Unity Transforms with Kinemation, please install the Latios Framework 0.8 alpha and add the scripting define LATIOS_TRANSFORMS_UNITY to your project.

Fifth, there does appear to be an issue where Kinemation is choking on the invalid entities and throwing exceptions. I will consider this and may add a sanitization system in a future release.

Lastly, I opened up the Navigation scene, and this time encountered the error in the Editor you described. This is the offending archetype: image Once again, the issue is that you are mixing transform systems. Either remove the physics from the prefab, uninstall Unity Physics, or switch to Latios Framework 0.8 alpha and add the scripting define LATIOS_TRANSFORMS_UNITY to your project.

I hope that helps!

MRfantastic3DGamer commented 1 year ago

After defining LATIOS_TRANSFORMS_UNITY the TransformsBakingBootstrap and TransformsBootstrap gets commented out as they are inside

if !LATIOS_TRANSFORMS_UNCACHED_QVVS && !LATIOS_TRANSFORMS_UNITY

and then LatiosBakingBootstrap ,LatiosEditorBootstrap and LatiosBootstrap don't work.

Dreaming381 commented 1 year ago

That is correct. You should remove those lines from the bootstrap, as they serve no purpose anymore with Unity Transforms.

Dreaming381 commented 1 year ago

Closing, as 0.8.0 is released and likely resolves most of the issues raised here.