 |
Author |
|
 |
|
Poo Bear Pod Team


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

|
Posted: Mon Apr 26, 2010 8:17 am Post subject: |
|
|
OK it does work now, but there are a couple of issues still - sorry
1. after install it tries to run the game straight away, but win7 pops up a message saying it won't allow it because it needs elevated privileges. If I cancel that and just click the menu shortcut then I have to confirm that I "want to allow this program from an unknown publisher to make changes to my computer".
Is this because the installer/exe is not signed? Or is the game doing something like accessing registry? Odd.
2. when it gets running it is going far too fast, like the frame rate is unconstrained. If I touch the controls my ship goes ping ponging around and the enemies are moving at 100mph. |
|
|
|
Back to top |
|
|
 |
|
codergames

Joined: 20 Apr 2010 Posts: 167

|
Posted: Mon Apr 26, 2010 6:06 pm Post subject: |
|
|
Wow, that sounds like special super powers ... its constrained, the code is limiting the frame-rate to 32 frames per second based on your CPU speed. All the formulas are using TimeFactor in calculations.
That thing with privileges is the same as with Vista ... you got to allow it. I don't know about 7, but Vista asks the same for everything, not just apps you install ... but each and every command you want done ... annoying! I'm not sure if that's what you're talking about? My setup is setting privileges for all users to read/write/execute, so you should not get that, the way you get it. |
|
|
|
Back to top |
|
|
 |
|
codergames

Joined: 20 Apr 2010 Posts: 167

|
Posted: Mon Apr 26, 2010 7:14 pm Post subject: |
|
|
Is there a problem when converting float to double under win7? Unless there is a conversion problem with Windows 7, it should work the same, all the formulas are the same on all platforms. |
|
|
|
Back to top |
|
|
 |
|
codergames

Joined: 20 Apr 2010 Posts: 167

|
|
|
|
Back to top |
|
|
 |
|
Konedima Grammar Police


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

|
Posted: Tue Apr 27, 2010 12:09 am Post subject: |
|
|
You seem rather eager to blame everything except your game - everybody makes mistakes, and in the long run it's usually best to take a good hard look at your code rather than spend all your time finding scapegoats. |
|
|
|
Back to top |
|
|
 |
|
codergames

Joined: 20 Apr 2010 Posts: 167

|
Posted: Tue Apr 27, 2010 12:41 am Post subject: |
|
|
True, but I'm not able to see anything wrong, unless the timer under Win7 is giving different values than on other OS. Its possible. I haven't said anything like you're suggesting, all I did found is that people do experience faster gaming experience under win7. Since the whole frame limiter is based on OS returning correct time passed between two frames, its impossible for me to know which time function is best to use under win7 unless you help me out and tell me which works the best? |
|
|
|
Back to top |
|
|
 |
|
Konedima Grammar Police


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

|
Posted: Tue Apr 27, 2010 1:56 am Post subject: |
|
|
War Pong HD uses a (slightly old) version of Allegro which has built in timer functions (including my favourite, one which can set a function to execute at set increments) and has no problem with Windows 7.
I've never used OpenGL, so I wouldn't know whether it has anything similar built in. I can't imagine Windows 7 would be that different with the time, though.
Just a thought... I'm using a 64 bit version of 7 - doesn't it use a 64 bit field for storing time instead of a 32 bit one? If your game is doing something wrong trying to convert that to a smaller size, that could be a problem.
I'm not sure what Poo Bear is using but it might be worth seeing if you can try it on a 32 bit version of 7. May not have come up before because 64 bit versions of XP and Vista are far less common than their 32 bit versions. |
|
|
|
Back to top |
|
|
 |
|
Poo Bear Pod Team


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

|
Posted: Tue Apr 27, 2010 7:51 am Post subject: |
|
|
I've got 64bit win7 here sadly, I'm using Ogre which has it's own timer system based off the hardware performance counters I think. Although I've used the old classic timeGetTime() often without problems. When you notice the game running too fast do you call Sleep(milliSecs) or some other way of pausing the thread?
I'm not aware of any floating point conversion problems specific to win7. |
|
|
|
Back to top |
|
|
 |
|
codergames

Joined: 20 Apr 2010 Posts: 167

