Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6
This is the forum to discuss the Wrox book Professional XNA Game Programming: For Xbox 360 and Windows by Benjamin Nitschke; ISBN: 9780470126776
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 4th, 2007, 09:08 AM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.

Reply With Quote
  #2 (permalink)  
Old May 4th, 2007, 09:22 AM
Wrox Author
 
Join Date: May 2007
Location: Hannover, , Germany.
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to abi.exdream.com
Default

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
Reply With Quote
  #3 (permalink)  
Old May 4th, 2007, 02:52 PM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

[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.
Reply With Quote
  #4 (permalink)  
Old May 4th, 2007, 04:23 PM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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).

Reply With Quote
  #5 (permalink)  
Old May 4th, 2007, 04:41 PM
Wrox Author
 
Join Date: May 2007
Location: Hannover, , Germany.
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to abi.exdream.com
Default

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
Reply With Quote
  #6 (permalink)  
Old May 4th, 2007, 08:40 PM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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?

Reply With Quote
  #7 (permalink)  
Old May 8th, 2007, 05:13 PM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #8 (permalink)  
Old May 11th, 2007, 02:26 AM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
XNA : India ram_kimi BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 3 November 1st, 2012 02:53 PM
Using XNA 2.0 ibeanewbie BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 0 January 25th, 2008 05:55 PM
XNA shooter problem alexmbr BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 0 August 10th, 2007 06:26 PM
XNA Shooter - Black Screen DMP_HERE BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 4 August 5th, 2007 06:04 AM
Chapter 11: XNA Shooter - black screen IanBrooks BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 3 August 4th, 2007 08:32 AM



All times are GMT -4. The time now is 08:33 PM.


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