• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
DragonBooster

I know a good amount of C++ but what do i need to know about game programming?

16 posts in this topic

After getting competent enough with C++ i had this problem for a while.

 

Even though I could read code properly when the code was from a command line program, when it came to a pong SFML program i was confused even though i used the documentation to see if i could understand the code i was very confused because i don't know how game programming works.

 

I searched the forums and saw that there were similar problems but not exactly like my problem.

 

I realize that there are way too many more things to learn about game programming other than just C++ such as the main game loop and frame movement etc.

 

So my question would be, how would i design game programs?

Edited by Zero_Breaker
1

Share this post


Link to post
Share on other sites

What game programming tutorials have you run through?  The SFML tutorials aren't a bad starting point, but those mainly focus on the SFML API.  There are plenty of good tutorials on this site, and Google will pop up plenty more.

 

If you have a solid grasp on C++, then the next big step is to understand graphics programming which falls into two categories.  Concepts that are largely API agnostic (ie what is a texture, pixel, sprite, coordinate systems, etc), and then of course the specific graphics API that you will be using.  C++ itself has no graphics capabilities whatsoever.  SFML, SDL, DirectX, etc.

 

Once you have the basics of drawing something to the screen, you can then look at the game loop, moving sprites around on the screen, dealing with collision detection, and so on and so forth.

0

Share this post


Link to post
Share on other sites

I see. It makes sense because i was so stressed because at the moment because i don't get why after learning a good amount of C++ and getting used to it i still don't understand programming enough and i can't see why i cannot understand or write code that simply moves a circle left and right.

0

Share this post


Link to post
Share on other sites

Programming is easy - engineering software is a completely different ball-game.

 

I would recommend Game Engine Architecture by Jason Gregory for understanding what components are involved in making games - based on that, even if you do not understand all of it, you should have the insight to look deeper into particular subjects (game states, AI, game objects, etc.) 

 

Otherwise, +1 for SFML which is a good framework to work from; you may also find that Gameplay3D is good starting point, as it focuses on games specifically (which is not the case of SFML, which is, as its name states, a multimedia library.

1

Share this post


Link to post
Share on other sites

I will check out the Game Engine Architecture but what i mean is i don't know how to use SFML to create a game because i do not know how you would use SFML or a game engine that requires scripting to create a game since i don't know how to design the way the game works.

 

I don't how i am supposed to structure my classes,functions,variables,pointers to make a game and i certainly don't know much game programming related techniques when you use a framework such as SFML.

 

For example i didn't know that to make a circle move left or right on a screen requires you to go into vectors and timed movement and etc. I think game programming is something completely different then your regular command line programs which greatly help your understanding of how things work.

0

Share this post


Link to post
Share on other sites

If you are really unsure about how to go about writing interactive software, I would suggest a middle-ground between something visual/shiny & your familiar command line : a Hangman.

 

It sounds really "basic", but you would be surprised the amount you will learn from it :

 

  • Displaying the state of the game on-screen : ASCII text & symbols will do
  • Handling user input : cin & standard line prompt will probably do the trick & I will assume you are familiar with printing & reading basic key inputs
  • Score logic to monitor how well the player is doing
  • Game states (once the player guesses the word, make him progress to a more complicated word)
  • File loading : you can learn how to load external content into the game to expand the list of words.

It is quite a common "mini-project" for novice programmers to take on, so chances are you will find a ton of resources on the web as well as a myriad of ways to approach and solve the problem.

Edited by Althar
0

Share this post


Link to post
Share on other sites

I like to think of games as simulations with fancy looks and with made up rules. Some of them are real-time, some aren't, some have a really complex UI, some doesn't.

 

The best way I found to understand the inner workings of a game software (that is not that different if you really have C++ experience) is by creating one.

Get the simplest of all, not real time, no fancy graphics, no fancy rules. Just go for a memory game like this one, for example.

1

Share this post


Link to post
Share on other sites

@Althar Thanks i will try that out. But the problem is that there so many game programming concepts that i just feel very overwhelmed by and don't know what to do. I bought the SFML game development ebook but it didn't explain things very well to me and some of the code introduced in the book was missing which gave me a lot of errors and bugs whenever i compiled the program example.

 

EDIT: @dejaime Thanks i will try that but i wasn't trying to make anything fancy with looks. I was just trying to make a circle move left and right on screen which is quite difficult to do with SFML for me.

Edited by Zero_Breaker
0

Share this post


Link to post
Share on other sites

All I can say is : have patience & persevere.

 

Start small & things will start to click. There is no shame in doing "simple things", as long as you do them well and understand the full extent of what it is you are doing. You will most certainly learn a lot more than say spending 2 years trying to desperately piece together a 3D MMORPG game by copying and pasting code from various tutorials / web until your brain starts to melt before your "Franken-code".

 

Expect to be overwhelmed with things you do not understand time and time again - this happens to us all, all the time; even the grey wolves who have been in the industry for donkeys, can feel "lost" when faced with a new system, API or even platform...

0

Share this post


Link to post
Share on other sites

If I were you I wouldn't even consider using an existing game engine or framework. Start small and work your way up. 2D is the way to go at first, maybe a tile based game where you move one tile at a time (with no animation). Learn how to get stuff to the screen, once you can do that it's just a matter of what to put where and when. Your programming will get better as you go along as well, you're sure to learn new concepts and put them to work in a real-world application.

Edited by Endemoniada
0

Share this post


Link to post
Share on other sites

@Althar I guess that's the truth really. I am not trying anything complex either the thing is i am trying to do very simple things so i get used to things and i have no shame in doing simple things because how can you make a complex program if you can't even make simple programs? I also don't copy and paste because it a very bad practice unless you know the code and you re-write it so i don't copy and paste most of my code.

 

I just felt very overwhelmed and lost when i came across SFML and the game development book was not explaining some game programming concepts well enough for me.

 

The first project in that book was to make a sprite just move left and right on the screen with no collision detection which i thought should've been understandable but was quite complicated and cryptic for me.

 

I also don't learn much from most tutorials, some of them are helpful but most are meh to me, i prefer fully fledged books which have a good amount of explanation although there are some books which are full of fluff and take time to get to the point and there are some which are not well explained enough and cryptic but most of the books i get are straightforward (C++ Primer 5th edition) and help me learn better.

 

@Endemoniada I tried to use Unity 3D to make a simple 2D platformer but i couldn't because back then i didn't understand programming enough and yeah i want to make 2D game first after several simple C++ and SMFL projects.

 

And just for the record i am not trying to make a full blown 2D action game yet, i am trying to to do simple projects like making a shape pop up on the screen and make it move left and right. Just wanted to point that out but yeah i guess you guys are correct and that is that i should just get stuff on the screen and do simple things and i would eventually get the concepts after a while. Thanks for the advice guys :)

