p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 (http://p2p.wrox.com/forumdisplay.php?f=325)
-   -   XNA Shooter not working... (http://p2p.wrox.com/showthread.php?t=57479)

savagesoft May 4th, 2007 09:08 AM

XNA Shooter not working...
 
I downloaded the latest version of XNA Shooter and tried to compile and run the contents of XnaShooterContentAndSourceCode.zip. The main menu screen appears and I can move the mouse, but I cannot select any of the menu items using the mouse or shortcuts of M, H, C etc.

The previous version worked straight out of the box.


abi.exdream.com May 4th, 2007 09:22 AM

Hmm, I had this problem on a slow computer before, but I tried to fix it with the latest XNA Shooter version. Have you tried the one from www.XnaProjects.net?

If there is still a problem I will figure it out and fix it asap. My guess is that the Draw method is still called more or less often than Update, which causes Draw to miss some of the input updates (key gets pressed and released immediately after before the next frame is reached). Strange thing is that this happens only in the XNA Shooter game. Try to use different values in BaseGame.Initialize for this.IsFixedTimeStep and this.ForceVsync (or similar). Setting both values to true worked for me in the past, maybe I forgot to activate them in the release build.

http://abi.exdream.com

jeffmorris May 4th, 2007 02:52 PM

[15:50:03] Failed to execute Mission
Error: System.Exception: You can't call Resolve without first setting the render target!
   at XnaShooter.Shaders.RenderToTexture.Resolve()
   at XnaShooter.Shaders.ShadowMapShader.GenerateShadows (RenderDelegate renderObjects)
   at XnaShooter.GameScreens.Mission.RenderLevelBackgrou nd(Single levelPosition)
   at XnaShooter.GameScreens.Mission.Run(XnaShooterGame game)
   at XnaShooter.XnaShooterGame.Draw(GameTime gameTime)

This is from new version of XNA Shooter game.

IanBrooks May 4th, 2007 04:23 PM

That's exactly the same error that I was getting.

Only way I could get around it, and not the fix as suggested by Ben, was to hardcode in a screen resolution of 800x600. Doing this I was able to play the game, although it did get stuck when the game was over, and the HUD gfx sizes were a little screwed.

Maybe it has problems with the laptop resolution I have running (1440x900).


abi.exdream.com May 4th, 2007 04:41 PM

Ok, then it is an issue with textures and render targets greater than 1024x1024. For testing it would probably be best if a settings file like for the racing game is used and allows the user to disable certain features until it works.

http://abi.exdream.com

savagesoft May 4th, 2007 08:40 PM

Hmm My work machine where I tested this earlier also uses a 1440x900 screen resolution. So maybe that is what is causing the mouse clicks not to register or is it something to do with supporting the v1.1 Shader?

When I tried the same XNA Shooter version on my machine at home, Credits, HighScore and Exit work as advertised, while Mission shows a black screen. This machine is running @ 1024x768 and again the previous version runs without any problems ( I have both installed ). The version I downloaded from the XNAProjects.net also does not work! Also worth noting is that the old version compiles without any Warning errors, while the new versions do.

Ben, I would suggest you put the previous version back up there for download until the bugs with the new version are sorted out. Unless others ( not me ) had problems with the previous version as well?


aykutucar May 8th, 2007 05:13 PM

the same problem with me. blank screen when pressed to missions.
I have gf6600 go with 1440X900 directx9c xna 1.0 refresh.
where can I change the resolution in source code?
regards

savagesoft May 11th, 2007 02:26 AM

After some messing around on my WORK machine with the new code, I found that the game detects the mouse clicks and displays all the respective screens and plays the game if I set the screen resolution to 800x600. If I set it to 1024x768 or leave it at the default 1440x900, then it only displays the main menu and nothing else works.

To change the resolution, go to BaseGame.cs and in the constructor you will see...
Code:

// Use current desktop resolution if autodetect is selected.
if (resolutionWidth <= 0
|| resolutionHeight <= 0)
{
    resolutionWidth  = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
    resolutionHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
            } // if (resolutionWidth)

change this to...

Code:

// Use current desktop resolution if autodetect is selected.
if (resolutionWidth <= 0
|| resolutionHeight <= 0)
{
    resolutionWidth  = 800;
    resolutionHeight = 600;
} // if (resolutionWidth)

and it works ( be it slowly, for me ). Now I just need to work out what is causing the black mission screen on my HOME computer.



All times are GMT -4. The time now is 08:54 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.