Xbox and WP7 not working?

Feb 5, 2012 at 7:09 AM

Hi,

I went and tried to see if I can get the code from tutorial 4 to work on my Xbox and WP7 but get this Exception error when I run it:

An unhandled exception of type 'System.Exception' occurred in SynapseGaming-SunBurn-Pro.dll

Additional information: Product not activated, please run activation tool.

I know my SunBurn is activated as I am able to get the tutorials to run on my computer and have gotten a sample from the Sunburn website to work on my Xbox so the only thing I can think of is that I need to modify something in the code to get it to work.

I know that Indiefreaks is working on a revised version of the tutorials but wondering if anyone has tried porting the tutorials to the other platforms? If so what did you have to do to get it working as the platform I want to target is WP7 but if no one has I'll continue with going with the tutorials for Windows until the revised tutorials come out.

Feb 5, 2012 at 8:23 AM

With mmsbludhound's help I was able to figure out what was causing the error as had to add the SunBurn-Deplu.auth file to the project. Now need to figure out how to add the input for WP7 so I can see if I can get that working and continue with the tutorials.

Coordinator
Feb 5, 2012 at 5:01 PM

Hi,

The WP7 vitual gamepad isn't available in v0.9.1 but will be released in the next version.

Until then, you may build the framework from the latest changeset in the source code tab.

Feb 5, 2012 at 9:22 PM
Edited Feb 5, 2012 at 9:54 PM

Hi,

I went and downloaded the latest changeset but how do I go by creating the dll files as I have never done that before.

I am also getting these errors when building the Pro projects:

Error    56    Resource file "BEPU\Resources\WindowsPhysicsResources.resx" cannot be found.    Indiefreaks.Game.Physics Windows (SunBurn Pro)

Error    57    Resource file "BEPU\Resources\Xbox360PhysicsResources.resx" cannot be found.    Indiefreaks.Game.Physics Xbox 360 (SunBurn Pro)

Feb 6, 2012 at 4:48 AM
Edited Feb 6, 2012 at 5:20 AM

I went and built just the WP7 Pro project from the source code as couldn't figure out how to solve the above problem. I took the binary files from the bin folders and added those to my WP7 project which was the tutorial for the press start screen. I am getting an exception error after the Indiefreaks splash screen that states:

Indiefreaks.Xna.Core.ContentLoadingException was unhandled
  Message=XNA Framework Reach profile supports a maximum Texture2D size of 2048.
  StackTrace:
       at Indiefreaks.Xna.Core.GameState.<Load>b__2()
       at Indiefreaks.Xna.Threading.ThreadPool.Update()
       at Indiefreaks.Xna.Core.Application.Update(GameTime gameTime)
       at Microsoft.Xna.Framework.Game.Tick()
       at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
       at Microsoft.Xna.Framework.GameHost.OnIdle()
       at Microsoft.Xna.Framework.MobileGameHost.RunOneFrame()
       at Microsoft.Xna.Framework.MobileGameHost.gameLoopTimer_Tick(Object sender, EventArgs e)
       at Microsoft.Xna.Framework.DispatcherTimerWin32.TimerElapsed(IntPtr hWnd, UInt32 uMsg, IntPtr nIDEvent, UInt32 uTime)
  InnerException: System.NotSupportedException
       Message=XNA Framework Reach profile supports a maximum Texture2D size of 2048.
       StackTrace:
            at Microsoft.Xna.Framework.Graphics.ProfileCapabilities.ThrowNotSupportedException(String message, Object arg1, Object arg2)
            at Microsoft.Xna.Framework.Graphics.Texture2D.ValidateCreationParameters(ProfileCapabilities profile, Int32 width, Int32 height, SurfaceFormat format, Boolean mipMap)
            at Microsoft.Xna.Framework.Graphics.RenderTarget2D..ctor(GraphicsDevice graphicsDevice, Int32 width, Int32 height, Boolean mipMap, SurfaceFormat preferredFormat, DepthFormat preferredDepthFormat, Int32 preferredMultiSampleCount, RenderTargetUsage usage)
            at Indiefreaks.Xna.Rendering.Gui.Control.PrepareRenderTarget(GraphicsDevice device)
            at Indiefreaks.Xna.Rendering.Gui.Control.Indiefreaks.Xna.Rendering.Gui.IGuiElement.Refresh(GraphicsDevice device)
            at Indiefreaks.Xna.Rendering.Gui.Image.LoadContent(IContentCatalogue catalogue, ContentManager manager)
            at Indiefreaks.Xna.Core.ContentCatalogue.Add(IContentHost host)
            at Indiefreaks.Xna.Core.GameState.LoadAsynchronously()
            at Indiefreaks.Xna.Threading.DelegateWork.DoWork()
            at Indiefreaks.Xna.Threading.WorkItem.DoWork(Int32 expectedId)
            at Indiefreaks.Xna.Threading.Task.DoWork()
            at Indiefreaks.Xna.Threading.BackgroundWorker.WorkLoop()
            at System.Threading.ThreadHelper.ThreadStartHelper(ThreadHelper t)
            at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
            at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
            at System.Threading.ThreadHelper.ThreadStartHelper()

