Archived

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

Guest Anonymous Poster

Beating the Machine

This topic is 6600 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

Yeah, I'm an optimization freak myself. I don't, however, write that much asm! I'll maybe write the software graphics and sound mixing code in asm, but that's about it - I keep everything else in C/C++. I find that's all you need to do, so long as you optimize the algorithms you use in your higher level languages. Or maybe, use a little inline asm too.

Share this post


Link to post
Share on other sites
Yeah, I have the same idea as you do- check out the thread "Software Rendering is not dead (or is it?)"
I optimise nearly everything I can- however I never really test it against the compiler's opt's so I have no idea how successful I am ;-)

Share this post


Link to post
Share on other sites
I optimize any part of my game that takes a reasonable amount of CPU time. Unfortunately these routines seem to be the ones that have the least there to optimize (software lightmap routines, etc). Occasional optimization I do also, but I rarely resort to Assembler anymore. For my needs I've found C++ does a fairly good compiling job, and the code is more readable as a result. As long as the framerate is "good enough" (in my case, about 23-27 frames per second on a PPro180), I live with that.

Share this post


Link to post
Share on other sites
Umph... well, maybe I would. But I don't for several reasons. First, I've got the VC++ standard edition. My compiler doesn't optimize c/c++ code. 2nd point : there are so many processors out there, so many different opcodes. 3th point : optimizing requires a lot of time to do. And in fact, I got little time for programming, so I won't spend my time writing lines and lines of assembly just to get a 10% speedup.
4th point : I'm still learning how to code for Win9x and OpenGl, so why should I optimize at this stage?
5th point : My PC runs fast enough (P!!! 450). I don't have to optimize. But I know you want to speed up your code if your PC requires it. (I know it, because I used to program for a P90 back in the good old DOS days)
6th point : The M$ Macro Assembler is just too expensive for me... (if you know some good alternatives...)

Of course I would optimize my code in some ways, if the time's right and the code's already there (Personally, I find it very difficult to code something in assembly from scratch.) Optimizing the core functions, the timecritical stuff, o.k. But to write about 50% or more percent of your code in assembly is a waste of time, I think.
That my point of view. Anyway, less optimizing makes your code easier to port onto other platforms.

BTW what assembler do you use? inline or the M$ macro asm or sth different?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Something to think about, and kind of my own little personal crusade. As many of you writing here are game programmers, with probably about the same amount or more experience than I have (5 years?), then tell me this:

Do you still optimize your code?

It's funny that today, most of the games that I see seem to have increasing hardware requirements, but seem to go slower and slower, while not really adding much in the way of gratuitious eye candy, improved frame rate, or some sort of reason for this increased reliance on hardware. Are we just using our increased machine speed as a crutch?

I still optimize my code, by hand, using about 70-75% assembler. I usually beat the compiler by at least 10%, usually more. I also rework my algorithms and ideas, writing new test programs, and dragging as much as I can out of the hunk of junk in front of me. (For instance, I'm currently working on an online game, the recommended requirements for which are a P/100 with 16 megs of RAM and a 28.8 modem) Does anybody else still bother these days, or are the days of optimization dead?

- Nicholas

Share this post


Link to post
Share on other sites