- Joined
- Jul 10, 2010
- Messages
- 124
Is the shortest time interval in-game still 0.0625?
Actually... Time is realitive.
Using game time you can achieve 1/32 of a second because the game runs on fastest by default and as such everything is at twice the speed of normal.
Using real time it will be 1/16 of a second, this is because it is the same delay as game time but is not altered by game speed.
Is the shortest time interval in-game still 0.0625?
Itachi009, incorrect. All PC processors have a nanosecond timer which although not totally accurate servers to allow benchmarking of code, I can confirm that this is in java and python and probably also C/++. Additionally games usually have more than 1 thread now and with DX10 cards it is possible to have multiple threads creating graphics at the same time (or quing instructions to be sent via buss). Further more game time via main loop is horriably inaccurate and SC2 definatly does not use it outside of the game engine. We all know how SC2 has no framerate cap on certain scenes and as such could obtain 500+ FPS which would make everything seem speeded up thus the overall flow of the game is syncronized by a proper timer. Additionally this points towards there being a separate graphic thread whos purpose is just to instruct the creation of the next scene so any virticle sync cap is ignored completly.
You can also run SC2 at any frame rate again throwing that idea out the window as it would then not be syncrnous for multiplayer so cause people to drop almost instantly.
Game loops might be what good old sega genisis or nes or SC1 used, but with or 4-6 processors and 100s of shaders it is a pretty usless design. Ultimatly there will be the basic idea of a loop inorder to keep the program going but the loop might do nothing more than set up and direct threads to keep the game in sync. I know for certain SC2 was designed for 2 main threads eating up most of a processor each although it does have other minor threads (1-2% of a processor) which handle inturupts, input and background tasks.
Oh yes, I forogt to mention that the clock generator circuit used to keep your processor syncronized and drive it is pretty accurate (your processor clock rate varies minimally in opperation) and as such you could even use it to get a pretty accurate timing.
this is the reason why nearly every game (including scII) takes up ~100%
SC2 loads 2 processors at 60% and 80% respectivly as well as loads of other low threads.
Only crap games use a loop like you described as it results in a huge wastage of system resources. Instead it puts the thread on hold allowing the time splicing kernal to allocate the processor to do something else in the mean time. Additionally it may wait for the graphic update thread or other threads to reach a certain stage so as to keep the game engine in sync. Ofcourse some games still run at 100% but that is because instead of instructing the kernal to let the prcoessor do something else in the mean time, it instead tells the kernal to keep the thread ready so the processor is equivently blocked until the thread gets revived.
In SC2, the game updates a fixed number of times per second and has to. If too many units move you will get a "your too slow" message meaning your processor can not keep up with that rate per second so the game will slow down. However every frame inside the game will be calculated. The graphics you see use their own framerate and ulike the internal game engine, not all frames have to be renderd cause they are based upon the current state of the internal engine unlike the internal engine which is based on previous states of itself.
In SC2 the graphics probably have their own thread, it makes the most sense since it allows an axceptable framerate even if the engine is overloaded while also allowing it to use dual cores cause most of SC2's CPU needs are for the graphics. It also explains why you can not reach 100% CPU usage on a single processor because the main engine thread has to wait until the graphic thread has read the current state values to prevent a scene being generated from an old and new frame. It also explains how frame rate drops when the main thread is heavilly loaded because there are less idle times from which data is safe to axcess for use with the graphic thread.
Alt + Ctrl + delete oh and from a website which was benchmarking its performance on Core I7 processors.where did you got this information from?
On average, yes. The game will firstly try lowering to slow and then even slower to keep it running fluid. Howevever if it is only 1 person with such a processor it will go in bursts of 0.5 seconds fluid play then the screen will hang for him to catch up and it is likly he will time out eventually and be dropped.and what if someone got a 0.6 GHZ processor, will the game then run on 3 fps for EVERY player?
Sigh, someone has not looked up how computer graphics are made have they. The image is rendered by the GPU, yes, but the instructions to the GPU of how to render the image have to come from the CPU. This includes stuff like animations, reflections, praticles, and physics are all set up by the CPU (the GPU just makes the image out of them).you mean most of sc2 GPU needs are for the graphics, right? else i dont understand why the graphics should use the processor to render like in GDI or X11
Alt + Ctrl + delete oh and from a website which was benchmarking its performance on Core I7 processors.
Sigh, someone has not looked up how computer graphics are made have they. The image is rendered by the GPU, yes, but the instructions to the GPU of how to render the image have to come from the CPU. This includes stuff like animations, reflections, praticles, and physics are all set up by the CPU (the GPU just makes the image out of them).