-
-
- (0)
-
premium membership
-
Posts
74
|
Re: XNA Games 'jump', but professional games do not.
|
I did what everybody suggested and it did not make anything better.
|
|
-
|
|
Re: XNA Games 'jump', but professional games do not.
|
Whiplash6: I just got back from a format a few days ago so a re-install of DX and XNA wont help. I am not sure how to get an update for my bios.
I had 2 other people test it, 1 person has the same problem, the other person does not. Any ideas?
Bios updates (also known as a firmware update) come from your mobo manufacturer. For instance I run with Asus (personal preference thing) If you didn't build your own consult with the person or company that did to determine the manufacturer. You typically only update your bios when you encounter a problem (this would fall under that category). Given the info provided I'm less likely to say it's a GC issue, but of course it cannot be ruled out. I have one more test I could try, but it would take me some time to do, and I don't have that right now. Basically creating a constant 2d particle effect, one with recycling, one without and seeing if it the problems remain a constant. Still if the problem starts from the beginning, with your memory I don't see it. But I can't rule anything out. BTW, what were your friends test systems stats (best guess)? Just curious as it might narrow down the problem.
http://www.freewebs.com/campelmxna/ - C# and XNA tutorials The only stupid mistake is the one you make twice
|
|
-
-
- (0)
-
premium membership
-
Posts
74
|
Re: XNA Games 'jump', but professional games do not.
|
Camp ELM: Whiplash6: I just got back from a format a few days ago so a re-install of DX and XNA wont help. I am not sure how to get an update for my bios.
I had 2 other people test it, 1 person has the same problem, the other person does not. Any ideas?
Bios updates (also known as a firmware update) come from your mobo manufacturer. For instance I run with Asus (personal preference thing) If you didn't build your own consult with the person or company that did to determine the manufacturer. You typically only update your bios when you encounter a problem (this would fall under that category). Given the info provided I'm less likely to say it's a GC issue, but of course it cannot be ruled out. I have one more test I could try, but it would take me some time to do, and I don't have that right now. Basically creating a constant 2d particle effect, one with recycling, one without and seeing if it the problems remain a constant. Still if the problem starts from the beginning, with your memory I don't see it. But I can't rule anything out. BTW, what were your friends test systems stats (best guess)? Just curious as it might narrow down the problem.
One is on a laptop (had the problem), and the other has SLI 8800GTS(did not have the problem). they both have 2GB of ram Core2s, and 250GB HDD
|
|
-
|
|
Re: XNA Games 'jump', but professional games do not.
|
Well the laptap might have had a problem with it's graphics card driver (might want to find out about what onboard graphics it has). The other is obviously overkill with SLI 8800's, which kind of proves my point about XNA adjusting to the processor/graphics card changes. Bios seems like a long shot honestly but it might just be your problem. Depending on the mobo (for instance Asus doesn't require a flash or floppy drive) it can be quite simple. But you might need a blank 3.5" disk for it depending on the manufacturer. I'll be back on tommorrow later. If you've flashed your bios and it still is an issue I'll write up a quick test to see if there's a difference between 2 similar programs (1 with recycling, 1 without) to see if there's a performance difference. It just seems like it's less of an XNA issue to me because the way computers work but again I'll reserve judgement till we know for sure.
http://www.freewebs.com/campelmxna/ - C# and XNA tutorials The only stupid mistake is the one you make twice
|
|
-
-
- (0)
-
premium membership
-
Posts
74
|
Re: XNA Games 'jump', but professional games do not.
|
Camp ELM:Well the laptap might have had a problem with it's graphics card driver (might want to find out about what onboard graphics it has). The other is obviously overkill with SLI 8800's, which kind of proves my point about XNA adjusting to the processor/graphics card changes. Bios seems like a long shot honestly but it might just be your problem. Depending on the mobo (for instance Asus doesn't require a flash or floppy drive) it can be quite simple. But you might need a blank 3.5" disk for it depending on the manufacturer. I'll be back on tommorrow later. If you've flashed your bios and it still is an issue I'll write up a quick test to see if there's a difference between 2 similar programs (1 with recycling, 1 without) to see if there's a performance difference. It just seems like it's less of an XNA issue to me because the way computers work but again I'll reserve judgement till we know for sure.
Yeah the bios update didnt fix it. I want to know why 3D games run better than basic games.
|
|
-
|
|
Re: XNA Games 'jump', but professional games do not.
|
Well the only test I personally have right now that I can come up with, between two very similar 2d tests to see if there's a performance differernce. Trust me, you'll know if there's a difference if you're running a 1000 particles that are recyled vs 1000 that aren't. But again tonight I'm not coding anything for personal reasons.
Regarding my eperience, if there's a difference soon we can narrow it down. If it's more ambigious then it's really up to the XNA team to figure out why this is happening and they can reference the info from this thread to get a better clue as to what's going on.
http://www.freewebs.com/campelmxna/ - C# and XNA tutorials The only stupid mistake is the one you make twice
|
|
-
-
- (1115)
-
premium membership
-
Posts
859
|
Re: XNA Games 'jump', but professional games do not.
|
I get this as well, in my case it seems to be when a network access occurs, outlook checks for email or norton looks for updates.
I have put it down to norton having critical code sections to do network handling.
Information is not knowledge, knowledge is not wisdom, wisdom is not truth, truth is not beauty, beauty is not love, love is not music, music is the best! Wisdom is the domain of the Wis (which is extinct).
|
|
-
-
- (4670)
-
premium membership
MVP
-
Posts
2.729
|
Re: XNA Games 'jump', but professional games do not.
|
My initial response to your question for why XNA game jump but professional games do not is simply that professional have professional game coders.
But, when you said even simple 2D games that just move a sprite around on the screen seem to jump the worst for you, that threw that idea out the window.
There are things that can make a 2D game jump related to coding. Not moving the sprites at integer positoins can cause "jumps". Excessive garbage collection can cause "jumps". Even not moving your sprite based on time can cause "jumps" on monitors with different refresh rates.
...but with all of that said, I was re-writing my Wizard tutorial and was working on part one, making a sprite move around the screen and it was jumping like crazy. No mater what I did, it just wouldn't move smoothly and just stuttered along. I worked for over an hour refactoring what was already very simple code and trying to correct anything that might be causing stuttering issues for the 2D sprite. I even re-booted several times just in case.
Then, when checking out task manager just to get a feel for what was running on my PC, I noticed that explorer was taking up 98% of my CPU time. That will DEFINITELY cause some stuttering.
So on the PCs that have the stuttering, check task manager and see what processes might be hogging the CPU. That's my guess for why you're seeing this. Maybe there's some file indexing going on, maybe a virus scan is going on in the background, maybe you have backup software running. But I bet there's a process that's taking up all your CPU.
(LOL, and thanks for the site pimping CampELM. I appreciate it :) And yep, I can commiserate with you. Going through our old content and getting it updated is a very time consuming process. I'm almost halfway there though!)
|
|
-
-
- (1614)
-
premium membership
-
Posts
858
|
Re: XNA Games 'jump', but professional games do not.
|
The jumping thing has been reported before. I personally experienced it when running my game (which runs fine on my PC) on a friend´s computer. His PC has similar specs to mine.
|
|
-
-
- (0)
-
premium membership
-
Posts
74
|
Re: XNA Games 'jump', but professional games do not.
|
George Clingerman:My initial response to your question for why XNA game jump but professional games do not is simply that professional have professional game coders.
But, when you said even simple 2D games that just move a sprite around on the screen seem to jump the worst for you, that threw that idea out the window.
There are things that can make a 2D game jump related to coding. Not moving the sprites at integer positoins can cause "jumps". Excessive garbage collection can cause "jumps". Even not moving your sprite based on time can cause "jumps" on monitors with different refresh rates.
...but with all of that said, I was re-writing my Wizard tutorial and was working on part one, making a sprite move around the screen and it was jumping like crazy. No mater what I did, it just wouldn't move smoothly and just stuttered along. I worked for over an hour refactoring what was already very simple code and trying to correct anything that might be causing stuttering issues for the 2D sprite. I even re-booted several times just in case.
Then, when checking out task manager just to get a feel for what was running on my PC, I noticed that explorer was taking up 98% of my CPU time. That will DEFINITELY cause some stuttering.
So on the PCs that have the stuttering, check task manager and see what processes might be hogging the CPU. That's my guess for why you're seeing this. Maybe there's some file indexing going on, maybe a virus scan is going on in the background, maybe you have backup software running. But I bet there's a process that's taking up all your CPU.
(LOL, and thanks for the site pimping CampELM. I appreciate it :) And yep, I can commiserate with you. Going through our old content and getting it updated is a very time consuming process. I'm almost halfway there though!)
I already checked task manager while the game ran, it didnt go above 40% at all. And besides, I tried it while nothing was running in the background too. Also, when Task Manager or any other window has focus, the jumping its WAY worse than if the game window has focus. Maybe that tells something?
|
|
-
-
- (1205)
-
premium membership
MVP
-
Posts
1.204
|
Re: XNA Games 'jump', but professional games do not.
|
You could try downloading some native 2D games and see if the same problem occurs. That would at least tell you whether or not it's something with .NET/XNA on your machine. Here's a link to a list of SDL games: http://www.libsdl.org/games.php
Microsoft DirectX/XNA MVP
|
|
-
-
- (10849)
-
Team XNA
-
Posts
8.007
|
Re: XNA Games 'jump', but professional games do not.
|
There are many things this could be.
Windows is a multitasking operating system. That means it is impossible to ever have a Windows program run 100% smoothly. Every now and again, some other process is going to wake up, and that will make your game stutter. How often this happens and how noticable the stutter is depends entirely on what software you have installed on the box, but it will always happen to some extent. You can minimize the effects of this by running in fullscreen mode (or running on Xbox :-)
The other factor is if you are using fixed timestep, your game framerate may be slightly out of phase with your monitor refresh, which will cause a dropped frame or catch-up frame at periodic intervals, to get the two back in sync. The only way to prevent that is to switch to variable timestep mode so your game can run at exactly the same rate as the monitor refresh, but I can't recommend doing this as it makes your game logic much more complex and requires a good understanding of calculus.
My main advice here is, don't worry about this so much. When you have just a single sprite moving around the screen, especially if it moves in integer pixel units each frame, any dropped frames will be incredibly obvious. But this is not a realistic scenario to care about. In an actual game, you will have many objects, moving at different speeds, and most likely with velocity and acceleration. In that case, the eye will be much less likely to notice the occassional dropped frame, which is probably why you see this in trivial samples but not in more complex games.
XNA Framework Developer -
blog - homepage
|
|
-
-
- (0)
-
premium membership
-
Posts
74
|
Re: XNA Games 'jump', but professional games do not.
|
Shawn Hargreaves:There are many things this could be.
Windows is a multitasking operating system. That means it is impossible to ever have a Windows program run 100% smoothly. Every now and again, some other process is going to wake up, and that will make your game stutter. How often this happens and how noticable the stutter is depends entirely on what software you have installed on the box, but it will always happen to some extent. You can minimize the effects of this by running in fullscreen mode (or running on Xbox :-)
The other factor is if you are using fixed timestep, your game framerate may be slightly out of phase with your monitor refresh, which will cause a dropped frame or catch-up frame at periodic intervals, to get the two back in sync. The only way to prevent that is to switch to variable timestep mode so your game can run at exactly the same rate as the monitor refresh, but I can't recommend doing this as it makes your game logic much more complex and requires a good understanding of calculus.
My main advice here is, don't worry about this so much. When you have just a single sprite moving around the screen, especially if it moves in integer pixel units each frame, any dropped frames will be incredibly obvious. But this is not a realistic scenario to care about. In an actual game, you will have many objects, moving at different speeds, and most likely with velocity and acceleration. In that case, the eye will be much less likely to notice the occassional dropped frame, which is probably why you see this in trivial samples but not in more complex games.
I wouldnt be so worried about it but I paid a large amount of money for this computer. Oh and also I deployed some samples to the Xbox360 and it jumped too but it happened less.
|
|
-
|
|
Re: XNA Games 'jump', but professional games do not.
|
Try this:
- In your simple game's constructer, set IsFixedTimeStep to false.
- In the Update method, use gameTIme.ElapsedGameTime.TotalSeconds as your time step. Something like this:
void Update(GameTime gameTime) { float dt = (float)gameTime.ElapsedGameTime.TotalSeconds; //set spriteVelocity somehow (xbox360 controller thumstick, arrow keys, etc.) spritePosition += spriteVelocity * dt; } This fixed my "jumping" problem. I really don't know why... Let me know if it works.
|
|
-
-
- (10849)
-
Team XNA
-
Posts
8.007
|
Re: XNA Games 'jump', but professional games do not.
|
Whiplash6:I wouldnt be so worried about it but I paid a large amount of money for this computer.
Sure. But what I'm saying is that this isn't neccessarily a "your computer sucks" or "the XNA Framework is broken" thing - more of a "you are testing using an atypical situation: what looks like a problem when examining a trivial one-sprite-moving-in-integer-pixel-units example tends not to be a problem at all when you examine a real finished game". If this behavior really bothers you, you can change your game to run with variable timestep, but I cannot recommend that as it makes programming your update logic significantly more complicated.
XNA Framework Developer -
blog - homepage
|
|
-
|
|
Re: XNA Games 'jump', but professional games do not.
|
This could be issue of v-sync or LCD monitor reaction time...
|
|
-
-
- (295)
-
premium membership
-
Posts
145
|
Re: XNA Games 'jump', but professional games do not.
|
I had the exact same problem with my game during development, although it's a 3d game. The amount of "jump" I saw in my object were related to how much objects/effects my game was rendering. I did some optimizations, mainly reducing the number of particles on the screen and the periodic jump decreased. Since you said your problem is enhanced with 2d games, I'm starting to believe it has something to do with spritebatch. Not necessarily saying that it's spritebatch's fault, but it seems related to it. On faster computers and the xbox, my game has no noticeable jumps (after reducing number of particles), but I've played it on some computers with crappy graphics cards (Geforce 5200 for example) and I still have the big jump every few seconds.
|
|
-
-
- (0)
-
premium membership
-
Posts
74
|
Re: XNA Games 'jump', but professional games do not.
|
caedicus:I had the exact same problem with my game during development, although it's a 3d game. The amount of "jump" I saw in my object were related to how much objects/effects my game was rendering. I did some optimizations, mainly reducing the number of particles on the screen and the periodic jump decreased. Since you said your problem is enhanced with 2d games, I'm starting to believe it has something to do with spritebatch. Not necessarily saying that it's spritebatch's fault, but it seems related to it. On faster computers and the xbox, my game has no noticeable jumps (after reducing number of particles), but I've played it on some computers with crappy graphics cards (Geforce 5200 for example) and I still have the big jump every few seconds.
I dont think its spritebatch since games like NetRumble tend to do it less but have more spritebatch calls.
|
|
-
|
|
Re: XNA Games 'jump', but professional games do not.
|
My very first XNA "game" was moving a 32x32 square around the screen in response to the keyboard. Every update I would move exactly one pixel. When I ran the game it was move, move, move, hick, move, move, move hick etc. In my case, the game was running at 75Hz, but my LCD only refreshes at 60Hz (regardless of what you drive it at). Once I'd changed the refresh rate of the game to be 60Hz, the hiccups went away.
|
|
-
-
- (0)
-
premium membership
-
Posts
74
|
Re: XNA Games 'jump', but professional games do not.
|
HadesSpaniel:
My very first XNA "game" was moving a 32x32 square around the screen in response to the keyboard. Every update I would move exactly one pixel. When I ran the game it was move, move, move, hick, move, move, move hick etc. In my case, the game was running at 75Hz, but my LCD only refreshes at 60Hz (regardless of what you drive it at). Once I'd changed the refresh rate of the game to be 60Hz, the hiccups went away.
How do you change the refresh rate?
|
|
-
-
- (7787)
-
premium membership
MVP
-
Posts
5.916
|
Re: XNA Games 'jump', but professional games do not.
|
If it's a laptop, then power management may get in the way. If the laptop senses that not all CPU is being used, it may throttle down the CPU speed. It may throttle down too much, and thus cause the game to run slow, until it detects that the CPU needs to run faster again.
If it's a dual-core machine, it may suffer from a BIOS and/or driver update problem. You need a special CPU driver for the dual-cores to do timing right. If not, you'll have time jumping backwards and forwards. This is usually most noticable on AMD based systems.
Jon Watte, Direct3D MVP Tweets, occasionallykW X-port 3ds Max .X exporter kW Animation source code
|
|
-
|
|
Re: XNA Games 'jump', but professional games do not.
|
Shawn Hargreaves:If this behavior really bothers you, you can change your game to run with variable timestep, but I cannot recommend that as it makes programming your update logic significantly more complicated.
The variable time step method I posted above is the only way I've been able to get rid of the jumping.
@OP: Try what I suggested please. :-) I want to know if it works for you.
|
|
-
|
|
Re: XNA Games 'jump', but professional games do not.
|
Harald Maassen:
The jumping thing has been reported before. I personally experienced it when running my game (which runs fine on my PC) on a friend´s computer. His PC has similar specs to mine.
I've seen the same thing before, on my system it works perfect, take it to another works perfect, take it to a third then boom, little hiccups or pauses during the gameplay. I thought it was just me, obviously not. It does it with multiple projects, so its not just bad coding on one project.
Dev site: SquigglyFrog StudiosYouTube Project Vids: Project Vids
|
|
-
|
|
Re: XNA Games 'jump', but professional games do not.
|
Whiplash6: HadesSpaniel:
My very first XNA "game" was moving a 32x32 square around the screen in response to the keyboard. Every update I would move exactly one pixel. When I ran the game it was move, move, move, hick, move, move, move hick etc. In my case, the game was running at 75Hz, but my LCD only refreshes at 60Hz (regardless of what you drive it at). Once I'd changed the refresh rate of the game to be 60Hz, the hiccups went away.
How do you change the refresh rate?
Right click on the desktop->Properties->Settings->Advanced->Monitors and change the refresh rate for the monitor
http://www.freewebs.com/campelmxna/ - C# and XNA tutorials The only stupid mistake is the one you make twice
|
|
-
-
- (10744)
-
premium membership
MVP
-
Posts
6.664
|
Re: XNA Games 'jump', but professional games do not.
|
Camp ELM:Right click on the desktop->Properties->Settings->Advanced->Monitors and change the refresh rate for the monitor
I think he meant the refresh for the game.
Jim Perry - Microsoft XNA MVP If people spent a minute searching the forums and reading the FAQs before posting I'd be out of a job. Got some XNA Game Studio/XNA Framework development info to share with the community? Put it on the XNA Wiki. Please mark posts as Answers or Good Feedback when appropriate.
|
|
|