about game programming
Would I have to full understand the purpose of fib() to program games? because it seems irrellivent to me right now
Same question with recursion
[edited by - ThomasSauder on October 3, 2002 7:27:42 PM]
All you need to know is how to manipulate variables, check for conditions and create loops.
Boosting this to top for game developpers that migth take a look at my question. Just going to restate it: Does fib() or Recursions get used a lot in game programming? or should i just learn the basics of those topics and that''s it?
Well, I''m not a professional game programmer, but I have experience writing a lot of code. Recursion most likely isn''t used in games all that much. This is mainly because recursion is slower than iteration due to more function calls, and it uses more memory.
However, it is useful to have a solid grasp of recursion. For one, there are a lot of problems where recursion is the simplest, most elegant solution. Iteration may be faster, but it won''t be as pretty a lot of times. Take for example the Fibonacci sequence. You can calculate fib numbers without recursion, but the formula is not really that obvious. The recursive solution is much more understandable.
However, there are some problems(even in games) where recursion really is the best solution. For example, I''m working on a skeletal animation system, and in my system, each bone has its own mesh in the model file. Loading the hierarchy of bones is very simple using recursion, but I don''t even want to think about what it would be like to write without recursion(might be impossible).
In short, recursion might not be used that much in games, but it can be really helpful to know.
However, it is useful to have a solid grasp of recursion. For one, there are a lot of problems where recursion is the simplest, most elegant solution. Iteration may be faster, but it won''t be as pretty a lot of times. Take for example the Fibonacci sequence. You can calculate fib numbers without recursion, but the formula is not really that obvious. The recursive solution is much more understandable.
However, there are some problems(even in games) where recursion really is the best solution. For example, I''m working on a skeletal animation system, and in my system, each bone has its own mesh in the model file. Loading the hierarchy of bones is very simple using recursion, but I don''t even want to think about what it would be like to write without recursion(might be impossible).
In short, recursion might not be used that much in games, but it can be really helpful to know.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement