monogame issues (bugs/functionality missing)

i’m really struggling with monogame.
making 2d games is easy. but anything sort of complex is a no-go.

i try to compile kosmonaut’s modelviewer

github - Kosmonaut3d/Modelviewer

and i get an error that monogame cannot find SHARPDX.DLL
i looked into this. it seems to be a bug that at least a few people have run into. i tried EVERY workaround.
i pasted sharpdx.dll directly into the output folder. no luck. i added it to the references. nothing. i added the dll to the project. no result. i set up the property on the compiler for this DLL to be an embedded resource. not working.
i set up the entry point of the application to load assemblies like someone mentioned here:

stackoverflow - questions/21035400/could-not-load-file-or-assembly-sharpdx

it does not work.
i even tried installing other monogame releases.
to no avail.

ok. so i give up on that.
i try to compile kosmonaut’s engine.

github - Kosmonaut3d/DeferredEngine

now it is bugging out in different ways (it is not even consistent) sometimes i get a black screen. sometimes i get an error that the model trying to be drawn is not found. sometimes it straight up tells me that the graphics device is REMOVED. (WHAT?) sometimes i get an error telling me that SDL2.DLL is not there… this is the most workable error (and the one that actually points to what is happening)

so i paste SDL2.DLL from the assemblies into the output folder, and i can actually compile, but keyboard/mouse input Doesn’t work. at all. then if i close it and try to recompile, we’re back to black screens…

so, i give up on this too…

then i try to compile my xna little projects. (my bag of tricks!!! nothing extremely fancy like a deferred renderer, but stuff like rendering screen-space normals to the screen…)
now i am finding out that i simply CANNOT generate tangent frames for models with monogame content pipeline. this won’t let me do any fancy rendering at all… i am stuck with graphics from the year 1999

(some thread claims that this is fixed, but it is not fixed. i tried using the open asset importer, i tried forcing the pipeline to generate these tangent frames but it just compiles to a black screen… - i have not tried if the 3.7 dev release works with fbx tangent frames, but my .x file is not having it’s tangent frames generated)

other stuff is also BIZARRE.

there is a monogame.framework.content.pipeline.dll (or is it XNA framework content pipeline dll? i don’t know what the name is but it’s the monogame version) that projects use. but the assemblies of monogame does not include this file.
the only place i’ve found it is with tainicom’s aether extra project

github - /tainicom/Aether.Extras

so every time i need the content pipeline.dll, i have to add a reference to a project that i downloaded…
all i can do is laugh… because i do not want to cry

what is going on?
i have seen threads on this site (official monogame site) that claim these issues are fixed and the issues threads are closed. but these issues are not fixed for me!!!

please, anyone that can point me to the light… what can i do???

what am i missing!??! i would appreciate some help.
i really cannot learn how to work in monogame to fix my animations (in monogame the skinnedmodel animations are choppy compared to XNA)
if i cannot compile even the work of people who DO have it working. because i am sure nobody will just explain anything to me or make a tutorial for me. but even my usual approach of reverse engineering is impossible…

i am working with windows7, monogame 3.6 (i actually just switched to 3.7 development build!!! did no good either) and visual studio 2017.

sure it works fine if i try to compile a 2d platformer. but that’s not what i’m trying to do.

i know that it should work, because kosmonaut has an amazing deferred renderer working, with a thousand bells and whistles.
but i cannot even compile it 90+% of the time…

somebody please help???

i asked cosmonaut himself. but he doesn’t know what’s going on. he’s been really nice and i admire him.
but i just cannot fathom how he solved these issues? i am assuming he didn’t run into most of these…

I am no expert, but there seems to be 2 ways to get MonoGame framework into your project; either installing the SDK and starting a new project using the Visual Studio templates it installs, or using nuget. If Kosmonauts projects don’t work then I would say that’s Kosmonauts problem. Perhaps start with the first method I mention and work from there rather than starting with a complex project.

1 Like