Which is weird as when I used the WP7 binary files from v0.9.1 I don't get that error.

Coordinator
Feb 6, 2012 at 12:47 PM
Strikerx87 wrote:

Hi,

I went and downloaded the latest changeset but how do I go by creating the dll files as I have never done that before.

I am also getting these errors when building the Pro projects:

Error    56    Resource file "BEPU\Resources\WindowsPhysicsResources.resx" cannot be found.    Indiefreaks.Game.Physics Windows (SunBurn Pro)

Error    57    Resource file "BEPU\Resources\Xbox360PhysicsResources.resx" cannot be found.    Indiefreaks.Game.Physics Xbox 360 (SunBurn Pro)


On the top of the solution, you'll find a Content folder which hosts 2 content projects for Windows & Xbox 360. These content projects are required to build some embedded content in both IGF Physics and Post processor assemblies. They may be unloaded in the solution and if it is the case, make sure to load them right clicking on them and selecting the Load project menu item.

That should solve the building issue.

Coordinator
Feb 6, 2012 at 12:50 PM
Strikerx87 wrote:

I went and built just the WP7 Pro project from the source code as couldn't figure out how to solve the above problem. I took the binary files from the bin folders and added those to my WP7 project which was the tutorial for the press start screen. I am getting an exception error after the Indiefreaks splash screen that states:

Indiefreaks.Xna.Core.ContentLoadingException was unhandled
  Message=XNA Framework Reach profile supports a maximum Texture2D size of 2048.
  StackTrace:
       at Indiefreaks.Xna.Core.GameState.<Load>b__2()
       at Indiefreaks.Xna.Threading.ThreadPool.Update()
       at Indiefreaks.Xna.Core.Application.Update(GameTime gameTime)
       at Microsoft.Xna.Framework.Game.Tick()
       at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
       at Microsoft.Xna.Framework.GameHost.OnIdle()
       at Microsoft.Xna.Framework.MobileGameHost.RunOneFrame()
       at Microsoft.Xna.Framework.MobileGameHost.gameLoopTimer_Tick(Object sender, EventArgs e)
       at Microsoft.Xna.Framework.DispatcherTimerWin32.TimerElapsed(IntPtr hWnd, UInt32 uMsg, IntPtr nIDEvent, UInt32 uTime)
  InnerException: System.NotSupportedException
       Message=XNA Framework Reach profile supports a maximum Texture2D size of 2048.
       StackTrace:
            at Microsoft.Xna.Framework.Graphics.ProfileCapabilities.ThrowNotSupportedException(String message, Object arg1, Object arg2)
            at Microsoft.Xna.Framework.Graphics.Texture2D.ValidateCreationParameters(ProfileCapabilities profile, Int32 width, Int32 height, SurfaceFormat format, Boolean mipMap)
            at Microsoft.Xna.Framework.Graphics.RenderTarget2D..ctor(GraphicsDevice graphicsDevice, Int32 width, Int32 height, Boolean mipMap, SurfaceFormat preferredFormat, DepthFormat preferredDepthFormat, Int32 preferredMultiSampleCount, RenderTargetUsage usage)
            at Indiefreaks.Xna.Rendering.Gui.Control.PrepareRenderTarget(GraphicsDevice device)
            at Indiefreaks.Xna.Rendering.Gui.Control.Indiefreaks.Xna.Rendering.Gui.IGuiElement.Refresh(GraphicsDevice device)
            at Indiefreaks.Xna.Rendering.Gui.Image.LoadContent(IContentCatalogue catalogue, ContentManager manager)
            at Indiefreaks.Xna.Core.ContentCatalogue.Add(IContentHost host)
            at Indiefreaks.Xna.Core.GameState.LoadAsynchronously()
            at Indiefreaks.Xna.Threading.DelegateWork.DoWork()
            at Indiefreaks.Xna.Threading.WorkItem.DoWork(Int32 expectedId)
            at Indiefreaks.Xna.Threading.Task.DoWork()
            at Indiefreaks.Xna.Threading.BackgroundWorker.WorkLoop()
            at System.Threading.ThreadHelper.ThreadStartHelper(ThreadHelper t)
            at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
            at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
            at System.Threading.ThreadHelper.ThreadStartHelper()

Which is weird as when I used the WP7 binary files from v0.9.1 I don't get that error.