|
Posted: Tue Apr 27, 2010 9:01 am Post subject: |
|
|
Of course not, you get weird slow-downs / ups by doing so and inconsistent results. I'm doing math. First measure how much time has passed between two cycles and then dividing that with with 1000 milliseconds, as I want frame rate to be per second. After the double value has been calculated, its multiplied with wanted number of frames, which becomes a speed factor value. The value is then converted to float to get more speed, as that value is used in all time based formulas.
What's Ogre? |
|
|
|
Back to top |
|
|
 |
|
Poo Bear Pod Team


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

|
Posted: Tue Apr 27, 2010 9:15 am Post subject: |
|
|
Ogre is an open source 2d/3d engine that's very good.
Making everything use accurate time based calculations so it can run smoothly at any frame rate then? Complicated, but great when it works. For that to work on XP and not on win7 does seem quite odd and points to the time measuring code. Might be worth just switching in a different timer maybe and then retesting?
Or it could be a annoying stealth bug i.e. maybe my machine is so much faster than yours I reach frame rates you've never seen and therefore all the values in the get really small and somewhere you suddenly run into some kind of precision problem and things go nuts. Seems unlikely, but you never know.
Side note - don't let the frame rate go above 100fps, really powerful PCs with those enormous graphics cards can actually over heat and lock up. This has even happened in some high profile games. |
|
|
|
Back to top |
|
|
 |
|
Poo Bear Pod Team


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

|
Posted: Tue Apr 27, 2010 9:28 am Post subject: |
|
|
codergames wrote: | Of course not, you get weird slow-downs / ups by doing so and inconsistent results. I'm doing math. |
Starscape and MrRobot work by fixing the frame rate at 25fps
Not ideal, but it makes a lot of things simpler. You don't get any slow downs or speed ups, that is kind of the point The downside is that on a powerful computer with a big monitor you can tell it isn't as smooth as it could be and you can see video tearing. Although doing it the other way doesn't necessarily eliminate video tearing, depends if you can update at the same rate as the video card refresh. Obviously you need to set the minimum hardware spec such that the lowest spec PC can actually manage 25fps of course. |
|
|
|
Back to top |
|
|
 |
|
codergames

Joined: 20 Apr 2010 Posts: 167

|
Posted: Tue Apr 27, 2010 9:42 am Post subject: |
|
|
I agree with you and already found the error. Windows 7 is having problems with GetTickCount, returning 0 as the values sometimes, although I still haven't encountered that. No-one knows why. I'm using GetTickCount through SDL ... the computer must run continuously for 49.7 days to start returning 0 as value. So, either your comp is running more than 49.7 days continuously or its MS's fault.
I downloaded Ogre3d 1.7.0 few days ago to start learning it and its huge. My engine uses OpenGL and SDL and is under 500Kb. I like to keep things simple. |
|
|
|
Back to top |
|
|
 |
|
Poo Bear Pod Team


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

|
Posted: Tue Apr 27, 2010 10:35 am Post subject: |
|
|
Ah, so maybe you can find your own timer code to avoid whatever bug is in SDL. Odd, you would think a well established library like SDL would be free of bugs like that?
As for Ogre, I use it because of compatibility/reliability. Very few free open source engines have had as much testing and compatibility work done as Ogre. Sadly it is a huge bloated thing, as many open source projects often are, but it is fast and powerful. |
|
|
|
Back to top |
|
|
 |
|
Slyh

Joined: 25 Nov 2004 Posts: 480 Location: Karlsruhe, Germany

|
Posted: Tue Apr 27, 2010 10:59 am Post subject: |
|
|
Poo Bear wrote: | Starscape and MrRobot work by fixing the frame rate at 25fps :) |
How do you do this, code-wise? |
|
|
|
Back to top |
|
|
 |
|
codergames

Joined: 20 Apr 2010 Posts: 167

|
Posted: Tue Apr 27, 2010 11:01 am Post subject: |
|
|
Its not a SDL bug, I misunderstood it, its a MS function that is supported from Windows 2000 and it returns an integer value of the time passed since you booted the OS. It represents milliseconds and if you keep your computer running too much the integer can't keep track of it, so the function starts returning 0. It happens if the computer is running for more than 49.7 days. Other than that, its a fast call and higher precision is not needed anyway. |
|
|
|
Back to top |
|
|
 |
|
|
|
|
|
|