Modified/remove entries not working on Xbox? XNA - c#

Ever since I ported my game to Xbox with XNA the code that's supposed to modify and remove entries on the as such as chests, NPC ect hasn't been working. It worked while I was testing on the PC but now it isn't. I double checked over a previous build and it's all the same so I can't reason out what's wrong, I've also debugged the hell out of it but everything returns as it should be.
Here is the code that modifies/removes content: http://pastebin.com/9QKEhAM3
I think if anything that's where the hiccup will be at I just can't find it. I definitely think it's something to do with the one of the quirks of PC/XBOX differences because when I create another windows version of my game Chests and NPC disappear as they should.
If you could help it would be much appreciated.

You have to add some try... catch statements...
I'm sure you have a problem with an uncontrolled exception.
You can use this extended game class too, I've used it in my games and is very effective.
http://blog.nickgravelyn.com/2009/07/a-more-robust-exception-system/

I managed to fix it! It's a really ugly fix but a fix never the less. What I did was simply removed the if removedEntries > 0 conditional. Works like a charm! I'd really like to thank #Blau for all your help as well :)

Related

Unity Prefab Not Updating On Old Android Tablet

I have a Samsung Galaxy Tab Active 1, on the latest version of android it can handle, and just recently, after adding accessibility features that shouldn’t affect anything, the balls in my game stopped updating. I instantiate a ball, and change a few properties on it, and then for some reason I think it’s not calling the update method. There are no errors.
I’ve heard using PrefabUtility to instantiate might help, but I haven’t done that just yet. I will update if PrefabUtility works.
Any advice?
Whoops, this was due to me being a bit stupid. The main reason it was happening was because of a parsing error in some of the accesibility settings, as they were not saved correctly due to weirdness I can't wrap my head around with files in Android. TLDR: file did not save correctly, and so did not load correctly, and so data messed up, and so it errored before it could do anything.

Monogame SoundEffect Crash

I am trying to re-program some old Arcade games in C# with the Monogame engine. However, I have encountered a certain problem.
Since my code tends to be a bit messed up, I am often not taking the effort to reset everything when the player successfully completes the game. Instead, I am simply closing the current Game-instance and opening a new one, like this: (in Program.cs)
if (startgame)
{
do
{
using (var game = new Game1(level, points, soundOn))
game.Run();
} while (continueGame == true);
}
Now the problem. In Game1, I am declaring and playing various SoundEffects. The first run everything works fine, but in all following Game1-instances, my program will always throw an System.AccessViolationException related to SharpDX.XAudio2.dll at the moment I am calling the .Play()-Method of a SoundEffect.
I tried playing SoundEffectInstances instead of the actual SoundEffects. Now it doesn't crash anymore, but is being completely silent from level 2 on instead.
Do you know what could be the reason of this error? Is my game-restarting loop causing problems I did not know about?
Thank you in advance.
(I am using Win 7 64 Bit, VS Express 2015 and Monogame 3.6)
Do you know what could be the reason of this error? Is my game-restarting loop causing problems I did not know about?
Yes. Do not do it.
You are destroying the whole game object just to reset the game. This is a very bad style, because it destroys the whole instance and everything that is connected to it. If you use static variables within it, they will remain in memory which may be the problem you have.
If you want to reset your game, simply write a Reset-method for everything and call these instead. Cleanup and nice code is something you should use instead of terrible hacks.
Can you show more code, so it is possible to understand, what went wrong?
PS: Never write something like while (continueGame == true) always go for while (continueGame).
There is a chance that the issue is due to SharpDX's reaction to the media file itself. For instance, an MP3 file that would work perfectly fine under XNA 4.0 loaded as a SoundEffect (with associated SoundEffectInstance) may crash the game under MonoGame UWP. (This happened to me with one file, but I was already using SoundEffectInstance in the first place when the crashing started.)
As such, have you tried re-encoding your relevant audio files, such as through a utility like Audacity? Although it may not solve the internal issue per se (some element of the audio file breaking SharpDX), if a re-encoded file doesn't have the problem element in the first place, that should be a valid solution for you.

Bricked Netduino 3 WIFI & Netduino Plus 2

I hope someone here can help me. I've managed to brick two Netduinos today. It happens when I run the following code: http://pastebin.com/DjUbM3hN
I found the code example here and from what people say, it should be working just fine. I don't know if my hardware setup can have caused any issues?
But the problem is, when I run the code, then Visual Studio isnt able to find the debugger engine, and after that I cant do anything on either device. I've tried to ping it with MFDeploy, but no luck there either. I am really unsure what happened and what to do from here.
Let me know if anymore details are needed in order to help me. Any help is highly appreciated!
I found a solution here. Really easy. Takes about 2 minutes to reset it with this guide: http://forums.netduino.com/index.php?/topic/11842-how-to-recover-non-responding-netduino-3/#entry62928

Where is my error occuring Unity

When I can run my game perfectly fine, however when it stops I get this error
!CompareApproximately (det, 1.0F, .005f)
UnityEditor.DockArea:OnGUI()
From what I've been able to find I think I would be able to fix it, however I can't find where the error is occuring. I would include code, but I'm not sure what would be relevant. Any ideas would be appreciated.
This error is unrelated to your game code. This is just a small bug within the Unity Editor's internal GUI coding. Although, I thought they had patched this particular one up with the lastest hotfix release. Ensure that you are running the latest version of Unity.
Looks like you're due for a Unity Update.

XNA 4.0 Adding surrounding Sphere/Box to the terrain

i have been searching for long in order to find how i can place a sphere/cube around my playfield so ill have an effect similar to sky. I have seen SkySpheres/Boxes but couldnt implement them . Im looking for a rather simple solution since my play field is really small and i just need something to replace the Clear(Color.Black) .I dont care about collision i just need it to be there with a texture on . Thanks !
You should take a look at Riemers XNA Tutorial
HERE is the post on the skybox.

Categories