Not sure if this is a monogame issue since you are trying to use external libraries. Just as trojanfoe suggested, I think you should uninstall everything and reinstall everything from scratch (visual studies, monogame, etc…). With all the missing dlls, I wonder if something got messed up. After the fresh install, create an empty monogame project with no external libraries and start it up to make sure it works (with no dll problems). If it starts, it likely isn’t monogame.

Just looking at the libraries you mentioned. You should probably try to use the exact version of visual studio and the exact version of monogame they were built with especially since you’ve had so many compiling problems.

  • The Aether .sln file comment says it was built on VS 2013 v12.0.40629.0. I think it is monogame
  • The DeferredEngine and ModelViewer .sln says it was built on VS 2015 v14.0.25420.1. I can’t find a reference to a version of monogame.

I’m not an expert in Visual Studios but you mentioned you are using VS 2017. With all the compile issues you are stating, I’d use an older version since these libraries were made on older version.

Sorry I couldn’t suggest more. That is all I can think of… good luck dude.

The aether.extras importers/exporters all reference the nuget package of monogame.framework.content.pipeline.dll. You can reference this package directly from your project. You can also find the DLL in the installation directory of MonoGame SDK .

Ah yes! That one can be frustrating when you move code from XNA. In XNA the importer returns interpolated keyframes (60Hz), MG doesn’t do that.
You could, A) bake the animation while exporting your fbx. B) interpolate the keyframes during runtime (a trade of CPU vs. memory). C) Let the processor handle the interpolation. You can copy the code from tainicom.Aether.Content.Pipeline.Processors if you like. look for AnimationsProcessor.GenerateKeyframesFrequency and InterpolateKeyframes().

thank you Nkast!!!

i will try that very soon!!

i actually managed to compile kosmonaut’s deferred renderer now.
the actual problem was REALLY WEIRD…

this actually fixed it:

never in a million years i would have guessed that this was it. but it was… :confounded:

Hi @nkast!
I tried your animations sample with another model. I tried the fish model mentioned in the Modelviewer thread from @kosmonautgames The animation works but it isn’t as smooth as it should be. Has this something todo with the things mentioned in the quote above? I guess yes, so what is this Generate Keyframes Frequency value and which value is recommended? I checked, seems to be some value in Hz, so I think it is the frequency at which interpolated keyframes are calculated from the original keyframes?

Also I have some issues with the samples in Aether.Extras I could resolve some of them but not all yet… I will try a bit more…

Ok, all samples up and running :slight_smile. If anyone runs into it, here is maybe some info that may help:
I ran the BuildShaders.bat files which gave me the mgfxo files. Then I added them as embedded resources to the ones already existing in the solution but added “.9” to all filenames before adding them. The existing ones have lower values at the end. The value stands for a specific MG Minor version. I found some places where LoadEffectResourceStream is called. To make sure the Effects are loaded, there has to be a check for the current Minor version (7 in my case) and then adding the right ending to the base resource name. So in FXAAEffect.cs for example I added the marked lines:

        internal static Stream LoadEffectResourceStream(string name)
            // Detect MG version            
            var mgVersion = GetAssembly(typeof(Effect)).GetName().Version;
            if (mgVersion.Major == 3)
                if (mgVersion.Minor == 4)
                    name += ".6";
                if (mgVersion.Minor == 5)
                    name += ".7";
                if (mgVersion.Minor == 6)
                    name += ".8";
                if (mgVersion.Minor == 7) // added this here!
                    name += ".9"; // and this
            Stream stream = GetAssembly(typeof(FXAAEffect)).GetManifestResourceStream(name);
            return stream;

That’s right. To get results similar to the XNA importer, set it to a value of 60 keyframes per seconds. You can set it lower to save in memory and XNB size. Below ~12 Keyframes/sec the animation start to get noticeably choppy.

Those values are the MG mgfx version. The format has not changed since MG 3.6, so the existing mgfxo.8 should work with 3.7 as well.
I wonder why the fallback method did not work though…

1 Like

Thanks :slight_smile: