(Text-Based) Games for C++ practice - c++

I'm currently learning C++ and so I thought it would be a good idea trying to (re)program some "common" text-based games. (Thinking of Hunt the Wumpus, Guess a (pseudo) random number generated by the computer,...)
However, I can't find any good sources for such tasks.
Which text-based games could be "educating" for me to program?
Do you remember a special game you have programmed (written in C++ preferably), which taught you a lot?
It would be nice if you could include:
A general concept of the game
What aspects of the C++ language programming this game would require/involve

A self-learning version of "20 questions" might be quite fun (if you are unfamiliar with this, there is quite a fun implementation of this at Guess the Dictator/Sit-Com Character).
An example session (based on questions from this web site):
Are you female?
> N
Are you overweight?
> N
Do you live in an apartment building?
> Y
Do you travel for your job?
> N
Do you have strange schemes to make money?
> N
Do you live in California?
> N
Are you a new doctor?
> N
Is your father gay?
> Y
Are you gay?
> N
Are you an actor?
> N
Are both your parents gay?
> N
Are you black?
> N
I guess you are Chandler from Friends, am I right?
> Y
At this point, if I had answered N, I would have to say who I was thinking of, choose a question which distinguishes my chosen dictator/sit-com character from Chandler from Friends, and then say whether the answer to my question is "yes" or "no". This question is then remembered, and the program becomes slowly more and more knowledgeable about sit-com characters and dictators.
Depending on how you did this, this could help you learn:
Console I/O (to ask the user the questions)
Binary trees (each question is a node in the binary tree, and the child nodes are the questions you ask depending on the yes/no response)
File I/O (if you save the tree to disk)

I'm trying to remember some of the fun stuff I did way back when in my high school CS class. They're not all games but here it goes:
Text based (ASCII) animation - Basically I animated an ASCII dragon coming into the terminal, saying something, and leaving. After "drawing" each frame it was cleared so basically it was a frame-by-frame ASCII animation generator.
Maze - Used Unicode characters in kind of the same concept. I got keyboard input from the arrow keys and redrew your block going through the maze based on your input. Again, clearing the screen after each frame and printing out the text again.
Snake - similar concept as the above but it was a snake game.
Simple chat - this polled a shared text file on a central server in our school (that someone accidentally chmoded 0777) and facilitated basically a really simple chat room.
The beeper - this program became infamous at my school. Up until XP apparently the sound buffer on Windows computers could easily get overloaded by text. Running this caused the computer to beep until you turned it off (and in most instances also caused it to get bogged down so much you had to do a hard reboot). Definitely pissed off the administration of our high school. Plus it's only a 2-liner.
char o = 7;
while(1) cout << o;
Anyway, not sure if this helped you get any ideas but just use your imagination. You can have a lot of fun without having to know a lot about programming. Just be creative.

Zork of course!

Facebook has some cool engineering puzzles that I like, but they may be a bit advanced for just starting out. I'm am a so-so C++ programmer, so I solved the puzzles first in Python, then in C++.
Check out: Facebook Engineering Puzzles
They seem to have everything from easy (Hors d'oeuvre) to quite challenging (Buffet).
I believe these puzzles were set up for recruiting, but they're fun on their own. (Maybe I'm kind of geeky?)
Plus, they have an added benefit: never know when you might need a job.

A good source of classic games is
http://www.atariarchives.org/basicgames/
The games are in old school basic but learning to translate and write these in any language would certainly be useful to gaining skills.
For instance if you wanted to tackle a few cards games this would be good to create headers, functions, classes and put code into libraries that could be re-used between two or more of the games.
It is not so much what you do as long it stretches your skills and moves from the trivial to something less so...
Find a mentor to review your code and make suggestions about what to try or do different.

A number of basic board games you've played during your childhood.
Battleships! (In some countries, known as subs) -> This teaches you to mess around with arrays, passing buffers around. Can also (if you code an AI) get you to play around with that.
Checkers/Chess -> Implementing an AI is beyond the basics learning, but it's rather easy to code a text representation of the game.
Stratego or basic wargames -> Data structures and OOP.

How about Nim? There are two variations, one with multiple piles where you are allowed to take as many tokens in a single pile as you wish, and one with a single pile where you are allowed to take 1-N tokens at once (N typically around 3). The person to take the last token wins or loses.
Way back when, I implemented a version of the second game that let you specify all the parameters of the game, then would quietly choose to go first or not so as to guarantee a win. Ah, good times.

You must go to the coolest text game ever, Elite.
You can get the source code in very readable, and very interesting C code. The source is available at Ian Bell's site.
Elite was famous for its "infinite" universe. It's quite a clever design.

Hunt the Wumpus would be fantastic. It's a relatively simple game, but most examples are old procedural code in BASIC. You could start from scratch and write an OO version in C++.
Conway's Game of Life is another good one, since it doesn't require any user interaction. I wrote a 3D version early in my career, and found it helpful. And it's fascinating to watch :-)
<aside>
I actually miss the old days, when computer magazines had program listings in the back that you could type in yourself. They had games, utilities, whatever. I learned so much just copying what others had written.
</aside>

