XNA Game Studio 4.0 is a programming environment that allows you to use Visual Studio to create games for Windows Phone, the Xbox 360 console, and Windows-based computers.

learn more… | top users | synonyms (1)

1
vote
1answer
136 views

Can I render some vertices as an object instead?

I am generating vertices at runtime that represent terrain. I've always drawn the vertices as triangles with GraphicsDevice.DrawUserPrimitives<VertexPositionColor>, but I'm wondering: Can ...
0
votes
1answer
24 views

Store custom data against XboxLIVE Gamer in XNA?

If I am using Xbox LIVE Gamer Services for a networked XNA game, is there anyway to store custom data against the Gamer or GamerProfile so should they sign-in again even on a different machine I can ...
1
vote
0answers
31 views

Grid patter appear over bloom when resolution is lower than 1366x768

The bloom post process in our engine is done via consecutive downscaling of the treshhold texture down to 1/64x1/64 of the main size. Every texture we use is R16G16B16A16 FP16. Afterwards, we ...
0
votes
0answers
54 views

Implementing Exponential Shadow Mapping

I've been following the tutorials (link1) and (link2) to implement Shadow Mapping. However, I'm getting shadowing artifacts which are quite ugly. I've done some research, and found that ESM ...
-2
votes
1answer
75 views

explosion spritesheet is not working [closed]

