I am fairly new to python, panda3d, and game programming. I have some years programming in other languages for business apps but decided to take on a mid-size game project to further my knowledge and give me something to do.
My problem is the development of a game loop. I am not really sure how to build it. Should I make it a task or a loop from scratch? Frankly I am lost and I have done quite a bit of searching and haven’t come up with much useful information about using panda3d to help me accomplish this task. If anyone has any tips, tricks, or tuts let me know. I appreciate your help!
In Panda, the “game loop” is already part of the engine. Generally, you will define your game tasks, and add them to the Task Manager, to be called once per frame. You don’t need to explicitly create your own game loop.
Look to the sample applications for examples of this sort of thing being done.
Thanks drwr, everything just kinda clicked for me after reading your post. Just to make sure I am understanding it correctly. I make several tasks and control them by their priority and have “throttling” code inside each task if needed.
Since this is also my first semi-OOP project, don’t all of these calls all over the place get expensive on resources? Potentially running 200 actively moving entities plus all the other typical game goodies is really going to get a rig smoking right?
Also, holy crap fast reply! Thanks again.
Yes, that’s the right idea. Just moving things around generally doesn’t cost too much, though it’s true you might start to notice that time with 200 independently-moving objects. PStats can be a useful tool to help you identify bottlenecks.
I appreciate you taking the time to chat! Thanks for the tips and I will be sure to check out the Pstats util.