Back in the day, I made a hot-seat multiplayer roulette that taught me some basics, all text based. Basically, players would take turns to make bets on various numbers at different levels of stakes, there would be a draw (with animation & sounds), double or nothing for the winner. Was a lot of fun.

Legendary NetHack seems to be an excellent choice and originally in ASCII graphical user interface. However, it is implemented in C, not C++, though may be a good education material. Here you will find all details:
http://en.wikipedia.org/wiki/NetHack
http://www.nethack.org/

checkers. I had great fun writing this in a mixture of cobol and fortran a long time ago
there is a real thrill in seeing your creation act smartly
of course you go through many iterations where it acts dumb before you get to that point

Jotto is a great game that is just about the right complexity for someone learning. You have to think hard about a couple of good data structures, but you can easily put together a fun game in less then 1000 lines of C++.

You should check the site for interactive fiction in english:
http://www.intfiction.org/forum/
This is where the new developers of text games gather to discuss about them. However, implementation is not anymore carried on in C++ - a few specialized programming languages called Inform, TADS and Hugo are used instead.
You'll find a lot of text games (including Zork, Hithhiker's guide to the galaxy, Wumpus...) in the ifarchive:
http://ifarchive.org/
You can find an implementation of one of my one games in C++ here:
http://www.caad.es/baltasarq/if/csa/csa-cpp.zip
It could be useful, provided that you can read in spanish. Anyway, I've moved to Inform 6 myself.

Board games like checkers and Othello. Back in the 90s I had an Othello-AI competition with my coworkers. I think I started with tic-tac-toe before that.
Etudes for Programmers has some fun projects, if you can find a copy.

there used to be an adventure (i.e. text based game) writing language called ALPS and I remember coding a version of this, plus tcp and rudimentary multi user handler, as my first C/C++ project (initially the former, eventually the latter). Project was neatly bite-sized "modules" with definitive yardstick and fun end-result: I used it to make a quaint MUD with my mighty 32K BBC Micro. Coding a C/C++ ALPS ended up teaching me the lingos in literally a week - to a decent working standard (far from expert mind you).

Related

C++ and python simultaneously. Is it doable

I am totally new to programming as though I have my PhD as a molecular biologist for the last 10 years. Can someone please tell me: Would it be too hard to handle if I enrolled simultaneously in C++ and python? I am a full time employee too. Both courses start and finish on the same dates and is for 3 months. For a variety of complicated reasons, this fall is the only time I can learn both languages. Please advise.
GillingsT
Update:
A little more detail about myself: as I said I did a PhD in Molecular Genetic. I now wish to be able to obtain programming skills so that I can apply it to do bioinformatics- like sequence manipulation and pathway analysis. I was told that Python is great for that but our course does not cover basics for beginners. I approached a Comp Sci Prof. who suggested that I learn C++ first before learning Python. So I got into this dilemma (added to other logistics).
You'll get holes in the head.
Python's data structures and memory management are radically different from C++.
Whichever language you "get" first, you'll love. The other you'll hate. Indeed, you'll be confused at the weird things one language lacks that the other has. One language will be reasonable, logical, unsurprising. The other will be a mess of ad-hoc decisions and quirks.
If you learn one all the way through -- by itself -- you'll probably be happier.
I find that most folks can more easily add a language to a base of expertise.
[Not all, however. Some folks are so mired in the first language they ever learned that they challenge every feature of a new language as being nonsensical. I had a guy in a Java class who only wanted to complain about the numerous ways that Java wasn't Fortran. All the type-specific stuff in Java gave him fits. A lot of discussions had to be curtailed with "That's the way it is. If you don't like it, take it up with Gosling. My job isn't to justify Java; my job is to get you to be able to work with java. Can we move on, now?"]
If you are new to programming, I would say start with the C++ class. If you get the hang of it and enjoy programming, you can always learn Python later. There are a wealth of good books and Internet resources on pretty much any programming language out there that you should be able to teach yourself any language in your spare time. I would recommend learning that first language in a formal classroom, however, to help make it easier to learn the general concepts behind programming.
Edit: To clarify the point I was trying to make, my recommendation is to take whichever course is geared more towards beginning programmers. The important things to learn first are the basic fundamentals of programming. These apply towards almost any language. Thanks to the wealth of resources available online or in your bookstore/library, you can teach yourself practically any programming language that you want to learn. First, however, you must grasp the basics, and intro C/C++ classes typically (in my experiences, at least) do a good job of teaching programming fundamentals as well as the language itself.
Since you are a beginning programmer, I would not recommend trying to learn two languages at once (especially if you are trying to learn fundamentals at the same time). That's a lot of very similar (yet very different) information to keep track of in your head, almost like trying to learn two brand new spoken languages at the same time. You may be able to handle it perfectly fine but at least for most programmers that I know, it is much easier to get a good grasp on one language first and then start learning the second.
I think that given the circumstances (fulltime employee, etc) studying one language will be hard enough. Pick one, then study another. You'll learn basics from either language.
As for "which language to pick"... I specialize in C++, and know a bit of python. C++ is much more difficult, more flexible, and more suitable for making "traditional" executables.
I'd recommend to start with C++. You'll learn more concepts (some of them doesn't exist in python), and learning python after C++ won't be a problem.
edit:
From your comment on this question, it appears the Python course is not geared towards beginner programmers. They'll probably be covering some of the more advanced topics of programming without touching on the basics of program flow which are really essential. So if the C++ course is geared towards beginners, then I would recommend that you take the C++ course and teach yourself Python on the side.
There is a wealth of Python tutorials out there. The official one is also really good. You don't have to wait to learn Python, of course, you can do it right now by going to any of those tutorials. The first tutorial I linked, by Alan Gauld, is geared towards non-programmers and is really high quality. He's also a regular contributor/moderator of the python tutor list. If you want to really learn Python, subscribe to that list and ask questions when you have them and do your best to answer questions that are posed - that's how I learned Python and I credit that process with much of my knowledge and understanding. As a PhD you've probably seen countless times that teaching someone else helps you retain your knowledge better and forces you to really understand the concepts.
When you do start learning, there's a great package of Python tools called Python (X,Y) that is designed for doing scientific type computing. It has all sorts of great tools packaged with it.
If you've had any experience programming, then you should easily be able to handle both course loads. What I mean is that if you can understand the following two programs, you should be able to easily perform the course loads.
Python:
elements = ['Sn', 'Pb', 'Au', 'Fr', 'F', 'Xe', 'H']
for element in elements:
if element == 'Sn':
print 'Tin'
elif element == 'Pb':
print 'Lead'
elif element == 'Au':
print 'Gold'
else:
print 'Other'
C++
#include <stdio>
#include <string>
using namespace std;
int main(){
string name;
int age = 0;
cout << "Please enter your name: ";
cin >> name;
cout << "Please enter your age: ";
cin >> age;
cout << "Hello " << name << "! You are " << age << " years old!" << endl;
return 0;
}
Even if you don't know exactly what's going on, in the programs, if you kind of have an idea, you should do just fine. These are typical programs that you'd expect to see in the first few weeks of class, and if you can look at them and figure out what's going on you're probably at least better off than the average student.
If you look at both of these programs and think, "What in the...??? I'm so confused!", then you should only take the Python course. Python makes it a lot easier to grasp the concepts (and write programs) than C++. The knowledge you gain in either language easily translates to the other, but you have to be exposed to a lot more in C++ than Python. For example, that C++ program looks like this in python:
name = raw_input("Please enter your name: ")
age = raw_input("Please enter your age: ")
print "Hello", name, "! You are", age, "years old!"
You can usually focus on one concept at a time without having to worry about possible bugs being introduced by other language features.
But if you can guess what's going on in both programs within 5 minutes, I'd go ahead and take both classes - as a molecular biologist you've had to do plenty of logical thinking which is essential to programming (not so essential to being a high-schooler).
Good luck!
I think it all depends on the level or difficulty of the of the class and that the languages in and of themselves really don't make that much of a difference.
To me, programming is 95% logical and about 5% dealing with syntax and the actual language. I started programming in high school and up through college (a senior a Computer Eng Currently) the focus was all about understanding the mindset of things and learning how to logically think through a problem and then develop a solution. Very few of our classes were a C++ or Java or Python based class. Of course there were some that focused on the more obscure languages such as x86 Assembly, but even then the idea was more of learning how to attack a problem. As a MCB person you should be fine with that.
For the other 5%, which is the actual language, taking two classes in two different languages will lead to crossovers. Of course a lot of what you learn in both can be applied to the others such as loops, conditionals, classes etc. However syntax is what is going to mess you up. You'll find yourself writing the syntax for the other language when you don't mean to. Simple things such as an if statement
Python:
if x > y
C++:
if (x > y)
But other than syntax issues, I really think all languages are pretty much the same. Sure people are going to disagree and that yes different languages are better at things than others but if you're not taking a graduate level class and these are both pretty basic intro classes what you learn could actually complement the other class you're taking.
But of course the biggest question for you to consider is time. Even being a full time student taking multiple heavy programming classes is not smart. Often times assignments are longer than expected or more difficult than first realized. So if you're going to have multiple long involved projects dealing with coding you may want to pick just one class. Especially seeing as a lot of what you learn in one can easily be translated to the other and vice-versa.
I think you pretty much answered this question yourself:
I was told that Python is great for that but our course does not cover basics for beginners.
In other words, the Python course is not an introductory course -- it assumes you already know how the basics of programming. That's probably why the professor suggested you take the C++ course first.
I come from a computational maths background, and have written sizeable (commercial and accademic) programs in both C++ and python. They are very different languages and I would probably learn one first (or only one).
Which one would depend on what you want to be able to do with the language.
If you want to build something useful with your language that is not (overly) compute or data heavy, go with python, you'll get something useful quicker.
If you need to do something useful that is either compute heavy or data heavy, then you'll probably need to go with C++. But it will take you longer to get to something to do what you need --- It will take a while to learn C++, then additional time to code data-heavy or compute-heavy code effectively.
Now some will say that python can handle data/compute heavy jobs well enough.. but in molecular biology "heavy" can mean very heavy.
Having said this, my suggestion is go with python if you can.
You've got to find out what people in your field are programming with so you can leverage existing libraries/APIs/projects. It won't do you any good re-inventing the wheel in C++ or Python if there's some wicked-cool FORTRAN library out there that is standard in your field. (And, if that is the case, God help you, I'm sorry.) Anyway, the CS prof you talked to might not have any idea what computational molecular geneticists use.

(student) interview questions - programming for a robotics lab

my robotics lab is looking for programmers to work on some projects we have at the moment.
We nailed down the requirements (mainly, c++ and experience with openGL and 3D), but due to obvious money constraints we can't afford to hire Great Developers. Instead we're going to settle for Talented Students, offering them projects for their dissertation/thesis and hoping for some fresh ideas and creativity from their side. We can also afford to pay students that just graduated (first job experience).
So my question is:
In your experience, how did you spot a Talented Student (computer scientist or engineer)? What questions did you ask? What else did help you in finding a candidate that turned out to be a Good Programmer? (note: they might not know much about a specific language, but might have the ability to learn pretty fast)
or, if you were the interviewee,
Which questions were asked that made you jump on the bandwagon? Or, if you had an awful experience, what - in retrospect - was an obvious warning signal that you ignored?
Please note that I am not looking for an argumentative answer. We can talk all day long about what's best for us and never agree.
Instead, I'm looking for tales from your experience. Anecdotes, stories, hints, everything will help.
Background:
A bit more background: working for academia here is slightly different than working for the private sector (here = Italy). There are no 'deadlines' to 'sell' a product; instead, it's all proof-of-concept based. Nothing you start working on has the guarantee to be functional.
A comic best describes it: reinventing the wheel
I am considering doing Coding Questions for their interview, but all my colleagues are scoffing at me (too scary, nobody will ever come to work for us again, nobody really know how to code, etc).
Coding-wise, programming done by researchers is ... ugly. I am fighting to get a version control system in constant use, people have to be chased down to report bugs and document their code, everything is coded-so-that-it-works and rarely we go back to old code to 'fix bugs'. Basically once it's somewhat working, the project is closed and people go work on another project.
Lots has been reinvented and rewritten over and over again (just because nobody knew it was already there). People come and go, future is uncertain, but we play with robots so it's very cool :)
Furthermore, being really understaffed, nobody can follow you and guide you in your project. At best you're the one that has to come up with a plan, background literature and a working prototype.
Hence, we are looking for people that:
have some background to get started
can be highly independent
do want to learn and build their own expertise in new fields
Actually, here's my best advice:
Recruit among your students.
Since you work for an academic institution I assume that either you or your colleagues teach. This provides you with a wealth of information about what potential recruits are capable of -- how fast they learn, how motivated they are, what they are good and bad at, how the code they turn in for the lab assignments and projects look like, etc.
Firstly, in industry, coding questions are very much the norm - I'd be worried if coding questions weren't asked!
I've been responsible for doing technical interviews for about ten years now. And yes, I ask coding questions. But the questions themselves aren't really the point. What I'm more interested in is getting an idea of whether the candidate can think, and articulate their thoughts.
One question I ask (asuming the simple earlier stuff has gone well) is about inheritance heirachies. There is no one right answer, although there are a lot of wrong ones. But what's important is how they approach the question, the points they come up with in favour of one design over another.
Background knowledge is useful, in that it shows that they have an interest in the area in which you're working - but really knowledge can be gained. Intelligence is much more important.
However it's quite possible to have intelligent people who are impossible to work with! I haven't figured out how to determine who they are.
I have done such a project when I was a student: ie a 4-months project, working half-time. It was not about robots, per se.
I think that the most obvious requirement is motivation/passion. Since they'll be mostly on their own you will need them to be somewhat independent and able to think for themselves, this requires motivation first and foremost.
In order to determine whether the candidate is motivated or not, begin by asking them about the project itself. If they only gave it a cursory glance, they're likely not motivated. Also look at their experience / courses: optional courses in CS, projects they've done, etc... anything indicating that they really care about CS / development in general and are not there just because they've heard it paid well.
Then comes the question of ability. Like you said it might not be easy to spot those who will be smart enough to figure stuff out by themselves and DO things. Once again, you can ask them about past projects, having them detail the issues they faced and how they solved it.
Finally, I agree with you that some demonstration of their abilities is in order. They might be a bit tense initially, so I would do this at the end, once the interview is already going, you might have had a chance to get them to relax with the previous questions this way.
You don't necessarily need them to do coding questions, I think it's most about reasoning. Try to pick problems related to your area work, for example one you really had in the past, and get them to analyze the problem. If possible they should take the lead and ask you questions about the problem itself here.
We've had an issue with the robot not being able to analyze the images the camera took, it could not correctly determine the moving objects itself, do you have an idea how you would do that ?
Then you'll need to get them to think about a solution. You need a whiteboard here, and ask them to think aloud so that you can follow their reflexion. You'll probably need to nudge them a bit from time to time to keep them on track, their reaction to your input is also a key-point here, since you want them to be able to accept criticism and build on it, otherwise you might have issues directing them afterward.
Frankly, try to avoid asking them for the quicksort algorithm, or the introsort, or the radix sort... If they need sorting, they'll just fire up their computer and browse the internet. On the other hand, getting them to analyze an existing algorithm unknown to them (for example, the median of 5 sort) and checking that they understand why it works, could be worth it. If they need to work on their own, they'll need to be able to learn on their own too :)
As others say, try to hire someone that's motivated!
For master thesis students I put more emphasis on knowing the basic skills (programming, knowing how to use version control) as they don't stay on long enough to learn everything along the way.
If they're going to work mostly on their own and you have no special requirements on language I wouldn't focus much on language questions. But every decent programmer knows at least one language fairly well, get a sample or their prior work or make them code some simple application to test that they don't suck.
I'd focus more on algorithm and data structures. Ask rudimentary stuff that every programmer should know - when to use a list and when to use a vector, why summing a row-major matrix by iterating over the columns first is bad, basic complexity analysis questions, etc. That will sort out many of the bad weeds.
Ask some design questions too perhaps, e.g. what is "coupling" and why is it bad, ask them if they know what a design pattern is, etc.
Check that the applicants have a solid grasp of linear algebra and coordinate system changes in particular if they're going to work with any 3D stuff like OpenGL. In my experience, learning the API is simple, wrapping your head around how the transformations work less so.
Obviously, if you except them to perform any real robotics-specific you should check for that knowledge as well. E.g. estimation (understanding simple EKF and particle filters is a requirement in my book), control theory, pattern recognition, machine learning, vision, or whatever is useful for the particular task.
If I were hiring someone for theoretical work I would perhaps loosen up on the CS/programming skills and focus more on math knowledge. Someone with solid math skills will pick up the CS easily, and programming is just programming.
Ask for references or to see some of the prior work. Many great students already have some interesting project to show after graduation.
I'm not sure how common this is at universities in general, but I would look for a games programming (or robotics) course on the transcript where the candidate, as a student, succeeded in completing a project with a team. It would ask the candidate to describe how that project worked (important technical details) and the role he had in the team. The only way to really tell if someone is good at something is to see what happens when they try it, and since you're in academia, recruiting students, that should not be a problem.

What is a good project / way for an out of practice C++ developer to get back into it?

Like many people here, I started my programming experience with the good ol' green screen BASIC that you get when you booted an Apple II without a disk. I taught myself C++ in my teens, and even took a class on it in college, but as soon as I discovered .NET and C#, I dropped C++ like a bad habit. Now, (many) years later, I'm interested in getting back into C++ development - thank the iPhone for that - and I have to admit, I feel a little daunted. Having to deal with pointers, ATL, macros, etc. seems a bit overwhelming at times when you've been in managed .NET land for a long time.
What are some good resources or weekend type projects I could do to ease me back into C++? I'm not interested in debating the relative merits between platforms, stacks, but I would be interested in hearing about objective comparisons between different development platforms, although keep in mind I'm a Windows guy.
If anyone wants to change the tags around, feel free - I wasn't quite sure how to tag this.
TIA!
Try Euler Project
Project Euler is a series of
challenging mathematical/computer
programming problems that will require
more than just mathematical insights
to solve. Although mathematics will
help you arrive at elegant and
efficient methods, the use of a
computer and programming skills will
be required to solve most problems.
I had this problem a while back, I chose to find a cool open source project.
I chose Chromium.
It was really interesting, and all C++
They have a vast number of small bugs which can be fun to fix, I ended up fixing about 4 in a few evenings/weekends. Check it out (pun intended)
You don't need to leave .NET to program for the iPhone, unless you want to...
http://arstechnica.com/open-source/news/2009/01/open-source-mono-framework-brings-c-to-iphone-and-wii.ars
If you're into the iPhone, grab the openGL demo for it and get modifying.
It's fun, you can show people and it's kept me busy for the last 3 months.
I'm about release my first app.
While Project Euler or related sites are cool, for me they just don't hold my attention very much. I find the best way to start using a new technology (or refreshing an old one) is to find a project that scratches an itch that I am genuinely interested in. This is the only way I can maintain interest while learning something new.
I haven't gotten around to doing this yet, but a friend of mine recommended building an ircbot. for me this doesn't really scratch an itch since I don't use IRC a whole lot and when I do I'm trying to talk to people.
I've thought about modifying his recommendation and instead building a web crawler. Though I'm not sure of the particulars of this sort of project it seems like a good one as it would teach you a lot of libraries at once, it might not exactly scratch an itch though.
How I DO currently get projects to learn a language is make a game. The game dev club at my school is small and holds periodic challenges for individuals/small groups to make a certain genre of game. This works for me, as it's somewhat competitive.
I would definitely recommend finding such a group, even if you're not going to school any more, a school dev club is always eager to have a professional around. And depending on the area you're in there are also groups that are not associated with any school.

