.qc (dot qc) - the group for quake c coders of all denominations. If you make quake one mods and write code in quake c, join our group! I'll try to answer any quake c questions - please post your inquiry in the forums...
Posts | ||
---|---|---|
Per frame code operation | Locked | |
Thread Options | ||
|
Jun 11 2014 Anchor | |
What is a frame? Technical answer: En.wikipedia.org A frame in a video game is a rendering of the scene for one update of the display device. Why is this important to coders? The answer is here: En.wikipedia.org "In modern action-oriented games where players must visually track To be visually appealing (look realistic) framerate must be more than 30 FPS and consistent. Input responsiveness is also a factor in this equation. In theory a short enough think time ( Moddb.com ) could operate on a per frame basis. Quake-c has 2 functions tied permanently to the game engine C code: void () PlayerPreThink; // Called every frame before physics are run What kind of code is found in the per frame functions? In general things that must be handled every frame for visual appeal or continuity. Some physics, liquid movement and damage, jumping, artifact (like the quad) operation, certain sounds (like the landing thud), weapon auto switch, intermission and death / respawn. What can be added? There is a great amount of potential. I try to follow these guidelines: Nothing that can be done with think or touch. Avoid code that is waiting on some event to complete, unless it _must_ be checked every frame. Sample wrapper to make sure precisely 1 call happens per frame: // global var in defs.qc // in pre or post think You are now armed for per frame code goodness. Edited by: numbersix |
Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.