Public Group

#### Archived

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

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

## Recommended Posts

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]

##### Share on other sites
All you need to know is how to manipulate variables, check for conditions and create loops.

##### Share on other sites
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?

##### Share on other sites
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.

##### Share on other sites
Ok Thanks, I was just asking this because as being a new programmer, the concept on how it works is hard for me to understand right now. Hopefully I''ll understand it in the future

• 11
• 20
• 12
• 9
• 34
• ### Forum Statistics

• Total Topics
631399
• Total Posts
2999846
×