Click to See Complete Forum and Search --> : Game Development


DenisL
12-14-2000, 04:02 PM
I've written enough code in the past year that I'm getting rather comfortable with C and C++. I've built a few simple apps for my own use. Some GUI based, some CLI, etc...

What really perplexes me though is games. I mean with most app programs it's simple. Take input, send output, repeat. In a game, say asteroids for example. Theres so many things one has to do simultaneously. Calculating the ships speed as it decreases. Moving the ship. Moving all the asteriods around. Maybe even animating the asteroids (like in Kasteroids).

On top of all that you've also got to constantly be scanning the keyboard for controling input...

Thats a lot of things to keep track of in a piece of code. How is this generally done? Is threading generally heavily used, or does it just go from one function to the next at a fast enough speed that one doesn't notice any delay.

Is there a general planning method for designing all this or how does one normally go about it?

I've written some Palm apps, it'd be nifty to learn a little more so I can write some fairly simple games...

YaRness
12-14-2000, 04:18 PM
i know one thing. the more complicated an app gets, the more you thank your programming language that it has OOP support.

------------------
"Assembly of Japanese bicycle require great peace of mind."
Registered Linux User #188285 http://counter.li.org/
------------------

Phuzon
12-14-2000, 05:00 PM
Actually game programming ain't that hard. It just sucks a lot of time out of your life. Try writing pong or something. All it needs to do is check to see if up or down was pressed and move the paddle accordingly(sp?), and add the speed to the ball location. Negative speed will allow up and left movement. And when the ball hits a wall on say the left side do some thing like:
ballspdx = ballspdx - (ballspdx * 2);
And that will work on the left and right wall. For the top or bottom wall just change the x's to y's http://www.linuxnewbie.org/ubb/smile.gif

DenisL
12-14-2000, 06:09 PM
I suppose its like everything else I experienced, it's obscure right now but if I actually got a chance to code a game I could comprehend what was involved.

Pong port for the Palm anybody? Heh.

I suppose one would have to have like an event loop, in the example of pong, that would check if the ball was moving towards the computer controlled player, whether or not it hit a wall, etc...

I suppose I'll have to start examining source of various games.

TheLinuxDuck
12-14-2000, 06:48 PM
The most baffling part for me in a game is object collision rules. I've done pongish 2D stuff before with some success, but the whole 3-d thing is what gets me..

But, I've not really done any serious game type stuff before..

I always thought it would be totally qool to be involved in the development of a game. I don't have enough coding knowledge to do it, though.

A simple game like breakout/pong sure, anybody with a few months of coding knowledge could do that.. but a real game.. something with some meat.. I just don't have the desire to devote to learning how it all works, and putting it together..

Oh well.. maybe some day, I'll fall into a group of coders that will find a niche for me to fill in a game's development.

Even if it was minimal coding, and writing all the music for the game.. I could really have fun with that!!! http://www.linuxnewbie.org/ubb/smile.gif

Does anybody need music for a game?? http://www.linuxnewbie.org/ubb/biggrin.gif http://www.linuxnewbie.org/ubb/biggrin.gif

------------------
TheLinuxDuck
Wait... that's a penguin?!?!?
:wq

Blckglass
12-14-2000, 06:59 PM
If you want a lot of info on game development you should go to http://www.gamedev.net . Developing games is quite a challenge but once you know what you are doing it is great.

Phuzon
12-16-2000, 04:50 AM
Originally posted by TheLinuxDuck:
The most baffling part for me in a game is object collision rules. I've done pongish 2D stuff before with some success, but the whole 3-d thing is what gets me..


But, I've not really done any serious game type stuff before..


I always thought it would be totally qool to be involved in the development of a game. I don't have enough coding knowledge to do it, though.


A simple game like breakout/pong sure, anybody with a few months of coding knowledge could do that.. but a real game.. something with some meat.. I just don't have the desire to devote to learning how it all works, and putting it together..


Oh well.. maybe some day, I'll fall into a group of coders that will find a niche for me to fill in a game's development.


Even if it was minimal coding, and writing all the music for the game.. I could really have fun with that!!! http://www.linuxnewbie.org/ubb/smile.gif


Does anybody need music for a game?? http://www.linuxnewbie.org/ubb/biggrin.gif http://www.linuxnewbie.org/ubb/biggrin.gif



Were you the one who was gonna write the side scroller with me? Cause I would still work on that if you want.

Minime80
12-18-2000, 06:39 AM
I've written a couple games. I wrote a tetris-like game using C++ and DirectX. Right now I'm in the middle of programming a Stratego type game where the pieces are going to be the Hatfield's vs. McCoy's. The goal is to capture the other family's still (as in alcohol making). It's just getting under way though. I'm thinking about using fuzzy logic for the computer AI, but we'll see how far I get with that. I'm also going to include the ability to play network games. It should be fun. I'm pretty pumped about it. Anyways, I guess I got off track. I was just going to mention that from what I've learned with games is that with real time games there's a big game loop that does basically these things

retrieves player input
performs logic on player
General game logic (AI, Collision, Motion)
Low Priority tasks (Background Anim., Sound, Music)
Render image to buffer
Copy buffer to screen
Synchronize loop to a constant speed (i.e. 30 fps)