Hot answers tagged

11

Visual Studio 2012 does not work out of the box with XNA 4.0 but there is a workaround but since this still requires VS2010 to be installed as well I would recommend to just use VS2010 since that still works as expected.


11

The wording of your question suggests a misunderstanding of how Unity works (please correct me if I'm wrong), so I'm going to recommend you just try out Unity. "Unity3D scripts" are just .NET classes that inherit from UnityEngine.MonoBehaviour or UnityEditor.EditorWindow. There's nothing stopping you from writing freestanding C# classes or pulling in .NET ...


8

For newcomers to this question, it looks like Microsoft has put up XNA installers for Visual Studio 2010/2012/2013. I haven't personally tested to make sure these work, but they might be worth a look: https://msxna.codeplex.com/releases/ EDIT: After running all included installers for the Visual Studio 2013 release (running VS 2013 Ultimate on my computer),...


8

This is not a good use of object orientation or typing. You've fallen into the trap that inheritance and polymorphism and metaprogramming and language features are there to solve every problem. You should reconsider using a data driven approach. Your current design is partially data driven as you explain it, but the data is embedded in code. You are ...


7

Separation of Concern, shuffling the board shouldn't be done by simulating a user, it should be done directly with the model (as in Model-View-Presenter) class Puzzle { IList<Direction> GetValidMoves(); void MakeMove(Direction); enum Direction {Up, Left, Down, Right}; } With a class similar to the one above you could shuffle the board in this ...


7

I don't know why 2 people voted to close this as I think it is a legitimate questions that isn't more localized than XNA and threading Starting a new thread is relatively expensive and might cause a tiny bit of jittering when you only have 15ms to build a new frame. The best way to overcome this is by using the a thread pool. Here you park a few threads so ...


7

A pseudo-random number generator like C#'s System.Random generates a deterministic sequence of numbers from a starting state, a seed. When you construct a System.Random instance without any arguments, it initializes the seed based on the current time. As your two instances are created very close in time, it's likely that they will get the same seed, and ...


6

(EDIT: The library in progress mentioned at the end of this post now has a project here - https://smallmedialibrary.codeplex.com/) I have spent a few days looking at this and so I will share what I know (and as usual leave the Q. open for future additions). As it turns out, doing video is really hard. It also turns out the only thing harder than doing ...


6

I think many here are in the same boat, so to speak. XNA was great and I had a lot of fun, now I'm moving on as Microsoft is keeping too silent about it, and excluding it in the ways you already noticed. There's a workaround to develop XNA projects with Visual Studio 2012 and they should still run on Windows 8 desktop, but there's no official support from ...


5

Head over to the MONOGAME repo on Codeplex i have XNA running in the Win8 Store in both full game mode and embedded within a XAML Application the discussion forums contain plenty of example on how to achieve this sometime this month MONOGame 3.0 is being released that officially supports Windows8 (rather than using a development branch)


5

I think the problem is that in one frame the objects move fast enough to pass through each other. Behold my ascii art: Frame 1: a is heading towards b +-------+ +-------+ | A | | B | +-------+ +-------+ Frame 2: +----+--+----+ | B| |A | +----+--+----+ At this point the collision response moves them away from each other but the ...


4

Two approaches come to my mind: Render bounding box of the object. The box would be an extrusion of the quad that you are currently rendering. Then implement a shader that does raymarching inside the box to look for texels. This is like volume rendering a 3D texture, but the depth of the texture is 1. This might not be efficient enough though. The positive ...


4

Disclaimer: The following recommendation may or may not be biased due to my personal involvement in the development of this engine. Duality is an extensible 2D game engine that comes with a WYSIWYG editor system. Quick overview: It's plugin-based. You don't write a new application, but a plugin that contains all your code. Plugins feature runtime reload ...


4

Here is a resource on what @""-style string literals are. Basically they turn off escaping. So, for example, you only need @"\", instead of "\\" to get the \ character. Another example: @"\t" gives you \t, whereas "\t" (no at symbol) gives you a tab character. Internally XNA handles the difference between path separator characters. You can use \ or / (or ...


4

The solvability of an n puzzle can be tested (after shuffling) by computing the permutations of the puzzle. "While odd permutations of the puzzle are impossible to solve, all even permutations are solvable." For the math behind this, please see http://mathworld.wolfram.com/15Puzzle.html


4

ClickOnce creates a "setup.exe" that checks for prerequisites (like the .NET Framework and XNA), downloads and installs them from Microsoft's servers, and then invokes your ClickOnce manifest. It is possible to create a setup.exe that installs just prerequisites and then does nothing. The best way to do this is to with an MSBuild script. The creation of "...


4

Yes, it is possible to do using iterators. I've put some pseudo C# code here to give you an idea. You use yield return to return something from an iterator, which has the same behavior as yield in a theoretical coroutine. You can then store the iterators in a list, dictionary, or other structure to keep track of them, and run them all. Note that coroutines ...


3

With XNA you have two approaches: mix your own filters as Bjorn describes in his answer with DynamicSoundEffectInstance (it's fun, try it :) ). The other option is XACT Variables. Watch this video to see somebody use XACT variables to dynamically change an engine sound over time using pitch. To accomplish what you want, do something similar, but use it to ...


3

I don't know XNA, but I can give you a generic answer: What you want is a "low-pass filter" which is a kind of EQ, or equalizer, sometimes simply called an "audio filter". If the system you are using does not have one, you can use a moving average filter: so each sample output will be the average of the previous N inputs (the bigger N is the more "muffling" ...


3

XNA would be the obvious choice for a C# beginner. I suggest installing the XNA GameStudio and getting a copy of the book XNA Game Development by Example: Beginner's Guide. It introduces you to all the important basics and concepts and leaves you well equipped to become a game developer. If you want, you can also use Unity. It's a 3D engine, but allows for ...


3

This creators club thread suggests that WCF has some unnecessary overhead compared to just using the lower level socket API. Have you looked at a third party library like Photon? They're built on top of Enet (C++) and allow you to add logic via .NET. They handle providing infrastructure like message channels, packaging multiple messages, and reliable UDP. ...


3

This is how I do it in my Minecraft clone: http://pastebin.com/10JH8HHF I apologize for the lack of comments in the source, however I will try to explain here: I will skip explanation of the Direct3D specific code - all it is doing is getting access to the texture data in memory. The function is called with one of the arguments a pointer to an array of ...


3

There are at least 3 messages that you can track. WM_SIZE - window resizing, mini/maximization, fullscreen/windowed switching. You shall read into wParam to find out what exactly happened and to lParam for current size. WM_ENTERSIZEMOVE - begin window resizing in windowed mode WM_EXITSIZEMOVE - end window resizing in windowed mode Usually you will not want ...


3

.NET Framework is availble on other operating systems if you use Mono. If your problems are just about cross-platformness, I would highly suggest you use MonoDevelop. However, it seems SDL.NET has some issues with Mono, at least on Android. I suggest you do some research about SDL.NET and Mono and see if would be OK to use this match-up.


3

Note: I'm gonna use the term "pixel" here to refer to a unit of land in your height map. I'll assume your definition of noise are groups of land pixel are that smaller than certain size and you want these removed (turned into water). In that case, a simple method may be just counting the total number of connected pixels (size) for each group of land pixels(...


3

I can't verfiy this right now (no XNA installed), but I'm pretty sure the following should work: Add the text file to your project. Open the file's properties (within VS) and set the following values: Build Action: Content Copy to Output Directory: Copy if newer (or Copy always) Then open the project properties, select the "Publish" tab and click on "...


3

Okay I'll start the wiki. Supported Platforms iOS, Android, Windows (both OpenGL and DirectX), Mac OS X, Linux, Windows 8 Store, Windows Phone 8, PlayStation Mobile, and the OUYA console. References: http://www.monogame.net/ Prerequisites OpenTK - http://www.opentk.com OpenAL - http://connect.creativelabs.com/openal/Downloads/oalinst.zip References: ...


3

I asked the question over on the Monogame forums, this is the list that came from that: Windows Phone 8: No restrictions. Will run on all Windows Phone 8 devices. Windows Store: No restrictions. Same requirements as you you needed to meet to install Windows 8 on that PC. Windows desktop (OpenGL): I think OpenGL 3.0 is the minimum for graphics, plus ...


3

Doing that is possible, though I imagine insanely difficult, and since there is a better way, unnecessary. I'm also assuming that your using OpenGL 2.1, since glRotate was deprecated in OpenGL 3.x. So, Using OpenGL 2.1, instead of reversing the matrix from your physics API, I suggest you just plug that matrix straight into OpenGL. This can be done with ...


3

Add the modifiers to the component that holds the value being modified. This means for the strength attribute, you'd add a list of strength modifiers to the component that defines the strength attribute. The modifiers are just data after all. Then your systems will have no trouble accessing the modifiers because they'll already in the same component.


Only top voted, non community-wiki answers of a minimum length are eligible