Comments (12)
I was receiving build failures that only indicated MCGB.exe crashed with only an exit code as feedback.
It would be good to reproduce that crash. It should have given you a more clear error message like:
font.spritefont() - Error: The font "Pericles" was not found!
That would have made things much easier to figure out.
Still... yea the samples need to include any custom fonts it uses.
from monogame.samples.
@tomspilman Yes, I would think the same build output you see in the Pipeline editor when building there would be the same output in the VS output windows. I.e. MSGB.exe compile step would have its output piped to the VS output window. Maybe it would be appropriate to have verbose switches to limit output to warnings/error by default so as not to clutter the output.
from monogame.samples.
Yes, I would think the same build output you see in the Pipeline editor when building there would be the same output in the VS output windows.
It should be. Are you saying you saw different output in VS than you saw in the Pipeline tool?
from monogame.samples.
Correct. When the font was not installed on my computer, when building from VS, a "MGCB has stopped working" dialog appears and the error in the Error List is:
The command ""C:\Program Files (x86)\MSBuild\MonoGame\v3.0\Tools\MGCB.exe" /@:"C:\Users\aaron\Downloads\MonoGame.Samples-develop\MonoGame.Samples-develop\Platformer2D\Content\Platformer2D.mgcb" /platform:WindowsGL /outputDir:"C:\Users\aaron\Downloads\MonoGame.Samples-develop\MonoGame.Samples-develop\Platformer2D\Platforms\WindowsGL\Content\bin\WindowsGL" /intermediateDir:"C:\Users\aaron\Downloads\MonoGame.Samples-develop\MonoGame.Samples-develop\Platformer2D\Platforms\WindowsGL\Content\obj\WindowsGL" /quiet" exited with code -532462766.
If I look at the build output there is an unhandled exception from MGCB:
1> Unhandled Exception: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
1> Parameter name: index
1> at System.Collections.Generic.List`1.get_Item(Int32 index)
1> at Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler.Texture2DWriter.Write(ContentWriter output, Texture2DContent value)
1> at Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler.ContentWriter.WriteObject[T](T value)
1> at Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler.SpriteFontContentWriter.Write(ContentWriter output, SpriteFontContent value)
1> at Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler.ContentCompiler.Compile(Stream stream, Object content, TargetPlatform targetPlatform, GraphicsProfile targetProfile, Boolean compressContent, String rootDirectory, String referenceRelocationPath)
1> at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.WriteXnb(Object content, PipelineBuildEvent pipelineEvent)
1> at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.BuildContent(PipelineBuildEvent pipelineEvent, PipelineBuildEvent cachedEvent, String eventFilepath)
1> at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.BuildContent(String sourceFilepath, String outputFilepath, String importerName, String processorName, OpaqueDataDictionary processorParameters)
1> at MGCB.BuildContent.Build(Int32& successCount, Int32& errorCount)
1> at MGCB.Program.Main(String[] args)
from monogame.samples.
@AaronLS - Yea... that should have been handled a lot cleaner. A) the font processor should have failed when the font wasn't found B) the XNB writer should be capturing content building exceptions and reporting a good error message.
I'll see about correcting both of these in the pipeline code.
from monogame.samples.
For now I've just submitted a PR to change the font used in the sample to Arial. #33
This ensures that all machines will be able to build the samples without extra stuff
from monogame.samples.
Simply shipping the font with the source code doesn't help as fonts need to be installed. So this should be shipped at part of MonoGame since that's what XNA 4.0 Game Studio did (note that 3.x did NOT - developers had to install it themselves)
I have no clue if the license Microsoft got with Ascender allows us to do that thugh - someone else would need to determine that http://xbox.create.msdn.com/en-US/education/catalog/utility/font_pack
Here's the spritefont schema http://msdn.microsoft.com/en-us/library/bb447759.aspx - it doesn't allow multiple fonts to be selected like CSS. Its pretty rare you would want that - fonts are so different in sizes that even a simple font switch can totally change the game layout.
Obviously the font processor needs a better error but installing the XNA font pack would be a much better solution if legally allowed.
from monogame.samples.
it doesn't allow multiple fonts to be selected like CSS
Yea... you don't want the font selection to be fuzzy like that. It should always select the desired font or error out.
I think we support looking for the font TTF in the same folder as the .spritefont folder. That is as good as we can get I think without requiring users install the font into the system.
from monogame.samples.
Well that's a cool feature that XNA didn't do and would work well for samples since we can ship the TTF with the sample.
from monogame.samples.
I think we support looking for the font TTF in the same folder as the .spritefont folder.
Nice. Side-by-side like this is really great because it makes it easy for others to get-latest and compile without interference from variations in their own local environment.
from monogame.samples.
without interference from variations in their own local environment.
Yeah... that is exactly why we wanted that feature.
from monogame.samples.
@AaronLS can you close this issue since it is no longer an issue?
from monogame.samples.
Related Issues (20)
- Mac Sample build configuration issues HOT 2
- Mac Platformer2D GLError: InvalidFramebufferOperationExt HOT 1
- Microsoft.Xna.Framework.Graphics Missing HOT 2
- Loading Song on MS Windows HOT 1
- Platformer2D - MSBuildExtensionsPath not set?!
- .NET Core/Standard HOT 3
- Platformer2D builds on Windows 10 but not on macOS 10.15.1 HOT 1
- Updating MonoGame.Samples for 3.8 HOT 6
- What's the license for this project? HOT 1
- .NET 5.0 compatibility HOT 2
- Missing README.md for NeonShooter HOT 1
- cant update to mg 3.81 HOT 2
- should update to net 6 libs , for 3.81 since netstandard 2.0 isnt supported for MG game code, people might be confused. HOT 6
- NeonShooter Sample doesn't build with clean install of MonoGame 3.8.1 HOT 2
- Platformer2D sample is not building due to missing font file HOT 1
- Feature Request: Add automated building to validate the samples.
- ShipGame: Only UI shows in game view on DX HOT 1
- ShipGame: Ships do not show on ship selection screen on DX HOT 1
- ShipGame: Title screen does not animate on DX, but does on GL HOT 1
- Dead Links
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from monogame.samples.