Archived

This topic is now archived and is closed to further replies.

Getting to know your hardware...

This topic is 5086 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there! I''m working hard to build a solid knowledge of C++ and some assembly before undertaking the somewhat daunting task of mastering (yeah, right!) DirectX and/or OpenGL. But I have this annoying feeling that something is missing from the picture, and that''s hardware. There''s something I learned from assembly, and this is that there''s more to a computer than Strings or Vectors. I would like to know thoroughly the machine I''m working on to be able to squeeze every piece of performance out of it; I understand that the difference between a project like DoomIII and some of the amateur games you can find around is more than artistic quality or the number of people involved, and has something to do with the (let''s call it that way) intense knowledge of the hardware you''re developing for. Do you people know of any interesting source where I could find that information? And do you think it''s worth the trouble, to begin with? I''m not sure if the post is clear enough (as I''m not too confident about my english''s skills). Anyway, thanks for your time!
"Senri no michi mo ippo kara (A journey of a thousand miles starts with a single step...)"

Share this post


Link to post
Share on other sites
I agree TOTALLY that programmers should know how computers work

First learn about hardware architecture (chipsets, busses...). Many tech sites have diagrams when they review a motherboard. Try building a computer if you havn''t already.

Assembly is how I learned how the CPU works. Looking at the assembly listing the compiler generates (an option) is a good way to learn how the code you write runs on the computer. This makes C++ programming much easier and efficient.

As for DirectX it is not so much about the CPU so you should learn how the API talks to the graphics cards and how the card works (pipelines, graphics memory).

Magazines (like Maximum PC, CPU...), web sites (Anandtech, HardOCP...) and the DX SDK all have great info even for newbies

I think it is very fun and worth it but takes a bit of time to learn like a hobby

Share this post


Link to post
Share on other sites
Hi again! First of all, Cybertron, thanks for your reply!

I bought the "Black art of 3D Game Programming" book, by guru LaMothe some time ago, and it made me think that a deep knowledge of your computer was a must back in ''ye ole'' DOS days, because the resources were limited and there were no interfaces fast enough to access most of the hardware, so you had to actually create some black magic to solve both problems.
Thus, even if nowadays the computers are extremely powerful, why do people forget that most computer resources can be used more efficiently handling them at low-level? Or am I wrong? Is not necessary anymore to know what ports the PC has, and how to read/write them, for instance?

One thing is for sure: many so-called ''professional'' developers are getting increasingly lazy, and they release games that look and play like shit, but have incredibly steep requirements. Is this some kind of "Game''s-gonna-play-on-that-oh-so-powerful-computer-so-I-don''t-have-to-optimize" syndrome?

P.S. Sorry to bother you again, Cybertron, but do you have any links to those tech sites you were talking about? Thanks!!



"Senri no michi mo ippo kara (A journey of a thousand miles starts with a single step...)"

Share this post


Link to post
Share on other sites
For cpu''s these would be a good place to start,

http://computer.howstuffworks.com/microprocessor.htm

www.intel.com

Share this post


Link to post
Share on other sites
quote:
Original post by Greatwolf
He means these sites:

HardOCP
AnandTech
ArsTechnica


Oops!

Thank you all! Looks like I'm gonna spend some time browsing those sites... Thanks again!



"Senri no michi mo ippo kara (A journey of a thousand miles starts with a single step...)"

[edited by - JoriathLionfort on February 5, 2004 9:53:58 PM]

Share this post


Link to post
Share on other sites
Don''t worry if you can''t understand the API''s. Getting a DirectX demo in C++ up working requires you to have some experience. Try to write as much code without having to deal with a specific API. Some simple games with console output is somthing I would advice you to write.

Share this post


Link to post
Share on other sites
Thanks for the advice! In fact, right now I''m working on a (typical) text-based combat RPG, with a mix of real-time and turn-based gameplay.

