How program a cargame?,
Members - Reputation: 205
Posted 11 January 2002 - 05:27 AM
Of all the game types out there driving games are probably the most physics orientated games ever.
You accelerate, thats physics,
you break, thats physics
you hand-break, thats physics
you turn, thats physics
you skid, guess what, THATS PHYSICS.....
If you did not use some physics equation to calculate the skid of a car when you break, how else would you do it.
if(speed == 01 && steerint_wheel == 0 )
There are thousands of combinations, and it would never work right.
If you want a good racing game, you need 3 things, and in my opinion, they come in this order.
Totally Great Physics, (so it feels like you are really driving)
Great AI ( So it is fun to race the computer players )
Just my two cents, but I have tried to program a very basic 2d driving game, and it is very very difficult to get it to feel right. The acceleration was wrong, the turning was wrong. ie. my physics was crap.
"Only two things are infinite, the universe and human stupidity, and I''m not sure about the former." --Albert Einstein
Members - Reputation: 100
Posted 12 January 2002 - 08:38 PM
Ok, mr datatubbe, i''m going to let you in on a few things you need to get familiar with if you intend to make any sort of game at all:
1]C++, while not the only language out there, its widely supported, so learn it. Dont just learn how to get things to compile using some stupid book, but learn how to put the language to use for yourself. Understand what all those little symbols and keywords mean like #define, typedef, unsigned, switch, #endif, class, etc etc etc...and how they work and when to use them. Then learn basic programming constructs such as while loops, if statements, things like that.
2]Learn how to use C++ to create standard data structures and implement fundemental programming ideas. For instance, do you know what a pointer is, what about a Tree, linked list, a graph, a Binary tree, a hash table etc, what object oriented programming is, how to use templates, and much much much more. You''ll need to know these things they are very very important. Why? Here''s why. How do you suppose you are going to store your graphics, your racing maps, your car models, the textures, music, fonts, text, animation, and all the rest? How do you propose to handle those resources without bringing your computer to its knees when you combine the above with the AI, physics calculations, and rendering of the engine? If you can manage your data and data structures with efficiency, you have won half the battle. As I always say, when programming games, MIND YOUR DATA.
3]Get familiar with an API. Unless of course you plan on creating your own. In which case you''ll need to know a lot more than i''m going to talk about here. Otherwise, DirectX or Opengl are the current API''s of choice. Figure out how to use the API and the data structures you learned above to load and display graphics, move them around on the screen for instance. Learn how to use keyboard input, make game loops, and play sounds and movies.
4]Get familiar with a Math book that will help you understand vectors, their functionality mathmatically and thier application to 3 dimensional space. You''ll need this information to begin to understand how to make a 3d engine as you want to do. Similarly, get really cozy with your Calculus, because the level of physics you''ll need to model to make your racing game realistic is going to be hefty. Moving a car around on the screen is much more than just pressing the up arrow and changing the position on the screen. If you want to make it realistic you need to make it accelerate at a proper rate, you need to shift, and brake, and turn while accelerating. What if you turn to sharp and roll over? This type of thing is answered through physics.
6]Pick up a few books on artificial intelligence, or possibly some tutorials. Figure out how to make your AI cars race down the track, and think and drive for themselves. This has been done with bezier curves for instance. There are many ways to implement an AI system, these topics can take years to master.
7]By the way, all of the above only scratches the surface of what you want to do.
My proposal to you and your college grad in C/C++ and the rest is to start with something small and easy in 2 dimensions. Then make something bigger in 2d, with effects,animations, pathfinding, AI, music the works. Then, begin learning about how to implement 3d graphics, without then with an API.
Finally after about 4 to 5 years of learning and practicing the above, you may *almost* be ready to begin understanding what it is you need to LEARN to make a game like Need For Speed.
Ok, i hope this helps you out, because you have a lot of learning to do :-)
Members - Reputation: 122
Posted 13 January 2002 - 09:16 AM
I don''t think i have thought much about the physics, but hey, see what i learned now just by askin'' in this forum
It''s great help im getting tnx ya all!
They didn''t accept me in the Tubby World!