XNA is a game framework by Microsoft that allows deployment for Xbox Live Indie Games as well as Windows Phone 7.

learn more… | top users | synonyms

9
votes
1answer
634 views

Portable buffered keyboard input for XNA / MonoGame?

As a preliminary solution, I am currently using the Nuclex framework in an C#/XNA game project for buffered keyboard input. Sadly, nuclex relies on SlimDX.Directinput.dll and therefore to my knowledge ...
9
votes
2answers
944 views

XNA stuttering at regular intervals

I'm trying to do hardware instancing but I'm hitting some strange performance problem. The average framerate is around 45, but it's extremely choppy. Windowed SynchronizeWithVerticalRetrace = false ...
9
votes
3answers
2k views

Pixel-perfect rendering to a rendertarget with a fullscreen quad

I have some trouble rendering a bunch of values to a rendertarget. The values never end up in the exact range I want them to. Basically I use a fullscreen quad and a pixel shader to render to my ...
9
votes
1answer
373 views

How can I incorporate physics into a procedurally generated world from a geometry shader?

Essentially I want to remove the need for generating coherent noise from the CPU to the GPU. From there, I also want to generate the terrain for a three dimensional world using this noise as densities ...
9
votes
1answer
417 views

Zune same features as WP7? (gesture, accelerometer)

We don't have zune HD in Canada (yet) just wondering if it has the same programmable features as WP7? Like gestures and accelerometer. Basically if I am just making a game, with screen controls ...
9
votes
1answer
333 views

How do I implement 2D shadows cast between layers?

How could I implement 2d shadows that are cast by objects in a different layer? NOT like the dynamic lighting in the well known tutorial from Catalin Zima : But like the shadows of the pipes in ...
8
votes
6answers
4k views

Map with 20 million tiles makes game run out of memory, how do I avoid it?

While loading extra huge maps, the loading method throws out of memory exception where a new instance of map tile is created. I'd like to have whole map processed at least on server app (and on client ...
8
votes
4answers
3k views

What are some good resources for creating a game engine in XNA? [closed]

I'm currently a student game programmer working on an indie project. We have a team of eleven people (five programmers, four artists, and two audio designers) aboard, all working hard to help design ...
8
votes
5answers
585 views

What should I do to prevent my monsters from walking off platforms?

I have a question that is driving me crazy because I think it should be fairly easy to find a tutorial on it. I'm currently using XNA and Farseer to create a simple platformer game. I'm about to be ...
8
votes
3answers
5k views

How do I make objects move along a path?

I'm trying to get something like the below image. As you can see, there's a highway and inside of it, there'll be some objects moving (millisecond). I guess the street behavior is like a pipeline. ...
8
votes
2answers
696 views

Function for sun movement?

So, given a sun sprite set at the horizon (x = 0, y = worldheight/2) I'm trying to devise a function to make the sun rise, then fall. The best way to do this would be the sin function, but I have no ...
8
votes
3answers
604 views

Vector3 vs. Vector2 - performance, usage?

I'm currently playing around with XNA, and creating a simple 2D platformer. I was thinking of adding multiple layers to make it a little bit of challenge. In stead of having a Vector2 for my ...
8
votes
4answers
3k views

Should I use Events in a XNA Game?

I created a button class which draw a button on the screen. When I click on it, I want to see something happening. In WinForm, I would simply use the event OnClick of the button. What about XNA? ...
8
votes
2answers
12k views

How to find the window size in XNA

I just wanted to know if there was a way to find out the size of the window in XNA. I don't want to set it to a specific size; I would like to know what dimensions it currently displays as ...
8
votes
2answers
1k views

XNA: How does threading work?

I would like to implement threading in my XNA game but I'm not sure how things work when compiling for the XBOX 360. Could someone elaborate on this? For example, how many threads does XBOX support? ...
8
votes
1answer
293 views

Curious Transparent Holes Render Artifact

So I'm trying to implement "smooth" terrain in my block engine by giving each surface block a heightmap. Basically, what I do to generate these "heightmaps" for each block is I generate the heights ...
8
votes
3answers
2k views