But I''m after something different. I''m not that much concerned about APIs (at least, not yet...) as I''m about how a PC actually works. I know that, back in the DOS era, knowing and handling your hardware directly was a must. Why, then, nowadays seems that no one cares about it, only focusing on higher level languages (even if it''s C)? Computing power has been hugely increased, as hardware''s complexity, but that''s no the point... After all, building a 3D engine is not an easy task, either! So, my main question is: are there any benefits to work at hardware-level? And, if that''s so, what books or sites should I buy/visit to get the information I need?



"Senri no michi mo ippo kara (A journey of a thousand miles starts with a single step...)"

Share this post


Link to post
Share on other sites
Well, with dos, you could easily get access to the low level hardware (well, it might have been a pain in a compatiblity way - but it was doable).

But, with modern Operating Systems, they need to protect the computer they are running on from crashes... And that means for one, that they must protect the hardware by not let us (programmers) directly access them, only by means of an API. And while it still may be possible to work around OS protection and deal with the hardware itselt. There are a few things wrong with that - you may use the ability to have your app run on all kinds of hardware, or more than liekly, you will crash the OS

Edited - some spelling

[edited by - pjcast on February 8, 2004 12:07:48 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by JoriathLionfort
Thanks for the advice! In fact, right now I'm working on a (typical) text-based combat RPG, with a mix of real-time and turn-based gameplay.

But I'm after something different. I'm not that much concerned about APIs (at least, not yet...) as I'm about how a PC actually works. I know that, back in the DOS era, knowing and handling your hardware directly was a must. Why, then, nowadays seems that no one cares about it, only focusing on higher level languages (even if it's C)? Computing power has been hugely increased, as hardware's complexity, but that's no the point... After all, building a 3D engine is not an easy task, either! So, my main question is: are there any benefits to work at hardware-level? And, if that's so, what books or sites should I buy/visit to get the information I need?



"Senri no michi mo ippo kara (A journey of a thousand miles starts with a single step...)"


It sounds like you might be interested in this book called

Vector Game Math Processors
But the main reason everyone uses API's instead of assembly now is that they write games for windows xp and it doesn't let you access the hardware directly anymore. Try writing a console program trying to access an interrupt and you'll see what I mean.



If God played dice, He'd win.
—Ian Stewart, Does God Play Dice? The Mathematics of Chaos

[edited by - daveangel on February 13, 2004 10:37:54 AM]

[edited by - daveangel on February 13, 2004 10:39:30 AM]

Share this post


Link to post
Share on other sites
Thank you very much, pjcast & daveangel! Now I understand why are the APIs so important nowadays, and why should I quit bothering about DOS-like hardware programming... So far I never had a problem with real low-level programming probably because I''m still working under W98SE But, with that new found knowledge, I''ll change my focus. Thanks again!

P.S. daveangel, I''ll check out that book immediately!



"Senri no michi mo ippo kara (A journey of a thousand miles starts with a single step...)"

Share this post


Link to post
Share on other sites
JL~

About the whole know your hardware thing:

Back when I started playing with graphics, mode X was the coolest thing. Converting the inner loops into asm was a must, etc (anybody else use a 32-bit int to hold both 16-bit fixed-point u/v coordinates simultaneously? He he he.). Then 3D accelerator cards came along, and no matter how fast my software renderer was, a sloppy HW implementation could beat mine. Now, with shaders and what not, we are getting "back" to the good old days.

As for the non-graphics part, I''ve always believed that knowing the HW was important. I remember being impressed because in Quake I some programmer (what was his name again?) set up the code so both integer and floating point pipelines were in use at the same time, with great results.

Of course, my highly optimized crap routines (bubble sort) tend to get beat by some poorly implemented better algo (any other sort [8^). So I try to keep my optimizing tendencies at bay till I''ve done a bit of profiling.

Well, there''s my 2%. Sorry if I sound like Pat Morrita ("ambition without knowledge is like a ship without sails". Or was it "jetski"?).


lonesock

Piranha are people too.

Share this post


Link to post
Share on other sites