|
|
| My game to be |
|
BAF
Member #2,981
December 2002
|
If they are rendering in the background then the game won't run very well and if they are that concerned about playing games they should either pause the rendering or use a different computer. |
|
FMC
Member #4,431
March 2004
|
Quote: Can you name a single comercial "3D" game that use this as a "selling point" ? It's not an opinion, it's a fact, and the curtesy is far from "common" (a game should use all the available power for the best experience). No, nearly all commercial games don't use CPU if they don't need it. Just for example i could happily play Ufo: Aftershock (modern 3d tactical game) with max settings, but Civil War Generals 2 (an OLD 2d wargame) uses so much CPU that it overheats in a few minutes... talk of optimizing! Besides using more CPU power than you need is just useless. Quote: Are you sure it was overheating? My CPU in my laptop regularly runs in the 70-80C range when I run it under heavy load for a while and it works fine. They are made to withstand higher temperatures. I'm saying it overheats because Asus Probe thinks 70°C deserves getting my attention with loud beeps [FMC Studios] - [Caries Field] - [Ctris] - [Pman] - [Chess for allegroites] |
|
BAF
Member #2,981
December 2002
|
Change Asus Probe's settings then? I highly doubt you are overheating. It's not 'wasting' CPU time, a waste of CPU time is when the CPU sits idle. |
|
kentl
Member #2,905
November 2002
|
Quote: If they are rendering in the background then the game won't run very well and if they are that concerned about playing games they should either pause the rendering or use a different computer. I can see that you didn't read my post very throughly and that you didn't understand the point I was trying to give. Each application/game should only use what it needs. If you use up all CPU-time "for the hell of it" you are practicing bad software engineering. Why not apply the same philosophy to the required hard disk space? Most games these days take up 600-700 MB, so even if you are not using it you could store some large trash files along with your game, so that you are not wasting less resources than other games. Give one single reason for why you want to use up all CPU-time even though you don't need to? Except that you as the programmer is lazy and/or use libraries which won't allow you to be nice to the system. |
|
FMC
Member #4,431
March 2004
|
Quote: Change Asus Probe's settings then? I highly doubt you are overheating. It's not 'wasting' CPU time, a waste of CPU time is when the CPU sits idle. I think they know a bit more than you and me, and since only "broken" aps have this behaviour i don't see why i shouldn't stay on the safe side. [FMC Studios] - [Caries Field] - [Ctris] - [Pman] - [Chess for allegroites] |
|
Richard Phipps
Member #1,632
November 2001
|
Kent: There is a problem here in that giving the OS back some time could result in your game missing a frame or more because the OS doesn't return back to your game in time. I think the OS processes in Windows only have something like a 10 ms resolution. The best bet is to provide options to run with or without resting. |
|
BAF
Member #2,981
December 2002
|
A game can use 100% CPU if it wants, it is doing stuff during the time, which allows for more accurate stuff and such. FMC: 70C seems like a good number for a desktop, but laptops are designed to run hotter to help preserve power (less fans running = less power consumption). |
|
kentl
Member #2,905
November 2002
|
Quote: There is a problem here in that giving the OS back some time could result in your game missing a frame or more because the OS doesn't return back to your game in time. I think the OS processes in Windows only have something like a 10 ms resolution. Yeah this is the only reason. If you have tried this, does the game skip a frame or two once in a while? And does it matter? Quote: The best bet is to provide options to run with or without resting. Absolutely! Quote: A game can use 100% CPU if it wants, it is doing stuff during the time, which allows for more accurate stuff and such. Well that is not always the case. When you reach a certain treshold it makes no sense anymore to break down for example unit movements into smaller movements per logic update and a higher rate of logic updates. There will always be a point when it makes no sense anymore to consume all available CPU-time. The "new way" of programming is waste resources all you want to, because great hardware is common and relatively cheap these days. I'm not an advocate of this style. |
|
CursedTyrant
Member #7,080
April 2006
|
Ok, I've used: rest(1); DeltaTime = FpsCounter::NewFrameStarted(); FPS = FpsCounter::GetFps(); The CPU is used at merely 2%, maybe 10% at most, but the FPS drops down (and stays at) 63. With effects, as well as without them. Am I doing it the right way? --------- |
|
kentl
Member #2,905
November 2002
|
It's nice of you to not take up all the system resources! The resting is supposed to free up system resources while waiting to do the next logic/frame update. That is, if you finish and have lots of time left until the next cycle you wait some more than 1. |
|
CursedTyrant
Member #7,080
April 2006
|
Actually, the game runs as smooth as before, only the FPS stays at 63. I've updated the game, now it includes a plasma rifle (actually, 2). It's a test of the tri-slot weapon base I'm trying to implement (3 customizable slots, you can have 1 pistol and 2 plasma rifles, or the other way around. Once I include more weapons and add all the necessary menus, you'll be able to change which weapons you insert and into which slot). The link is the same, but I'll post it again, so that lazy people can still try my game: http://cursedtyrant.freshsite.pl/tests/shooter[ol].rar --------- |
|
kentl
Member #2,905
November 2002
|
I myself only run Linux at the moment so I can't try it. By the looks of the screenshot earlier in this thread it seems nice. Are you inspired by the Alien Breed games for the Amiga? (If not, check them out using WinUAE - they are great) |
|
CursedTyrant
Member #7,080
April 2006
|
Actually, yeah And here's a screenshot for those of us who use Linux: --------- |
|
Evert
Member #794
November 2000
|
Quote: a game should use all the available power for the best experience
A program should use 100% CPU power if it needs it. If it needs 1% and does 99% busy waiting, then that's bad. |
|
FMC
Member #4,431
March 2004
|
Quote: The CPU is used at merely 2%, maybe 10% at most, but the FPS drops down (and stays at) 63. With effects, as well as without them. Am I doing it the right way? I think you should do something along the lines: So that you are sure you're resting only when you don't need CPU time [FMC Studios] - [Caries Field] - [Ctris] - [Pman] - [Chess for allegroites] |
|
CursedTyrant
Member #7,080
April 2006
|
Yeah, but I'm not sure how to do that in OL. --------- |
|
Epsi
Member #5,731
April 2005
|
@ FMC Quote: No, nearly all commercial games don't use CPU if they don't need it. Just for example i could happily play Ufo: Aftershock (modern 3d tactical game) with max settings, but Civil War Generals 2 (an OLD 2d wargame) uses so much CPU that it overheats in a few minutes... talk of optimizing! Besides using more CPU power than you need is just useless.
Isn't it just doing VSync ? That's more than enough to spare CPU time if this option is available. @CursedTyrant: if (FpsCount::GetFps() > 200.0) rest(1); Where 200.0 is the acceptable FPS limit (assuming it's the same as the logic speedrate) ___________________________________ piccolo: "soon all new 2d alegro games will be better. after i finsh my MMRPG. my game will serve as a code reference. so you can understand and grab code from." |
|
Zaphos
Member #1,468
August 2001
|
Quote: since only "broken" aps have this behaviour i don't see why i shouldn't stay on the safe side. I will agree that it's friendly to use less than 100% of the CPU when possible, to allow for energy conservation, greater battery life, better multitasking, but calling an app 'broken' because it uses 100% CPU is simply incorrect. If the computer breaks down under these conditions, the hardware configuration is entirely to blame. So, sure, put in two lines of rest-when-idle, put in your other optimizations and your 'low quality graphics' mode, but there will almost certainly still be some PC that will need to use 100% to run your game, and that is not something you should lose sleep over. Quote: There will always be a point when it makes no sense anymore to consume all available CPU-time. One could certainly construct a world with background, physics-driven effects which could be scaled up to take more processor time than any currently-feasible processor could possibly provide. So unless you mean this in a very abstract, 'assuming we had a machine that was ~infinitely fast' sort of way, um, I don't know how you come to this conclusion? Quote: The "new way" of programming is waste resources all you want to, because great hardware is common and relatively cheap these days. Er. What? There's surely nothing wrong with trading off performance for ease of development, when one has analyzed the significance of the gains and losses involved.
|
|
Paladin
Member #6,645
December 2005
|
OpenGL games work for me, and I think AllegroGL works as well Richard. |
|
kentl
Member #2,905
November 2002
|
Quote: One could certainly... Sure and if it's part of the game then use 100% CPU-time. Just do not use it without spending it on something which adds to the game quality. Quote: There's surely nothing wrong with trading off performance for ease of development Well in some cases it is, and this is one of them. Remember that we are talking about a game using up 100% of the available CPU-time without needing it. I'm not saying that we should all do some kind of pre-mature optimization, just not be lazy in situations like this one. That laziness is what I meant by "new way". |
|
Zaphos
Member #1,468
August 2001
|
Quote: just not be lazy in situations like this one. That laziness is what I meant by "new way". Um, okay ... except that laziness isn't new, and running tight loops of code-which-does-nothing doesn't rely on "great hardware" being "common and relatively cheap", so I still have no idea where your "kids these days"-style commentary comes from. Anyway, regarding the demo:
|
|
CursedTyrant
Member #7,080
April 2006
|
Quote: if (FpsCount::GetFps() > 200.0) rest(1); Not a good idea. It starts jumping periodically on my PC when I turn out shadows (the only way I can get over 200 FPS). I think that rest(1) unconditionally is the best way to go, especially since it doesn't slow the game down at all. Quote: The shadow cast by the block in the middle of the map looks jittery when I move my cursor; Yeah, I know. It's because I'm calculating each ray of light, and it just works drastically slower if I make it any more smooth. --------- |
|
FMC
Member #4,431
March 2004
|
Quote:
Isn't it just doing VSync ? That's more than enough to spare CPU time if this option is available. Nope [FMC Studios] - [Caries Field] - [Ctris] - [Pman] - [Chess for allegroites] |
|
CursedTyrant
Member #7,080
April 2006
|
Can you say "bloodshed"? --------- |
|
kentl
Member #2,905
November 2002
|
Quote: Um, okay... EOD. Let's just say that I don't agree with you. Quote: Can you say "bloodshed"? Very nice! Is that skeletons lying in the blood? Perhaps the blood should splatter in the same directions as the bullets? (You blood piles seems to be gravity droppings, if I may speak CSI-eEnglish;) ) |
|
|
|