6
votes
Accepted
How to change screen resolution in XNA?
The easiest way is to set it through the GraphicsDeviceManager.
...
6
votes
Accepted
How to convert png images to True Type Font?
Truetype fonts are vector based. So you would have to trace the glyphs with a vector editor and then use a program like FontForge (which also is a vector editor) to build a font from that.
That said, ...
5
votes
Accepted
Efficiently updating building effect radius coverage
Caching building coverage
The idea of caching the information which buildings are in range of an effector-building (which you can cache either from the effector or in the affected) is definitely a ...
5
votes
Accepted
Position vs Destination Rectangle
The simple answer is: the Vector2 positions the sprite at the X,Y coordinates, while Destination rectangle fills the sprite to fit that rectangle.
More advanced answer:
Sprites are in reality quads ...
5
votes
How to correctly enable anti aliasing in XNA?
If anyone here is using MonoGame instead of XNA, the process is ever so slightly different. Notice that we change the graphics profile to HiDef. This allows more ...
5
votes
3D objects with animated bones Monogame in the year 2017, is it possible?
Finally I've found the solution to my problem.
First I've created a new content pipeline by following this blog: http://community.monogame.net/t/tutorial-how-to-get-xnas-skinnedsample-working-with-...
5
votes
Accepted
Is there an advantage to creating a tileset instead of multiple content items?
Nowadays the most important reason to use a tilemap instead of separate pngs is just for organisation. Do you want a stage to have a different theme? Then you simply create a new tilemap, that follows ...
5
votes
Accepted
How does ECS handle systems which need to know more about the environment of the entities it processes?
My solution to this would be to create a component AITarget which marks an entity as something zombies are supposed to attack (like a player or a civilian).
Now ...
4
votes
Drawing huge amount of tiles in Monogame (XNA) efficiently
Graphics cards are optimised to draw a few things lots of times rather than the other way around.
In your case, you have a lot of things (different textures) that you want to draw a lot of times (...
4
votes
Accepted
Why is the mana regenerating too fast?
You forgot to reset your currentTime variable. Do it like this instead:
...
3
votes
MonoGame "couldn't find a default importer" for .txt file?
You're getting this message because the pipeline doesn't contain a content importer for a .txt file. Plain-text files generally don't require any special processing, and don't need to be converted to ...
3
votes
Efficiently updating building effect radius coverage
1. Duplicate work.
Your affectedBuildings are presumably close to each other, so the different radii will overlap. Flag the buildings that need to be updated, ...
3
votes
Accepted
Drawing huge amount of tiles in Monogame (XNA) efficiently
I found out that SpriteBatch is not suitable for drawing tiles. One reason is that sprites are meant for dynamic objects and are used for multiple purposes. Another reason is that it's incredibly CPU-...
3
votes
Accepted
Sprites With Vastly Disparate Scales
Don't represent the carrier with a single sprite. Represent it with a tilemap.
So instead of having one 14000px wide sprite for the carrier flight deck, have a 32x32px sprite for runway without ...
3
votes
MonoGame SetRenderTarget is wiping the backbuffer
I'm going to post this answer as an adaptation from @James Carlyle-Clarke's comment. Because the code formatting in an answer makes it easier to understand. It has also been modified to make it ...
3
votes
Accepted
Why are .xnb files used rather than source files?
It is much simpler to only support a single format at runtime.
A lot of formats just are not suited for quickly loading in the asset it contains. For example wavefront obj is a horrible format for ...
3
votes
Separating Axis Theorem is inconsistent
I am happy to say that I have squashed the bug. The visualisations really aided me and I strongly recommend anybody struggling with anything to try and get whatever it is your working on onto the ...
3
votes
Destroying a ship removes both the ship and the bullets it has fired
As you're probably aware, since the ship is responsible for drawing and moving the bullets it created, the bullets it created will no longer be drawn or updated when their creator is destroyed.
...
3
votes
How to incorporate delta time into movement?
The code you've got there is going to produce some really small numbers.
Let's say your game is running at 60 frames per second (that's pretty typical for MonoGame). The ...
3
votes
How can I store in-game money so that nobody can manipulate the amount?
What I do is store the data in an obscured and verifiable fashion in memory and on disk, only decoding it when necessary. As mentioned in the comments, this will not prevent alteration, but it will ...
3
votes
How to implement ECS architecture in C#?
So a solution to this, as I've just successfully implemented, is to keep and "consume" all data types separately, thus avoiding casting/boxing operations. Every component type has it's own unique ...
3
votes
Is there an advantage to creating a tileset instead of multiple content items?
Here's a little experiment you can do yourself to see why using a texture atlas (or tileset) is a good idea.
The goal is to draw a checker pattern using a ...
3
votes
Accepted
Server game loop
Should I be processing data from all the clients in the same thread like this?
Yes, a single thread for all clients. Although there is an argument for multiple server threads and even they talking ...
3
votes
Accepted
How do I get the full path of Content?
There's a few things you need to understand to get this to work.
First, what you're trying to do will be platform specific. So I'm going to assume you're only concerned with getting it working on ...
3
votes
Accepted
Monogame sprite rotation issue
Nevermind, my (poor) experience in graphics is problem - rotation has to be in radians, not degrees. Solution is MathHelper.ToRadians(rotationInDeg)...
3
votes
Accepted
Monogame - SpriteFont Exception: Text contains characters that cannot be resolved by this SpriteFont
The problem lies in your .spritefont file.
...
3
votes
Accepted
Room Detection on a Tilemap
Here's an example of depth-first search implemented in python, finding all squares of the same type and connected to a given input square:
...
3
votes
Exported FBX to Monogame doesn't translate all meshes
I’m not an expert. I only just recently got into modding using Blender.
I had a similar issue with a custom model I imported into MonoGame using FXB format. What fixed it for me was downgrading to ...
3
votes
Accepted
How to handle octave & frequency in the Perlin noise algorithm?
These functions compute a single octave of noise.
To layer noise into something like Fractional Brownian Motion (FBM), you can invoke one of these functions multiple times.
Let's say I have a noise ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
monogame × 797c# × 402
xna × 399
xna-4.0 × 51
hlsl × 46
shaders × 45
2d × 40
collision-detection × 39
windows-phone-8 × 35
3d × 25
textures × 24
sprites × 24
camera × 22
android × 21
xna-content-pipeline × 18
monogame-extended × 17
optimization × 16
windows × 16
directx × 15
visual-studio × 15
tilemap × 13
sharpdx × 13
rendering × 12
graphics × 12
collision-resolution × 12