I found out that the GUI Controls may try to create a RenderTarget2D that would be outside of the Graphics adapther capabilities. It is solved in my local workspace and will be availbale in my next checkin.
Until then, you may want to go on any of the GUI projects and in the Control.cs file, find the PrepareRenderTarget method and replace its content by the following code:

        /// <summary>
        /// Creates or recreate the RenderTarget where the control will be rendered
        /// </summary>
        /// <param name="device"></param>
        public void PrepareRenderTarget(GraphicsDevice device)
        {
#if WINDOWS_PHONE
            const bool useMipMap = false;
            var width = Math.Min(Width, 2048);
            var height = Math.Min(Height, 2048);
#else
            const bool useMipMap = true;
            var width = Math.Min(Width, 4096);
            var height = Math.Min(Height, 4096);
#endif
            _renderTarget2D = new RenderTarget2D(device, Math.Max(width, 1), Math.Max(height,1), useMipMap, SurfaceFormat.Color, DepthFormat.None, Application.Graphics.GraphicsDevice.PresentationParameters.MultiSampleCount, RenderTargetUsage.PreserveContents);
        }
Feb 6, 2012 at 4:59 PM

Thanks for the help! Downloading that latest source code now. :)

Feb 6, 2012 at 10:10 PM

I just got home and was able to build the framework with no problems this time. :) But when I try running the press start screen tutorial for WP7 with this new build I'm getting a new exception error:

Indiefreaks.Xna.Core.ContentLoadingException was unhandled
  Message=This resource could not be created.
  StackTrace:
       at Indiefreaks.Xna.Core.GameState.<Load>b__2()
       at Indiefreaks.Xna.Threading.ThreadPool.Update()
       at Indiefreaks.Xna.Core.Application.Update(GameTime gameTime)
       at Microsoft.Xna.Framework.Game.Tick()
       at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
       at Microsoft.Xna.Framework.GameHost.OnIdle()
       at Microsoft.Xna.Framework.MobileGameHost.RunOneFrame()
       at Microsoft.Xna.Framework.MobileGameHost.gameLoopTimer_Tick(Object sender, EventArgs e)
       at Microsoft.Xna.Framework.DispatcherTimerWin32.TimerElapsed(IntPtr hWnd, UInt32 uMsg, IntPtr nIDEvent, UInt32 uTime)
  InnerException: System.OutOfMemoryException
       Message=This resource could not be created.
       StackTrace:
            at Microsoft.Xna.Framework.Graphics.RenderTargetHelper.CreateRenderTarget(GraphicsDevice device, Boolean mipMap, Boolean isCubeMap, UInt32& levelCount)
            at Microsoft.Xna.Framework.Graphics.RenderTarget2D..ctor(GraphicsDevice graphicsDevice, Int32 width, Int32 height, Boolean mipMap, SurfaceFormat preferredFormat, DepthFormat preferredDepthFormat, Int32 preferredMultiSampleCount, RenderTargetUsage usage)
            at Indiefreaks.Xna.Rendering.Gui.Control.PrepareRenderTarget(GraphicsDevice device)
            at Indiefreaks.Xna.Rendering.Gui.Control.Indiefreaks.Xna.Rendering.Gui.IGuiElement.Refresh(GraphicsDevice device)
            at Indiefreaks.Xna.Rendering.Gui.Image.LoadContent(IContentCatalogue catalogue, ContentManager manager)
            at Indiefreaks.Xna.Core.ContentCatalogue.Add(IContentHost host)
            at Indiefreaks.Xna.Core.GameState.LoadAsynchronously()
            at Indiefreaks.Xna.Threading.DelegateWork.DoWork()
            at Indiefreaks.Xna.Threading.WorkItem.DoWork(Int32 expectedId)
            at Indiefreaks.Xna.Threading.Task.DoWork()
            at Indiefreaks.Xna.Threading.BackgroundWorker.WorkLoop()
            at System.Threading.ThreadHelper.ThreadStartHelper(ThreadHelper t)
            at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
            at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
            at System.Threading.ThreadHelper.ThreadStartHelper()

Coordinator
Feb 7, 2012 at 12:48 AM

I don't really have the time right now to look at the previous tutorial support with the latest build: I decided to stop working on them because there were too many breaking changes to go on.

Sole thing I can tell you would be to add a breakpoint in the Control.PrepareRenderTarget method and see what are the values passed as width and height as I guess that's the sole way to generate a OutOfMemoryException while creating a RenderTarget: providing too large texture resolutions.

Feb 7, 2012 at 4:51 AM

Thanks for the suggestion so far it has to do with the GameTitle Image. I set a break point on the _gameTitleImage = new Image line and my _gameTitleImage is never set a value which I'm guessing is causing the exception.

Feb 9, 2012 at 3:50 AM

Just wanted to update on my progress which I have commented out the code the the game title as wasn't able to figure out what the problem was with and have gotten to where I can go to the menu screen and start. It is a bit slow at responding to the touches and loading the game play screen so going to be looking into that next and adding the virtual game pad.

Coordinator
Feb 9, 2012 at 7:55 AM

Cool, the latest changeset should help you getting input reacting faster ;)