Jump to content


Help I am new and need help!


47 replies to this topic

#1 onyxthedog

    Senior Member

  • Members
  • PipPipPipPip
  • 467 posts

Posted 20 December 2007 - 01:40 AM

I am a 7th grader, (not all hope is lost I promise) I do know basic C/C++ from "C by Disection" and "C++ How to Program", the latter by Dietel/Dietel. I am learning Pre-algebra and my dad has a BS in computer science from the University of North Carolina in Wellington and works to up-keep about 20 servers. I also am possibly going to learn Python and IBM assembly language as well. (Most of the books are my dad's old college textbooks.) I have no graphics experience other than paint and I used graphicsgale and Photoshop at my best friends house. (He is also interested in mainly graphics, but I need to teach him programming first.) I have written a text-based Craps game that has been modified from the original several times and I mean major mods.(Changed the whole game loop kind of mods.) Now that you know what I need to learn lets move on to more of what the real question is about.

I know of several graphics libraries: SDL, Directx, OpenGL, and Allegro. Although I have no experience in any of them. I have no audio output experience at all. Is there any online tutorials, books, open source file that I need to disect anything that can lead me to the right direction? Thanks,
onyxthedog

#2 monjardin

    Senior Member

  • Members
  • PipPipPipPip
  • 1033 posts

Posted 20 December 2007 - 02:00 AM

It sounds like you're off to a great start!

I recently forced myself to learn Python and used pygame to create some small games in the process. It was a very pleasant experience and I highly recommend it. Also, since it's a fairly thin wrapper around SDL, you should be able to translate your experience into C/C++ easily.

Here are some links it get you started:

http://www.linuxjour...om/article/7694
http://www.pygame.org/wiki/tutorials
http://www.penzilla..../python/pygame/
monjardin's JwN Meter (1,2,3,4,5,6):
|----|----|----|----|----|----|----|----|----|----|
*

#3 onyxthedog

    Senior Member

  • Members
  • PipPipPipPip
  • 467 posts

Posted 20 December 2007 - 02:16 AM

monjardin said:

It sounds like you're off to a great start!

I recently forced myself to learn Python and used pygame to create some small games in the process. It was a very pleasant experience and I highly recommend it. Also, since it's a fairly thin wrapper around SDL, you should be able to translate your experience into C/C++ easily.

Here are some links it get you started:

http://www.linuxjour...om/article/7694
http://www.pygame.org/wiki/tutorials
http://www.penzilla..../python/pygame/

I am not completely done with either book I am home-schooled this year (first year) and I have been doing C++ for as long as this school year has been going on (I am on arrays at the moment) and C (earlier experience and I am just on the basics right now in the book) just recently restarted because I tried last year around this time but quit because my knowledge in computers and math was just lacking too much to be able to do it easily. So Python is the way too go? Do I even need assembly anymore or have graphics libraries pick-up enough now? Thank you monjardin.

P.S. I am running Windows 2000 Professional on an IBM of some sort, I will ask my dad the exact model but we are probably going to upgrade soon due to the age of the computer and my family needs are growing as more of us start use it!

#4 SamuraiCrow

    Senior Member

  • Members
  • PipPipPipPip
  • 459 posts

Posted 20 December 2007 - 03:25 AM

If you're looking for a C++ tutorial in SDL and OpenGL, you should look at LazyFoo's Tutorials. Usually to make graphics go faster in SDL, most of the graphics plotting is done in OpenGL (as the later tutorials indicate).

You shouldn't need to use Assembly language unless you are writing a compiler although it does help to understand why compilers do what they do to optimize your code.

#5 monjardin

    Senior Member

  • Members
  • PipPipPipPip
  • 1033 posts

Posted 20 December 2007 - 03:45 PM

onyxthedog said:

...recently restarted because I tried last year around this time but quit because my knowledge in computers and math was just lacking too much to be able to do it easily.

Doing interesting graphics with the limited math background you have at this point will be a challenge. It's not that you won't be able to figure things out, it's just that having a solid base in geometry/trigonometry, linear algebra and kinematics/dynamics make things go more smoothly.

Take a look at this tutorial and see what you think: http://programmedles...sons/index.html

onyxthedog said:

So Python is the way too go?

Not necessarily, but it would probably be a more efficient learning process since you won't have to fight with build systems and library dependencies as much. Also, it's more conducive to trial and error since you can edit and run instead of having to compile & link in between.

onyxthedog said:

Do I even need assembly anymore or have graphics libraries pick-up enough now?

You are safe ignoring assembly for now. It's not like DOS where you access hardware directly. Using SDL frame buffers or OpenGL/DirectX with your mainstream desktop operating systems does not require assembly knowledge.
monjardin's JwN Meter (1,2,3,4,5,6):
|----|----|----|----|----|----|----|----|----|----|
*

#6 onyxthedog

    Senior Member

  • Members
  • PipPipPipPip
  • 467 posts

Posted 20 December 2007 - 03:59 PM

monjardin said:

Doing interesting graphics with the limited math background you have at this point will be a challenge. It's not that you won't be able to figure things out, it's just that having a solid base in geometry/trigonometry, linear algebra and kinematics/dynamics make things go more smoothly.

Take a look at this tutorial and see what you think: http://programmedles...sons/index.html



Not necessarily, but it would probably be a more efficient learning process since you won't have to fight with build systems and library dependencies as much. Also, it's more conducive to trial and error since you can edit and run instead of having to compile & link in between.



You are safe ignoring assembly for now. It's not like DOS where you access hardware directly. Using SDL frame buffers or OpenGL/DirectX with your mainstream desktop operating systems does not require assembly knowledge.
Thank you both SamuriaCrow and Monjardin! I do have book on game design, but is from 1994: "Tricks of the Game Programming Gurus". I knew the algorithems would not be uptodate but I would be able to make a simple game all the way up to Doom 1.2/Wolfenstien style. The source for everything was supposed to come on CD-Rom but when the book got here the CD-Rom wasn't in it. My mom said we will just buy one a little more expensive one that is more current. (It cost $4 including shipping)

#7 Reedbeta

    DevMaster Staff

  • Administrators
  • 4979 posts
  • LocationBellevue, WA

Posted 20 December 2007 - 07:42 PM

You got it off ebay or something like that, I presume? Gotta watch out for those, the books will often come without the CD. That particular book unfortunately has a lot of stuff about obsolete hardware, like mode 13h, sound blasters, and so on. There is still some stuff in there worth reading about math and overall game construction, though.

It just occurred to me that you might be able to use DOSBox if you want to play with some of that code directly, as it will give you an emulated mid-90s era machine. It might be tough to find a compiler that can still put out 16-bit code though. Besides, you really don't want to have to deal with the quirks of DOS memory management - 32-bit virtual address space is much nicer. :yes: So, all things considered it's probably a better idea to start learning SDL and figure out how to adapt the algorithms described in your books to the newer technology.
reedbeta.com - developer blog, OpenGL demos, and other projects

#8 onyxthedog

    Senior Member

  • Members
  • PipPipPipPip
  • 467 posts

Posted 21 December 2007 - 01:04 AM

Reedbeta said:

You got it off ebay or something like that, I presume? Gotta watch out for those, the books will often come without the CD. That particular book unfortunately has a lot of stuff about obsolete hardware, like mode 13h, sound blasters, and so on. There is still some stuff in there worth reading about math and overall game construction, though.

It just occurred to me that you might be able to use DOSBox if you want to play with some of that code directly, as it will give you an emulated mid-90s era machine. It might be tough to find a compiler that can still put out 16-bit code though. Besides, you really don't want to have to deal with the quirks of DOS memory management - 32-bit virtual address space is much nicer. :yes: So, all things considered it's probably a better idea to start learning SDL and figure out how to adapt the algorithms described in your books to the newer technology.
Most of the books on programming that I have are my dad's old college text-books but he says the language doesn't change just way they compile it. I know a few algorithms have changed, but the CD had a most of the libraries I needed and since I don't know assembly I cant recreate it. I guess I can still salvage basic theory though. I have heard a lot of bad things from LaMothe, are they true?

Any recommendations for books I should buy? Any tutorials for math (geometry, trigometry, or anything that might be helpful), or game programming.

P.S. This maybe a bit ahead of my self but can someone post a simple text-based game so that I can see everything in action.(must be in C++ and they don't care if I modify for my personal experimentation.) Also, I was wondering how can you create an object that has multiple instances and stores it own graphical output as a "mask" so to speak? In other words How do you make it that it reacts with its graphical representation properly?

#9 SamuraiCrow

    Senior Member

  • Members
  • PipPipPipPip
  • 459 posts

Posted 21 December 2007 - 02:40 AM

First of all, what compiler are you using. C++ has changed a little since it first came out in the late '90s.

If you are using MinGW (a version of GCC for Windows that usually comes with the Code::Blocks IDE or the DevC++ IDE) or are using Visual Studio or Visual C++ 200x Express Edition you should be fine. Visual C++ 6.0 or older will be a little out of date and you should consider upgrading.

If you have broadband internet then it should be free of charge to download any of the ones I mentioned (except Visual Studio which is commercial).

You should be able to find the source code to lots of games at SourceForge. Just be sure to look in the CVS/SVN repositories of any program rated 5-mature (meaning the program is complete and working). Also, keep in mind that most of the programs at SourceForge are not games.

If you want to know how they work in gentle steps, you probably will need to look at the LazyFoo tutorials that I pointed out to you earilier. He has written some SDL games that will be good examples to look at as well.

I know a lot of people recommend looking into doing text games first before you learn graphics but it's often hard to make text work as an action game without special libraries anyway. You might as well follow the LazyFoo tutorials first and then you can step back and look at making text stuff later.

I seem to be starting to repeat myself so I'm going to stop here. Be sure to post back here with any questions you may have.

#10 onyxthedog

    Senior Member

  • Members
  • PipPipPipPip
  • 467 posts

Posted 21 December 2007 - 03:04 AM

SamuraiCrow said:

First of all, what compiler are you using. C++ has changed a little since it first came out in the late '90s.

If you are using MinGW (a version of GCC for Windows that usually comes with the Code::Blocks IDE or the DevC++ IDE) or are using Visual Studio or Visual C++ 200x Express Edition you should be fine. Visual C++ 6.0 or older will be a little out of date and you should consider upgrading.

If you have broadband internet then it should be free of charge to download any of the ones I mentioned (except Visual Studio which is commercial).

You should be able to find the source code to lots of games at SourceForge. Just be sure to look in the CVS/SVN repositories of any program rated 5-mature (meaning the program is complete and working). Also, keep in mind that most of the programs at SourceForge are not games.

If you want to know how they work in gentle steps, you probably will need to look at the LazyFoo tutorials that I pointed out to you earilier. He has written some SDL games that will be good examples to look at as well.

I know a lot of people recommend looking into doing text games first before you learn graphics but it's often hard to make text work as an action game without special libraries anyway. You might as well follow the LazyFoo tutorials first and then you can step back and look at making text stuff later.

I seem to be starting to repeat myself so I'm going to stop here. Be sure to post back here with any questions you may have.
MY C++ book was written in '94 but I use VC 2005 Express Edition. I was just going to look into the game loop with the text because I don't have to worry about messing with graphics then.

#11 TheNut

    Senior Member

  • Moderators
  • 1473 posts
  • LocationThornhill, ON

Posted 21 December 2007 - 04:32 AM

I personally think the "OpenGL Programming Guide", ie "Red Book" is an excellent starting point (it's how I started 8½ years ago). It has nothing to do with game development per say, but the way it introduces you to common 2D/3D development and manipulation of geometry should open your mind on how things are done. There's some nice demos and assignments in there that will get you through each chapter.

I would focus first on graphics and basic algebra first before anything else. You don't need much math either. You can do some cool effects with it, yes, but it's not necessary to know it. For example, you don't have to care about rotation matrices when APIs provide a simple rotate() call. So long as you understand what it means to rotate about an axis (for example), you should be fine.

After that, I would jump into SDL and start playing with it's API. It supports input, audio, and 3D graphics via OpenGL (or 2D via Direct Draw). By then you'll be able to create objects and get them to interact with your scene.
http://www.nutty.ca - Being a nut has its advantages.

#12 onyxthedog

    Senior Member

  • Members
  • PipPipPipPip
  • 467 posts

Posted 21 December 2007 - 04:37 PM

TheNut said:

I personally think the "OpenGL Programming Guide", ie "Red Book" is an excellent starting point (it's how I started 8½ years ago). It has nothing to do with game development per say, but the way it introduces you to common 2D/3D development and manipulation of geometry should open your mind on how things are done. There's some nice demos and assignments in there that will get you through each chapter.

I would focus first on graphics and basic algebra first before anything else. You don't need much math either. You can do some cool effects with it, yes, but it's not necessary to know it. For example, you don't have to care about rotation matrices when APIs provide a simple rotate() call. So long as you understand what it means to rotate about an axis (for example), you should be fine.

After that, I would jump into SDL and start playing with it's API. It supports input, audio, and 3D graphics via OpenGL (or 2D via Direct Draw). By then you'll be able to create objects and get them to interact with your scene.
Are there any WELL written open-source games that you know of? And I am doing the lazy foo tutorials I am just having a little trouble understanding a few things but I am sure I after I read the documentation a little I will figure them out. Can I create a first game with simple paint pictures, via. tic-tac-toe, connect four, or a simple memory game?

#13 utdiscant

    New Member

  • Members
  • PipPip
  • 11 posts

Posted 22 December 2007 - 03:34 AM

If you are looking for open sourcecode from good games, take a look at the source from the Quake engine.

#14 onyxthedog

    Senior Member

  • Members
  • PipPipPipPip
  • 467 posts

Posted 23 December 2007 - 03:27 AM

Is the way to make an object:
struct object {
WHAT EVER IT HAS IN IT
} and typedef?

P.S. Does anyone know what is still used in the Guru book?

#15 Skaldi

    New Member

  • Members
  • PipPip
  • 16 posts

Posted 23 December 2007 - 03:31 PM

onyxthedog

this would be a valid object what youre doing with

struct object {

WHAT EVER IT HAS IN IT

} and typedef


But I would suggest you to make it this way:


class Object

{

public:

     Object();

     virtual ~Object();


     virtual void draw();

     virtual void move();

     virtual void act();


     virtual bool isFinished();


private:

     you're data of your Object here (its position, color, size,...)

     ...

};


Keep the properties of the class virtual, because every other object will be inherited of this, your base object. And may require other behaviour inside those functions.

A big advantage of this system is, that you can push your Objects all together into a list (for example for garbage collection.)
Or you can have your drawing List where all necessary Objects are stored sorted by its Z-value (depth) and can be drawn then (may be of intreset when you have transparent objects).
Or if you have a physic engine all relevant Objects are stored in a List where they can interact with each other....

And I would suggest you to start with a really little game. You can remember asteroids or something? I made it too this way and I didn't regret it.

And don't worry my first game I ever developed took me 4 months (Not working only on my game this time I have a job to do too).

Happy Coding then and a nice day.


EDIT:
But i guess this was kind of too much input, you only asked for Object.

Yes this is the way to make a object!
Some code would look like that (I take my Object for demonstration)


int main(void)

{

    Object *myObject;


    myObject = new Object();


    while(!myObject->isFinished())

    {

          myObject->act();

    }


    delete myObject;


    return 0;

}


Visit my Homepage Skaldi Games

#16 onyxthedog

    Senior Member

  • Members
  • PipPipPipPip
  • 467 posts

Posted 24 December 2007 - 02:55 AM

Skaldi said:

onyxthedog

this would be a valid object what youre doing with

struct object {

WHAT EVER IT HAS IN IT

} and typedef


But I would suggest you to make it this way:


class Object

{

public:

     Object();

     virtual ~Object();


     virtual void draw();

     virtual void move();

     virtual void act();


     virtual bool isFinished();


private:

     you're data of your Object here (its position, color, size,...)

     ...

};


Keep the properties of the class virtual, because every other object will be inherited of this, your base object. And may require other behaviour inside those functions.

A big advantage of this system is, that you can push your Objects all together into a list (for example for garbage collection.)
Or you can have your drawing List where all necessary Objects are stored sorted by its Z-value (depth) and can be drawn then (may be of intreset when you have transparent objects).
Or if you have a physic engine all relevant Objects are stored in a List where they can interact with each other....

And I would suggest you to start with a really little game. You can remember asteroids or something? I made it too this way and I didn't regret it.

And don't worry my first game I ever developed took me 4 months (Not working only on my game this time I have a job to do too).

Happy Coding then and a nice day.


EDIT:
But i guess this was kind of too much input, you only asked for Object.

Yes this is the way to make a object!
Some code would look like that (I take my Object for demonstration)


int main(void)

{

    Object *myObject;


    myObject = new Object();


    while(!myObject->isFinished())

    {

          myObject->act();

    }


    delete myObject;


    return 0;

}

Thanks, I haven't gotten deep into object-oriented (spelling?) programming yet but I kind of understand what you are saying. I am home schooled, so sometimes I will have more time to work on it sometimes I will have less. Any good starting books on game design, well game development anyway. I was wondering is there any good tuts other than Lazy Foo's out there?

#17 Skaldi

    New Member

  • Members
  • PipPip
  • 16 posts

Posted 25 December 2007 - 02:01 PM

I would start the development with learning by doing.

First thing to do is, to create an OpenGL Window with black background with nothing on it.
Theres a good tutorial on nehe for this!

The next step for example learn how to display a texture on this black screen (on nehe too).

After having finished this, learn how to interact with keyboard (let your texture move and rotate when pressing the arrow keys.)

You'll se when this is finished you're very motivated to see how your players moves around on your black world.

Next step add a background to your black screen (for your first game a simple texture is enough).

Then add some effects to your player moving around (if it is a spaceship a simple particle system to it's jet propulsion).

Next add some obstacles and maybe enemies and some boons.

And then the game is almost finished anyway and you've done a big step learning.


Edit:
I started my first game this way too! And this is the result!
I would give you the sourcecode, but it is more confusing than helpfull I guess (If you ask for it I will post you a link for it anyway though). (It was my first game and I didn't know it better too.).
But with every project you make you'll get better and better and soon (in 2-3 years) you will be the guy who answers questions here :).

Screenshots
Download
Visit my Homepage Skaldi Games

#18 onyxthedog

    Senior Member

  • Members
  • PipPipPipPip
  • 467 posts

Posted 26 December 2007 - 07:52 AM

nehe seems to be down!

#19 Skaldi

    New Member

  • Members
  • PipPip
  • 16 posts

Posted 26 December 2007 - 12:54 PM

Works fine by me. Probably you had a bad timing
Visit my Homepage Skaldi Games

#20 onyxthedog

    Senior Member

  • Members
  • PipPipPipPip
  • 467 posts

Posted 28 December 2007 - 03:55 AM

Skaldi said:

Works fine by me. Probably you had a bad timing
I think that your are right. It works fine now, or maybe it is like it said on i,Robot- "Computers have always had ghosts, random lines of code that create unitended prodocall."
What is the best order for developing your first few games?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users