> To think of an analogy, for example you want to use your computer to
> solve a problem, let's say invert a 6x6 matrix. Yes, computers can be
> used for things other than games. You write a program (an 'engine') to
> invert this matrix by using an algorithm that is used for general
> matrices, only that you seet the parameter of the dimension of the
> matrix to 6, problem solved.
It's good analogy, but a bad example ;)
By coincidence, I spent several hours this afternoon implementing
an algorithm to invert a 10x10 matrix for a game.
It was built for exactly the specific problem at hand, in order
to take advantage of all the zeros common in some of the
matrices of various of our equations of motion. Eventually, we will optimize it
much more by sucking the life out of every common factor we can find, ;)
and precalculating (or low rate recalculating) any parts for which that is
appropriate. It is specifically for use with one type of suspension that we
deal with. We will repeat this task for other suspension types later, as required.
This algorithm replaces a general routine that was used until it's
slowness got too annoying. This is the algorithmic equivalent
of designing an ASIC (Application Specifric Integrated Circuit)
Having said all that, I actually agree with the basic premise.
I was part of the team that revised a completely general
trajectory optimization program (OTIS 3) for new uses by NASA
a few years back. I'd love to use OTIS on race car simulations,
it would rock. It would be a fun challenge to implement everything in an
input file. It could _almost_ be done, I think ;)
As you suggested, we tended to use that tool for everything.
Once you have a general hammer, every problem starts
looking like a nail! ;) However, if I was using it day in and day out for a
particular problem, rather than staring at my screen for long periods of time,
I'd consider ripping out 100,000 lines of general code and specializing
the equations of motion for the particular problem
(the tool is designed to allow that.)
I'd advocate using general algorithms to save engineering time up front, and
specialized tools once you change over to turning the crank.
If the speed improvements are worth revalidating the specialized code.
And in games, they still often are.
--
Matthew V. Jessick Motorsims
Vehicle Dynamics Engineer (972)910-8866, Fax: (972)910-8216