Sign in to follow this  

This thing got me desperate. How do you learn these stuff?

This topic is 4691 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm getting really really desperate of this game programming thing. I started with SDL two days ago , most (or all) beginner SDL tutorials sucked till i found Cone3D site providing a simple tutorial. So i learned lessons 1 and 2 with no problems. But when i reached lesson 3, the code got rediculously bigger and hard to memorize. I shouldn't even memorize stuff in programming , but even if i try to understand it , there is too much info for a single lesson. So i made a simplified version of lesson 3 that uses only 1 source file with much much less code and works the same way. At lesson 4 the author started to stuff info again that i couldn't take it anymore so i stopped reading. Am i supposed to spend days on one lesson or what? You know , i didn't have a problem learning standard C\C++ because books and tutorials usually tech each concept individually with its own examples so i can play with it a little before moving to the other one. Aren't there game tutorials like that? SDL seem low on recources. Whats the second best API for beginners? and whats a good tutorial for it? I really feel like i reached a dead-end. any help is MUCH appreciated

Share this post


Link to post
Share on other sites
I found the same thing about SDL when I started using it, There aren't very many tutorials for how to get started in it and the documentation is a little limited at times, but before I started I had read alot of tutorials on how to work with graphics, and learn how to go about displaying things on the screen. So once I was able to have SDL show me part of an image on the the screen, I knew enough to get started and began working on what I wanted to do..

This worked for me because I don't really like tutorials, they only teach you how to do things the way the author thinks they should be done, and they don't really help you learn how to solve the problems on your own.

I'm guessing by now you have something on the screen, well why don't you try writing some code to make a small map, or place an image on the screen and move it around with the arrow keys.. just think about what you want to know and then see if you can figure out what you need to do..

Share this post


Link to post
Share on other sites
Quote:
I'm guessing by now you have something on the screen, well why don't you try writing some code to make a small map, or place an image on the screen and move it around with the arrow keys.. just think about what you want to know and then see if you can figure out what you need to do..

I actually made my own way of animating sprites. I didn't need all those useless variables , classes and structures in the Cone3d tutorial 3. I made a little program where i can control a megaman sprite and it won't animate untill i hit right or left. And im afraid i'm not capable of doing more.

I still lack knowledge on these essential elements :
1. Collision detection
2. Including other moving objects.
3. simple AI
4. printing text and counters on the screen (for "lives" or "points" for example)
5. Game menus


and maybe more. Cone3d tutorials aren't hard. They just stuff too much info in one tutorial. Thats why i thought i need another tutorials.

