• 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.

nycjay

acceleration and deceleration

9 posts in this topic

hi. i am doing an opnegl/c++ model of a hard disk. basically, i have a disk, and an arm that swings over it. right now i just rotate the arm to the correct degree to be over the appropriate sector. my professor now wants me to make it more realistic, to make the arm accelerate and decelerate when it moves from one track to another. can anyone point me in a good direction to do this? thanks in advance for your help. Jason
0

Share this post


Link to post
Share on other sites
You can do some physics research...or just simplify things...

Currently, you might have movement like...

PositionX += SpeedX;

Acceleration would just be...

SpeedX += AccelerationX;

That''s the basics of it, simplified even, but your post doesn''t have enough information for me to know if this''d even be usseful for you.

If you''re just moving the arm by certain degrees every second, you could also just calculate everything beforehand and move it dependant on those calculations...

Like...You know that PositionX needs to move 40 units, and that it''ll take 12 seconds...

PositionX = 0;
SpeedX = 1;
AccelerationX = 1;
Time = 0;

while( Time < 12 )
{
PositionX += SpeedX;
SpeedX += AccelerationX;
if( Time == 3 ) AccelerationX = 0;
else if( Time == 6 ) AccelerationX = -1;
Time++;
}

Go ahead, plug it in and see what you get...The object will speed up to 5 units per second, then slow down to 0 units per second, and will have moved 40 units.

G''luck,
-Alamar

PS. If that seems complicated, go with the initial suggestion and research some physics...
0

Share this post


Link to post
Share on other sites
I wouldn''t have thought that the acceleration of the head would have much overall impact on the hard disk (i.e. you wouldn''t really notice the acceleration/deceleration) especially since the head only moves a very small distance before it gets to where it was going...


War Worlds - A 3D Real-Time Strategy game in development.
0

Share this post


Link to post
Share on other sites
Yeah, why don''t you just tell your professor that you added acceleration when you really didn''t

He''d never notice


Got Slack?
Commander M
0

Share this post


Link to post
Share on other sites
I know that it will be hard to see. Basically, he wants to use this app as an example to show to an into operating systems class. i will have sliders to control the speed of the disk and the arm (and hopefully it''s performance) so the students can see how efficiently different read/write algorithms work with different hardware. i am going to try and put in some of the above code, and see where it gets me. thanks for the help and advice though...
jason

ps. he tols me that the acceleration does play an effect in the real world. the mechanism for moving the arm with the head on it has to take it into account so it knows how much power to give the mechanism. i am at a loss, be he says its important ?? oh well
0

Share this post


Link to post
Share on other sites
it is important. what if the disk accesses several sectors that require the movement of the arm everywhere. the arm spends lots of time accelerating and decelerating. if the arm has to read from a sector at the edge, and then the next one near the center of the disk (sweeping) the entire disk, the acceleration and deceleration time has a lesser effect since the time the arm has to move outproportions the time for accel and decel.

a2k
0

Share this post


Link to post
Share on other sites
Just out of curiosity I went and checked out a drive on Seagate''s web site. The track per inch was 21,368 and with 16,383 cylinders. That makes about .7667 inches. A full seek takes 17.8ms which is an average velocity of around 43.07 inches/second. The average, 1/3 of the tracks, is 31.17 inches/second and a single track seek is .039 inches/second. So apparently the time it takes to accelerate to the maximum velocity is large relative to the distance between two tracks. I would think the acceleration curve would look something like M*R*T*e^(1-R*T) where M is the maximum acceleration and R is the reciprical (eek sp?) of the time it takes to reach the maximum acceleration. That would make it M*1*e^0 or M at that time.
0

Share this post


Link to post
Share on other sites
Very simple system is like this:

float speed=1.00;
#define PER_MOVEMENT 0.15
#define MAX_SPEED 5.0
#define MIN_SPEED 0.0
float characterpos=50.0;
BOOL accelerate;
int direct;

...

void gameloop() {
...

characterpos+=(direct*speed);
if(accelerate) {
if(speed speed+=PER_MOVEMENT;
} else {
if(speed>MIN_SPEED)
speed-=PER_MOVEMENT;
}
...
}

In serious projects, I recommend you don''t use this. But if anyone wants quick and fast system, this would be good.
0

Share this post


Link to post
Share on other sites
You need to know how much umph the drive can supply, and the mass distribution of the heads. From that you can calculate the moment of interia, and then given the umph characteristics of the drive you can calculate rotational accelerations and velocities. Finally you can calculate the position of the heads.

Magmai Kai Holmlor
- Not For Rent
0

Share this post


Link to post
Share on other sites
Well, I thought it would be easy to come up with a curve that would approximate the average velocity versus the number of cylinders being traversed. Perhaps it is, but not for me. A few more data points would certainly go a long ways. I think I would argue that if he wants an accurate simulation then he needs to give you that equation and otherwise he needs to be happy with something that looks good. Even with that it would be a bit of a challenge to come up with an linear acceleration/decelleration and maximum velocity that would always get you where you are going at the right time.
0

Share this post


Link to post
Share on other sites