Tagged Questions

C# is a multiparadigm, managed, garbage-collected, object-oriented programming language created by Microsoft in conjunction with the .NET platform.

learn more… | top users | synonyms

1
vote
1answer
75 views

Seperate draw calls

What I want to implement next in my game is frustum culling. The issue that I'm having is creating a draw method that I can check which cubes in my vertex buffer I draw or not. What I want to do is ...
1
vote
2answers
103 views

Loading textures as a method

I want to load a texture when I need it, so I'd need a method in order to do so. LoadTexture(string fileName) I'd only use that one parameter, but what would I put in the method? So far I've ...
10
votes
2answers
4k views

XNA 2d Camera Scrolling - why use matrix transform?

I am making a test game where I want the level to be constantly scrolling. To create this effect I have established a camera class which simply stores a vector2 position and an enum direction. It also ...
2
votes
1answer
242 views

XNA Framework Reach profile does not support separate alpha blend

Yesterday I released my app 'Pic Words' to the windows phone store. It is an Silverlight/XNA app that runs on Windows Phone 7.1 & 8. I have BugSense incorporated into my app. Today I started ...
3
votes
1answer
110 views

How can one impliment multiple control schemes for a single player?

I am working on a platformer and I want to have the player be able to switch control types based on items that may be carried + default controls for things such as water, in the air, on the ground ...
0
votes
1answer
792 views

Camera Matrix Transform to scroll through level - Monogame, XNA

I am trying to change the way I scroll through a level. Currently I have a static camera class which stores a direction enum and a vector 2 position. This class then has a method to move the position ...
-1
votes
1answer
80 views

Setting texture in effect pass

I created different types of cubes for my cube class and based on the height of the cube, the cube type is different. This means changing the texture for the cube. if (y >= 1) ...
0
votes
3answers
319 views

Different types of cubes

I'm looking into making 4 types of cubes; grass, stone, dirt, and empty. I have a cube class that is just for storing the location of the cube. public Cube(GraphicsDevice Device, Vector3 ...
2
votes
0answers
195 views

Chunk Texture3D GPU generated vertices

I read GPU Gems 3 from NVidia about procedural terrain. It's quite interesting but not applicable for me because I only read the online version without the shipped DVD so I'm not able to download the ...
1
vote
1answer
83 views

Getting wrong value for middle of screen

My mouse is able to move the camera and rotate it around my model. If the mouse is in the middle of the screen, the camera should not move. The red circle is where my mouse has to be at in order ...
5
votes
2answers
523 views

XNA 3.1 to 4.0 Vertex Shader Not Drawing

I have recently been converting our XNA 3.1 game to XNA 4.0 and am stuck on the shaders. I have the game running, but nothing is drawing to the screen, except things not using a shader. This is only ...
1
vote
1answer
103 views

using a texture with indices and vertices

I've written this down on paper and tried to understand how the triangles of each cube are created, but I can't get my texture drawn on my cube properly. I don't know if it's the texuture coordinates ...
1
vote
1answer
315 views

Best way to load texture2d tiles in xna?

I am making a test xna game as a learning exercise and I have a small question about using 2d textures. Basically the game is a grid of different 'tiles' which are taken from a text map file. I ...
1
vote
1answer
106 views

Cubes drawing on top of each other

In follow up of my previous question: Limit the number of draw calls I've lowered my draw calls to only 58 a frame!! But now I have another problem. I have 2500 cubes all drawn in the same position. ...
1
vote
2answers
179 views

Limit the number of draw calls

I know where the error lies in my code at this point, and I know what I need to do to fix it, I just don't know how. My problem comes with the 120,000+ draw calls I get each frame. This is caused by ...
1
vote
2answers
337 views

Handling intro and title screen

What is the best way to handle the intro, title screen, and menus? I am contemplating that each of these could be a "scene" object of sorts. Perhaps in the game loop based on what needs to be done, a ...
1
vote
1answer
235 views

Wrong intersection: Bounding Sphere and Ray

