All Projects → Martenfur → Nopipeline

Martenfur / Nopipeline

Licence: MIT license
A Monogame Content Pipeline enhancer.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Nopipeline

MonoGame.Primitives2D
Easy-to-use 2D primitives
Stars: ✭ 44 (-71.05%)
Mutual labels:  monogame, monogame-framework
Steamworks.Net-MonoGame-Integration
This repo is for everyone who is about to integrate the Steamworks.Net.dll into a MonoGame project. It shows some Steamworks.Net features and how easy it is to integrate it into a MonoGame project.
Stars: ✭ 30 (-80.26%)
Mutual labels:  monogame, monogame-framework
cocos2d-mono
Continuation of Cocos2D-XNA project, with focus on MonoGame
Stars: ✭ 18 (-88.16%)
Mutual labels:  monogame, monogame-framework
MonoGame.SplineFlower
Create wonderful smooth Bézier-, CatMulRom- and Hermite-Splines with Trigger Events for your MonoGame project.
Stars: ✭ 18 (-88.16%)
Mutual labels:  monogame, monogame-framework
MLEM
MLEM Library for Extending MonoGame provides extension methods, improvements and additional features like a ui system and easy input handling.
Stars: ✭ 26 (-82.89%)
Mutual labels:  monogame, monogame-framework
MonoGame.Forms
MonoGame.Forms is the easiest way of integrating a MonoGame render window into your Windows Forms project. It should make your life much easier, when you want to create your own editor environment.
Stars: ✭ 183 (+20.39%)
Mutual labels:  monogame, monogame-framework
Sadconsole
A .NET ascii/ansi console engine written in C# for MonoGame and XNA. Create your own text roguelike (or other) games!
Stars: ✭ 853 (+461.18%)
Mutual labels:  monogame
Easy Extends
一个简单快速安装PHP扩展的程序--最简单的方法就是使用Linux
Stars: ✭ 85 (-44.08%)
Mutual labels:  monogame
Pixelvision8
Pixel Vision 8's core philosophy is to teach retro game development with streamlined workflows. PV8 is also a platform that standardizes 8-bit fantasy console limitations built on top of the open-source C# game engine based on MonoGame.
Stars: ✭ 773 (+408.55%)
Mutual labels:  monogame
Barotrauma
A 2D online multiplayer game taking place in a submarine travelling through the icy depths of Jupiter's moon Europa.
Stars: ✭ 547 (+259.87%)
Mutual labels:  monogame
Penumbra
2D lighting with soft shadows for MonoGame
Stars: ✭ 207 (+36.18%)
Mutual labels:  monogame
Protogame
This project has been sunset as of 1st Jan 2018 and is no longer supported or maintained
Stars: ✭ 166 (+9.21%)
Mutual labels:  monogame
C3de
C3DE is a 3D Game Engine powered by MonoGame
Stars: ✭ 78 (-48.68%)
Mutual labels:  monogame
Monogame.extended
Extensions to make MonoGame more awesome
Stars: ✭ 908 (+497.37%)
Mutual labels:  monogame
P3d Legacy
Legacy repository for the Pokémon3D Visual Basic version
Stars: ✭ 122 (-19.74%)
Mutual labels:  monogame
Apos.input
Polling input library for MonoGame.
Stars: ✭ 25 (-83.55%)
Mutual labels:  monogame
Monogame.forms
MonoGame.Forms is the easiest way of integrating a MonoGame render window into your Windows Forms project. It should make your life much easier, when you want to create your own editor environment.
Stars: ✭ 165 (+8.55%)
Mutual labels:  monogame
Awesome Monogame
A collection of interesting libraries/tools for Monogame based game projects
Stars: ✭ 655 (+330.92%)
Mutual labels:  monogame
Nez
Nez is a free 2D focused framework that works with MonoGame and FNA
Stars: ✭ 1,168 (+668.42%)
Mutual labels:  monogame
Magicallife
A 2d game that aspires to be similar to Rimworld, with more depth, magic, and RPG concepts.
Stars: ✭ 145 (-4.61%)
Mutual labels:  monogame

Nopipeline

Nopipeline

nuget

For some reason, the only Monogame's resource manager, Pipeline tool, is a total pain in the ass to work with. A lot of stuff which should've been automated is instead painfully done by hand in a crappy UI. After you've dragged and dropped 100 pngs one by one, you come to realization that the Pipeline tool is nothing but tears and sadness.

So what shall we do about all this?

Fear not - Nopipeline comes to the rescue. It's an addon for Pipeline Tool, which generates and updates .mgcb config for you. You can safely add, delete and move around resource files directly in Explorer - Nopipeline will do the rest for you.

Additionally, you can make resource files watch other files! Let's say, you got Tiled map project. It has one main .tmx file and a bunch of textures and tileset files. But Pipeline Tool has referenced only .tmx file, so if you update only texture or only tileset, you have to either update the .tmx or do a manual rebuild, because Pipeline Tool doesn't know about files other than .tmx.