Looking to get into the turn base webgames business

Ok lets start off with info about myself.... that way there is no stone unturned.
I am a adult, 27 years old. so this isnt a joke or a passing fad. Im into computers, how they work and how apps and games are designed from the ground up and made.
I have ZERO programming back ground. I went to college for the wrong thing. I love video games since i was a child and should have went that route.
I just picked up a book called C++ without fear. i already have went thru the first 3 chapters and im not having an issue yet on self teaching myself this subject.... yet... lol.
I have a few game ideas written and drawn out on about 3000 pages. i took one of my games to a few website developers and the cheapest offer i received to make the game was 16k and 3 months time. Now im not now super duper genius or a brilliant mind kind of guy.... but come on... 16k? i figured... ok time to teach myself how to make these games.. and yea it might take 2 to 4 years but at least i will learn how to code myself and never ever have to pay for this kind of service.
So i asked around at what i should learn and i was told C++ was a nice starting point.... Is this correct?
2... 2 of the games i have written down and played with all the math issues are kinda in this games fashion. www.goallineblitz.com. if someone here could sign up and look that game over and let me know what tools you would need as a coder to make a game in that style... i would thank you greatly for the info.
Where else do i go from here? what would you do and plan out?
I know a have a huge mountain in front of me. and i look foward to every step, stumble, fall and bloodied knee i will endure during this venture...
=)
thanks in advance!
I wish you the best of luck, but you have to realize you're the 1238471920847th person in this exact situation, of which approximately 3 manage to figure out what they're doing. there are even previous questions like this on stackoverflow. The most useful answer is "reconsider whether you're interested in coding or game-design -- the two are not equivalent"
Also, you have to realize 16k is an unreasonable number. Not because it's high, but because it's low. Consider Braid for an example of an "indie" game that was pretty successful. It cost $200k, and the developer started off already knowing what he was doing.
There is so much to learn, you would be surprised.
What I think you should do is find a bright young web developer who's interested in investing some time into a business startup for a certain % of share of the business. You can contribute the intellectual property of the game and the creative direction. I imagine this would let you get up and running for significantly less than $5k including incorporation fees, web site costs (minimal), trademarks, etc. You could save money by doing the business stuff yourself, and by your partner doing the programming himself.
It's win-win. You get your game built, and the developer gets a lot of great experience for their resume (and a share of any profits).
I think you've got a very low estimate of how much work is involved, frankly. Going from a spec to a finished web product in 3 months sounds quite good to me, counting things like quality assurance (a very important thing here) and graphics and sound, and $16K also sounds very good for three months' work. (Seriously, this is $64K a year, as a contractor, assuming only one person. Anybody who can do this sort of thing can make more money than that.)
That being said, doing it yourself will teach you a whole lot. Just don't count it as a likely source of income.
If you're interested in web-based games, you will need to become familiar with more than C++. At a minimum, you'll need to know web design and Javascript. This strikes me as a lot to bite off at one time, so I'd suggest starting with a simple screen-based game, and learning about the web stuff when you're confident of the basic game programming. (Don't just write the game you want on the screen and then think you'll just port it to the web; write to get some familiarity with C++ game programming, learn the web stuff, and design your game based on that.)
This sounds like a good way to learn programming, but don't get your hopes up too high. That's going to be a loooong road.
Also, I agree that C++ is probably not the right language to do this. Maybe you should start to learn programming with a smaller, less ambitioned project first and use a more beginner-accessible language.
A turn-based strategy game is basically a business application with a glossy front-end.
I'd recommend SQL Server for data storage and rules engine. You're going to have to learn how to model a database. I don't want to shit on your hopes, but the other guys are right: you've got a long road ahead of you. Here's some help to get started:
An introduction to turn-based gaming and what it means
Source code for a turn-based war game you can browse and modify
The Torque 2D gaming engine
I wrote the beginnings of a turn-based space combat/strategy game in MSAccess(!) over a decade ago (ugh I just did the math and it's been almost 20 years actually) that I never finished. Here's hoping you get farther than I did. Good luck!
Java, Flash, PHP, ASP.NET, all are languages that are commonly used to implement web-based games.
You're also going to need to introduce yourself to SQL most likely, since data will have to be stored in some manner.
First, I'm gonna answer your technical question.
You will need 3 things.
1- Display things in the user's browser so that he can use your application. This means using languages best suited for programming. Most likely PHP (or its Microsoft equivalent : ASP.NET, less used, and requires more expensive tools) or maybe Flash. There are others, less used options, but that's beside the point.
2- A database, to store your data. The language here will be SQL, and you will probably start with a free open-source database. Most people choose MySQL in this case.
3- An engine to do something with the data you have in your database and the input of your user. Here, since you don't know anything about programming, the easy way is to use the same language you used for your GUI : PHP/ASP.NET. Later on, if you manage to be a code guru and need some performance improvement, you may try something more powerful like Java or C++, but then you will have to interface your PHP front-end with your C++ back-end which is gonna be tricky.
Now here is why i think you're going to fail :
All i said means that, at the very least, you need to learn basic programming concepts, 2 languages (PHP + SQL), and all the associated tools (MySQL, an IDE for PHP, ...). Moreover, you will also have to learn how to set up, configure and use a web server. That's quite a daunting task to do all this by yourself in a few months or even in two years.
Actually what worries me the most, is that you say you have no programming background. This means you don't even know whether or not you will like to do this kind of thing. Programming can be quite frustrating and many people hates it. You should start by building small apps as a hobby, and see whether this is the kind of job (because yes it's a job, that requires skills) that you would like to do. Only then you will be able to think about making this your line of business.
If you want to make web-based games C++ is probably the wrong language. You should look into PHP, SQL database programming, and Perl.
Welcome to the world of programming. It's lots of fun but takes a while to learn.
My advice: start small. Really small. There are a lot of basics you need. C++ may actually be a good way to get the basics down solidly, though you won't likely be using it for your final web product (see other answers for web language options). As you go through examples, think of small parts of your project that you could do with what you know, even if it's just choosing a name and displaying it, or adding up a score. Processing.org is a fun language-- again not what you'll need in the end, but it's aimed towards beginners and lets you get into graphics right away (which is fun, though probably won't be your main focus with this game).
Bonus advice: if you want to make money off this or become a professional game developer, don't release your best ideas on the web right away. My husband created a really innovative game in college, which became somewhat popular on a java game site. A few years later an almost exact clone was released for the Playstation. The Playstation developers weren't ripping him off directly, it turned out the idea had spread widely. While in some ways that was really cool, if you want money or credit as a game designer obviously that's not going to be what you want.
You could approach this from another direction. Instead of implementing these large designs you have in mind, aim at starting with a Facebook app instead. That way you can get some very small ideas implemented. If you try to do something large first, you'll end up in a tar pit.
Be careful of large game designs. Get good at implementing small ones first. You can always build on top of them.
C++ is a good language for learning how to program computers; however, for the specific task of programming turn based web games, C++ is probably not the tool you will want to use for that task. You may want to continue learning the C++, to get a grip on the underlying programming; it may take a while, though. You may also want to look into other programming languages for implementing your games on the web; PHP is good for scripting. C# has a lot of similarity to C++, and has good integration with Microsoft's web servers; ASP.NET is pretty easy to comprehend, as well. You should do the research into each of them concurrently with learning the C++ to figure out which one seems like it's going to give you what you need.
Others have already said this, but PHP is going to be the best starting place for you. For a turn based, web based game I would say use PHP and mySql for sure. After coding much of your game using PHP, you will have a good enough understanding to start moving to other languages if you so desire.
Setup an apache server with php support, and a mysql server (they can easily run from your own machine). Then just start playing with the code. Look at other examples, modify them, mix them, learn.
You can find lots of free tutorials on both php and sql on line.
I started learning C++ fairly recently, also with "Without Fear". The best thing you can do once you have the basics is dive into a simple project, but REALLY simple (like tic-tac-toe).
I don't think you should be learning to program just for this one idea of yours. Learn to program for the fun of it, see how you get on, see what floats your boat. A year from now, think again about your project, whether it seems feasible, whether you want to do it, how you want to do it. But don't think about it till then, because all you'll be able to think about is how you don't seem to be getting any closer to having thousands of customers lining up.
Just keep on coding, and you'll get where you want to be. Where you want to be may not be where you think you want to be now though! Good luck.
It may be of no use to you but http://archverse.sourceforge.net/ is an open source C++ turn based web game. Its not finished but all the basics are there and it actually does quite a lot (though it has no client just a server with unit tests right now). Its BSD licensed so you're welcome to do what you want with it aside from claim you wrote it from scratch.
Contrary to suggestions from others here im not a fan of RDBMS for semi real time games so I'm using BerkeleyDB as a data store it allows me to have ACID and still be massively faster since I never search on anything but a key field and everything is in process. Don't really want to start a flat file vs rdbms flame war but the non open source project this is related to used MySQL and paid for it quite painfully.
The learning curve for C++ can be tricky for beginners. If you can get through the chapters on references and pointers without severe mental damage, you'll probably be fine. Otherwise, you may want to pick up something a bit higher level to start out with. As others have stated, C++ is a great programming language for game development, but it's not particularly suited for web-based applications.
Regardless of your language of choice, there's only so much you can learn from books. Programming skill is very much dependent on experience -- program, program well, and program always.
At some point, you'll probably want to study up on object-oriented analysis and design. If your games have any significant degree of complexity to them, the ability to break them down into easily manageable chunks is invaluable.
Check out gamedev.net, they have a number of resources for game developers.
Game development involves a lot of different aspects other than the programming itself. Depending on the game, you'd also have to worry about sound, music, graphics, animation, user interface, play balancing, story, dialogue, and database design. All of which has to work on a variety of hardware and software configurations. Oh yeah, and it probably has to be fun as well.
Start small.
Good luck.

How would you go about implementing the game reversi? (othello)

I have been thinking about starting a side project at home to exercise my brain a bit. Reversi looks like a simply game, where mobility has a profound effect on game play.
It is at least a step up from tic tac toe. This would be a single player against an AI of some sort.
I am thinking to try this in C++ on a PC.
What issues am I likely to run into?
What graphics library would you recommend?
What questions am I not smart enough to ask myself?
Issues...
Well, just be sure when writing the strategy part of the game, not to simply do the move that gives you the most pieces. You must also give weight to board position. For example, given the opportunity to place a piece in a board corner should take priority over any other move (besides winning the game) as that piece can never be turned back over. And, placing a piece adjacent to a corner spot is just about the worst move you can ever make (if the corner space is open).
Hope this helps!
In overall, issues you will end up running onto will depend on you and your approaches. Friend tends to say that complex is simple from different perspective.
Choice of graphics library depends about what kind of game you are going to write? OpenGL is common choice in this kind of projects, but you could also use some GUI-library or directly just use windows' or xorg's own libraries. If you are going to do fancy, just use OpenGL.
Questions you ought ask:
Is C++ sensible choice for this project? Consider C and/or python as well. My answer to this would be that if you just want to write reversi, go python. But if you want to learn a low level language, do C first. C++ is an extension to C, therefore there's more to learn in there than there's in C. And to my judge, the more you have to learn onto C++ is not worth the effort.
How do you use the graphics library? If you are going to do fancy effects, go to the scene graph. Instead you can just render the reversi grid with buttons on it.
How ought you implement the UI, should you use the common UI concepts? Usual UI concepts (windowing, frames, buttons, menubars, dialogs) aren't so good as people think they are, there's lot of work in implementing them properly. Apply the scene graph for interpreting input and try different clever ways onto controlling the game. Avoid intro menus(they are dumb and useless work), use command line arguments for most configuration.
I yet give you some ideas to get you started:
Othello board is 8x8, 64 cells in overall. You can assign a byte per each cell, that makes it 64 bytes per each board state. It's 8 long ints, not very much at all! You can store the whole progress of the game and the player can't even notice it. Therefore it's advised to implement the othello board as an immutable structure which you copy always when you change a state. It will also help you later with your AI and implementing an 'undo' -feature.
Because one byte can store more information than just three states (EMPTY, BLACK, WHITE), I advice you will also provide two additional states (BLACK_ALLOWED, WHITE_ALLOWED, BOTH_ALLOWED). You can calculate these values while you copy the new state.
Algorithm for checking out where you can put a block, could go the board through one by one, then trace from empty cells to every direction for regex-patterns: B+W => W^, W+B => B^ This way you can encapsulate the game rules inside a simple interface that takes care of it all.
As the guys were suggesting my idea of telling you for thinking first for algorithms and the game logic. next answer for me was the graphics library, it depends on your target platform, programming language, framework etc. But as I suggest is using C# with Cairo 2D graphics library which you can achieve this using Mono framework (which then you can target all three major operating systems for your game to work) -> www.mono-project.org. Meanwhile I found this I think that and this kind of resource will help you: http://home.datacomm.ch/t_wolf/tw/misc/reversi/html/index.html. But if you finish this, you can try implementing Sudoku.
As mentioned by others, I would begin by getting a deep understanding of the gameplay and strategies, and the algorithms involved. This link may be useful to you, it describes basic Othello strategy and algorithms:
http://www.site-constructor.com/othello/Present/Basic_Strategy.html
You will want to look into minimax with alpha-beta pruning if you write an AI to play against. Your favorite search engine will have much to say on the topic.
After you've taken a whack at the game logic yourself, go read chapter 18 of Peter Norvig's outstanding book Paradigms of AI Programming. (Source code here.) It has a rather short and extremely readable program that can kick just about any human's butt; you ought to learn a lot by comparing your solution to it.
There are tons of libraries out there but as far as I can think your game is going to need event and graphics libraries....and a sound library for more fun!
Allegro 5 is a best choice...Its an All in one library.
http://liballeg.org/
though It is written in C language you can create Object Oriented programs.
and A tutorial for this...
http://fixbyproximity.com/2d-game-development-course/
or you can use low level APIs like.. OpenGL for graphics.
OpenAL for sound.
glfw for events.
but OpenGL is a big deal because you have to create your own sprite sheet handler and all that 2d stuff.
Go with allegro...Complete your game and then go for OpenGL!
Reversi should be a very simple game to implement. It is perfect to learn some basic algorithms of games theory (specifically min-max) during the implementation of the AI.
One thing to note on the AI is that it is perfectly possible to make a perfect AI for Reversi (one that always wins no matter the moves of its opponent). So on the strategy side, if your AI loses, you still have work to do :)
I wrote a reversi game many years ago, when I was still at school. Its strategy was very simple, it just went for the maximum number of pieces, but weighted so it preferred the edges and particularly the corners and didn't like squares that risked giving away the corners.
This worked fairly well against people who hadn't yet worked out what it was doing, but once you had it was very easy to use its strategy against it. I'm not proud to say, however, that it beat me the first few times even though I'd written it!
A proper AI with a few moves of lookahead is far more complicated. Should be an interesting problem, but at the time I was more interested in the user interface.