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

0
votes
0answers
55 views

Simultanious RenderTarget use in XNA

I am currently grappling with the idea of lighting a 2D scene as a 3D one and i need to clear up a couple of things. I have so far figured out that i am going to use a differed lighting system where ...
0
votes
2answers
182 views

How do I detect and remove completed rows of blocks in Tetris?

I am making Tetris for a learning experience in XNA, and I'm having trouble deleted completed rows. I am having an issue with deleting rows, for some reason when I go to delete a row, I end up ...
0
votes
1answer
221 views

(XNA) 3D Model Rotation Angles

I'm currently in the process of making a 3d "semi" top down game, the camera comes in at a very high angle near 90 to show off the 3d models. I have a main character which can move in 4 axis (up, ...
0
votes
1answer
137 views

Write my own level editor, questions [closed]

I just finished to code the most important parts of my game engine (not a tile-map one), such as lights, shadows, objects update/draw, input, ecc. Now I'm making a level editor to simplify the ...
0
votes
2answers
295 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 ...
2
votes
1answer
186 views

XNA mesh.Draw() takes the longest CPU time

We have a problem. Our game steadily slows down as we increase the number of models we draw. When the number reaches 100 - FPS is dead. Our humble tests showed that the reason is not GPU. This is what ...
0
votes
0answers
21 views

XNA problem: models processed with different content projects reference the same effect file

I want to add multiple content projects to my XNA Game solution in order to compile them with multiple cores in parallel. The compilation time is a problem for us already and in the future things will ...
0
votes
2answers
52 views

Percentages for different platform generation [duplicate]

I have a level manager, which creates levels and levels create platforms. Levels can contain a variety of platforms. I dont really understand how I can say: I want a 10% of one platform being ...
0
votes
1answer
95 views

Effectively drawing dynamic primitives

Okay, so this is where I am now. My game largely consists of textures drawn through spritebatch. Now I have to draw a dynamic number of triangles. I cannot say in advance where or how many I have to ...
1
vote
2answers
213 views

XNA : Character walking on tiles and getting stuck

I develop games for my own pleasure and also to share experiences with my kids learning coding. Lately I have been working on a classic retro platform game using XNA and Farseer. One issue I am ...
1
vote
1answer
435 views

MonoGame - when/how to save data

I am making a simple 2d game for WP in monogame/xna and am at a point where I want to save data. I have created a method to serialize the data (index, counter and percentage counter) to an isolated ...
2
votes
2answers
89 views

Finding a specific point in a graphic model in code

I'm not really sure what I'm asking, so sorry for the bad title. I'm still new to game programming and especially the "game specific parts" like models and graphics. Let's say I have a model of a ...
0
votes
0answers
48 views

Simulating Windows Phone Trial mode is not working

I want to simulate a Windows Phone Trial mode. I created a little game in XNA and uploaded it as a beta on my Windows Phone Dev Center account. After that, I installed the game from my Dev Center ...
0
votes
2answers
82 views

How can I create the correct player object based on a type in a network message?

I am using lidgren as a networking library for a small XNA game. I am using a client/server architecture for the game. Currently, I have the client and server connecting but I would like to be able to ...
5
votes
2answers
292 views

How can I optimize a parallax effect consisting of multiple transparent layers?

I have a parallax effect in MonoGame consisting of multiple semi-transparent layers of textures. The effect is simple, but rendering multiple transparent layers on top of each other is rather slow. ...
1
vote
3answers
195 views

Lag created when detecting collision

I'm fairly new to gamedev and have encountered a problem with the collision detection system. The collision is essentially worked out like this: for (int x = 0; x < playerprojectiles.Count; x++) ...
2
votes
2answers
189 views

Workaround for Texture2D.GetData

I’m converting a game from XNA to iOS with Monogame. In the code snippet below, smallDeform is a Texture2D on which I call the GetData method. smallDeform = ...
0
votes
1answer
140 views

Why does my game exit immediately if I restart it after calling Exit()?

When launching a game multiple times in a console, the first time this.Exit() on the game class is called, all following games do not properly run. Instead they exit immediately. For example, if I ...
0
votes
3answers
356 views

