FAQ Search
Memberlist Usergroups
Profile
  Forum Statistics Register
 Log in to check your private messages
Log in to check your private messages
Moonpod Homepage Starscape Information Mr. Robot Information Free Game Downloads Starscape Highscore Table
I'm a new independent game developer, here's my game video.
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Post new topic   Reply to topic    Discussion Pod Forum Index -> Independent Game Development View previous topic :: View next topic  
 Author
Message
Konedima
Grammar Police
Grammar Police


Joined: 25 Oct 2003
Posts: 1068
Location: Sydney, Land of Censorship



PostPosted: Wed Apr 28, 2010 10:06 am    Post subject: Reply with quote

codergames wrote:
Just to add that I tested it again on 3 different configurations with new time function:

1. 1Ghz Celeron 256Mb 32Mb video nVidia 4 indeo (not even the official card that supports directx fully) with XP SP3

2. 1.6Ghz Celeron 512Mb video nVidia 128Mb 6600 GT, running Vista with service pack

3. core2duo 2.2Ghz 2Gb, nVidia 8900 running XP with SP2

I know you probably don't have the ability to test on a huge number of systems, but those aren't very varied (and I'd hate to think how bad Vista is on a 1.6ghz Celeron with 512mb RAM) - no Windows 7 machine, no ATI graphics, no Intel integrated graphics, no quad core processors, no really new nVidia graphics cards, no AMD processors, and so on.

If you don't know enough people with different machines personally, try having a more open beta - get a range of different systems, promise everyone who tests it $5 off the game when it's released or something - it's still nowhere near as good as having a range of systems to test on yourself (I got a copy of Windows 7 for $50 - Microsoft gives students lots of cheap stuff cause they probably think we'd pirate it otherwise), but it should let you catch things like this before you release the game.
Back to top
View user's profile Visit poster's website
codergames



Joined: 20 Apr 2010
Posts: 167



PostPosted: Wed Apr 28, 2010 10:21 am    Post subject: Reply with quote

But Brothersoft tested it on their machines, passed everything! Its not about which card you have, its about math ... its always the same. Vista runs ****** on 1.6Ghz with 512Mb ... but my game doesn't, which might seem strange at first. However, since its OpenGL game with math formulas, nothing else ... the math should be the same on all, its platform independent, the same as OpenGL is.

I don't know, its very strange!

Theoretically, its possible that on your system time passed between two cycles is less than 1ms, in which case only a more precised time function is needed to capture the moment like:

http://msdn.microsoft.com/en-us/library/ms644904%28VS.85%29.aspx

I think I know what the problem is ... its returning 0ms between two cycles Sad
Back to top
View user's profile Visit poster's website
Konedima
Grammar Police
Grammar Police


Joined: 25 Oct 2003
Posts: 1068
Location: Sydney, Land of Censorship



PostPosted: Wed Apr 28, 2010 11:48 am    Post subject: Reply with quote

codergames wrote:
Theoretically, its possible that on your system time passed between two cycles is less than 1ms, in which case only a more precised time function is needed to capture the moment like:

http://msdn.microsoft.com/en-us/library/ms644904%28VS.85%29.aspx

I think I know what the problem is ... its returning 0ms between two cycles Sad
Possibly a stupid question, but can't you use a more accurate time measurement? I know they exist in other languages.

I'd still also try to test it on either a 32 bit version of Windows 7 or a 64 bit version of Vista, but that's just me.
Back to top
View user's profile Visit poster's website
codergames



Joined: 20 Apr 2010
Posts: 167



PostPosted: Wed Apr 28, 2010 12:03 pm    Post subject: Reply with quote

You're right there is such function, but it highly depends on CPU family, so you get inconsistent results. No need for higher precision, I think I solved the problem, it now covers the case in which time is less than 1ms. So, please check it out for me, will you?

You guys must have some beasts over there, can you disclose the speed and the number of processors you're having?
Back to top
View user's profile Visit poster's website
Konedima
Grammar Police
Grammar Police


Joined: 25 Oct 2003
Posts: 1068
Location: Sydney, Land of Censorship



PostPosted: Wed Apr 28, 2010 12:52 pm    Post subject: Reply with quote

Core 2 Quad Q6600, running at stock. 2.4GHz per core, 4 cores (obviously), 1066MHz FSB, 8MB L2 Cache. Uses a 65nm core so sometimes it's hotter than the fires of hell (yet still cooler than the first series of Radeon HD cards) - got it cheap when all the stores were getting 45nm processors in.

Downloaded the latest version off your website - same problem. If anything it's a tiny bit worse. I tried setting it to run on 1 core, seemed to make it slightly slower, but I also noticed that the core was at almost 100% usage while I was playing - a relatively simple game like yours should need all that power, which makes me wonder what it's doing.

