★ TouchArcade needs your help. Click here to support us on Patreon.

NOOB :( How do you program a game...

03-18-2009, 06:09 AM
#1
Joined: Mar 2009
Posts: 12
NOOB :( How do you program a game...

hello all,

i am new to game programming... very new... i know any game programmers and i have never looked into how it all works before... im sorry for this total noob question...

i am trying to figure out how a game is actually created. what i have come up with at the most basic level is this... you have some code and you have some animations... you use the code to play the animations in a sequence that relies on user input...

is this how it all works?

for example, if i had a character in a game that can stand, walk or run depending on what the user wants them to do i would have 3 animation, one of the character just standing there, one walking and one running. the user then selects a motion and the character performs it...

so does this mean that can create the animations in a program like toon boom studio 4 and then save each animation in the resources file and then call on it to play on the screen based on user commands? does this question even make sense?

sorry for the noob question... if you have pitty for me, please answer...
03-18-2009, 07:13 AM
#2
Joined: Mar 2009
Location: Oslo, Norway
Posts: 731
Well you do have the gist of it, yes.
In practical terms however it is not as easy as it sounds. You have to hook up the code to the interface, learn Objective-C + the Cocoa framework etc.

I'd say that iPhone is not the best platform to start programming on.

03-18-2009, 07:58 AM
#3
Joined: Feb 1983
Location: Barcelona
Posts: 1,268,691
Hope this helps!

http://tinyurl.com/d8rwxa
03-18-2009, 09:48 AM
#4
Joined: Jan 2009
Location: Toronto, Ontario, Canada
Posts: 5,206
Well, that would be one aspect of game programming in a nutshell I suppose -- specifically, getting something to move and animate on the screen. There's a lot more to actual game programming than that, but you've more or less touched on the tip of the iceberg.

Without getting technical, game prorgamming is a very, very in-depth subject that can cover a great deal of ground depending on what sort of game you want to write, and for the solo programmer there are a number of disciplines that all come into play when designing it. Much of it you can farm out if you don't have the talent -- graphics, sound effects, music, that sort of thing -- but those are the easiest parts anyway. Coding is the longest and most difficult part.

To get a thumbnail sketch you can read this Wikipedia article on game programming to get a rough idea of the typical steps involved game design and programming logic. If you're at all comfortable with that you can move on to learning how to program your own game through books, online tutorials and such. The iPhone also has a fantastic dev community who are often willing to help out with programming questions and issues as well, though don't expect them to hand you everything on a platter. You have to do your part, but if you're stuck there are many developers more than willing to lend a hand when you need it.

[Relax with Galactic Chill] [Let me tell you a story.]
Currently working on: Music for Spirit Hunter Mineko
03-18-2009, 10:46 AM
#5
Joined: Oct 2008
Location: Vancouver, BC
Posts: 1,652
Then you have to program enemy collision, what happens when certain characters pick up item, program the AI, respawn locations, where the character dies, HP, the landscape...a lot harder than most people think.

Quote:
Originally Posted by NickFalk View Post
I'd say that iPhone is not the best platform to start programming on.
+1.

 /l、
(゚、
 l、 ~ヽ
 じしf_, )ノ Inconspicuous Group Cat?

Last edited by Mew2468; 03-18-2009 at 10:48 AM.
03-18-2009, 12:06 PM
#6
Joined: Mar 2009
Location: Hanover, NH
Posts: 17
I'm going to second the notion that programming in Cocoa/Obj-C is not the easiest place to start. If you really want to make games you should start with flash, you will be able to make progress right away, there are tons and tons of examples out there that will also teach you the basics of how games are put together, and that is knowledge that you can translate directly into iPhone programming when you are ready to make that leap. Google a guy named Emanuele Feronato to read his blog and learn some basics of making games in flash.
03-18-2009, 12:18 PM
#7
Joined: Nov 2008
Location: San Francisco
Posts: 430
Quote:
Originally Posted by Mew2468 View Post
Then you have to program enemy collision, what happens when certain characters pick up item, program the AI, respawn locations, where the character dies, HP, the landscape...a lot harder than most people think.


+1.
But before that you need to be able to load in the 3D character and textures. So you have to pick a 3D format that works with your 3D package, and an animation system that also works with it.

I've made a lot of games. You've played them.
03-18-2009, 06:34 PM
#8
Joined: Mar 2009
Posts: 12
hello all,

thank you all for you input.

i understand that programming a game is not a simple task, and i didnt mean to imply that it was. what i was trying to figure out is whether it was just animation controlled by the user, so all the things like background movement and collisions and that are all predefined animations that are displayed depending on what happens in the game. i realise that this is an extremely basic question, but i am not trying to say that doing this is extremely easy.

the reason i am asking the question (aside from the fact that i want to create a game) is that i have a graphic designer who is doing the art for me and he insisted that the characters are drawn in the code. I can see how this would work in a 3D game but for a 2D scrolling game i dont think that would be necessary.

oh, and i am not new to programming, just new to gaming. i am familar with objective C and Hodapp, i am familiar with google search :-)
03-18-2009, 07:08 PM
#9
Joined: Jan 2009
Location: Toronto, Ontario, Canada
Posts: 5,206
Quote:
Originally Posted by gabacus View Post
the reason i am asking the question (aside from the fact that i want to create a game) is that i have a graphic designer who is doing the art for me and he insisted that the characters are drawn in the code. I can see how this would work in a 3D game but for a 2D scrolling game i dont think that would be necessary.
Your artist should stick to artisting. Graphics are only drawn in the code if you're creating special algorithmically-generated visual effects -- explosions, glow effects, blurring, depth of field, etc. Characters, ships -- anything in the foreground is almost always going to be straight up bitmaps. Even many effects, such as glow, light maps, and such, can be done with transparency overlays and light maps. You could create the sprites in real time if you really wanted to, but why would you waste all of that CPU time on such a thing when the same thing is achieved in a single blit with a bitmap image?

The majority of the time the character animations and most background animations are done with bitmap images, one image for each frame of animation. That's the simplest and most basic method. Multiple parts of a single character that can have independent animations can be done with individual bitmap images for each segment of the character that is to be animated independently. (Pocket God uses this method, for example.) Background animations are usually the same because it's the most memory-efficient method; you wouldn't do whole-screen animations because you'd be using up gobs of memory. Instead you create a background from a set of tiles, animating the ones that call for animation. You can sometimes get away with large single-bitmap backgrounds but it eats memory like a pig. There's a game I'm beta testing now that uses this method because the developer wants nice detailed levels, but he's probably going to have to convert it all over to tile-based to save memory, 'cos he's hitting pretty close to the magic 20 as it is.

[Relax with Galactic Chill] [Let me tell you a story.]
Currently working on: Music for Spirit Hunter Mineko
03-18-2009, 09:16 PM
#10
Joined: Mar 2009
Posts: 12
haha... artist should stick to artisting... thats pretty much what i told him! (although not as elegantly...) he kept saying "i dont want to learn how to code" and all that and i kept telling him that all he has to do is create the characters and animate them. he insisted that he was told that all the animation is done in the code and it made me question myself for a while there...

so, in terms of lingo... the animations are called sprites?