Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Well guys, it's me again.

First of all:

I got PacMan working. Yay! It is now a (almost) complete game with pellets and powerups...

Now to the question.
I am upgrading the Racing Game starter kit to XNA 4.0, because I am going to totally redo it. But for some reason, it will not run (because of graphics card), and I get these weird warnings:

Warning compiling C:\Projects\XNA\Projects\Racing Games\XNA-4-Racing-Game-Kit\RacingGameWindows1\RacingGame\RacingGameContent\Shaders\NormalMapping.fx:

Warning X3571: pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them.
C:\Projects\XNA\Projects\Racing Games\XNA-4-Racing-Game-Kit\RacingGameWindows1\RacingGame\RacingGameContent\Shaders\NormalMapping.fx

and so on. Does anyone know what these warnings mean, and if they have anything to do with the application not running?

I have a Intel video card, on a Windows 7 desktop machine, and I'm using the Reach profile.

Thanks!
Posted
Comments
LanFanNinja 11-Dec-11 19:34pm    
Check my solution.

Congratulations on PacMan! Your graphics card should not be causing this game not to run because you ran the Robot Game just fine correct?

I recommend that you go here and grab the racing game already converted to XNA 4.0
https://github.com/Pepsi1x1/XNA-4-Racing-Game-Kit[^]

Here is the link from that page to download the archive as a zip file
https://github.com/Pepsi1x1/XNA-4-Racing-Game-Kit/zipball/master[^]

Note: Go into the options and enable/disable post screen effects, shadows, and high detail to get the best looking graphics.

Hope this helps.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 11-Dec-11 20:25pm    
You see, in your answer you totally missed the essence of the problem, which is in the nature of floating-point arithmetic. (I did not vote.) Please see my answer.
--SA
LanFanNinja 11-Dec-11 20:53pm    
I was only considering the fact that the OP wanted to modify and build upon the starter kit to create his own game. I know from experience the problems he will face to convert this particular XNA 3.0 project to XNA 4.0 (a lot more problems than is posted in his question). I thought it was best to avoid these problems all together by offering a link where he can download the already converted solution so he can focus his time on the game.
ge-force 12-Dec-11 16:01pm    
Thanks guys.

You are right, that I got the Robot Game to run on my computer, but Racing Game has stuff like high-speed terrain rendering, lens flare oscolate queries, and transparent stuff like car windows.

So Racing Game requires a little more rendering power. But I checked in DirectX Caps Viewer, and I have Shader Model 2.0, and Vertex Model 0.0. This may not be causing the problem, but I am getting a new graphics card for Christmas, so if I don't figure it out, that will solve any rendering problems.

@SAKryukov: Should I then do a try - catch statement, and set the values to positive defaults if they become negative?

P.S. And sorry guys if I'm asking to many questions. Its just that this conversion stuff is really hard.

@LanFanNinja: I already have seen that link, but I decided to convert it on my own. Thanks though! :-)
What else would you expect of f is negative? The value f is to be raised in the power e. Everyone should know from elementary school algebra, that power operation is not defined on the whole set of real numbers. (It is defined on complex numbers which is not the case.)

Consider this (square root from real -1):

C#
double pow = 0.5;
double bs = -1;
double x = Math.Pow(bs, pow);


In .NET for Windows, the value is System.Double.NaN (not a number), which is a very reasonable result. The processors of x86, IE-64 and x86-64 and instruction-set architectures allow the mode where some floating point operations return NaN, or the mode where such operation throw exception — all legal. You just did not come across any trouble in your previous compilation of the system. Hard to say why but it can easily happen.

Consider yourself lucky. You got a diagnostics of incompatibility free of charge! Re-visit your calculations, find out why you have such input values for power operation and fix your code.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900