Update: just tried it in XP (my 'puter is 7/XP dual boot). Runs at normal speed. Barely any CPU use. Maybe whatever you're using to get the thread to sleep doesn't work in 7?
Back to top
View user's profile Visit poster's website
codergames



Joined: 20 Apr 2010
Posts: 167



PostPosted: Wed Apr 28, 2010 1:03 pm    Post subject: Reply with quote

That's odd since its running smoothly on 1Ghz Celeron, the usage is high, varies between 80 and 100%.

The funny thing is that on all 3 configurations, I mentioned earlier, I'm getting the exact same results as before, no change at all, running smoothly on all of them, and exactly the same, with same results. Its the timer problem, so its a must to have sleep(1) for speedy CPUs, its a must.
Back to top
View user's profile Visit poster's website
codergames



Joined: 20 Apr 2010
Posts: 167



PostPosted: Wed Apr 28, 2010 1:06 pm    Post subject: Reply with quote

On my core2duo its between 0 and 9%, its not consistent, it can't be, AI is not working at its fullest all the time.
Back to top
View user's profile Visit poster's website
Konedima
Grammar Police
Grammar Police


Joined: 25 Oct 2003
Posts: 1068
Location: Sydney, Land of Censorship



PostPosted: Wed Apr 28, 2010 1:37 pm    Post subject: Reply with quote

In 7, when I restricted it to one core, usage was >80% the whole time the game was running. XP on the same computer, <5%.

Sleeping threads wasn't the way I was taught to restrict it to a framerate - I was taught to have most of the game logic in something like this
Code:
while (game not won) {
   if (time now - time since last frame >= delay required for stable framerate) {
      //game loop goes here
      record time at end of frame
   }
}

But that's just what I was taught in my basic games programming class.
Back to top
View user's profile Visit poster's website
codergames



Joined: 20 Apr 2010
Posts: 167



PostPosted: Wed Apr 28, 2010 1:45 pm    Post subject: Reply with quote

I never used sleeping thread that's what is making CPU usage high, so it must be something else causing the problem. If my Celeron is having between 20 and 80% CPU, mostly 30%, then I can't imagine why you're having that.

I had to include Sleep(1) now, so please check it out, would you? So, Sleep(1) is included for the first time ever in my code.

It had no Sleep before, but it must have it now, as your CPUs are just way too fast and time spent between two cycles is less than 1ms. Still same smoothness on all 3 configurations for me. Should work for you now, it makes no sense.
Back to top
View user's profile Visit poster's website
codergames



Joined: 20 Apr 2010
Posts: 167



PostPosted: Wed Apr 28, 2010 2:11 pm    Post subject: Reply with quote

Also, it seems that timeGetTime is having different default resolution set under different OS, eg. Win95 is having 1ms, NT is having 5ms or higher ... it just doesn't return different values if only 1ms passed between two consecutive calls. So, I probably have to set Sleep(5), instead of Sleep(1), its possible that its higher for Win7. maybe the best bet would be 20?
Back to top
View user's profile Visit poster's website
codergames



Joined: 20 Apr 2010
Posts: 167



PostPosted: Wed Apr 28, 2010 2:43 pm    Post subject: Reply with quote

I changed it to 16ms making sure that the timeGetTime will capture time passed between two cycles on very fast CPUs.

I know you were pulling my leg with 100% CPU usage ... it was funny man! We need more fun in our lives ... hahaha, you got me there, it made me go through my timer related code many times. Finally, the solution is final and 100% working, have no doubt about it. Just download again and enjoy first 5 levels of the great game!
Back to top
View user's profile Visit poster's website
Poo Bear
Pod Team
Pod Team


Joined: 14 Oct 2002
Posts: 4121
Location: Sheffield, UK



PostPosted: Wed Apr 28, 2010 3:23 pm    Post subject: Reply with quote

It works Smile
Back to top
View user's profile Visit poster's website
codergames



Joined: 20 Apr 2010
Posts: 167



PostPosted: Wed Apr 28, 2010 3:43 pm    Post subject: Reply with quote

Thanks! Finally, we got it ... if the time between two cycles/loops is less than 1ms, timeGetTime is useless in that case small Sleep has to be used so that the timeGetTime would get updated and return some value different from the previously stored. But, since timeGetTime's resolution differs from OS to OS, it must be some enough large value. It should be very smooth as sleep is not used for calculations, only to get a value from timeGetTime.

Thanks a lot for helping me out, if you need anything that I'm able to do, don't hesitate to ask!

Phew, these were rough times ...


Last edited by codergames on Wed Apr 28, 2010 4:12 pm; edited 1 time in total
Back to top
View user's profile Visit poster's website
codergames



Joined: 20 Apr 2010
Posts: 167



PostPosted: Wed Apr 28, 2010 4:26 pm    Post subject: Reply with quote

I just noticed that my article was released on Buzzle.com, I couldn't stop laughing:

http://www.buzzle.com/articles/lifelong-passion-and-a-source-of-positive-energy.html

They haven't informed me about approval of the article, this was a shock. But Mark mentioned a buzz yesterday, it reminded me of Buzzle, otherwise I would probably never checked it, totally forgot about it!
Back to top
View user's profile Visit poster's website
Poo Bear
Pod Team
Pod Team


Joined: 14 Oct 2002
Posts: 4121
Location: Sheffield, UK



PostPosted: Wed Apr 28, 2010 4:39 pm    Post subject: Reply with quote

Excellent, getting articles out that link to the game is one of the best forms of publicity you can get - it's free and people are more likely to take note of the game if the article is interesting.
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Discussion Pod Forum Index -> Independent Game Development All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 5 of 6

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group