Encode two integers into colour values and compare them in a HLSL shader

I am writing a 2D point and click adventure game in Monogame, and I'd like to be able to create an image mask for every room which defines which parts of the background a character can walk behind, ...
0
votes
1answer
137 views

Programming and drawing to deal with different screen sizes and resolutions

I started making an XNA game years ago and picked it up recently. I'm looking later to convert it to use Monogame so that it can be deployed on various mobile devices and OS, though I have a sinking ...
0
votes
1answer
82 views

Where is the LocalizedFontProcessor in XNA?

I tried this tutorial to localize my XNA Windows Phone game, but I can't find the LocalizedFontProcessor in the drop-down list. Why is the LocalizedFontProcessor missing in the drop-down list? What is ...
0
votes
1answer
94 views

Finding a way to display objects efficiently

I am making a 2D simple Breakout game, and I would like to know of an efficient way to display all the blocks on the screen. I was thinking of dividing the whole screen into little squares that can be ...
0
votes
1answer
110 views

Why do I get an exception when accessing my sprite members in this fashion?

I'm getting a NullReferenceException error on the line where I do new Vector2(...). I think the problem is with the variables I'm using even though they're working to control the player sprite, so ...
0
votes
0answers
86 views

Create random level platforms on screen

I'm trying to create random level platforms like this: public Level(int platfromsInLevel, Texture2D sprite, int screenWidth) { rnd = new Random(); this.screenWidth = screenWidth; ...
0
votes
3answers
656 views

Basic 2D Enemy AI

This is the basic layout of my game: http://www.youtube.com/watch?v=qcd-CcKWjGU&feature=youtu.be To make him move I just made it so you click left or right to move, just for a test. Anyway, I ...
0
votes
0answers
82 views

XNA - Draw FPS Hands? [duplicate]

I'm creating a FPS game in XNA 4. I'm trying to display two hands and a gun in front of the camera. I already the models Hands: How can I do so the fingers and hands position adapts to the gun ...
3
votes
1answer
209 views

Is multipass rendering possible with SpriteBatch?

I'm trying to implement a bloom effect. This requires three shader passes: a brightness threshold, a horizontal blur, and a vertical blur. It also requires resizes, but these are irrelevant to the ...
0
votes
1answer
180 views

How can I support more than one resolution/language on WP7/8?

I want that my Windows Phone game runs on the following three resolutions: 480x800, 768x1280 and 720x1280. And maybe later on 1920x1080. But in the XAP file information, it's just written ...
1
vote
1answer
53 views

XNA flip SpriteBatch on click

Is there any way to make a SpriteBatch flip when its clicked, something like Android Animation? I know that spriteBatch.Draw() have SpriteEffects, but it literally flip it and I want to flip it like ...
1
vote
1answer
474 views

Drawing sprites to a permanent Texture2d using Monogame / XNA

I'm working with Monogame to do a 2d sprite engine. I've gotten it work pretty well where I can move lots of sprites around the screen with the effects and positions that I want. Last night I tried ...
0
votes
1answer
62 views

Layer depth problem in XNA puzzle game

I am working on puzzle game where tiles are needed to be dragged to their correct place, but at the time of dragging one of the textures goes behind the other texture. How can I bring the texture to ...
0
votes
0answers
43 views

XNA speed up content compile with multiple content projects: what to do when two assets reference the same sader file?

Right now our content is being compiled over the course of 10 minutes. Given that we literary have no content yet, it is a huge timebomb waiting to explode once we start ading it. As we build the game ...
0
votes
1answer
131 views

HLSL postprocessing for day to night (DTN)

I am trying to implement a "day-to-night"-filter (as commonly used in cinema) for a 2D game (XNA) by using a full screen HLSL pixel shader. The aim is to transform any bright and colorful image into a ...
1
vote
0answers
223 views

Monogame is not using GPU? [closed]

