craftworkgames / MonoGame.Extended

Extensions to make MonoGame more awesome
http://www.monogameextended.net/
Other
1.43k stars 324 forks source link

[TIled] Object reference not set to an instance of an object when trying to build map #700

Open SilenceOfTheLambdas opened 3 years ago

SilenceOfTheLambdas commented 3 years ago

When trying to make a tileset that uses a collection of images instead of 1 image, the following exception is thrown: Screenshot_20201015_125517

This error seems to pertain to the .tsx file, and only the .tmx file if the tileset is embedded into the map.

janfokke commented 3 years ago

Can you post a project that reproduces this problem.

SilenceOfTheLambdas commented 3 years ago

Can you post a project that reproduces this problem.

Here is a link to a snapshot of the repo: https://github.com/sudo-make/Capstone-Project

lithiumtoast commented 3 years ago

Related:

https://github.com/craftworkgames/MonoGame.Extended/issues/475 https://github.com/craftworkgames/MonoGame.Extended/issues/102

lithiumtoast commented 3 years ago

The problem is about assets; currently, there is no middleware to combine collection of images into a single image. This process is better known as "texture packing".

Why is texture packing important? Well, the technical details are that there is a performance penalty for switching textures at runtime when rendering. See https://github.com/craftworkgames/MonoGame.Extended/issues/295

lithiumtoast commented 3 years ago

Looking at this again, there should at least be a better exception message :)