How do I move a 3D particle using the Mercury particle engine?
I'm currently creating a 3D game with XNA, and I am in need of some particles.That's why I searched for a particle engine. I found Mercury, watched the tutorials and integrated it in the game.But now I...
View ArticleCombine 3D objects in XNA 4
Currently I am writing on my thesis for university, the theme I am working on is 3D Visualization of hierarchical structures using cone trees.I want to do is to draw a cone and arrange a number of...
View ArticleHow can I embed music in my XNA .exe?
I'm trying to embed music in my XNA game's .exe (with resources) but compiling them as a sound effect stores the music in uncompressed form, which results in a 16 MB .exe.I can compress my music with...
View ArticleHow to remove the jitter from my pong AI movement?
I am developing Pong using Monogame / XNA and my AI paddle is really jittery when the ball is moving more horizontally than vertically. My AI is very simple and works as follows:If the ball's position...
View Article3D Vector "End Point" Calculation for procedural Vector Graphics
Alright, So I need some help with some Vector Math.I've developing some game Engines that have Procedural Fractal Generation for Some Graphics, such as using Lindenmayer Systems for generating Trees...
View ArticleAlpha blending not rendering properly XNA 4.0
I'm trying to render a tree made out of 2 rectangles intersecting in the center at a 90degree angle. The texture has an alpha channel but which ever rectangle gets rendered second causes a weird...
View ArticleDisposing only certain resources in XNA?
The ContentManager in XNA 4.0 only has one Unload() method that Unloads all Assets.I want to have some "global" Assets that are always loaded, but then I want per-Level Assets which should be Unloaded...
View ArticleSimple WP7 pong game with real time multiplayer using sockets
I'm making a pong clone for Windows Phone 7 and I'd love to add a multiplayer option. I've been trying to use this Ricky Tan's tutorial:LinkThe problem is it is designed around the platformer example...
View ArticleError on new XNA 4.0 game project - No suitable graphics card found
Any ideas on how to fix this? According to what I remember about XNA 3 was that when running the application from scratch, I would get a blue colored windows with nothing rendered.Any...
View ArticleWhat are the differences between XNA 3.1 and 4.0? [closed]
I have been away from XNA for a couple months and want to get back into it. I had a game I was currently working on, but it was done in XNA 3.1. What are the differences between the two, and is it...
View ArticleWhen should a bullet texture be loaded in XNA?
I'm making a SpaceWar!-esque game using XNA. I want to limit my ships to 5 active bullets at any time. I have a BulletDrawableGameComponent and a ShipDrawableGameComponent. My Ship has an array of 5...
View ArticleUsing 2D sprites and 3D models together
I have gone through a few posts that talks about changing the GraphicsDevice.BlendState and GraphicsDevice.DepthStencilState (SpriteBatch & Render states). . however even after changing the states...
View ArticleCustom effects on Model in XNA
If I have a Model that is drawn with a different effect occasionally, what is the typical approach to this?Models have effects stored in each of their meshes, and you seem to be forced to use...
View ArticleHow do I prevent XNA from pausing Updates while the window is being...
XNA stops calling Update and Draw while the game window is being resized or moved.Why? Is there a way to prevent this behaviour?(It causes my network code to desynchronise, because network messages...
View ArticleLearning XNA 3.1 Vs XNA 4.0
I am starting out learning XNA and its going smoothly. However I wonder if I am shooting myself in the foot by learning 3.1 not 4.0?I am also aware Microsoft obviously has a conflict on interest in the...
View ArticleUsing a shader messes up my alpha in XNA
I'm making a 2D game that ends up being too dark on some laptops, so I figured I'd use a shader so people could brighten it up if need be. Unfortunately, once I got it in there nothing would fade in or...
View ArticleWhen/how to use GameService, GameComponent, Initialize()?
So I've finally got around to playing around with XNA and have been toying around with making a 2D game (I have a bunch of art assets from a friend who developed it on iOS)A lot of things seem to be...
View ArticleHow do I align the matrix used in SpriteBatch and the matrix used in...
I'm writing a Windows tool that uses XNA and allows the user to place textures on the screen.I'm using a 'camera' for the SpriteBatch used to draw the textures, e.g:Matrix matrixForSpriteBatch =...
View ArticleWhat are the GPU requirements for XNA 4.0?
I tried to build a sample application using XNA, but I got an error saying that Pixel Shader 1.1 was required, so I got a used Radeon X300 GPU that supports Pixel Shader.I tried to build it again, but...
View ArticleXNA objects not occluding properly
I have got simple 1x1x1 cube model. I draw 3 of them. They are located at:1,0,02,0,03,0,0I draw them in the same order every time. When I move the camera and look at them from one end everything is...
View ArticleProblem loading content in WinForms using XNA
I'm currently having trouble implementing loading content with the content pipeline into my WinForm application. I'm using the "WinForms Series 1: Graphics Device" sample provided by microsoft.By...
View ArticleSetting variable values in XNA 4.0 from an XML file
I made a program that simulates an assembly line using the XNA 4.0. I made a 3D model, and divided it into 5 positions - start, 3 workstations, and end. These positions represent the places on the...
View ArticleWhat is a good bytes per second sent/received rate?
I am working with XNA networking, on the XBOX.I was wondering what is a safe number to stay under in the bytes sent and received when it comes to the xbox. Obviously various factors will effect the...
View ArticleXna model parts are overlying others
I am trying to import in XNA an .fbx model exported with blender.Here is my drawing codepublic void Draw(){ Matrix[] modelTransforms = new Matrix[Model.Bones.Count];...
View ArticleWhy distant objects are being drawn in front of close objects?
I am rendering two cubes in the space using XNA 4.0 and the layering of objects only works from certain angles.Here is what I see from the front angle (everything ok)Here is what I see from behindThis...
View ArticleSpriteBatch, trying to reduce draw calls
This my main draw call: Matrix Camera_transformation = player_camera_.GetTransformation(); // Background - AlphaBlend spritebatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null,...
View ArticleXNA Rotate Vector2 around Origin
I have a Rectangle and a Vector2 position, my sprite is being drawn at this position. The rectangle is meant to be a collision system with the cursor, when I rotate my sprite around the origin and...
View ArticleHow do I target a tank turret with an offset barrel?
I have a tank model consisting of multiple parts, a body, a turret and the barrel of the gun. The turret is offset from the body origin and can rotate around the Y axis(up). The barrel is connected to...
View ArticleFlip sprite vertically AND horizontally?
In Microsoft.Xna.Framework.Graphics.SpriteEffects there is the possibility to flip a texture horizontally or vertically before rendering. But can one do both at the same time?When I use: spriteEffect =...
View ArticleHow do you write Texture2DContent and read it as Texture2D in the XNA content...
I'm trying to create a custom Monogame content pipeline extension that packs a bunch of individual sprites into a single sprite. I need help figuring out how to write and read the texture in the...
View Article