0

Share this post


Link to post
Share on other sites

@tonegub Thanks a lot for the advice smile.png ! I have to agree that some books have very badly commented and unexplained code and i would agree that most of the time tutorials explain code better than books but for me books kind of expand and give you a good theoretical explanation on some features of a language and what they do in depth.

 

But yeah for the writing code i fully agree, i am very persistent but sometimes i just feel burnt out or lose my patience because there are so many things that i have to go through again and sometimes i run into some very cryptic books which don't explain the code and i feel like ripping my hair out but calm down after 5 minutes.

 

And as i said before i copy and paste something if i know what it does and then re-write it to change anything etc or i use code that's been already made since it saves you time and the person wants people to use it.

 

But overall your post is very helpful smile.png !

Edited by Zero_Breaker
0

Share this post


Link to post
Share on other sites

Lazy Foo man. http://lazyfoo.net/tutorials/SDL/index.php

 

    It goes through many of the things you will need to know about the basic game loop. Input handling, image loading and rendering, sound, basic collision detection, and some things that are more difficult to understand like frame-independent movement. It also goes over things that are included in common games like a game camera and background tiling. It gives you a full(ish) understanding of basic 2D games. It's also a native C library (which means native C++ too). So yeah, that's good.

 

    Books probably won't help you too much until you understand the basic game loop.They tend to be somewhat unfocused in some places because when your an expert, you can forget what was difficult for a beginner. Also, I wouldn't worry about coming up with amazing solutions to problems(or any solution without research), or copying others code(as tonemgub said) as long as you try(really try) to understand it. Eventually you will get to a point where you do understand, and then you will really want to change copied code or rewrite poorly understood code (because you can do it better).I struggled with the frustration at not being able to come up with a solution on my own for a while before I realized I would just get there eventually with some perseverance and a touch of diligence.

 

I hope Lazy Foo helps you and if you have some specific questions I would love to answer them, send me an email or a PM on here, and I will get back to you! Much luck to you on your journey.

Edited by AlexWalters22
1

Share this post


Link to post
Share on other sites

If you want to learn about game programming, why not choose an game engine like Unity, they have a huge community and when you searching for example how to do something, almost everytime somebody have already posted a solution in their forums or stackoverflow. And if they don't you can get friendly help from the community.

 

If you choose Unity, I do recommend skipping their javascript in favour of C#. Their javascript is a weird custom scripting language that is not really javascript and might cause confusion for beginners.

0

Share this post


Link to post
Share on other sites

First of all, you should know that it is normal for being overwhelmed when you get started in a new area of programming.  Even if you know a particular language, it can be quite difficult to sit down and read the designs for a particular industry.  So don't stress out about it - just take it one piece at a time and make progress.

 

I think the other advice that was already given about learning how the main loop works is a good place to start.  Once you know that, then you can move on to the update method and all of the things that are done there - rendering, then audio, etc...  But make a concerted effort to only concentrate on one topic at a time, and you will be able to digest the information more easily.

1

Share this post


Link to post
Share on other sites

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  
Followers 0