Game programming in C, where do I get started? [closed] - c

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I started programming about 6 months back and have a decent knowledge in how to code in C. I have mainly used it to implement elementary algorithms or solve Project Euler questions (reached 50 now :) )
What I really want to learn since a long time is game programming. Ie make simple 2D games like snake, or pocket tanks. By simple, I no way mean the amount of work or effort it's going to take to make these games
I've tried searching the net but have had no luck with that. Could anyone point me in the right direction?
What exactly will I need to learn? Where do I start?

Game Programming requires a lot of Computer Science stuff on top of creativity. By Computer Science stuff I mean Algorithms, Data Structures, Computer Architecture, Computer Graphics, Operating System Internals, Artificial Intelligence & at least basic familiarity with Mathematics & Physics + experience on playing Games + Passion for Games. As you seem to be a good Algorithmic coder (Coding problems on Project Euler) so it should not be very difficult for you.
Now coming to your question one simple way to start is: Microsoft XNA (which lets you just go into game programming without having too much knowledge on above areas, ofcourse having it will be an advantage for you in longer run). Check it out: http://en.wikipedia.org/wiki/Microsoft_XNA
You can also check out this book: http://www.amazon.com/Beginning-Game-Programming-Michael-Morrison/dp/0672326590/ref=pd_sim_b_4
I have read the above (It's in C/C++/Win32) and it is really a good resource on implementing basic games which will give you a very good start to jump to XNA as a next step.

You could go with graphics.h. I am saying this because, when I were in your stage, I began with Worm and nibbles game, a very easy game, which can be constructed with drawPoly function. I used drawPoly as my implementation, but you could use you won.
In addition to that, graphics.h will provide many user-defined functions, to draw lines,rectangles,polygens. It also provide functions to color them in many different ways.
So, When you want to start gaming in C, I would suggest graphics.h as a good starting point.

Related

Looking for a good GUI library for C [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
As the title says, I am looking for a good library for the C Programming Language.
The GUI library should be really popular. I'd also appreciate if there are popular forums on the Internet where I can ask professionals for help. And I definitively need a good book about the library. If it's possible it should be cross-platform but I can live without that... I guess ;)
The only library I know for C so far is GTK. It sounded really well to me but neither did I find any good book (I've actually seen only one book about GTK and I don't know if it's good or bad cause nobody posted a review) nor did I see anyone using it except 2 guys on You-tube with their impressing amount of 2 videos! >.< .
The really important thing for me is that it should be popular... I don't want to sit here, learn how to use this library and in a year or two nobody uses it any more.
I hope you guys can help me finding a library :)
GTK+ is hugely popular and is used extensively. It's the best choice if you want cross-platform GUI development in C alone. There are plenty of books around, though they're a bit outdated (but most of it still applies). You can find up to date tutorials and full API documentation at the GNOME project website.
GTK is the most popular GUI library in C you can find.
Have you tried amazon? There're plenty of books. It's hard to believe that all of them are bad.

Chess engine in C [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I'm a 17 year old high school student who just started to learn C programming 1 week ago. I've also had some very basic experience in web design(+ a little web programming with javascript and php. I once made a website with contact form).
Anyway, I'm very interested in AI and as a school project, I thought that i'll build a chess engine and a robotic arm that physically moves the pieces.
Now, my deadline for which i have to finish the engine is 7 months away, (and the arm has to be completed in a year).
Do you think it's feasible for a total beginner to program a chess engine in 7 months(and eventually build a robotic arm using that engine?)
Thank you very much!
lol, great ambition, but it will take a hurculean effort on your part to get it done. Building the engine itself in your spare time will take quite a bit, as the AI for a chess game is pretty complicated, you have to tell the program to think ahead at least 7 moves with an end goal in mind, not to mention you will have to program the piece that interacts with the robot arm. You could theoretically cheat/not reinvent the wheel by utilizing some open source chess game and save yourself a few months of programming just in that piece.
I think, that it is better to choose some real task to start with for practice. Of course, you can divide the task in steps. But in chess the first step - GUI - is real for you. But the second - the most primitive AI - is extremely hard. It is the specific of the game.
If you take reversi/othello as the subject game, then creating a very primitive AI could be possible. I don't believe that you can manage recursive thinking, but one-step thinking, with evaluation of the positions and of course, the GUI for the game is possible. But you will have to work really hard. If you are interested, I could give you a pair of advices for this game realzation - I did it myself twice on different machines. But robotic hand is out of question.
Of course, if you are a genius, you can manage everything. ( I am not joking. You can never tell...)
And C is not the best language for AI. It is not even one of better ones.

Can you please provide some topic ideas related to AI to be used in a project? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I need topic ideas related to AI on which I will base my thesis. I am mostly interested in Genetic Algorithm and Neural Networks techniques. I already got the some ideas, but non of them seems to hit me!
Any help will be really appreciated!! :)
Russ Greiner has a great list of project topics for his machine learning course, so that's a great place to start.
Both GAs and ANNs are learners/classifiers. So I ask you the question, what is an interesting "thing" to learn? Maybe it's:
Detecting cancer
Predicting the outcome between two sports teams
Filtering spam
Detecting faces
Reading text (OCR)
Playing a game
The sky is the limit, really!
I think your thesis should involve a project of a high-carnage shooting game in the style of Smash TV or Crimsonland that uses the player as the fitness function for a GA engine: generating behavioral control code for the enemies and evaluating fitness by how long the controlled entity survives and/or how much damage it does to the player.
That'd be fun.
What's a problem that you are passionate about? If you pick something that you love and are interested in you will undoubtedly do a better job and learn more. I love finance but it is not for everyone. GA's are best at optimization problems so maybe portfolio optimization using GAs and ANNs.
Maybe predict which blog posts someone will like. I have always wanted to do that but I have not gotten around to it?

Interview questions to assess Linux C programmers [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I'm not quite a C programmer and I'm going to interview a guy with 3 years experience in C in linux. In his CV, he says he is quite experienced with C programming.
So my question is if you are going to interview this "C linux" guy, what question or questions would you ask to make sure that this guy is competent? By the way,
I expect you give me the answer as well :-).
Thanks in advance.
If the candidate really knows his stuff (C Linux programming) he'll catch you pretty quickly, but anyway, here are a few pointers to topics you should investigate to prepare questions:
POSIX concepts
Standard C library (libc), ANSI C
Debugging and profiling tools: gdb,
valgrind, strace, etc
Linux/UNIX system calls: sbrk,mmap,fork,etc
Threading
(Insert your favorite pointer question here)
The GNU toolchain: gcc,ld,as,automake,autoconf, etc.
Classic Linux utility C/C++
libraries: glib,qt, etc.
Don't simulate knowledge you don't have. This will get noticed and this is the image of your company that you are playing with. Candidates may want to find better oportunities.
Be honest with your level of C and ask him open questions about what he finds wonderful in C and Linux, and what he thinks are drawbacks. Let him tell you what were his previous experiences.
Appreciate not his knowledge but his passion.
To be honest I think your best bet is to get someone who is a C programmer in the interview with you to ask questions, you can only really judge competences you have yourself.
If that isn't possible I'd say you should be askind questions that test their knowledge of pointers. an obvious example is to write string manipualtion functions such as strcpy
Favorite:
Ask him where the strenghts of C are...and why he would recommend to use it...maybe you can give him a project example. He has to clarify why C is the right Language for that Job from his point of view.
From my point of view it is very important to know if a Language is really fitting to a project. Not because its your favorite Language...
It is an easy question...
If all you are trying to do is assess his knowledge of a specific language, and you don't know that language, you're gonna fail at evaluating him.
Can you instead evaluate "can this guy program and is he a good communicator" and be up-front with him about your knowledge? Give him a basic question to start with, fizzbuzz or whatever, and ask him to code it in C and give you a C tutorial as he does it. Then do something more complex but C-ey (see other answers for ideas) but still in the context of, "teach me what you know and how this works".
If you frame the question as, "I know (for instance) python and Java, but not C, please teach me" you could end up with a very informative interview. But don't give the poor guy a quiz, you won't be able to give him hints, and he could ace it or flub it with very little correlation with his actual skills.

Beginner's guide to 3D graphics programming [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
What are the best guides / tutorials / books / websites for someone with minimal experience (or none) in the world of 3D graphics programming?
I realize that the fundamentals of 3D graphics and mathematics apply across platform specific 3D library implementations such as OpenGL, DirectX, WPF etc..
Therefore it would be useful if answers would explain if they focus on a specific library implementation, on the fundamentals, or maybe both.
Rationale for for asking this question:
With Windows Presentation Foundation (WPF) 3D on the scene, it's realistic for many programmers to now seriously consider using 3D for their applications, where this would have been almost impossible even a few years ago.
I'm sure there are many programmers out there, like me, who find the leap from 2D to 3D a very big one.
I recommend that you implement a simple software based 3d rendering engine. Simple stuff like line, quads, lighting etc. You will learn a whole lot more about 3d programming in general, and it will give you a good prescriptive on 3d graphics and it's limitations.
This should get you started:
http://www.devmaster.net/articles/software-rendering/part1.php
Petzold's 3D Programming for Windows is an obvious start if you are doing WPF.
For Opengl the book is available free online , there are also tutorials at NeHe although OpenGL does require that you understand the details of transforms to really do more than cut and paste
I thought I'd start by providing this resource I found during my own research:
The Twelve days of WPF 3D by Eric Sink.
It is a series of articles focusing on WPF, from the beginner to intermediate level.
It focuses on getting practical things done with WPF 3D, rather then fundamental 3D math etc, but is great for answering some common questions most WPF 3D programmers eventually come across.
One site I have been recommended previously is GameDev. It is full of articles and tutorials for 3D game development.
What do you want to learn to do? build a graphics / game engine? or USE a graphics or game engine? ..
I chose the easy route. I am using an available engine - www.3dgamestudio.com - so I can focus on the actual game. I feel that reinventing the wheel takes too much time.
A good handle on the math behind things can be useful. This tutorial is a good place to start.
One book I'd definitely recommend is Computer Graphics by Foley and Van Dam.
Here is a good hands-on tutorial for getting started quickly with a little bit of mathematical theory included: http://www.kindohm.com/technical/wpf3dtutorial.htm

Resources