I want to do a simple explosion on a collision.Here is my code... public explosion(Texture2D newTexture, Vector2 newPosition) { texture = newTexture; position = newPosition; ...
-1
votes
0answers
37 views

Applying custom effect from nVidia Shader Library [closed]

I'm quite new to XNA 4.0. I'm trying to apply an effect I downloaded from nVidia Shader Library, it's called post corona. I'm facing two problems, and I can't find any "compatible" examples or help ...
0
votes
0answers
33 views

Sprite won't travel properly to a point

I am creating a game in which I would like the player to be able to click a location and have the character travel to it. This is the code I am trying to use for this: if (Mouse.GetState().LeftButton ...
1
vote
1answer
56 views

XNA Move List of Rectangles

I have a game in which sprites will be removed and added under different circumstances, and so I created Rects of type List<Rectangle> to hold the bounding rectangle for each sprite. ...
2
votes
0answers
22 views

Xna 4 Model Rotation with inertia not working as expected with variable updates

I am trying to rotate a model with inertia damping with the keyboard. The code works great with a fixed time step but it doesn't behave the same with a variable update frequency. Update method: ...
1
vote
0answers
26 views

Multisampling Gamma Correction Problem

I have multisampled rendertarget where I use red channel as stencil data, but the problem is I get incorrect results around borders if "Antialiasing - Gamma Correction" is set to on in Nvidia Control ...
1
vote
1answer
31 views

Proper Directional light on multiple models

I've been trying to implement a Directional light into an XNA game I'm working on, but for what ever reason, I cannot seem to get the directional light to be a true directional light. Instead, I am ...
2
votes
1answer
86 views

XNA: Non-overlapping shadows

I want to create an effect similar to the following in XNA / MonoGame: There's a background and a semi-transparent shadow consisting of several objects (two circles in this example). However, the ...
1
vote
0answers
40 views

Monogame apply tint to only some parts of sprite [duplicate]

Each player is a different colour (Red, Blue, Green, Yellow) and I want a small part of each piece of armour to be tinted to the player colour. Is this possible without using a second armour sprite ...
1
vote
1answer
78 views

Scale adaption based on distance to object

I have situation illustrated on image above, name displayed over the player. Text is rendered as 3d rectangle and rotated to face camera as billboard. (I am using this article ...
0
votes
0answers
53 views

How can I position different size creatures in a group automaticly

I'm doing a game (in xna) on my free time, as I'm not in the game market, I'm pretty sure I'm missing something that would help me get this right. Think of Ogre Battle. A group of unit moves, and ...
0
votes
1answer
53 views

Issue with calling Spritebatch in XNA 4.0 Game [closed]

So, I am creating a game in XNA 4.0, using the program Microsoft Visual C# Studio Express 2010. The issue I am having: I have the entire game done, and there is no reason why it should not be ...
2
votes
1answer
54 views

Monogame/Android: Using content from PCL

I'm quite new to Monogame and PCL, but I hope someone can help me with my question. I have a Monogame/Android project with references a PCL which targets .NET 4.5, iOS and Android. The PCL has ...
1
vote
1answer
90 views

Dealing with angles in 3D

In 2D everything is easier to understand. I'm not enought experienced to join people who say that 3d is the same: you JUST need to add a dimension - THAT adding a dimension is my problem, bacause I ...
1
vote
2answers
152 views

How can I project a vector on another vector?

I have a generic not normalized Vector3 v1 and I want to calculate its component along another Vector3 v2. I used to normalize the vector I want to be the direction and then multiplying the other ...
0
votes
0answers
71 views

Interactions between camera and procedural terrain

QUESTION REWORKED I need to update every frame camera position along a surface with hills and drops. In this picture you can see a particle of the surface terrain (just one triangle) and a sphere ...
1
vote
1answer
50 views

Can I rely on SoundEffects being stopped when unloaded?

I am using XNA's SoundEffect class to play sounds. I have to unload all sounds from the corresponding ContentManager for technical reasons, while some of them are still playing. What happens to ...
0
votes
0answers
69 views

Smooth circular collisions with edges/collision boxes [C# + XNA]

So, me and a friend are working on our top-down perspective 2D game, and have come to work on perfecting our collisions. In its current state our player sprite is colliding with walls, but is ...
1
vote
2answers
136 views

XNA blurring moving images

Why does XNA blurs the images which moves less than 1px in between two draws? It is quite annoying, because everything looks really blurry. Is there a way to disable it? I have tried to set the ...
1
vote
1answer
106 views

Angular velocity from 2D Collision

I have been working on a 2D physics engine for my A Level computing project and I am having trouble calculating the angular velocity from a collision. I have managed to workout each objects linear ...
0
votes
0answers
67 views

Collision - Per Pixel and Rectangle Based, Combined

UPDATE:i found the error in my calculation the problem was that i needed to consider if the image is rendered flip or not to fix it just need to rub from the opposite side of the sprite I am currently ...
0
votes
0answers
25 views

Farseer Physics, mass affecting velocity

I have just started with Farseer Physics, so I am kind of a newbie in this theme, so not a surprise that I have encountered something that is not involved by the engine, or I just don't know about it. ...
0
votes
1answer
46 views

xna 2.5d gravity system

i currently developing a game using the xna API. now the game i am developing is 2.5d. by 2.5d i mean the character or object can move left and right and a up and down(not just by jumping) that it ...
0
votes
1answer
144 views

How can I create my own GameTime for timing things in my game?

I have a Game class and a GameComponent class. I want to perform operations inside the GameComponent class which depend on calling gameTime.ElapsedGameTime.TotalSeconds, but I've noticed that that ...
2
votes
1answer
65 views

map the section of a procedurally generated surface on a plane

I'll try to be as clearer as I can. I have a surface on a 3D space which is not flat, it has hills and depths. My goal would be intersect it with a plane so that I can map the section of the surface ...
1
vote
0answers
70 views

Using obj file in an XNA game [closed]

Sorry if this is a bit novice but I am far more into engineering than game development but I just want to make a small 3D game for fun with XNA (well actually MonoGame). The thing is that I don't have ...
0
votes
1answer
51 views

Height map renders upside down and/or backwards

After following the tutorial found here:http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series1/VertexBuffer_and_IndexBuffer.php The code at the bottom of this page is what I am using. (I have ...
1
vote
2answers
92 views

margin of error trying to check if a point lays on line

Working with floating point values it is as easy as breathing to run on approximation errors by comparing quantities which should be the same. I want to know if there is a way built in some MSDN (or ...
5
votes
1answer
199 views

How can I draw a perspective-correct quad?

I'm trying to draw a quad in 2D (in SharpDX, but that is basically XNA). But texture correction is not working, and I'm getting only an affine textured quad. I'm using BasicEffect to render it. ...
1
vote
2answers
92 views

Where does the Game class come from in the DrawableGameComponent constructor?

I'm making a project to Windows Phone using Silverlight + XNA, but I don't know how I can use the DrawableGameComponent because the constructor requires a Game class, it looks like this: Planet.cs ...
0
votes
3answers
135 views

Why I am I told “Color0 is missing” when I run the following code?

In the code below, I want to draw a box on my screen. But when I run it, there is an error message: The current vertex declaration does not include all the elements required by the current ...
-1
votes
1answer
67 views

Why doesn't my XNA model render at all? [closed]

I am trying to draw a 3D Model in XNA 4.0, but it doesn't show up. I think I made it correctly, but maybe not. My code follows: Here is the LoadContent and Draw method of my Main class. Spaceship is ...
2
votes
1answer
103 views

How do I check if a surface is sloping?

I'm implementing gravity over a 3D terrain and I'm struggling with how to check if surface "under your feet" is flat or sloping. I read some tutorials but gravity is always considered along a single ...
0
votes
2answers
280 views

Add a “fake” Loading Screen

I'm working on a 2D game for WPF8 using XNA 4.0. Everything goes great, but it's too fast. I was just wondering, what could I do between the end of the game and the score screen, and before the game ...
0
votes
1answer
110 views

Where does XNA 4.0 takes memory from to perform operations?

I found this question which talks around the question I'm interested in. In particular I focused on the line where the guys says that GraphicsDevice object is literally a representation of the ...
0
votes
1answer
79 views

XNA DepthBias increases performance even when EarlyZ is turned off. Why?

My 3d scene consists of three main polygons: The first and the second polygons overlap each other (have the same World matrix and use the same geometry), the third one is perpendicular to the first ...
6
votes
1answer
138 views

How should I attenuate sound in a 2D game where you can zoom in and out?

In my 2D game, I have some ambient sounds like the noise of a waterfall or the humming of a generator. However, it is not practical to play these sound all the time at full volume as in a large level ...
0
votes
0answers
26 views

Skip the first RenderTarget when writing to MRT with Opaque blending

I am writing to three rendertargets and whant to know how to tell a GPU not to write to the first RT. When you write a shader you can simply output less data than you have RTs (like output a single ...
0
votes
1answer
202 views

Rope Colliding with a Rectangle

I have my rope, and I have my rectangles. The rope is similar to the implementation found here: http://nehe.gamedev.net/tutorial/rope_physics/17006/ Now, I want to make the rope properly collide ...
1
vote
1answer
185 views

Get screen bounds of 3D object

I'm trying to draw a 2D plane that has minimum dimensions to contain a 3D model (a sphere). How do I calculate the minimum size and position of the rectangle to completely cover a 3D model on screen?
8
votes
2answers
365 views

What are some ways to texture map a terrain?

I'm working with XNA on a 3D Game, and I'm trying to have a proper and nice environnement. I actually followed a tutorial to create a terrain from a heightmap. To texture it, I just apply a grass ...
0
votes
0answers
79 views

Avoiding lag when rendering Texture2D for first time

I have found a similar question here, but it is about playing sounds. I am using 2048 x 2048 textures for sprite sheets and every time I call spriteBatch.Draw using a sheet for the first time in game ...
2
votes
1answer
106 views

What's the difference between Textures and VertexTextures in XNA?

The GraphicsDevice class of XNA has the properties Textures and VertexTextures. What is the exact difference? I don't really understand what MSDN tells me about this. I usually use Effect parameters ...
0
votes
1answer
132 views

Obtain rectangle indicating 2D world space camera can see

I have a 2D tile based game in XNA, with a moveable camera that can scroll around and zoom. I'm trying to obtain a rectangle which indicates the area, in world space, that my camera is looking at, so ...
4
votes
4answers
305 views

The physics equation for a perpetual seesaw

I am trying to create a game that involves two or more people jumping on a seesaw and propelling each other in the air. I need help with the physics equations Assume no friction and no air ...
0
votes
1answer
103 views

Changing enum in a different class for screen

I'm trying to make a start menu for my game and my code uses Enum's to moniter the screen state. Now i want to change the screenstate declared in the main class, in my Background class Screen screen ...