I agree with you though that tutorials are sometimes useless. But i my case i need them , because i still don't know how to implement those essential things i've mentioned. :(

Share this post


Link to post
Share on other sites
A possible recommendation I could make is to get the book Game Programming: All in one. It takes you through most of the steps you mention with very simple examples. It uses Allegro though, and not SDL. Still, Allegro is a nifty library, so you will not be wasting your time by learning it.

Share this post


Link to post
Share on other sites
Quote:
Original post by Coder21
Am i supposed to spend days on one lesson or what?
Yes. Your problem appears to be that you think you can pick up this stuff in just a few hours - probably because you've seen books with titles proclaiming Learn X in Y Hours/Days! That's just marketing. It takes time for you to really "get" the material being presented. A lot of tutorials go at a fast pace, but you'll have to go over them several times on your own to grasp the concepts if you're not already familiar with them.

Quote:
You know , i didn't have a problem learning standard C\C++ because books and tutorials usually tech each concept individually with its own examples so i can play with it a little before moving to the other one. Aren't there game tutorials like that?
Don't overestimate your comprehension of standard C/C++. Given that you found it necessary to reduce Lesson 3 to a single file to successfully build it, I suspect you're not as adept as you think you are. This may be a huge part of your problem.

Game programming is hard. It takes time to understand the languages, the concepts, the constructs, the idioms. It takes effort to become comfortable enough with them to reproduce them in the absence of hand-holding resources. It takes constant practice not to forget, though it comes back more easily the more experienced you are. I'm in Central New York right now (I live in Long Island) and I'll be setting up a basic game architecture from scratch over the weekend with no books and without Internet connectivity for my laptop; it's taken me 10 years to get to the point where doing that is not a problem at all.

Take it easy, and take your time. You'll be fine. Don't jump ship at the first hint of frustration. Work through it, accept that your first few attempts will mostly serve to show you how not to do things, but the end result will be an intuitive comprehension.

Good luck, and happy hacking.

Share this post


Link to post
Share on other sites
Coder21, everything that you have mentioned in your post has nothing to do with what API you are using, it makes no difference that you are using SDL to do any of these things.

Okay maybe point #4 but that can be done so many different ways its not funny, you an grab a library that is already made and let it handle any TTF you want to use, or you can do it like I did and make your own font class..

All I did was make a large image with all the characters in it, then the image has a txt file that goes with it to say how wide each letter is, all the information is loaded into the system and then I made a little function that accepts a string and outputs it using the image.

Anyways if your able to have a sprite react to your keyboard input then your ready to start playing around yourself. The next step I would say would be to make a little mapping system that will show you a 10X10 grid and then you place your character on the grid. Then you can start having your character walk on the grid, maybe make certain tiles blockable so you have to keep track of where you character is and if he is trying to step on a blocking tile. (just check to see if the box around the character is overlapping the box of the tile)

Trust me, if you know the parts to make the game then just take it slow you'll figure it out.

*EDIT* - One thing you need to know is that you need to learn the theory behind why you are doing things when your programming, the language you are using is not important.

Share this post


Link to post
Share on other sites
The thing is games can be a bit complicated in their architecture and all this stuff can be a bit overwhelming.

You might like to try C#, the .NET has the MSDN, and the DirectX SDK has awesome tutorials and examples. The priniciples in design you'll get through learning with C# (rather then worrying about COM pointers releasing, memory pointers and stuff) will be easily transferable back to C++. That and you can worry about higher level stuff and things are quickly to screen... with C++ the slightest mistake could lead to nothing happening at all or a crash.

Otherwise just have a go at delving in to the C++ Direct X SDK tutorials. They've got ones that show you how to start off with a triangle, working up to displaying a model.

As for getting the entire game together... reacting to keypresses... forming a game structure... well... that's almost always an exercise left for the reader. Thus whatever language you start off in, always start off with achievable goals. That way you build up your own library and understanding of code.

I find books much easier to learn from then web stuff when I'm doing things completly new to me, as often typing out examples reinforces what you are learning.

I'm sure some peeps here will recommend decent books, that and gamedev has some ones on the site rated.

Share this post


Link to post
Share on other sites
Quote:
Don't overestimate your comprehension of standard C/C++. Given that you found it necessary to reduce Lesson 3 to a single file to successfully build it, I suspect you're not as adept as you think you are. This may be a huge part of your problem.

Actually i think im stupid because i can't grasp game programming concepts as fast as standard C\C++. I thought that i'm either stupid or this thing really takes time to get into. So i'm actually kinda underestimating myself.

Quote:
Coder21, everything that you have mentioned in your post has nothing to do with what API you are using, it makes no difference that you are using SDL to do any of these things.

Thats not what i ment. I ment that i have no idea of how to implement those stuff whatever the API im using is.


Quote:
All I did was make a large image with all the characters in it, then the image has a txt file that goes with it to say how wide each letter is, all the information is loaded into the system and then I made a little function that accepts a string and outputs it using the image.

Since you mentioned it , i have a little question about it.

Lets say i made an image like yours (with characters) and a function that accepts a string. How do i print the string? shall i blit the first character , increase X axis , blit second letter untill the whole string is shown?


paulecoyote , thanks for the advice but i have no intentions to learn C# whatsoever.



Guys, i want to make something clear ...

Game Development won't be my career. I have no intentions to make 3D games or to participate in projects to make serious games. I just want to be able to make cool 2D side scrolling games such as classic mario or megaman , or at least a space shooter. I want to make games for the fun of it , thats all.

So shall i stick to SDL in that case or check Allegro? (i heard its good and easy)

Share this post


Link to post
Share on other sites
Quote:
Original post by Coder21
Guys, i want to make something clear ...

Game Development won't be my career. I have no intentions to make 3D games or to participate in projects to make serious games. I just want to be able to make cool 2D side scrolling games such as classic mario or megaman , or at least a space shooter. I want to make games for the fun of it , thats all.


The book I recommended will help you do exactly that. I definetly suggest giving it a try.

Share this post


Link to post
Share on other sites
Quote:
Original post by Coder21
Guys, i want to make something clear ...

Game Development won't be my career. I have no intentions to make 3D games or to participate in projects to make serious games. I just want to be able to make cool 2D side scrolling games such as classic mario or megaman , or at least a space shooter. I want to make games for the fun of it , thats all.

So shall i stick to SDL in that case or check Allegro? (i heard its good and easy)
That's really up to you. Different people find different libraries and APIs to be more intuitable. When you get to a certain stage, they all become different perspectives on the same thing to you.

Good luck.

Share this post


Link to post
Share on other sites
>>> Lets say i made an image like yours (with characters) and a function that accepts a string. How do i print the string? shall i blit the first character , increase X axis , blit second letter untill the whole string is shown?

Thats exactly how I've done it.. just move through the string and output it character by character.. this way means more work (cause you have to setup all the fonts you want to use yourself) then just using real fonts but in the case of my game where one of the fonts I'm using is designed to look right in the game then I think it works well

Share this post


Link to post
Share on other sites
Thanks for replying everyone :)

