Hellknight

I’m home in about one and a half hours depending on traffic. Then I will have a little time window of one hour to try this out before I have to leave again. Don’t know when I’ll be back home, I think at night. I thinking about a day off to work on MonoGame projects :smile:

1 Like

Changed the line and everything compiled just fine. Now I tried to rebuild all content, to make it compatible with the latest MonoGame source version. I was getting several “Bad tangent!” popups but all content got compiled and nothing was marked as failed.

So far so good. I looked up the old XNA project, what the setup for importer and processor was for the hellknight model. It was set to “MD5Importer” and “MD5Process”. Now after setting up the reference to the MD5ContentPipeline project inside the pipeline tool I can only find the “MD5Process” entry for the model processor. I think these images explain it very good.


Also another issue is, that I opened up the MGCB file from my “EngineMG” project and some content appears at a wrong level. By level I mean directory level. I have directories for shaders, textures and so on. Also I think it should be explained good by an image what I mean (also notive the path visible in the image).

I’m already late so I cannot try to just readd all content to a new MGCB file… Maybe then it works?!

Hmm, I don’t know why the importer wouldn’t show up… When you have time to look at this again can you double check if the same syntax is used as the built in importers?

I haven’t seen the treeview issue before either, but it’s probably not an issue when building.

What I can say now after some more tests is that if I create a new MGCB with the MonoGame pipeline tool from the latest source and add all folders (add existing folder for the five top level folders) all works as it should. So the new pipeline tool has some problems reading the old MGCB file.

Also the NullPointerException in CellBase.cs occured because I did not specify a string like so:

[ContentProcessor(DisplayName = "MD5Mesh Processor")]

Now that I added this to both the importer and processor, they show up in the pipeline tool and I can select the hellknight.md5mesh file without NullPointerException.

A KeyNotFoundException is thrown when I try to build the hellknight.md5mesh file:

Build started 28.01.2017 00:27:30

C:/MonoGame/EngineMG/EngineMG/Content/model/hellknight/hellknight.md5mesh
C:/MonoGame/EngineMG/EngineMG/Content/model/hellknight/hellknight.md5mesh: error: Importer 'MD5Importer' had unexpected failure!

System.Collections.Generic.KeyNotFoundException
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Microsoft.Xna.Framework.Content.Pipeline.Graphics.MeshHelper.IndexUpdateList.Update(Int32 from, Int32 to) in C:\MonoGame.Framework.Content.Pipeline\Graphics\MeshHelper.cs:Zeile 710.
   at Microsoft.Xna.Framework.Content.Pipeline.Graphics.MeshHelper.MergeDuplicatePositions(MeshContent mesh, Single tolerance) in C:\MonoGame.Framework.Content.Pipeline\Graphics\MeshHelper.cs:Zeile 414.
   at Microsoft.Xna.Framework.Content.Pipeline.Graphics.MeshBuilder.FinishMesh() in C:\MonoGame.Framework.Content.Pipeline\Graphics\MeshBuilder.cs:Zeile 162.
   at MD5Loader.MD5Importer.createMesh(NodeContent rootNode, SMeshInfo mesh) in C:\MonoGame\EngineMG\MD5LoaderPipelineExtensionLibraryMG\CMD5Importer.cs:Zeile 559.
   at MD5Loader.MD5Importer.Import(String filename, ContentImporterContext context) in C:\MonoGame\EngineMG\MD5LoaderPipelineExtensionLibraryMG\CMD5Importer.cs:Zeile 168.
   at Microsoft.Xna.Framework.Content.Pipeline.ContentImporter`1.Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import(String filename, ContentImporterContext context) in C:\MonoGame.Framework.Content.Pipeline\ContentImporter.cs:Zeile 45.
   at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.ProcessContent(PipelineBuildEvent pipelineEvent) in C:\MonoGame.Framework.Content.Pipeline\Builder\PipelineManager.cs:Zeile 651.

Build 0 succeeded, 1 failed.

Time elapsed 00:00:00.57.

Crap, that’s definitely a bug in the implementation :confused: Are you willing to share the project so I can debug this?

EDIT: Hold on, I think I might now what I’m doing wrong. I’m gonna try and write a test that catches this and get a fix in.

I now realize I made some big mistakes when implementing this :frowning: I’ll see if I can get this fixed.
EDIT: It’s not as bad as I initially thought :stuck_out_tongue: I think this is actually not that hard to fix!
EDITEDIT: I set up a PR with my fixed, the build bots are having some issues currently, so the only way to try it is from source if you’re up for that @Kwyrky. PR is at https://github.com/MonoGame/MonoGame/pull/5444

Found a few more screenshots :slight_smile:


1 Like

Damn, I really need to get this implementation right :stuck_out_tongue:

1 Like

Animation stuff is not that easy. How complicated is it?

I was just talking about the meshbuilder. It’s the vertex merging code that has some issues. It’s a bit complex because you have to compute hashes and use some indirection for addressing indices to get it to be reasonably fast. If you do it naively it’s N^2 complexity and takes way too long for a practical number of vertices. Don’t you have custom classes for animation?

I meant how complicated is the MeshBuilder implementation :slight_smile:
Was saying that animation stuff is not easy because I thought this is perhaps the thing which makes it difficult to implement the MeshBuilder. But as I now understood it seems to be the vertex merging, so the part, which gets rid of unnecessary doubles of vertices?!

Yes, exactly. There’s nothing difficult about MeshBuilder itself :slight_smile: It does not support animation.

Good to hear that its now “only” the merging stuff, which is in the way of using the hellknight in MonoGame :slight_smile:

@Jjagg
How is it going with the MeshBuilder?

Haven’t worked on it anymore. I put too much on my plate all at once :stuck_out_tongue: I’ll try and get back to it soon.

Just let me know, when it is ready to be used @Jjagg

I’ll do that. I’d really like to fix this up in the next few weeks, but uni is swamping us with projects this semester and that takes priority, so no guarantees :confused:

In the meantime, I will try to convert some more XNA projects to MonoGame :slight_smile:

1 Like

If anybody is interested in the XNA 4.0 content pipeline extension plus the animated model with textures, send me a pm. I don’t have the time or the knowledge to modify the MonoGame source, so that the model can be imported to MonoGame. But maybe someone wants to look at it.

That’d be great. If anyone wants to help out, ping me and I’ll get you started.