How do i get the custom content processor from XTiled to work with the new Monogame content processor?
You need to rebuild the custom content assembly as a stand alone c# class library – and be sure to follow the directions here. http://www.monogame.net/documentation/?page=Using_The_Pipeline_Tool
Scroll down to the section labeled
Custom Content Processors
for more specific directions.
Once you create a new class library and rebuild (be sure to reference MonoGame assembles instead of XNA) the assembly works with the content pipeline tool.
I’m using XTiled assemblies built this way on both OSX and Win32 targets.
Hope this helps.
Hey ah. Did you have a problem on asset set as a non-content file? I keep having that one although I pretty sure that I set my build to content and copy as always.
@James does this still work with MonoGame 3.8? I’ve just set up a MonoGame dev environment. Have not programmed in XNA for at least 6 years - back when it still was XNA. Now I want to get back at it - and i figured that i would start with porting my old XNA 4.0 games. However - those are heavily dependent on the xTiled assembly (funkworks).
I’ve spent a couple of days now trying to find a workable version of xTiled for the latest MonoGame version whilst also trying to understand the monogame content pipeline.
Please does anyone have a github link to a pre-compiled version of xTiled that can be used with the content pipeline tool?
All I’ve found so far is this https://github.com/jvlppm/xtiled which seems rather outdated.
You will have problems using the pre-compiled version with MonoGame 3.8 because it now targets .NET Core 3.1 instead of .NET 4.5. You’d have better luck tryinig to link them to 3.7.1 because it still targets .NET 4.5. Your best solution would be creating a new MonoGame 3.8 library and add the files manually. You are best to follow the migration guide from 3.7.1 to 3.8 for porting your old XNA code. That is creating a new base project, add your existing code and modify the .csproj files. At least that is the approach I take when migrating to the new version of MonoGame.
edit Welcome to the forums!
@Synammon Thanks for the reply!
Couple of followup questions:
“Your best solution would be creating a new MonoGame 3.8 library and add the files manually.”
Are you talking about the whole game here or just the xTiled assembly?
Even if i got the xTiled codebase up-to-date - wouldnt i still need to compile it as an DLL and refrerence it in the Pipeline Tool ? Much like you reference MonoGame.extended.pipeline for loading TMX files as “TileMaps”?
Yes, you will need to reference the new assembly in the MonoGame Pipeline Tool in order to import the files. I’d suggest looking at the migration guide from 3.7.1 to 3.8 as I follow it in order to migrate projects to 3.8.
The XNA migration guide might be useful as well.
Thanks @Synammon. I dont have any problem porting the game itself to latest MonoGame. The problem is just getting xTiled working with 3.8. If I were able to create a brand new 3.8 project that would be able to load and draw TMX maps using xTiled I would be more than satisfied.
I managed to use the old xTiled TMX mapper by loading the TMX as a XDocument and passing it manually to the xTile processor. Had to do some tweaking of course but the games now run on MonoGame 3.8 Open GL.
@James Im still interested in Custom Content Processors - but the link is broken. Is there any new documentation?
I haven’t gone through any investigation efforts in regards to MonoGame 3.8.
Some ideas for consideration:
I saw some documentation here on creating a pipeline assembly compatible with 3.8
Install the new mg template via the dotnet templating tools. You need to install the templates first, then you can create a
dotnet new -i MonoGame.Templates.CSharp
dotnet new mgpipeline
Once that’s complete maybe (big maybe) you can drop in the XTiled csharp files from their github?
Hi @James! Thanks for the suggestion. Allthough, I actually started looking at a manual mapping from Monogame.Extended.Tiled tol Xtiled. The generall idé is to load the TMX through the Content Pipeline using Extended.Tiled then parse the Extended.Tile data to the original Xtiled objects.
Other options would be to use another TMX loader such as TiledSharp but as of now I believe MonoGame.Extended is the only lib that actually loads the TMX through the 3.8 Content Pipeline.