XNA is a game framework by Microsoft that allows deployment for Xbox Live Indie Games as well as Windows Phone 7.
7
votes
2answers
1k views
Question about top down/side scrolling!
I know that its just the background that scrolls and the player pretty much stays centered. What I am wondering what technique is more correct when I am implementing a large side scrolling map (I am ...
7
votes
2answers
2k 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 ...
7
votes
1answer
776 views
In XNA, should I use the built-in game component classes?
I'm just getting started on an XNA game for Window Phone 7. For my Flash games I have my own framework that I was just going to port from AS3, but I have just found the built-in game component stuff ...
7
votes
1answer
593 views
Developing an RPG Encounter System
I'm in the middle of an encounter system for an XNA RPG. The idea is, you walk around a dungeon, and certain tiles are makred as RandomBattleTiles, and you have an area in the map defining what ...
7
votes
2answers
473 views
How to deal with variable size font in XNA 4.0
After searching for a while, I found no way to draw vector/scalable fonts in XNA 4.0 (which would be perfect...) and I am currently in a bind about how to render fonts for my game.
In the game I use ...
7
votes
2answers
810 views
Blurring point light variance shadow map
I've been working on implementing variance shadow mapping for my game. I was able to get a spot light working with variance shadow mapping with a gaussian blur applied to the shadow map to reduce the ...
7
votes
1answer
522 views
XNA 2D Collision Detection without GetData()
I'm currently working on a Worms game which involves terrain deformation. I used to do it with .GetData(), modifying the color array, then using .SetData(), but I looked into changing it to make the ...
7
votes
3answers
752 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 ...
7
votes
2answers
974 views
HLSL - Creating Shadows in 2D
The way that I create shadows is by the following technique:
http://www.catalinzima.com/2010/07/my-technique-for-the-shader-based-dynamic-2d-shadows/
But I have questions to HLSL. The way that I ...
7
votes
1answer
1k views
XNA Quadtree with LOD
I'm looking to create a fairly large environment, and as such would like to implement a quadtree and use LOD on it. I've looked through numerous examples and I get the basic idea of a quadtree. Start ...
7
votes
1answer
347 views
Spritebatch drawing sprite with jagged borders
Alright, I've been on the making of a sprite class and a sprite sheet manager, but have come across this problem. Pretty much, the project is acting like so; for example:
Let's take this .png ...
7
votes
2answers
326 views
Windows Phone Performance Analysis makes game run faster. Possible reasons?
A XNA game I was making was running slowly on my WP7 device. However when I started it in Windows Phone Performance Analysis to find the bottleneck, the game ran smoothly on the same device.
I ...
7
votes
1answer
320 views
Trying to use stencils in 2D while retaining layer depth
This is a screen of what's going on just so you can get a frame of reference.
http://i935.photobucket.com/albums/ad199/fobwashed/tilefloors.png
The problem I'm running into is that my game is ...
7
votes
1answer
295 views
Implementing water effects (splashes) into XNA 4.0 game
I am creating a 2D XNA game and came across a tutorial on adding water effects (splashes) to an XNA game but after implementing it into my game I can't get it to scale down. Currently it takes up the ...
6
votes
6answers
2k 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 ...
6
votes
2answers
1k views
Isometric Collision Detection
I am having some issues with trying to detect collision of two isometric tile.
I have tried plotting the lines between each point on the tile and then checking for line intercepts however that didn't ...
6
votes
4answers
4k views
How much memory does a texture take up on the GPU?
A large png on disk may only take up a couple megabytes but I imagine that on the gpu the same png is stored in an uncompressed format which takes up much more space. Is this true? If it is true, how ...
6
votes
2answers
2k views
What kind of culling does XNA do for me?
Which kinds of culling and clipping does XNA do for me as default, and which kinds does it not?
Z-culling? Backface culling? etc.
6
votes
4answers
1k views
How do I add Different Screens to my C#/XNA Game?
I'm working on a Pong clone in XNA. Gameplay-wise, I have it where I want it to be. I want to add a title screen and some other screens to it like a menu, as well as a screen for the Winning/Losing ...
6
votes
5answers
1k views
Why do objects interpenetrate in this simple collision solver?
The code below is from a Microsoft XNA sample here.
This is quite a simple rigid body simulation that ignores many physical effects (such as angular momentum), but it does try to push objects ...
6
votes
2answers
409 views
XNA ContentManager.Load causes string allocation
I was running the Visual Studio memory profiler on a project and noticed that an enormous amount of strings were being instantiated. It turns out that ContentManager.Load appears to create a new ...
6
votes
2answers
1k views
How do I save and load settings on the Xbox?
I'm using XNA 4.0. How can I load and save settings when on the Xbox? And can I write to and read from files?
6
votes
1answer
3k 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 }.
6
votes
3answers
5k views
XNA, SpriteBatch: Slow when rendering lots of sprites?
I've just now tested rendering a lot of sprites using XNA's SpriteBatch class. What I basically do is this:
Somewhere in the code, I have a list which contains all sprites that have to be rendered. I ...
6
votes
4answers
1k views
HLSL: Using instance float input to select texture index, possible?
I'm writing a game for the xbox360 using XNA.
I would like to draw several models with a single DrawInstancedPrimitives call. Each model will use a different texture.
To do this, I would like to ...
6
votes
2answers
9k 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 ...
6
votes
4answers
6k views
2D Platform Game Jumping
I'm currently writing a game in XNA for fun which uses C#. I have got my sprites loaded and when the character moves right he looks like he is running right and when he moves left he looks like he is ...
6
votes
2answers
253 views
Simulate movement towards the screen in a 2D world
I need to create the illusion of someone kicking a ball to the screen. For that, I have a initial position of the ball (about the middle of the screen), and I put the sprite of the ball scaled at 0.2 ...
6
votes
3answers
358 views
Smooth waypoint traversing
There are a dozen ways I could word this question, but to keep my thoughts in line, I'm phrasing it in line with my problem at hand.
So I'm creating a floating platform that I would like to be able ...
6
votes
1answer
386 views
Global keyboard states
I have following idea about processing keyboard input. We capture input in "main" Game class like this:
protected override void Update(GameTime gameTime)
{
this.CurrentKeyboardState = ...
6
votes
1answer
754 views
Questions about XNA
I've read tons of different threads about XNA, but I still have some questions.
First of all: I have 2 years of experience programming and C# is my main language, so XNA would fit perfectly for me, ...
6
votes
3answers
1k views
How do I organize my game into multiple classes in C#?
I've made two simple 2D games while following tutorials for the XNA libraries, and I wanted to make something myself, with only the knowledge I gained from these tutorials.
This will be my first ...
6
votes
4answers
740 views
How can I draw a sprite that inverts the colors behind it for an aiming reticle?
In XNA, how can I draw a sprite on the screen that inverts the colors behind that sprite (i.e. the colors that would appear if the sprite weren't in the way of them)?
I feel this is the best ...
6
votes
3answers
2k views
XNA - Static classes from game libraries executing after content pipeline extensions, how to avoid the problem?
Alright, formulated this way I'm sure it sounds obscure, but I'll do my best to describe my problem.
First, let me explain what's wrong with my real source code.
I'm making a platformer, and here ...
6
votes
3answers
664 views
Why is my model's scale changing after rotating it?
I have just started a simple flight simulator and have implemented Roll and pitch. In the beginning, testing went very well; however, after about 15-20 seconds of constantly moving the thumbsticks in ...
6
votes
2answers
908 views
For a 2D XNA game, should I use the built in Vector2 or Vector3 or port my own class from ActionScript?
I use a lot of 2D vectors in my Flash games - basically all velocities, positions etc I store in this way. My Vector2D class has lots of built in functions for rotation, dotproduct, projectOnto etc. ...
6
votes
2answers
9k views
How do i create bounding boxes with XNA 4.0?
I am having some trouble making bounding boxes for my models I am using within XNA 4.0. The way it was done in XNA 3.1 seems to be obsolete as you can no longer access parameters that were used before ...
6
votes
4answers
192 views
Game development for multiple Microsoft platforms
I intend to develop games for Microsoft's Windows Store, however, I'm confused between their platforms, so please clarify those questions:
Is there any technology (XNA, DirectX), so a game can be ...
6
votes
2answers
2k views
How do I create selectable menu options in C#/XNA?
Ok, I have my game's menu system set up. There are 3 screens (Controller Detect Screen, Title Screen, and GamePlay Screen). I wish to improve on this by having the ability for the player to select ...
6
votes
2answers
3k views
How to turn off vsync in XNA 4.0?
I created a FpsCounter DrawableGameComponent (linked to code, it's longish). It seems to work great, it displays 60.0 fps normally, and if I artificially slow down the game loop then it drops.
Given ...
6
votes
2answers
2k views
Learning 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 ...
6
votes
2answers
981 views
Rounded corners in XNA?
Is there any way that I can make rounded corners on a rectangle rendered in XNA through primitives (line-strips)? I want to make my UI a bit more fancy than it is already, and I would like the code to ...
6
votes
2answers
608 views
Rendering collections of light sources
I have a small test environment where small point lights are scattered. Players should able to collect them.
The collectible lights are rendered using a simple billboard technique where two triangles ...
6
votes
2answers
600 views
Can XNA Content Pipeline split one content file into several .xnb?
Let's say I have an xml file which looks like this
<Weapons>
<Weapon>
<Name>Pistol</Name>
...
</Weapon>
<Weapon>
<Name>MachineGun</Name>
...
...
6
votes
2answers
878 views
Sound emmiters with panning and volume in 2D
How can I create sound emmiters that pan and change volume based on distance from the player in a 2D game?
6
votes
2answers
902 views
Best way to do large XNA animations?
What's the best way to have large animations in XNA 4.0? I have created a spritesheet with the sprite being 250x400 (more of an image than a sprite but hey ho) and there are approximately 45 frames in ...
6
votes
2answers
11k 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 ...
6
votes
2answers
414 views
Size of the world and clipping area
I have a 32x32x32 cube (I say 32 because that's the size of the texture).
I can make the vertices of this cube go from (0,0,0) to (32,32,32). This mean the camera will be moving += 1 when ever a key ...
6
votes
1answer
215 views
How can I get a 2D texture to rotate like a compass in XNA?
I'm working on a small maze puzzle game and I'm trying to add a compass to make it somewhat easier for the player to find their way around the maze. The problem is: I'm using XNA's draw method to ...
6
votes
1answer
245 views
How to make a registration for my game?
Me and my (new) company want to sell a very simple game, but we want it so that only the person that buys it can play it.
I want to know if it's possible to make a "registration" window pop up when ...