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

2
votes
1answer
315 views

How do I get URL parameters from a Flash game (developed with Unity3D)?

I made a simple Flash game in C# using Unity3D. It interacts well with a web page: There is a textbox for the player to type their name and that name is used in-game. Now I want to pass the player's ...
3
votes
1answer
290 views

Gamepad thumbsticks active range

for my current project I use gamepad. I was successfull in hooking it up in C# through SlimDX. Everything works fine, only problem is that thumbsticks don't fully use the active range. If I move ...
2
votes
0answers
333 views

XNA 4.0 Pixel Shader 3.0 Exact Texture Lookup/Sample Issue

I am stuck on trying to solve this problem. I originally had some shaders written that worked for XNA 3.1, but after converting to XNA 4.0 they would no longer compile due to instruction counts, flow ...
1
vote
1answer
140 views

Optimize a vertex buffer and generate its associated index buffer

I need to generate a 64*64 grid with each cell being 32*32 wide. The following code works perfectly but I was wondering whether it can be further optimized when creating the index buffer for it. ...
2
votes
3answers
410 views

XNA Rending Bottom Half of Video, How to fix?

First off, sorry if this is a repeat question i didn't see anything similar in my searches. The issue i am having.... When running an XNA game any Video objects & related Texture2D's are not ...
1
vote
0answers
279 views

How to translate a direction on the screen to 3D space?

EDIT: Alright, I've figured out what's wrong. I'm calculating the direction vector properly with the below code: //Get our ship position in screen space Vector3 shipPos = ...
3
votes
3answers
2k views

How to implement marching cube algorithm for rendering clouds

I would like to render clouds using C#, directX9.0 using Microsoft.DirectX.Direct3D; using Microsoft.DirectX; Now I have roughly add and render the vertex as per below: As you can see, the ...
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
796 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
197 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
524 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
316 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
339 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
238 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
942 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
265 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
249 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
343 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
453 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
323 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
383 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
213 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
405 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
661 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
142 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
382 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
543 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
310 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
107 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 ...