Newbie here, I wish to start.
#1 Members - Reputation: 123
Posted 01 April 2012 - 12:05 PM
I was able to write myself a GPU temp monitor using AMD's ADL library. It's multithreaded so each thread is checking the corresponding sensor for overheats.
I am in the process of writing an HTML parser of sorts(not a library, but one that uses it) using cURL then piping to htmlTidy to fix up the document then piping the fixed document to libxml2 for the actual HTML parsing and finally through PCRE for regular expressions.
Well, I pretty much pointed out that I wish to write a game in pure C. I already have SDL. Now the problem I am facing is that, I don't know anything about game programming. Neither terminology(shading,voxel,polygons and the list goes on), neither about geometry involved, nor the concepts and maths of "Depth,Gravity,Collision". And for instance how walking on some texture, you don't fall off of it.
So if possible, can you point me to some resources on how all these stuff work. And perhaps how to start.
#2 Members - Reputation: 1001
Posted 01 April 2012 - 01:35 PM
#3 Crossbones+ - Reputation: 926
Posted 01 April 2012 - 01:36 PM
That being said Lazy Foo might be something of interest to you. With C++ I would prefer to work with SFML ( http://www.sfml-dev.org/ )
I highly recommend using a different language.. Such as Love or PyGame. There is also Unity, C# with XNA, and a whole other host of technologies you could chose from.
#4 Members - Reputation: 123
Posted 01 April 2012 - 02:53 PM
As far as other languages, I already know I'd never do python or C#.
#5 Members - Reputation: 286
Posted 01 April 2012 - 02:54 PM
#6 Members - Reputation: 1298
Posted 01 April 2012 - 11:22 PM
Because I find C++ too cluttered with all the OOP stuff,iterators, dynamic/static casts(with weird declarations, too),templates,maps, the list goes on. Whereas C is much easier, and typecasting is done via (type)variable and voila.
So in other words "I'd rather use a tooth pick for construction work than learning how to use those overrated 'power tools' everybody is talking about".
How is C "easier" if you end up wasting 80% of your time reinventing countless wheels instead of actually making progress with the game?
Based on your choice of language and current level of knowledge the only advice that comes to mind is: if you aim higher than a very simple Pong clone as a first project, you are over reaching. And even that means getting familiar with at least one way to get graphics on the screen (meaning a library) and reading keyboard input beyond scanf. Though it would technically be possible to create a "turn based" Pong on the console with nothing but the standard library.
#7 Members - Reputation: 3283
Posted 02 April 2012 - 06:39 AM
Because I find C++ too cluttered with all the OOP stuff,iterators, dynamic/static casts(with weird declarations, too),templates,maps, the list goes on. Whereas C is much easier, and typecasting is done via (type)variable and voila.
As far as other languages, I already know I'd never do python or C#.
Those different casts exist in C++ for a reason, the C casting system is all kinds of broken.
You can still use c style casts, can ignore templates etc... but you shouldn't.
#8 Crossbones+ - Reputation: 3512
Posted 02 April 2012 - 06:55 AM
Text-based Pong ftw!Though it would technically be possible to create a "turn based" Pong on the console with nothing but the standard library.
>>> you move your bat: >>> 4 >>> units >>> you miss the ball! >>> **** YOU LOSE ****
@OP: I understand your line of reasoning. Unfortunately it simply does not work if you want to develop games beyond a tetris. You do NOT have the time to reinvent and reimplement stuff which has been done before. If you want to get anything done you will need to use stuff other people have already coded, and this includes using OOP features. It will thus probably involve using a different language than C. Of course nobody is pointing a gun to your head and telling you to "use Java!" "use C#" "use Unity!", but if you want to get anything interesting done you will almost certainly need to move beyond C and get used to new programming paradigms.
Unless you have a specific project in mind, for instance a Dwarf-Fortress type game which requires nothing but trusty old console and algorithms (that can be coded in C, but you would probably still want OOP for that).
TL;DR: try and be more open-minded. Nobody's forcing you to anything but it doesn't hurt to look beyond what one already knows and actually try it out long enough to get comfortable with it - who knows, you may actually like it!
For instance I had some misconceptions about Python, but I actually came to like it quite a lot. Of course I don't really use it because I don't need to, but it does come in handy as a tool for quick script whip-ups, especially with all the stuff it takes for granted which most languages don't (arbitrary precision arithmetic is a good example).
#9 Members - Reputation: 1298
Posted 02 April 2012 - 08:03 AM
Text-based Pong ftw!Though it would technically be possible to create a "turn based" Pong on the console with nothing but the standard library.
>>> you move your bat: >>> 4 >>> units >>> you miss the ball! >>> **** YOU LOSE ****
Well, I was thinking more along the lines of an o for the ball and a couple |s for the bats. The reason I said "turn based" is because I don't know any non-standard way in C or C++ to get keyboard input without blocking.
TL;DR: try and be more open-minded. Nobody's forcing you to anything but it doesn't hurt to look beyond what one already knows and actually try it out long enough to get comfortable with it - who knows, you may actually like it!
To emphasize this point: I had co-workers with up to 40 years of experience in C that unfortunately spent at least 30 of them stubbornly refusing to learn anything new. Their code tended to be messy, not because you can't write clean code in C (you can), but because all the extra work resulted in taking shortcuts and just be sloppy to finish in time. So you had code with plenty of bugs that were also a pain to find in all that mess.
Of course I might simply be biased because I spent many years being the guy that had to find and fix bugs in other peoples code whenever the bug reports came in.
Nobody expects anyone to instantly transition to C++ and write what is so nicely called "modern C++". But flat out refusing even the option to make use of some extremely useful and time saving features out of a feeling of being "overwhelmed" by all the new possibilites? Really?
#10 Members - Reputation: 400
Posted 02 April 2012 - 10:11 AM
Well, I pretty much pointed out that I wish to write a game in pure C. I already have SDL. Now the problem I am facing is that, I don't know anything about game programming. Neither terminology(shading,voxel,polygons and the list goes on), neither about geometry involved, nor the concepts and maths of "Depth,Gravity,Collision". And for instance how walking on some texture, you don't fall off of it.
You may want to skip out on the shading, voxels, and all that 3D game stuff for the time being and focus on getting your geometry chops up to speed. That being said, you should study the basics of physics, comprising mostly of Rigid Body Dynamics, as well as review your concepts in geometry. I also suggest you look into vectors, which are a portion of linear algebra. You can learn these concepts by going to Khan's Academy (link in my signature). Rigid Body Dynamics comprise mostly of Newtonian physics. That is going to give you all the necessary tools to figure out how the game is supposed to interact.
Of course, there may be a better way to do this, but that's how I would do it
My personal links :)
- Khan Academy - For all your math needs
- Java API Documentation - For all your Java info needs :D
- C++ Standard Library Reference - For some of your C++ needs ^.^