Shifting from XNA/C# to C++? [closed]

For a while now, I've been working with XNA for game design and development (although only for personal use ATM.) Overall, I'm a major fan of XNA itself, and it's overall "feel." However, due to the ...
8
votes
3answers
438 views

Can you write games for Rock Band or Guitar Hero controllers in XNA?

Can you use the XNA framework to write games for XBox Live Arcade that require Rock Band or Guitar Hero instruments?
8
votes
1answer
6k views

Get position of point on circumference of circle, given an angle?

I would like to know how to get a specific point on the circumference of a circle, given an angle. The diameter of the circle is 1, and the center point of the circle is { X: 0.5, Y: 0.5 }.
8
votes
6answers
4k views

Good example of a multi-pass effect?

In XNA (and Direct3D in general AFAIK), rather than creating individual vertex and fragment shaders, you bundle potentially many related shaders into 'Effects'. When you come to use an effect you ...
8
votes
4answers
843 views

Detecting “Any Button Press”

I'm trying to allow the player to press any button to continue from the main page. I was able to do this by making a List of Buttons and looping through these and checking for one of them being down; ...
8
votes
2answers
14k views

Moving a sprite in XNA/C#, using vectors

I'm currently looking into XNA game development with the C# language. I have two classes: the main game handler and a "sprite" class. Following is some basic pseudo-code which I hope adequately ...
8
votes
1answer
4k views

Microsoft XNA Platformer Example, is the Collsion Detection implemented accurately?

The example provided by Microsoft seems as if the collision detection (from what I can see) will have a small error. When the user collides with an Unpassable tile, the depth of the intersection is ...
8
votes
2answers
2k views

Getting rid of dead objects in a game effectively?

I'm using a for loop or foreach loop (doesn't matter) to loop through all my objects when they need to be updated or drawn. However, when an object gets killed, I want it to get removed from the ...
8
votes
2answers
1k views

Physics for a 2.5D platformer with a plane that curves

I'm creating a 2.5D platformer in XNA which uses 3D models that are constrained to travelling along a 2D plane (just like Trine). To make things tricker, however, I want the 2D plane itself to be ...
8
votes
2answers
3k views

Eliminate delay between looping XNA songs?

I'm making a game with XNA and trying to get some background music to loop correctly. Because the file is an MP3 of about 30 seconds in length, I instantiated it as a Song. I want it to loop ...
8
votes
2answers
529 views

Can you develop a game in XNA only on Windows for the Xbox 360?

I'm going to start developing a game for the Xbox 360, its a small homebrew development and I don't have an Xbox 360 yet. Is it possible for me to develop the entire game targeting the XNA framework ...
8
votes
5answers
798 views

Is the XNA framework appropriate for server side programming?

I'm looking to create a text based MUD, so a lot of the elements of the XNA framework seem appropriate to what I need. Especially things like the general game loop, networking, etc. It looks like ...
8
votes
6answers
800 views

How can I store all my level data in a single file instead of spread out over many files?

I am currently generating my level data, and saving to disk to ensure that any modifications done to the level are saved. I am storing "chunks" of 2048x2048 pixels into a file. Whenever the player ...
8
votes
2answers
1k views

Scale my pixel art files when designing them or when rendering?

If I create pixel art files that need to be scaled up on the screen later, so that a single pixel becomes a box of 4 pixels. Should I create my pixel art with 2x2 pixels or should I create it with 1x1 ...
8
votes
3answers
747 views

What is a good method for coloring textures based on a palette in XNA?

I've been trying to work on a game with the look of an 8-bit game using XNA, specifically using the NES as a guide. The NES has a very specific palette and each sprite can use up to 4 colors from ...
8
votes
4answers
1k views

Decent Shader editor for Visual Studio

Is there a decent Effect file editor plugin for Visual Studio? I'm getting slightly frustrated with constantly copying and pasting from FX Composer.
8
votes
5answers
946 views

Managing multiple references of the same game entity in different places using IDs