I've got a huge problem with BoundingSpheres and Rays in XNA and I really don't know how to solve it. The problem: foreach (BoundingSphere s1 in GetCollisionHullBoundingSpheres()) if ...
1
vote
1answer
933 views

How can I load a text file from Content?

I created a small Windows Phone game with XNA, but I have some trouble with loading a text file from Content. I added the text file to my Content project and marked the Build Action to "Content". The ...
3
votes
1answer
264 views

Implementing smooth 8 directional movement

I have my units that i move around my map with path finding. The units can move in 8 directions, currently i have the units moving around the map with a extremely basic check against the unit's ...
4
votes
3answers
246 views

Debugging multiplayer games without killing network thread?

How do I approach multiplayer games for debugging? When debugging locally - how can you prevent yourself from disconnecting? The debugger halts network activity.
1
vote
0answers
341 views

XNA Monogame How to handle tile collision [closed]

I am working on a simple XNA side scrolling game as a learning exercise. It works by creating a level object which creates a matrix of tiles based on a map within a text file. The tiles are then drawn ...
2
votes
1answer
247 views

Sprite Animation Using Multiple Images (XNA / C#)

all. Right now I am currently working on a game with my Australian buddy and I just am having such a difficult time with the spriting process. As the programmer of our game, it is my responsibility ...
3
votes
2answers
446 views

Including files in an application using XNA

I'm making a game and I need to load some text files to create levels. After much frustration in trying to get them to work I placed the files in the debug folder of my project (I think this is a bad ...
0
votes
1answer
185 views

Volume raycaster problems HLSL

Hi this is my first question here so if I fail to include some necessary piece of information please dont rip my head off. ^^ I can't seem to get my volume raycaster to workt properly. I've been ...
0
votes
2answers
321 views

How to play a YouTube video in XNA?

Is there any way to play a YouTube video given the URL in XNA? I know it can be done using a shockwave control but I need it in XNA. I need to make a game where it has to be a YouTube video on the ...
1
vote
3answers
382 views

Preventing tunneling of small, fast objects

I'm making a basic shooter game with my friend and i have encountered a problem. I kind of know solution this but i just cant implement it. This is my first game made with XNA/MonoGame and i'm not too ...
1
vote
1answer
212 views

Drawing Transparency in XNA 4.0

Using C# (VS2010) with XNA 4.0, I have a terrain layer (RenderTarget2D) in a 2D side-scroller. My visual system tracks updates to redraw individual tiles, but I am having trouble finding a way to ...
2
votes
2answers
402 views

How can I actually understand Instanced Geometry Rendering - so that I can implement it the way I need it

I'm stuck trying to implement instanced mesh rendering in my project. Particularly because I am failing to understand how certain components actually function - and how the drawing routine is actually ...
0
votes
3answers
654 views

Lerp problem object teleporting not moving

Hi i just wanna move my object smoothly from one position to another but object disappear and immediately teleport to position where i clicking anyone know whats happen ? if ...
2
votes
2answers
141 views

UV mapping width and height

I am looking at the following C# code on howto construct a cube. It draws a cube using one texture on everyface. private void ConstructCube() { _vertices = new ...
25
votes
5answers
2k views

Simulating pressure in a grid based liquid simulation

I have a 2D grid based water system in my XNA game, we have a method using cellular automata to simulate water falling and spreading. Example of water flowing down a slope: Each tile can contain a ...
0
votes
1answer
381 views

2D sort for inventory items?

I asked this question some time ago. Now I ended up with just a sorter method that will sort the items based on their bulkiness/nSlotsRequired. Here's what I'm doing: I store all the items I have in ...
2
votes
1answer
533 views

XNA 4.0: Blender .fbx File Won't Display 3D Model

So I followed the basic 3D model display tutorial found here: http://msdn.microsoft.com/en-us/library/bb197293%28v=xnagamestudio.31%29.aspx And while I know this is for XNA 3.1, I can still get the ...
0
votes
1answer
54 views

Loading is not working after saving

I have difficulties to implement loading a savegame file in my Windows Phone project. I use EasyStorage to load and save files. I get the following exception when I try to load after saving a file. ...
0
votes
1answer
309 views

Chunks - Drawing in a randomly generated and infinite world

I am working on a platformer that is going to have a map that is randomly generated and infinite in 3 directions: left, right, and down. I've figured out that I will need to separate this world into ...
-2
votes
3answers
241 views

Options for a functional-style enthusiast? [duplicate]

Senior programmer who has been coding in a functional style for years. I want to make an attempt on the indie games market, but I don't find any good, big platform that provides a good way to code ...
1
vote
1answer
126 views

Creating a map editor for cubes

I was told that I should create a map editor, instead of hard coding out all the grids of my map. It sounds like a fun project and would make things easier in the long run, but I wouldn't even know ...
0
votes
1answer
120 views

Resizing a parallax background (bug)

I'm attempting my first 2D vertical scroller and can't seem to get the background size to work. For some reason, it stays small. I think in the beginning of the parallax scrolling class, I was told to ...
9
votes
3answers
1k views

How can I set my application to run on the High performance GPU by default?

Nowadays a good deal of laptops come with 2 GPUs - a high-performance one and a power-saving one (less powerful). Most of the application, which I use on my laptop run with my integrated(power-saving) ...
1
vote
0answers
69 views

Creating a DrawableGameComponent

If I'm going to draw cubes effectively, I need to get rid of the numerous amounts of draw calls I have and what has been suggested is that I create a "mesh" of my cubes. I already have them being ...
0
votes
1answer
167 views

Yet another frustum culling question

This one is kinda specific. If I'm to implement frustum culling in my game, that means each one of my cubes would need a bounding sphere. My first question is can I make the sphere so close to the ...
1
vote
0answers
106 views

XNA C# Rectangle Intersect Ball on a Square [closed]

I made a Game like Peggle Deluxe using C# and XNA for lerning. I have 2 rectangles a ball and a square field. The ball gets shoot out with a cannon and if the Ball hits the Square the Square ...
-1
votes
2answers
146 views

Memory is full with vertex buffer

I'm having a pretty strange problem that I didn't think I'd run into. I was able to store a 50x50 grid in one vertex buffer finally, in hopes of better performance. Before I had each cube have an ...
0
votes
2answers
126 views

Jumping with a player Matrix

My players position is stored in a world matrix and I want to make him jump. Can I do this just by creating a translation from the matrix? I want the player to be able to jump while moving in a ...
1
vote
0answers
88 views

Farseer: Cutting body from texture

Is it possible to cut a body from a texture in Farseer 3.0? I have a texture converted to a body with multiple fixtures ( using BayazitDecomposer, CreatePolygon method, ..) and can even do it as a ...
0
votes
0answers
78 views

Texture not drawing on cubes

I can draw the cubes fine but they are just solid black besides the occasional lighting that goes on. The basic effect is being set for each cube also. public void Draw(BasicEffect effect) { ...
1
vote
1answer
897 views

Loading images in XNA 4.0; “Cannot Open File” Problems

Okay, I'm writing a game in C#/XNA 4.0 and am utterly stumped at my current juncture: Sprite animation. I understand how it works and have all the code in place, but my ContentLoader won't open my ...
-1
votes
1answer
167 views

Win32 strange exception

When creating 2500 objects, I get a strange windows exception. It says the operation copmleted successfully at my constructor line. The program doesn't run or anything. I'm assuming it has something ...
1
vote
1answer
170 views

Gap in parallaxing background loop

The bug here is that my background kind of offset a bit itself from where it should draw and so I have this line. I have some troubles understanding why I get this bug when I set a speed that is ...
2
votes
1answer
193 views

How can I determine if a cube is adjacent to another cube, and optimize its buffers if so?

I'm trying to optimize the rendering of a collection of cubes, (based on an answer I was given to another question I asked). I understand the logic behind occlusion culling, but I'm having trouble ...