turt99 , that method seems cumbersome to the computer , but i'll try it :)

btw, I just read about SDL_ttf , does any SDL API user use it here? if so , is it hard to understand or not?

Share this post


Link to post
Share on other sites
Quote:
Guys, i want to make something clear ...

Game Development won't be my career. I have no intentions to make 3D games or to participate in projects to make serious games. I just want to be able to make cool 2D side scrolling games such as classic mario or megaman , or at least a space shooter. I want to make games for the fun of it , thats all.


Bingo. You just overestimated yourself right there. Mario and Megaman are much more complex beasts than you might realize (if you've never made one before). I've been working on a "simple 2D sidescroller" for the last 11 months now and all i can do is jump around and shoot. It's nothing even close to a game yet, but at least it functions.

I'll just reiterate what Oluseyi said: Game programming is capital H - A - R - D. Don't give up though. You'll get frustrated many times, fail many times, want to kill your computer many times, but in the end, you might get a functioning "cool 2D sidescroller" if you work like a dog for the next 2-3 years. This is not an exageration, but best of luck on your project(s).


As for SDL_ttf, i have used it and it works fairly easy and straight-forward. Read the documentation and header files and in a day or two you should be able to get something up and running understandably.

Share this post


Link to post
Share on other sites
Quote:
Original post by Coder21

Game Development won't be my career. I have no intentions to make 3D games or to participate in projects to make serious games. I just want to be able to make cool 2D side scrolling games such as classic mario or megaman , or at least a space shooter. I want to make games for the fun of it , thats all.

So shall i stick to SDL in that case or check Allegro? (i heard its good and easy)


getting into the game programming may be difficult, and yes, it takes too mucho time, even for doing a "simple" game like mario or megaman.....

you have to read, and read and read.....spend hours (or even days) to get something "easy" to work.

i learned sdl in a week or so.
this 2 links were the ones i used.
http://www.gamedev.net/reference/programming/features/sdl2/
http://www.libsdl.org/intro/toc.html

with those 2, i made a pong game.....
i recommend you to start making your own pong clone.....i think its the easist and the best way to see how a game should be structured.

though, i decided moving to allegro (http://alleg.sourceforge.net/) , because i think its a much more complete API (you can see both documentations and you will see)...

www.vermilliongames.com
download the game demo, i know the person who did that game (it is going to be commercial), it was done with allegro (and openGL of course). That can show the power of that api.

Share this post


Link to post
Share on other sites
Quote:
Original post by paulecoyote
You might like to try C#, the .NET has the MSDN, and the DirectX SDK has awesome tutorials and examples. . . .


Switching languages doesn't make game development any easier to do.

Share this post


Link to post
Share on other sites
Quote:
though, i decided moving to allegro

(http://alleg.sourceforge.net/) , because i think its a much more

complete API (you can see both documentations and you will see)...


hmm... ok you make me think twice about spending time on SDL. If

Allegro is more complete as you say , then shall i stop wasting my

time on SDL and learn Allegro instead?

Are APIs similar in anyway btw? I mean will learning an API make learning a more complicated API easier?

Share this post


Link to post
Share on other sites
Quote:
Original post by ishpeck
Quote:
Original post by paulecoyote
You might like to try C#, the .NET has the MSDN, and the DirectX SDK has awesome tutorials and examples. . . .


Switching languages doesn't make game development any easier to do.


Unless you are going from assembly to C# [grin] Anyways Coder21, you said that SDL seems low on resources and you are right. But then again, a lot of things are low on resources. All of the tutorial across the net are basically the same one's just tweaked and modded a bit. Now that is am over generizalation because there are quite a few good original ones, but not widely used in the public domain.

One thing though Coder21, is that you would not be wasting your time with SDL. You are still leanring the basics of game programming, of which you can use with either Allegro or SDL to achieve this means. It cannot be quantified which one is 'more complete', it just depends on what you need to do and how you want to do it and how long you are wanting to dedicate to it.

Turt99 brings up an important and correct point in his first post. If you simpy follow tutorials, then you are less inclined to learn how to solve the problems on your own. There is a tutorial syndrom of which sometimes beginngers want to find a tutorial that tells them how to do this and that - basically be spoon-fed the answers. This is not that good for you - even though using tutorials as a tool is a good idea. Basically I am just saying that tutorials are great, but they should not be the crux of your operations - more just as one tool you can use to aid you.

Heck be adventerous! Download both Allegro and SDL and start working with them at the same time. First get the basic application working for both of them. Then move on from there. You should be able to find one *you* like the best. This is the best advice I can give you - people's opinions help out, but you are the only one that knows what you like, so you must gauge which you think is better. You can start trying to do X in SDL and X in Allegro and see if one is more complete then the other, who knows, they might be both seem equal to you.

- Drew

Share this post


Link to post
Share on other sites
Quote:
Original post by Coder21
...then shall i stop wasting my time on SDL and learn Allegro instead?
Switching libraries doesn't make game programming any easier to do. Some people change languages and/or libraries every time they hit a road block. That'd be like changing bicycles every time you fell as a child. Those people haven't made anything useful, much less approaching games, yet.

Share this post


Link to post
Share on other sites
Quote:
Original post by Coder21
Quote:
Don't overestimate your comprehension of standard C/C++. Given that you found it necessary to reduce Lesson 3 to a single file to successfully build it, I suspect you're not as adept as you think you are. This may be a huge part of your problem.

Actually i think im stupid because i can't grasp game programming concepts as fast as standard C\C++. I thought that i'm either stupid or this thing really takes time to get into. So i'm actually kinda underestimating myself.

No, I agree that you're overestimating yourself. ;) (No offense, obviously)
But when you find an API hard to use, it is generally because you're not comfortable enough with the programming language yet. You might think you understand all the concepts of C/C++ (it might even be true), but until it becomes so much second nature to you that you can solve any problem (including collision detection, AI, or using an API to print text, graphics or menus), you're not good enough at the base language. ;)
I'm not saying this to be mean, but almost everyone goes through a phase when they've finished their tutorials on C/C++, thought it wasn't that hard, and then progress to find out they still don't have a clue how to actually solve the problems they need to solve. That's because they need a lot more practice with the language they're programming in.

There's no magic in collision detection, for example. Once you know your language well enough, it's just a matter of looking at the data for two objects, and calculating whether they intersect. Basic math, but can be hard to grasp when you're not comfortable enough with the language.

Share this post


Link to post
Share on other sites

This topic is 4691 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this