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
votes
1answer
888 views

Xna tile map collision

I finally found a tutorial on tile maps and loading them in from a file that I understand (http://circlessuck.blogspot.co.uk/2012/09/xna-tutorial-basic-tile-engine-part-2.html), however the tutorial ...
1
vote
2answers
324 views

How to tile multiple procedurally generated textures?

I'm trying to develop a procedural tile generator for a game, mostly for the ground tiles, instead of using "hand-drawn" tiles. To achieve this I'm using Perlin noise and a sine wave with multiple ...
1
vote
2answers
331 views

Rotate around the centre of the screen

I want my camera to rotate around the centre of screen and I'm not sure how to achieve that. I have a rotation in the camera but I'm not sure what its rotating around. (I think it might be rotating ...
0
votes
1answer
869 views

How to make custom shaped holes in terrain

So I'm trying to create a game where you fit certain shaped objects into the hole that fits them (similar to the young children's game with different shaped blocks) in Unity 3D. I've encountered a ...
0
votes
1answer
381 views

XNA & HLSL - rendering a model with its original materials (colors)

I am currently trying to code my own HLSL effect file, in order to render an FBX model I made with Autodesk maya, and to which I have applied some materials (colors). before trying to write an effect ...
1
vote
2answers
154 views

Rotating sprite 180 deg

I should say first, that I have the rotation down. Its just that I want my square to rotate exactly 180 degrees. Currently, it will rotate but it will rotate but by less each jump. So after several ...
1
vote
1answer
532 views

Using multiple passes in OpenCL .net

I'm new to opencl but I have some experience using HLSL. In HLSL multiple passes are used when you need to finish a computation before moving on to the next step. I would like to know how this sort ...
-1
votes
1answer
267 views

3d Wall sliding collision

I'm working on collision for walls in my game and the way I currently have it I get stuck walking into a wall. I'm trying to make my character slide on the walls but still collide. My character moves ...
0
votes
1answer
212 views

Monogame/SharpDX Texture2D doesn't hold value

The problem I have discovered is most likely between classes, so I dont really have much option but to post the whole code here: https://www.dropbox.com/sh/smyw9t1ap3by2vd/pBX-aJJ-Qx I have been ...
2
votes
2answers
401 views

How do I rotate a single object in HLSL?

I have a World with a 3D model of a head in it and that World rotates, like such: protected override void Update(GameTime gameTime) { //other stuff angle += 0.00005f; //more other stuff ...
0
votes
2answers
325 views

Pause and Re-Enter Game Component Update (XNA)

I'm currently working on a (trading) card game in XNA and I'm having some trouble with returning results from a popup and immediately using them. I'm able to make a popup screen (see this tutorial) ...
0
votes
1answer
748 views

ASP.NET MVC & SQL Server vs. PHP & MySql

I'm going to develop a strategy browser-based game with ASP.NET MVC and SQL Server. However, as I explored the web to get some ideas and patterns from existing games, I found out that none of them ...
1
vote
0answers
455 views

Windows 8 C# Compile spritefonts for MonoGame without XNA

Hello Stack Exchange community. Recently, I've been attempting to in some way generate sprite-fonts into XNB files for use with MonoGame. The issue is however, as you may be aware, XNA is very ...
3
votes
1answer
302 views

Automatic shadow for isometric objects

I have like hunderd of isometric objects. One example: I'm trying to find a way to automate creation of shadow they're casting. I ended up with following transformation: matrix.Shear(-0.25f, ...
0
votes
1answer
179 views

What's wrong with reversing an action like this?

I'm working on an undo and redo system map editor and have come across a major issue. If I place a tile down, move right a tile, and then move back to that tile I previously placed everything works ...
-1
votes
1answer
219 views

Difficulties with zoom point

I want to zoom about an arbitrary zoom point. For example, if the player tabs on a place on his windows phone display, this place(position) should get the new center of his viewport. In addition, the ...
1
vote
1answer
9k views

Correct way to use a GameObject.Find method in Unity C#

I have been following along with a Lynda.com video course to familiarize with Unity. I am currently attempting to grab a reference to a scene's First Person Controller's transform as follows: ...
3
votes
2answers
269 views

Target a specific Entity in a Component-Entity design

I'm starting to work on a game with Entity-Component Model Architecture (Artemis in C#). I'm beginning with something pretty simple, entities which are living things, with HealthComponent, ...
2
votes
1answer
486 views

Monogame crashes without any change

I've written a game in MonoGame, which works great on my desktop computer. It's running Windows 8, has a good graphics card and can be assumed to be up to date with everything. However, when I run on ...
-1
votes
1answer
191 views

Recommended aspect ratio for android / smartphones?

I'm making a game for android and would do it in 720p, but the phones got all different aspect ratios. Also thinking about a ios and windows phone port later. When the aspect ratio does not match, ...
0
votes
2answers
431 views

XNA Multiple Key Input

I'm using the KeyboardState state way (if there are any others) of handling key presses for a PC game. It has been working fine for single key presses but now I am trying to handle multiple key ...
6
votes
2answers
303 views

Where to put Entity Death Events in a Component/System Design

Entities in my game are nothing more than a collection of components, tied together with an entityID. I have (near) data-only components, and systems that work on the data. One of these components is ...
2
votes
2answers
264 views

Large resolution differences

I want to develop a game on multiple devices such as PC, Android or IOS. Want it to be in 1080p, but that means a massive scale down for the smartphones. I know how to do that, just render everything ...
-2
votes
1answer
173 views

Optimization Question about Singleton [closed]

I am using Unity with c#. I have two objects and one needs to call a function from the other which is a Singleton. For this I have two solutions. But what's the best thing to do : - Call for : ...
0
votes
1answer
110 views

2D Collision detection and reaction: Rect to Line

I'm working on a little 2D side scrolling platformer with a couple of friends. The issue I'm having is the level is completely defined by points. They are just a bunch of points which when I read in I ...
4
votes
1answer
125 views

Masking an area inside/outside a line strip

I have some point lights in my game which are just sprites implemented with help of HLSL. Currently I'm trying to implement dynamic shadows and I managed to make the program calculate the area in ...
0
votes
1answer
141 views

Is my social game technical solution viable?

I'm currently working on a board social game using HTML5 (canvas) & Asp.net MVC 4, Azure, Sql server, EF. I'd like to do a server side realtime validation (using Ajax) of a player moves (not more ...
4
votes
4answers
876 views

Face-Click Detection ( like in Minecraft )

I am working on a box-based game engine like minecraft and I was wondering how to detect the "clicked face" when placing blocks. I have created this engine in C++ ( DirectX / D3D ), C# ( XNA ) and ...
1
vote
1answer
90 views

What are some effective methods of documenting packet protocols?

I'm working with a few developers on a hobby project and we have a lot of different APIs. What are some popular methods of creating documentation on the potential requests, and what can be expected to ...
3
votes
2answers
2k views

C# Item system design approach, should I use abstract classes, interfaces or virutals?

I'm working on a Resident Evil 1/2/3/0/Remake type of game. Currently I've done a big part of the inventory system (here's a link if you wanna see my inventory, pretty outdated, added a lot of ...
4
votes
2answers
768 views

How to implement an event system

Im trying to implement an Event System for a game, where there are classes that can fire or handle an event wheter or not they implement these interfaces: public interface IGameEvent<T> where T ...
0
votes
1answer
139 views

How to control in the vertex shader where pixel ends up in the renderTarget?

What if I have an arbitrary renderTarget, that is smaller than the screen (say it is 1x1 pixel) and I want to make sure in the VertexShaderFunction that all my pixels end up exactly in that 1 pixel ...
1
vote
3answers
447 views

Tile Collision & Sliding against tiles

I have a tile based map with a top down camera. My sprite stops moving when he collides with a wall in any of the four directions however I am trying to get the sprite to slide along the wall if more ...
3
votes
1answer
331 views

Jittery Movement, Uncontrollably Rotating + Front of Sprite?

So I've been looking around to try and figure out how I make my sprite face my mouse. So far the sprite moves to where my mouse is by some vector math. Now I'd like it to rotate and face the mouse as ...
1
vote
0answers
108 views

DepthStencilState System.ObjectDisposedException [closed]

I developed a Windows Phone 7 & 8 game and released it already. Having integrated BugSense, I received a handful of errors mainly from specific versions of Windows Phone 8 OS (mainly ...
1
vote
0answers
144 views

Matrix array doesn't seem to get populated

I'm trying to stream an array of matrices to a vertex shader, but it seems that only the first matrix works. What could be the problem? I suspect that I upload the matrices in a wrong way. C# ...
0
votes
2answers
136 views

How to avoid character to move when selected

I've got a player Class which can walk to a certain point on the screen when left mouse is pressed: if (mState.LeftButton == ButtonState.Released && oldMouseState.LeftButton == ...
3
votes
1answer
754 views

Incorrect GPU skinning

I'm having some problems with implementing skinning and skeletal animation. It seems that the skeleton and the mesh are loaded correctly, but the mesh gets funky when the bone transformations are ...
0
votes
1answer
204 views

Storing player's tilemap position inside the player object

I'm trying to create a multidimensional array as a sort of 2D map for a text-based RPG game. I want to create a multidimensional array that's, for example, 5x5. The array would be filled with 0s to ...
8
votes
2answers
1k views

What is data-driven design? [closed]

I've been reading up on a lot of articles covering data driven design for games. It seems to come down to: No hard coding No game-specific code in the engine Scripting for AI, cutscenes, et cetera. ...
2
votes
1answer
546 views

GPGPU Programming using HLSL and XNA

XNA Newbie question: I'm trying to get the GPU to perform some calculations for me. I'm trying to figure out how to send some data to the GPU, get the GPU to process it, then get the result back. ...
2
votes
1answer
228 views

3D movement on an authoritiative server?

I'm developing an MMORPG, using Unity for the client and "standard" C# 4.0 for the authoritative server. The server should check each player's movement and ensure that it does not collide with props ...
-2
votes
1answer
150 views

How do I play a sound just once when the cursor enters my button?

I want to play a sound when the mouse is within the bounds of a button. When I first did it, it was just a constant sound no stoppages. But I then did it through a SoundEffectInstance, which just ...
2
votes
1answer
313 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
289 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
322 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
139 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
278 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 ...