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
4answers
2k views

What technique should I use to facilitate communication between XNA GameComponents (or between components of any type in a game)?

I'm starting out on my first 'proper' game project, and I've inevitably hit a block trying to decide how game components in XNA should communicate. From previous (Java) GUI programming events, ...
9
votes
2answers
276 views

Server-side Input

Currently in my game, the client is nothing but a renderer. When input state is changed, the client sends a packet to the server and moves the player as if it were processing the input, but the ...
9
votes
3answers
3k 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. ...
9
votes
2answers
2k views

How do I make a resolution independent system?

I'm blanking on this one. I can anchor stuff on edges of course, that would make my UI resolution independent...until it changes so much that the graphics are too small. How do I scale appropriately ...
9
votes
1answer
729 views

Rendering arbitrary text in XNA using Windows API?

In Andrew's comment on my other question, he noted that it was possible to render text to a Texture2D using the Windows API, instead of drawing the text directly with a SpriteBatch. How is this done? ...
9
votes
3answers
391 views

Why does Farseer 2.x store temporaries as members and not on the stack? (.NET)

UPDATE: This question refers to Farseer 2.x. The newer 3.x doesn't seem to do this. I'm using Farseer Physics Engine quite extensively at the moment, and I've noticed that it seems to store a lot of ...
9
votes
2answers
989 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
386 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
418 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
373 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
596 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
6k 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
3answers
3k views

Random enemy placement on a 2d grid

I want to place my items and enemies randomly (or as randomly as possible). At the moment I use XNA's Random class to generate a number between 800 for X and 600 for Y. It feels like enemies spawn ...
8
votes
2answers
728 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
687 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
1answer
7k 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
4answers
4k 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
13k 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
1answer
298 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
451 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
5answers
1k views

How can I simulate shattering glass?

I need to make a simulation with stone thrown through a glass window. How can I accomplish that? I mean, I was thinking about making a 3D model of a stone and glass in 3D Studio Max 2012, shatter the ...
8
votes
4answers
1k 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
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
15k 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
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
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
323 views

How do I perform an xBR or hqx filter in XNA?

I'd like to render my game scaled up with one of the hqx filters (hq2x, hq3x or hq4x) or an xBR filter in a shader. How can I do this in XNA 4.0 and SM3? Side note: this question has been heavily ...
8
votes
2answers
537 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
804 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
822 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
791 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
7answers
13k views

How to generate Spritefonts for monogame

I just want to render some text to the screen using: monogame 3.0 MS Visual Studio 2010 C# Express In XNA, you were able to add fonts to the content pipeline quite easily. But this doesn't seem to ...
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
960 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
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
4k 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
275 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
957 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
433 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
870 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
545 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 ...