With Nopipeline you don't have to do any of that - just set .tmx file to watch textures and tilesets - and Pipeline Tool will detect and update everything by itself.

Sounds cool and all, but is it compatible with my existing setup/engine/pipeline extensions?

Nopipeline is not a Pipeline Tool replacement - it's an addon. Its only function is to scoop up all resource files and put them into .mgcb config. The rest of the resource compilaton process will go exactly the same. You can add or remove Nopipeline at any point in development, and nothing will break. Nopipeline won't override resources which already exist in the .mgcb config and will leave a perfectly valid config after itself.

Now we're talking. How do I integrate this thing in my project?

First of all, install the Nopipeline.Task via Nuget. After that, you will need a NPL config. NPL config is what Nopipeline uses to generate MGCB config. Nopipeline will generate an empty NPL config automaticaly on first build. After that, you can just delete MGCB config. Yep, that's right, you don't need it anymore - Nopipeline will generate a new MGCB automatically. I also recommend adding your .mgcb files to the gitignore.

Now you need to understand how NPL config works and fill it up with rules so that Nopipeline would know what content goes where. NPL config looks like this:

{
	"root": "../Path/To/Your/Content/",
	"content": 
	{
		"textures": 
		{
			"path": "Textures/*.png",
			"recursive": "True",
			"action": "build",
			"importer": "TextureImporter",
			"processor": "TextureProcessor",
			"processorParam": 
			{
				"ColorKeyColor": "255,0,255,255",
				"ColorKeyEnabled": "True",
				"GenerateMipmaps": "False",
				"PremultiplyAlpha": "True",
				"ResizeToPowerOfTwo": "False",
				"MakeSquare": "False",
				"TextureFormat": "Color",
			}
		},
		"specificFile": 
		{
			"path": "Path/To/File/specificFile.txt",
			"recursive": "False",
			"action": "copy",
		}
	}
}

It is essentially a JSON. Config above has two content rules: textures and specificFile. Each rule describes one specific resource type. Rules can affect entire directories or specific files.

Let's look at an each parameter:

  • root is appended to each path field unless specified otherwise. This is an optional field.
  • path is a path to the resource files relative to the main Content folder. Here are some examples:
    • Graphics/Textures/texture.png will grab only texture.png file.
    • Graphics/Textures/*.png will grab any .png file.
    • Graphics/Textures/* will grab any file in the Textures directory.
    • $Graphics/Textures/* will ignore root property. NOTE: Rule paths cannot contain ../. Use root if you need those.
  • recursive tells Nopipeline to include resource files from subdirectories. For example, if set to True, and the path is Graphics/Textures/*.png, files from Graphics/Textures/Subdir/ will be grabbed as well. If set to False, they will be ignored.
  • action tells what action has to be done for this rule. Can be build or copy.
  • importer tells what importer should be used for building. Ignored if action is set to copy.
  • processor tells what processor should be used for building. Ignored if action is set to copy.
  • processorParam is an optional list of processor parameters, if resource has any.

There is also an optional watch parameter. Its usage looks like this:

{
	"content": 
	{
		"spriteGroup": 
		{
			"path": "Graphics/*.spritegroup",
			"recursive": "True",
			"action": "build",
			"importer": "SpriteGroupImporter",
			"processor": "SpriteGroupProcessor",
			"watch": 
			[
				"Default/*.png",
				"Default/*.json",
			]
		},
	}
}

With watch parameter present, all the .spritegroup files will be built by Pipeline Tool, if any .png or .json file will be changed. Note that all the paths listed in watch are relative to the main path, so final paths will look like this: Graphics/Default/*.png.

But that's not all. Nopipeline also provides an extended reference management. Add references section into your .npl config like this:

{
	"references":
	[
		"%PROGRAMFILES%/YourLibDir/Library.dll",
		"RelativePath/RelativeLibrary.dll",
		"OtherPath/*.dll",
	],
	"content": 
	{

	}
}

With Nopipeline you can use environment variables like %PROGRAMFILES% - something Pipeline Tool can't do by itself. If referenced libraries are missing, Nopipeline will delete their entries from config. Additionally, you can add references the old way from the Pipeline Tool - Nopipeline will not delete them unless the files themselves don't exist. References also support wildcards just like normal file paths.

With NPL config done, save it in the same directory as MGCB config and give it the same name. For example, if your MGCB config is named Content/Content.mgcb, your NPL config should be Content/Content.npl

You can also include NPL in Visual Studio project, if you want.

If you want more seamless pipeline-forgetting experience, you can check out Monofoxe Engine, with Nopipeline integrated out of the box.

Running the sample.

Before running the sample, build Nopipeline.Sample.Content project. This will build the custom pipeline extension.

All the other stuffs.

The thing is licensed under MPL 2.0, so you can use it and its code in anything you want for free.

Huge thanks to MirrorOfSun, who wrote most of the code.

Don't forget to pet your foxes.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].