Creating a Game [Archive] - C Board

PDA

View Full Version : Creating a Game


RazzTheKid
03-13-2008, 09:53 AM
Hey, although I am novice with programming in c++, I would like to know "how to make a game." (I know that phrase is throw around alot)

I'm not going to attempt to any time soon, but I would like to know what it takes.

What are the steps and what do I need to know to do so? Could I make a simple tic tac toe game with only c++? Or do I need to know how to use something like opengl? And what exactly is opengl? Is it a programming language? Can it be compiled in a c++ compiler like bloodshed dev c++? If it's not a language, how do I associate it with c++?

Any help's appreciated.

Wraithan
03-13-2008, 10:01 AM
Look into what libraries are when refering to C++, that will clear up some of your questions. Right now don't worry about games, you are unlikely to understand a lot of what we would talk about if we told you even an outline of what you need to do.

mike_g
03-13-2008, 10:07 AM
You can make a game of tictactoe in the console, as long as you are happy with textonly output. It sounds like a good starting point too. If you havent done any programming at all yet, I would suggest learning how to use if statements, for loops, and arrays. Once you know about them you should be able to make a basic tic tac toe game. And if you get stuck, just post you code.

RazzTheKid
03-13-2008, 10:51 AM
Thanks for the info. I understand if, loops, and arrays already. I look into what libraries are and such.

mike_g
03-13-2008, 10:59 AM
In C++ iostream should do pretty much everything you need.

xuftugulus
03-13-2008, 01:47 PM
My first game ever was a slot machine with very simple computed graphics using ... hold on GW-BASIC running in a DOS emulator on an Amiga-500. I was forced to learn premature optimization, as one could usually see a line of pixels being rendered on such a configuration.
I wish i had resources then as i have now, as i would definately work in 68000 Assembler as easily as with BASIC. But it was a lot of fun!

Raigne
03-13-2008, 05:03 PM
You can use the HGE game engine library to create 2D games. If you want to look at it I think this is the correct link.HGE (http://hge.relishgames.com). This uses DirectX, and if you get good with it, you can get mad frame rates. my game runs at 400 fps with 300+ sprites at a time.

mike_g
03-13-2008, 05:15 PM
Why have a frame rate higher than your monitor can display?

You may as well let the system sleep for a bit.

Bubba
03-13-2008, 05:20 PM
You may as well let the system sleep for a bit.


The more frames you have the more you can spare for non-rendering tasks.

mike_g
03-13-2008, 05:26 PM
Sure for a speed test thats fair enough, but for practical use you are better off capping the frame rate and have it wait.

Bubba
03-13-2008, 05:36 PM
Sure for a speed test thats fair enough, but for practical use you are better off capping the frame rate and have it wait.


I've never seen that in any book, forum, or code. Usually you want to cap the frame rate for physics calculations but you want the render to run as fast as it can go. The refresh rate is normally the cap but that depends what the user has vsync set to. The video card could care less how fast you render up to a point. Usually in the neighborhood of 600 to 700 fps things start to get a bit wacky (at least my experience on NVidia cards) and start to cause display artifacts. I've never seen any problems with FPS lower than that.

RazzTheKid
03-13-2008, 06:25 PM
You can use the HGE game engine library to create 2D games. If you want to look at it I think this is the correct link.HGE (http://hge.relishgames.com). This uses DirectX, and if you get good with it, you can get mad frame rates. my game runs at 400 fps with 300+ sprites at a time.

Thanks for that link. I'm sure it will come to use.

Raigne
03-13-2008, 06:27 PM
I have any physics code run off delta time just like everything else. Maybe I am mistaken in my way of doing things, but it works for me.