Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML Game Development book  (Read 3494 times)

0 Members and 1 Guest are viewing this topic.

UserNameIsGood

  • Newbie
  • *
  • Posts: 3
    • View Profile
SFML Game Development book
« on: June 27, 2014, 11:06:34 pm »
*if you don't want to read and you want to get to the question , it's " what math is used in sfml or any 2d game engine/framework ?

I have a book which is SFML Game Development book which is really a nice book " thanks to the creators "

I have kind of a problem , which is , the first thing and the most important thing I do before getting into the good stuff in any book , I read the introduction which usually tells the reader what skills he's required to learn before attempting to go on, this book only concerned about c++ and never about math , why ? I've never used this library before but one of the reasons that I choose a 2d game framework/engine or whatever is that I want to know what exactly are the basics that I need to know before going to 3d game programming.

So there're two reasons why the author didn't mention math that is required " beside vectors " :

1- this framework makes everything easy for you that you don't need to know math to use it , which in my case is a big deal since I want to learn the basics before going to 3d.
2- the math that is required to learn or use for this framework is not much , which in this case I would like you guys to direct me to the names of things that I need to learn , and please don't say " calculus or names of fields that has lots of concepts and theories that I won't use at all "

I'm sorry if this is the wrong section , I just wanted to clear things up before getting started.
« Last Edit: June 27, 2014, 11:17:28 pm by UserNameIsGood »

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: SFML Game Development book
« Reply #1 on: June 27, 2014, 11:23:24 pm »
I'm no expert on 3D graphics or on that book, but if you're after the absolutely necessary math for basic 3D graphics programming, the most complete no-nonsense introduction that I've personally run across is this: http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/

Though in general, there is no strict subset of math that is used in 3D games.  You'll see random bits and pieces of math from all over the place getting used wherever people find a use for it.  The good news is that, based on my personal experience with advanced math, calculus and linear algebra are the two big "need-to-know" theories.  As long as you study those at some point, I believe you'll be able to make sense out of pretty much any other piece of math that would ever be useful, even if there are many pieces of those theories you never directly put in your code.

UserNameIsGood

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: SFML Game Development book
« Reply #2 on: June 27, 2014, 11:53:33 pm »
I'm no expert on 3D graphics or on that book, but if you're after the absolutely necessary math for basic 3D graphics programming, the most complete no-nonsense introduction that I've personally run across is this: http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/

Though in general, there is no strict subset of math that is used in 3D games.  You'll see random bits and pieces of math from all over the place getting used wherever people find a use for it.  The good news is that, based on my personal experience with advanced math, calculus and linear algebra are the two big "need-to-know" theories.  As long as you study those at some point, I believe you'll be able to make sense out of pretty much any other piece of math that would ever be useful, even if there are many pieces of those theories you never directly put in your code.

Thanks for your reply , I've already took two calculus courses and to be honest it's was just like studying discrete mathematics it depends on your prof if he's good on giving examples in real life and since it wasn't like that me and most people that I know tend to just try to solve the problem instead of knowing the idea behind it , but I'm sure it won't be as bad when I learn 3D graphics , and about the linear algebra I'll take a course next semester + I'm watching khan's academy right now and learning a lot from there + I'll check your link and I think some of the stuff I already know so it'll be a good real life examples since it's for game dev.

I'm not really looking for the required math for 3D graphics right now since one of the reasons I wanted to learn 2D programming first is to pick up the idea and learn basics first , jumping to learn 3D first is like jumping to learn Calculus before taking School's math courses first, so I don't want to get involved in 3D before learning 2D's basics at least.

So is there some math used in this Framework , or to be specific , 2D games dev ? if so then what is it ? I really hope this framework does not make math easy so you won't need to learn it , since if it does then learning 2D first is completely pointless.

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: SFML Game Development book
« Reply #3 on: June 28, 2014, 12:08:07 am »
I don't know much about the book's framework, but for 2D gaming you typically don't need anything beyond vector algebra and/or trigonometry.  I doubt the framework will try to hide any of that from you.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: SFML Game Development book
« Reply #4 on: June 28, 2014, 12:15:17 am »
The goal of a framework is to make your life as a programmer easy. The SFML Game Development book is primary about how to use SFML, especially for games. SFML itself is written to keep things as simple as possible and as such many "math" related things are happening automatically or are accessible via a nice interface. Like for example you won't have to calculate the view matrix for your "camera", or you don't have to manually manage your transformation matrices to rotate a sprite, etc. SFML will do things for you, or provide a nice function for it (e.g. sprite.rotate(35);).
So what's left to you is math concerning the movement of your objects, which is just basic vector math. And this is about it what you'd need for the SFML Game Development book - and I wrote "need", because it won't be taught to you in detail, you have to acquire that knowledge differently.

IMHO if you want to learn the "math", you should start directly with OpenGL, but this will be directly in 3D, since there's no OpenGL 2D.

Generally speaking, you get away with a lot of games, you just know how to work with matrices, which includes vector math, etc. Calculus and other things are only needed if you start to do complex things, for instance some water or fog simulation. But till you get there, you'll have to learn a lot about non-math related topics. Math in games is not really that big of deal, first you need to know how to actually render something; how to manage your resources, entities, etc.; how to work with different states; how to load and save game info; how to do networking; etc. etc.

Just start with a simple Tetris clone or a like and you'll notice that math is not important at all in that type of game, but that there are a lot of other things to learn. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

UserNameIsGood

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: SFML Game Development book
« Reply #5 on: June 28, 2014, 11:04:00 am »
Thanks a lot guys , you helped a lot.

@eXpl0it3r , thanks that was really helpful.

I think I'll start with SFML and then program game or two and move to opengl next.

Thanks again for your help guys ^^

 

anything