![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on Understanding Basic Programming Ideas within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Hi folks, if I missed this topic in my searches please don't flame me. I have some scripting experience(for Maya), ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
|
Hi folks, if I missed this topic in my searches please don't flame me. I have some scripting experience(for Maya), and I can say "hello world" in C++. So yeah, i'm at the beginning.
What I'd really like to do is understand the most basic plain-language concepts involved in programming a game. That way i can have a goal and a checklist of what i should be trying to learn. Just an outline of things to research. Is that what metacode is? I'm asking you to help me create concept outlines like this for different kinds of games. Maybe it will help other aspiring devs to structure their learning also. Any help is appreciated! Topics I'd love to understand: LEARNING THE BASICS: (cred to Homer) -syntax -loops -if statements -variables -flow control -memory management -proper/clean/tidy code style -simple graphic processing ("how to open an image document and then display it.") -the basics of getting sound working -did I miss anything? Breakout: Opening screen -background graphic -music -main menu Main menu -start game -view high scores -exit Draw the player's paddle. Draw the blocks to break and place them. Draw the ball. Move the ball. Define the walls somehow Get the physics of moving the ball right. Take user input for moving the paddle(?) Understand Collision When the ball collides with the paddle, -it bounces away -it makes a sound When the ball collides with a block -the block disappears (with a little animation) -it makes a sound When the ball collides with a wall, -it bounces away -it makes a sound Tetris: -Graphics Needed - User Input -Scoring system Shooters like KETM: -Graphics Needed - User Input -Scoring system Fighters like BOR: -Graphics Needed - User Input -Scoring system An RPG: -Graphics Needed - User Input -Character stats -Scoring system A "Tactics" style game (my long-long term goal) -Graphics Needed - User Input -Character stats -Scoring system Much respect to those of you who understand programming. I'm getting lost in little symbols and need to see the big picture. I'll update this post with what develops and give credit, don't worry. Cheers, =pK= Last edited by pixelKeg; 03-11-2006 at 09:12 PM.. Reason: adding content, stressing the basics |
|
|
|
|
|
|
#2 |
![]() ![]() AKA Homer
|
Well.. First of all, you need to learn the basics. Like loops, if-statements, variables etc. etc.
Then, to create a game you need to learn simple graphic processing. Like, how to open an image document and then display it. If you're creating a game with sound you'd need to learn that too, but only the basics as learning the whole thing is nearly impossible. Hope that helps. |
|
|
|
|
|
#4 |
![]() |
It should be noted that unless you have a good amount of experience coding (like a year or so at least), coding a game should not be your first project. Yes, coding dumb little routines that just play with some numbers and output text to the screen isn't exactly glamerous. However, game design ups the ante a lot. You can't afford to be unfamiliar and clumsy with the language, you need to wield and control it exceptionally well. You must be to the point where, in your mind, there is no pause between "I know what I want to do" and "I know how to do it".
Also, to facilitate your learning, don't immediately ask for help when there's a problem you can't solve. Bang your head against it for awhile, don't immediately go posting your code and asking for fixes, or asking for algorithms to do whatever. If you go a while and you just can't figure it out for the life of you, then's the time to ask. When you do, just as important as finding out the answer is finding out why. If you don't know why, you'll never learn, and it will be a much shorter time before you require assistance again. Note that I'm not talking about little syntax or linker errors here and the like (you should be able to resolve those fine anyway with a little googling), I'm talking about algorithms like collision detection, sprite movement, pausing, menu creation, etc. Finally, if you have an idea about how to do something (like collision detection), even if you're in a discussion about the topic, TRY IT, don't ask about it. Trying will show you just how well it works. If it does work, great! If not, see if you can find out why it's not doing what you want to do to. Last edited by Andorien; 03-11-2006 at 02:21 PM.. |
|
|
|
|
|
#5 |
![]() ![]() AKA Homer
|
^ What he said.
Though, Homer's RIN was like my second project. But I had quite alot experience in programming before I started with PSP deving. So I learnt pretty fast. |
|
|
|
|
|
#6 |
![]() |
Also, if you're coding in C++, you need to gain a least a basic understanding of classes. They (along with Polymorphism) form the backbone of C++'s object oriented nature.
Added: and document your code! Even if you do it after the fact, and even if you're gonna be the only one looking at it, it's a good habit, and will help you remember what does what if you take a break for awhile. If you ever program in a professional environment, you will NEED to comment and document your code. More programmers work in teams (there's a reason the PSPToolChain is stored on a Subversion repository), so this is a good habit to pick up. For example, here's the documentation of my Menu_Item<TARGET> class. Some of the formatting is messed up, due to the way the forum editor handles tabs, but you get the idea. Code:
// Class : Menu_Item // Author : Elias Fox // Contact : andorien@comcast.net // Creation Date : March 10th, 2006 // Last Modified : March 11th, 2006 // // Purpose // ---------------------- // Creates a menu item, containing a picture, size, position, and target. // // Useage // ---------------------- // This class is designed to be used within a Vertical_Menu or Horizontal_Menu class. However, it is possible to use it outside of // that context. Before you attempt to use it, you MUST either run the alternate constructor, Menu_Item::Initialize, or run // Menu_Item::Place, LoadTarget, AND LoadImage. // // Templated Data Types // TARGET : The class type that this menu item will be linking to. The class MUST have a method named Execute(void), or else it will not function. // // Methods // ---------------------- // Menu_Item(void) // Default constructor. Sets all variables to 0 and all pointers to NULL // // Menu_Item(int nInputX, int nInputY, int nInputXSize, int nInputYSize, string strInputIcon, TARGET tInputTarget) // Alternate constructor. Initializes all values and loads images. // Parameters // nInputX = Object's position on the X axis // nInputY = Object's position on the Y axis // nInputXSize = Object's image's width // nInputYSize = Object's image's height // strInputIcon = Filename of the object's image // tInputTarget = Class object the object will link to // // void GotoTarget(void) // Method that, when called, will call the Execute(void) method of the linked class. It must contain an Execute(void) method to work // // void Place(int nInputX, int nInputY) // Sets the X and Y position of the object. // Parameters // nInputX = Object's position on the X axis // nInputY = Object's position on the Y axis // nInputXSize = Object's image's width // nInputYSize = Object's image's height // strInputIcon = Filename of the object's image // tInputTarget = Class object the object will link to // // void Display(void) // Displays the object on the screen (or more specificly, its picture). Note that this will not swap the buffers, you must still do it // yourself // // void LoadTarget(TARGET tInput) // Loads the object the Menu_Item class object will link to // Parameters // tInputTarget = Class object the object will link to // // void Initialize(int nInputX, int nInputY, int nInputXSize, int nInputYSize, string strInputIcon, TARGET tInputTarget) // Initializes all values and loads images. // Parameters // nInputX = Object's position on the X axis // nInputY = Object's position on the Y axis // nInputXSize = Object's image's width // nInputYSize = Object's image's height // strInputIcon = Filename of the object's image // tInputTarget = Class object the object will link to // Return Values // true = Image loading sucessful // false = Image loading failed // // bool LoadImage(string strInputIcon, int nInputXSize, int nInputYSize) // Loads the image for the object's icon // Parameters // strInputIcon = Filename of the object's image // nInputXSize = Object's image's width // nInputYSize = Object's image's height // Return Values // true = Image loading sucessful // false = Image loading failed // // int GetX(void) // Returns the object's current position on the X axis // // int GetY(void) // Returns the object's current position on the Y axis // // int GetXSize(void) // Returns the object's image's current width // // int GetYSize(void) // Returns the object's image's current height Last edited by Andorien; 03-11-2006 at 02:40 PM.. |
|
|
|
|
|
#7 |
|
Good points guys. I think my difficulty is in understanding how these basic skills can be applied in the context of a game.
Just a little background, i do 3D graphics for a living (pixelkeg.com) and I use scripting in my 3D software to do repetitive tasks. Ideas like variables, arrays, for loops make sense so far. I love procedures. Also did some modding for Unreal Tournament2004, which involves a bit of scripting, so the word "classes" has a bit of meaning for me. I need to research polymorphism. This won't happen overnight, it took me years to get a job doing 3D art, it might take that long to just get a working pong going. But i like understanding how things work. ![]() EDIT: Forgot to say that I need to be able to braek a complex problem into little chunks, little realistic goals. Please see the "Breakout" example in the original post to see what I'm respectfully requesting.
Last edited by pixelKeg; 03-11-2006 at 02:51 PM.. |
|
|
|
|
|
|
#8 |
![]() ![]() Developer
|
I wouldn't worry about learning about object-oriented concepts just yet (despite what the other poster said). Get yourself some cheap C books (the language isn't changing at a quick rate -- you could easily learn C from a 10-15 year old book on the subject).
Start small. Dream big. Work hard. |
|
|
|
|
|
#9 | |
![]() |
Quote:
string strblahblahblah = "adlkfdj"; printf(strblahblahblah.c_ str); and know somewhat what's going on. As for starting in C, yeah that's the sage advice pretty much everywhere you look. I didn't have a choice in the matter - my Computer Science curriculum started us out for the very first class in C++. Do not pass C/Visual Basic, do not collect $200. |
|
|
|
|
|
|
#10 | |
![]() ![]() Developer
|
Quote:
char hello_world_str[13] = "Hello world!"; printf("%s\n", hello_world_str); Many colleges start their students with object-oriented languages now. I think my univ. started CS majors w/ a Java course, although I had previous experience. Everyone eventually comes to terms with what they are learning, but for a long time there were a lot of people who didn't really understand what was going on, who would get stuck but not see solutions because they didn't understand the basics, etc. Not trying to correct you -- a number of experts feel differently on the subject. |
|
|
|
|
|
|
#11 | |
![]() |
Quote:
|
|
|
|
|
![]() |
| Tags |
| basic , ideas , programming , understanding |
| Thread Tools | |
|
|