I've seen great questions on similar topics, but none that addressed this particular method: Given that I have multiple collections of game entities in my [XNA Game Studio] game, with many entities ...
8
votes
1answer
2k views

Am I going to regret using a color based collision detection system?

I'm just getting started build my first game with XNA (I'm experienced with C# but not games). I'm building a pretty simple top down 2d shooter. I read this tutorial on using a color based collision ...
8
votes
5answers
2k views

How to get elapsed time of keypress?

I need to be able to determine how long a key has been held down with high accuracy. For example if they key tapped really fast it could report a time that is less than the time for each update frame. ...
8
votes
1answer
286 views

Fast lighting with multiple lights

How can I implement fast lighting with multiple lights? I don't want to restrain the player, he can place an unlimited number and possibly overlapping (point) lights into the level. The problem is ...
8
votes
3answers
3k views

Load all content from folder

I want to ask, is there way to load in xna all content from folder ? For example in my content I have: Images/hero Images/car Images/tree I want to make something like this ...
8
votes
2answers
3k views

How to decompose sprite sheet

I have a lot of spritesheets that are poorly formatted that I want to decompose, or split out into many small images, one for each sprite. If I can do that, I can use my custom texture packer tool to ...
8
votes
2answers
3k views

How to use XNA in WPF?

How can I render some graphics using XNA to a widget/control in a WPF app? Specifically, I don't need any WPF controls inside the XNA graphics window, I just want to put some controls around it for a ...
8
votes
4answers
270 views

Keeping rotation between two objects

In my XNA game I have two objects that collide. When the first object collides with the other it is able to latch on to it and move it about the world. I am having a problem with the math here (Math ...
8
votes
1answer
1k views

Why does XNA's ContentManager follow generic type parameters for serialization purposes?

I've finally gotten to the bottom of a problem and am wondering what my best recourse is. In short, the problem is that XNA's ReflectiveReader reflects into generic type parameters, even if no ...
8
votes
3answers
2k views

How do you do AI path following within a 2d physics engine like farseer/box2d?

I'm in the process of moving a 2d top down game I've been working on into a proper rigid body physics engine like Farseer. Up until now, I had just hacked together my own physics code where needed. ...
8
votes
3answers
922 views

Tiling Physics using Farseer

I'm having a problem with the Farseer Physics Engine, where in a tiled environment, my object will at times interact with corners of others objects, even if they align perfectly. I've read about ...
8
votes
1answer
426 views

Billboard draws fine on PC, not on XBOX

The moon is drawn with two draw calls, but both draw wrong on the xbox so I'm just displaying one draw for simplicity. This is how the moon should look on the PC: How it looks on the XBOX: ...
8
votes
3answers
851 views

Inverted textures

I'm trying to draw textures aligned with this physics body whose coordinate system's origin is at the center of the screen. (XNA)Spritebatch has its default origin set to top-left corner. I got the ...
8
votes
1answer
488 views

How do I stop stretching during window re-size in XNA?

In my windowed mode XNA game when the user resizes the window the game stops updating the window and the last frame drawn is stretched and distorted until the user releases the mouse and the resize ...
8
votes
1answer
629 views

Drawing “Stenciled” Sprites and making them glow

Currently, in my game - I'm not using XNA's SpriteBatch to render anything(I am using Farseer Physic's Debug View), and I was wondering how I would render something like this: only using XNA. My ...
8
votes
2answers
503 views

How to loop section from a song correctly?

I'm programming a little Music Engine for my game in C# and XNA, and one aspect from it is the possibility to loop a section from a song. For example, my song has an intropart, and when the song ...
8
votes
2answers
356 views

What would be the best way to find an open space in a level?

I'm working on a 2D game where you use paint to add tiles to a level and right now I'm working to add warp tiles. I have it set up so certain direction-oriented paints use two points (a start and end) ...
8
votes
1answer
368 views

Picture rendered from above and below using an Orthographic camera do not match

I'm using an orthographic camera to render slices of a model (in order to voxelize it). I render each slice both from above and below in order to determine what is inside each slice. The model I ...