• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

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

Terran Marine

Limiting the framerate....

4 posts in this topic

I''ve managed to disable V-sync in my project, but on faster computers, my engine runs much too fast to be playable. Can anyone suggest a way to limit the framerate, so that the engine takes full advantage of fast computers without running too fast? Thanks in advance.
0

Share this post


Link to post
Share on other sites
To get a constant frame rate:
record the time at the top of your main-loop, t1. At the end of the loop you record the time again, t2. Then you calc the difference t2-t1=t3.
Suppose you want to try to achieve a rate equal to r=30 fps (frames per second).
Then calc wait=1/r [unit=second per frame]
Now you compare t3 and wait. If t3 >= wait, then ignore any delay and return to top of loop. If t3 < wait then wait an amount a=wait-t3 before you return to top of the loop.

Was this any help?

/Mankind gave birth to God.

Edited by - silvren on September 24, 2001 12:50:51 PM
0

Share this post


Link to post
Share on other sites
dont do that u want your engine to run as fast a possible on all machines, check out flipcode, one of the topics or code of the day. theres a big discussion about fixed time steps for physics and ai. graphics u handle differently though see what fraction of a second youre currently at and alter the drawing depending on that.
A<----------->B
say u have a vertice that moves from A to B and back. from A to B takes a second and back also takes a second.
check the games time 46453.5 seconds thus half a second remainder thus stick the vertice halfway between A + B.
this is how u calculate things linearly its not the smoothest but its the easiest later can u use more accurate methods if u wish. q3a use this btw
0

Share this post


Link to post
Share on other sites
Well, I think it''s even easier than ZedZeek explained it.
First, start thinking in a different mode. Don''t make objects move at a rate x ammount of pixels per frame, instead make them move y ammount of pixels per second. If you do things this way, you game will run at the same speed no matter how fast or slow it''s going. The only drawback, but is consistant with all games, is that on slower machines the display will be quite choppy... Anyway, here''s how I''d do it.

First, you need a framerate counter. I got mine from the OpenGL Game Programming book (CHiResTimer) but i''m sure you can find a way to make a good FPS calculator.

Now, when displaying your object, lets say you want this particular object to move at a rate of 20 PPS (pixels per second) and you''re getting some FPS like 630.

x = number of pixels to move
y = framerate
x / y = z, number of pixels to move in this frame.

You''d end up with roughly 0.031. Break out a calculator and look at it. If you traveled 0.031 pixels 630 times, you''d move 20 pixels. And since you''re framerate is 630 FPS, you moved 20 pixels in a second.

Well, hope this was helpful.

- Mike
0

Share this post


Link to post
Share on other sites
i would suggest the same method as zedzeek it is a great method
the animations will be smooth and always run at the correct speed
nehe.gamedev.net have a tutorial on morphing that might be useful


A new world, dark without the false light ....
0

Share this post


Link to post
Share on other sites