View Full Version : Please Optimize your code!
derek
August 6th, 2000, 11:47 AM
Please Optimize your code! There is no reason that a game should require more than a 300MHZ+ processors. The Nintendo64 only has a 90MHZ processor and only 4 MB of RAM and it runs the games FAST unlike pcs. Though it does have a fast video/sound card.
Windows doesn't even use that much of your processor! It idles at least than 5%.
The only system requirments should be some form of semi-fast video card.
People will not buy a game, if the system requirment exceed there machine they bought two years ago!
------------------
"Bond, James Bond"
ncr
August 6th, 2000, 01:37 PM
I disagree. For a game like the new DOOM, people will gladly upgrade their computers.
I actually don't understand at all why one wouldn't want to buy a game that requires something faster than your 2 year old computer. 2 years is a long time, definitely enough to save money for a new computer.
[This message has been edited by ncr (edited 08-06-2000).]
derek
August 6th, 2000, 01:52 PM
Doom3 maybe they might upgrade. Please note that most of my friends have either have a 133-300 mhz machines and don't have enough money to upgrade every other year!
I'm a programmer part time and 300 (mhz) million instrutions a second is a lot of cycles, to have your computer use all these and to have a 3d accelerator is a real coding problem. A lot of programmers today are just plain lazzy.
ncr
August 7th, 2000, 11:21 AM
I don't know anything about programming. All I can say, is that you might very well be totally right.
But still, I seriously think one will buy the game even if it takes something stronger than the computer one bought two years ago.
Two years ago, I got myself a Celeron 300A, which runs fine at 450 MHz. If I were to buy a brand new game today, which I would really want and had been waiting for for two years, I would gladly upgrade if it were necessary.
[AoD] H3LL5P4WN
August 17th, 2000, 04:45 AM
The minimum specs might be 300mhz...
and code optimization is good, but...
youre gonna need a ballzy machine to run the new DooM in its full splendor...
People will upgrade.
I bought a whole new machine to play Quake3, and ive bought 3 video cards and a processor since then so I can brag about getting 105 frames a second in 800x600x32 with all the eye candy...
I really think that the game will require a regular GeForce at least...
One more thing. DooM 64 ran good because it was still sprite based. "DooM 3" will be pushing higher poly models than Q3A did...
------------------
I made the first DooM skin, the first DooM clan, and a monkey of myself. DEAL WITH IT.
[This message has been edited by [AoD] H3LL5P4WN (edited 08-17-2000).]
Phoebus
August 18th, 2000, 12:22 PM
I really can't emphasize this point enough, but apparently I must: it's NOT 'Doom 3'. Nor has it ever been, nor will it be. Doom 3 doesn't make sense from any logical standpoint, as there was already Final Doom. The new doom game will be a step forward, NOT a step backwards. Neither id nor John Carmack made any reference to 'Doom 3' anywhere in any of their announcements, nor do they refer to it as such. In fact, they specifically said THE NEW DOOM, and that's how it's continued to be referred, except over on the doomworld site, for whatever reason. But it's falsely presumptuous, to put it nicely.
I really hope this clears it up for you.
derek
August 19th, 2000, 02:36 PM
Every bit of speed matters in any game, Especially in 3d shooters! The more speed means the more frames per secound, which allows a more realistic game. The New Doom game will be even more realistic if they could it for speed.
Finite
August 19th, 2000, 05:04 PM
I don't know if this has been mentioned yet (I'm too lazy to read all the posts OK? http://www.newdoom.com/ubb/smile.gif) but it is very hard to optimise an engine for PCs. This is because different people have VERY different setups, and the game needs to run on all of these! Compatibility is a BIG drain on speed. Whereas when they begin writing the game for the XBox (they are, aren't they?) they can optimise it a lot more, because every XBox is the same, and hence the code can be chopped down a lot for that specific hardware.
------
Life is Finite. Live with it.
derek
August 24th, 2000, 02:30 PM
Please not however most API's do this for you. DirectX is what is used for Quake2 and 3. takes care of most of these things already for you. The optimization that is missing in NOT device related but low level optimizations. Many times even Microsoft doesn't code on a low level. These low level optimizations (and are compatable on all computers) are the ones they teach you in school and they are NOT hard to implement or time consuming.
Acid Rain
August 26th, 2000, 04:13 PM
I dont care as long as teh game is awsome!
------------------
Mess with the best
Die like the rest
--Hackers
Acid Rain
derek
August 26th, 2000, 07:08 PM
Every bit of speed helps!
The faster the game plays the more fun it is!
-tdk-jb
August 29th, 2000, 05:52 AM
The only the reason N64 and other consoles that have slower processors and can run fine compared to PCs with faster processors is because of 2 things. 1 is that the processors are dedicated to doing only games, like PC processors. Another is resolution. TV resoulution is 320x240, nothing compared to the 800x600 and 1024x768 used by PC games.
Finite
August 30th, 2000, 01:30 AM
Ermm no its not actually.. it can go up to 640x480... (well .. approximately.. its slightly different because of different height-width ratios on TVs)
derek
August 30th, 2000, 06:08 AM
However, please note most 3d video card are 4 or 5 times better then the consoles and require no time cycles from the pc processor. PC archetechture is a lot more advanced and constantly updated. Most Processors do 5 instructions per cycle so realistically, if you have a 300mhz pc it does 15,000 millions instructions a second. Thats a lot since most sound cards and video cards do all the work. That were the processor used to refresh all the screen, (back in the early 90's) before vidoe acceleration is where the higher resolutions ate cpu time.
Caesar
September 1st, 2000, 12:02 PM
Please Optimize your code! There is no reason that a game should require more than a 300MHZ+ processors. The Nintendo64 only has a 90MHZ processor and only 4 MB of RAM and it runs the games FAST unlike pcs. Though it does have a fast video/sound card.
Uhm.. You're talking about The Carmack! The man took optimizations to a new level with Wolf3D, DooM and then Quake. His engines have always been faster than any other engines.
And PLEASE for the LOVE OF GOD don't compare PC specs with Console specs! If you don't understand why there's a HUGE difference (as in: PC@500Mhz == Console@250Mhz) you shouldn't even be commenting on the subject. Just trust me, consoles will always be faster given that they have the same specs as a PC.
300Mhz processors are WAY TOO SLOW! You'd be lucky if you get a 2D-game to run nicely on somthing like that (Diablo2 would probably have a less-than-peachy time with that, for instance).
Please not however most API's do this for you. DirectX is what is used for Quake2 and 3. takes care of most of these things already for you. The optimization that is missing in NOT device related but low level optimizations.
No. The API doesn't optimize for you. NVIDIA's version of OpenGL will optimize for NVIDIA's graphics board, not for you specific system configuration.
DirectX is NOT what was used for Quake2/3. It uses OpenGL for graphics. Both Quake2 and 3 has low-level optimizations for critical stuff like matrix-math (mat*mat, vert*mat, vert*vert), except for when you run a T&L board, where the graphics chip handles this.
You can't really expect them to optimize ÈVERYTHING. Two very simple reasons for this:
1. There's a lot of code to optimize. You have to trade-off optimizations for ease-of-programming. I'd much rather have a good, clean code-base that is easy to extend and program for, than the 5 extra FPS low-level optimizations for game-code would give.
2. You have to optimize for every processor out there. Every extension (SSE, SSE2, MMX, 3DNOW! etc). Every sound-card. Every possible system configuration out there. Which will take YEARS to do! If they would sit down and optimize the code low-level style the game wouldn't come out in the next ten years. And that's too bad since that's 8 years behind the technology-curve (they're shooting for 2 years).
Put simply: you don't know what you're talking about. I seriously doubt you are a programmer, like you said you were. Or you'd know that doing low-level optimizations like you requested just isn't feasible, for anyone.
derek
September 1st, 2000, 04:44 PM
I'm talking about basic optimization not specfic processors ones! Like basic duff's device and general optimizations, these do not clutter the code very much. There is a lot of corporations which don't do the basic ones! In a time critical loop, if a few minor optimizations are used, it will speed the code exceptionaly, example AI or memory copies.
Also I don't expcept them to optimize everything! Just certain time critcal processes, ie AI and video processes.
Most likey Carmack will do this.
derek
September 1st, 2000, 04:53 PM
Also Please note:
Most Processors do 5 instructions per cycle so realistically,
so sayt that you have a 300mhz PC it does 15,000 Millions of Instructions a Second.
Thats a lot of extra time since most sound cards and video cards do all the work and frees the CPU time for other tasks as in AI and I/O operations.
Caesar
September 2nd, 2000, 02:32 AM
Ok, so you have 15 billion instructions per second. Now you want to output 90 000 vertices, which means you have to multiply them by a matrix which is 27 multiplications and 18 adds. That means 4050000 instructions for ONE frame. You need about 60 frames per second right? That's 243000000 per second. JUST TO RENDER THE STUFF! You also need to manage lights and textures which take up extra cycles. And you have a ton of game functions with a ton of math. Bottom line is: 15 billion instructions isn't enough, even if you optimize everything on an ASM-level.
derek
September 2nd, 2000, 09:27 AM
When are you going to have 90,000 vertices in one screen? Most complex 3d models of people only use about 400 vertices. Most games only have maybe 10 of these in one room at max! The rest of the rooms may use the other 600. But there is never that many vertices ever displaced!
Also note: All the major 3d video cards handle the multiplication of matrixes and do the memory copies using their built-in processor! Only the occasional rotations degrees are passed to the video card and cartesian refference points are passed, this is only done occasionaly. The old values are stored and kept till the codes says to copy the new ones. Do you even know what a coprocessor is?
derek
September 2nd, 2000, 09:41 AM
To show you guys how video cards and co-processors work, I would advise to take a look at the "Amiga" line of computers. This older line has processors that are no faster than 50 Mhz and which can run 3d games.
Dustin
September 2nd, 2000, 10:16 AM
Why spend money on upgrades when the computer should be fast enought to run newer games? I rather spend money on buying more games than hardware? Think about it. Most people who buy games are high school to college students who do not have enough money to upgrade every year including me. When most people buy a car they expect not to have to change the engine or the body of the car the next year. Optimzation is important even if it just means organizing. Have a nice day!
------------------
_________________
"Don't Touch That! It's my lunch!"
Email: nemo3@go.to
URL: http://www.geocities.com/nemo_33.geo
Caesar
September 2nd, 2000, 10:33 AM
Quake 3 models use between 1000-2000 vertices per model. The static scenerý is atleast 10'000 vertices.
We're talking about a game that's two years away. I consider 90,000 vertices to be a conservative statement.
The only cards that handle matrix-multiplication and vertex/matrix multiplication is the Geforce line of cards and alsoe the ATI Radeon. That's it. And since you mention a 300mhz system I seriously doubt you're using a GeForce card (a motherboard for a 300mhz system typically wouldn't be able to feed the required juice to such a card).
You're wrong about the rest of your entire message. You have to send your geometry through EVERY frame. Static geometry-passing will probably be a feature on the newest cards when DOOM3 is out though, not that those card will be able to co-exist with a 300mhz processor mind you.
Fact: When you render a scene you have to take your geometry, multiply it by the transformation matrix (i.e. camera-matrix) then send it to the graphics board. You have to do this EVERY FRAME. Even if nothing in the scene has changed one bit. Even if you haven't moved the camera one inch. You STILL have to transform ALL vertices EVERY frame.
Waste of time one might think. It would be neat if you could say "here, I'm not gonna touch this geometry for a while, render this really fast" but you can't, on today's graphics boards.
Current graphics board doesn't cache geometry, just textures.
Have you even programmed ANY 3D at all? Your statements are false.
People who act like they know a lot while making statements that are obviously conceived in ignorance annoy me.
derek
September 2nd, 2000, 10:59 AM
Yes, I do 3D programming. I try to keep the vertices down, so there isn't that much demand on the CPU.
Also DirectX is used in Quake2 aka "Software mode" for people without 3d cards. That why DirectX is inlcluded on the Quake2 cd. I have had to use that mode on my friend's older machine! Its not pretty.
A type of Static geometry is also used in the Direct3D ramp mode or was it Intermediate Mode. I believe it was the Execute Buffers. This creates a sort of buffer, which can be slighty modified and streams only the changes to the card.
Also I would advise you to take a look at the "Amiga" line of computers and their code base to better understand how coprocessors work.
Caesar
September 2nd, 2000, 01:12 PM
Christ!
If you have a high-poly scene you'll have a lot of vertices. There aren't any tricks you can do to "keep the vertices down" (aside from asigning them to triangle strips and triangle fans, obviously).
Ok. DirectX is used in Quake 2, but it isn't used for the 3D-rendering. It's used to blit the final rendering to screen. It doesn't use Direct 3D. It only uses it to do the final blit onto the screen. So it DOES use dx but not for the 3D.
Quake3 uses DX for input and sound, btw.
And if you ever programmed D3D (like you say) you'd know that it's called "retained mode" and "Immediate mode" not "ramp mode" and "intermediate mode".
I program OpenGL mostly but I assume that Execute buffers are the same as Display lists in OpenGL (it sure sounds like it) if that's the case you're wrong about what they do. Or maybe you're talking about Vertex Buffers? Which is the same as Vertex Arrays in OpenGL if I'm not misstaken.
The video-processor DOES NOT save vertices on-board for later use. There are however ways of sending them to the board (which still has to be done each frame) which are faster than others. Among them are vertex arrays.
The point is that current cards don't save geometry on board to save transformation math or whatever. You STILL have to send everything to the board, you STILL have to transform everything, EVERY FRAME.
If you don't take my word for it take a look at John Carmacks workshop at an earlier QuakeCon (I think, the workshop before the last one, anyway). He talks a bit about current technology and limitations in it. He mentions exactly what I said above. That there's no way to tell a graphics board "here, take this, I'm not gonna touch it for a while, just render it really fast". But it will probably be the next big thing after T&L (which still isn't fully supported among the current generation of cards).
[This message has been edited by Caesar (edited 09-02-2000).]
derek
September 4th, 2000, 02:19 PM
The main goal of this thread is to tell the rest of the software industry they need to actally do some optimizations for the lesser beings in the computer world. I'm not tring to cause a commotion. But trying to set an example for the rest of the software field to actually spend some time working on their code instead of slaping it together like a lot of companies do today.
Toke
September 22nd, 2000, 08:38 AM
A computer can be upgraded from 100mhz to 500mhz for less than 150$ if you buy it from the right places and upgrade it yourself.
derek
October 2nd, 2000, 06:36 AM
I will proably upgrade soon, but, college tutition kills your computer upgrade money!
------------------
"Bond, James Bond"
Maker of GoldeneyeDoom2 TC
http://www.newdoom.com/goldeneyedoom2/
Single Player Levels
Deathmatch Levels
vBulletin® v3.8.3, Copyright ©2000-2010, Jelsoft Enterprises Ltd.