I have the following code in Draw loop: for (int i = 0; i < 512; i++) { for (int j = 0; j < 512; j++) { spriteBatch.Draw(Textures.Grass, ...
0
votes
0answers
105 views

Incorrect frustum culling with center/half-size AABB

I'm trying to implement an axis-aligned bounding box with center/half-size instead of min/max. And I have some problems when it comes to create a method to detect if the aabb is visible or not. I try ...
1
vote
1answer
69 views

XNA soundEffect is null in when loaded in main class and called in another class

I have loaded a sound effect file into the main class in xna, but when I try to run it in another class I am given this error {"Object reference not set to an instance of an object."} I am new ...
3
votes
3answers
237 views

Does passing uniform constants from technique into shader cause branches?

I am trying to find a way to organize my evergrowing number of shader techniques/functions (I am coding in sm_3.0). One way is to do this: float4 PS_Crossroads(PS_INPUT input, uniform bool ...
0
votes
1answer
78 views

Map editor undo function - Not actually setting values to tiles

I'm currently attempting to implement an undo/redo function for my map editor for a tile-based 2D platformer game made with XNA. I've found a lot of resources online about this and decided to try to ...
0
votes
0answers
108 views

Overlay partially transparent texture onto another, but not the background

I'm using XNA and C#. I have two shapes (texture2ds), and I want to overlay shape 2 (50% transparent square) over shape 1 (opaque circle), but I want to get Option B, not Option A. I basically want ...
2
votes
1answer
310 views

How can I deal with actor translations and other “noise” in third-party motion capture data?

I'm working on a game, and I've run into a problem with motion capture data. My team is using 3DS Max 2011 and trying to put free motion capture files on our models. The problem we're having is it ...
-2
votes
1answer
85 views

How to do a multishot in xna?

I am trying to simulate a gun in which shoots multiple bullets at the same time(similar to a spread out shot). I am thinking I have to create another bullet array then do the same as I have below but ...
0
votes
0answers
68 views

Loading assets in Monogame [duplicate]

I'm creating a MonoGame application on Visual Studio 2012, yet when trying to load a texture I get the following problem: Could not load Menu/btnPlay asset! I have set content directory: ...
0
votes
1answer
66 views

OcclusionQuery: how to ignore some objects?

I'm trying to make a LensFlare effect when the player watch the sun in my XNA 4.0 Game. To do this, I use OcclusionQuery, here's my code: http://pastebin.com/meAkdwmD I also have some models, a ...
5
votes
6answers
323 views

Increasing efficiency of N-Body gravity simulation

I'm making a space exploration type game, it will have many planets and other objects that will all have realistic gravity. I currently have a system in place that works, but if the number of planets ...
22
votes
7answers
1k views

Multithreading 2D gravity calculations

I'm building a space exploration game and I've currently started working on gravity ( In C# with XNA). The gravity still needs tweaking, but before I can do that, I need to address some performance ...
1
vote
1answer
224 views

Unknown error XNA cannot detect importer for “program.cs”

I am not too sure what I have done to cause this, but even after undoing all my edits, this error still appears Error 1 Cannot autodetect which importer to use for "Program.cs". There are no ...
2
votes
1answer
113 views

XNA calculate normals for linesegment

I am quite new to 3D graphical programming and thus far only understand that normal somehow define the direction in which a vertex faces and therefore the direction in which light is reflected. I have ...
1
vote
0answers
134 views

write to depth buffer while using multiple render targets

Presently my engine is set up to use deferred shading. My pixel shader output struct is as follows: struct GBuffer { float4 Depth : DEPTH0; //depth render target float4 Normal : COLOR0; ...
1
vote
2answers
166 views

Input of mouseclick not always registered in XNA Update method

I have a problem that not all inputs of my mouse events seem to be registered. The update logic is checking a 2 dimensional array of 10x10 . It's logic for a jewel matching game. So when i switch my ...
3
votes
2answers
96 views

Multiple ( V- / I- ) Buffers, is it sane?

Currently I am developing an RTS game using XNA ( / ANX.Framework ). There is one thing bothers me. I am not sure in what way or how to organise Buffers. Should I use a new Vertexbuffer for any object ...