Beginning physics simulation - c++

I just finished taking an independent study course for CS282 - Computer Physics Simulation. It was the first time it was offered at the college I'm attending. The textbook was "Game Physics Engine Development: How to Build a Robust Commercial-Grade Physics Engine for Your Game" by
Ian Millington. This book is full of grammatical errors and, while a useful reference, is difficult to code from. The source code that is provided with the book is much more complete than the book illustrates and there is a level of difficulty deciphering the code, especially for graphical purposes as there is not even a primer on how to do something on your own with the engine, which in fact is broken or unimplemented in places, or how to use GLUT, which is the graphic utility the book uses and IS NOT DEVELOPED ANYMORE! In fact, most of the references in this book were not from the last decade, which isn't too bad for teaching code that's 15 years old, I suppose. While this text is a great resource for the big picture of physics simulation in a beginner setting, it does not introduce a friendly sandbox for CS students to play in.
This was basically an experiment to find out what works and what doesn't. My professor also included a textbook for using ActionScript with a physics engine, but the text required prior knowledge of how physics engines worked so we dropped it for practicality.
My question is this:
I'm in the process of writing a reflection paper and I'd like to be able to recommend an alternative to these texts that provides an easy way for CS students to jump in and write code and actually be able to see the fruits of their labors, possibly with python. Can anybody recommend a good resource and/or text that would be useful to this end? For those who have taken this course or similar, what have been your experiences?

which is the graphic utility the book uses and IS NOT DEVELOPED ANYMORE!
Wrong. Check FreeGLut project.
Can anybody recommend a good resource and/or text that would be useful to this end? For those who have taken this course or similar, what have been your experiences?
You might want to take a look at Chris Hecker's physics articles. They're old, but they're useful.
it does not introduce a friendly sandbox for CS students to play in.
Friendly sandbox means "nothing to program". TO "play" you could use ready-to-use physics engine (Bullet Physics (comes with source code), or PhysX), but I doubt it would teach how to write decent physics simulation from scratch - it is a big topic, and there's a reason why existing engines were in development for a long time...

Related

General game (RTS) scripting basics

I've been into several tutorials and links for how to integrate scripting into games--but most of these don't start early enough in the process for me. I am trying to wrap my head around the basic structure of an effectively scripted game. Here are the basics:
I'm working on starting a basic 2d RTS game in C++. The mechanics of the game and the graphics are pretty standard/simple, rather the logic and data will be extremely complicated compared to a standard RTS. Obviously, I have a lot of planning to do--and really, the point of this is more to learn C++, scripting, game programming basics rather than actually complete my project.
I'm trying to figure out which elements of my project should be handled by scripting and which should be included in my core "game engine".
For instance, the all powerful "game loop" -- do I program this in C++ as part of the engine, or will my "engine" be solely what I use for displaying graphics (tiles, characters, etc...), processing the large amounts of data, and similar tasks--and these classes get "plugged into" the game loop, which is scripted?
I would like to use C# as a scripting language, from what I've read it offers good speed while still allowing to develop in VS, which I like. But really, I'm more concerned with how it's all supposed to get set up, more from a pseudo-code level than the actual coding. There's plenty of resources I can use when I get to this point, I'm just looking for advice on how to structure the whole thing.
Any tutorials, resources, advice would be greatly appreciated! Thanks!
icnivad's recommendation for Programming Game AI by Example is an excellent one, it's chock full of practical information.
In terms of actual engines, Unity does the job and lets you script in C#, but for someone, such as yourself, who wants to learn the nuts and bolts, it may hide too much and do too much for you. Irrlicht is a pretty solid C++ engine and comes with lots of tutorials to get you started; it also has a very clear interface and a pretty active community. In terms of what you want to write in C++ and what you want to script, I suggest taking a hard look at what you actually need to script--if you need to script anything at all. You could write the entire thing in C++, which has the advantage of being more easily debuggable. Speaking of which, if you're still new to C++ and game dev you might want to stick to just C++ at first (if not, just ignore this).
"Debuggability" is one of the things you should be paying attention to, since it can often be extremely hard to debug C++ and script code at the same time (when you're shuttling data and instructions back and forth). That said, once you have your framework up and running, implementing new features and tweaking stuff can be a breeze.
You may want to take a look at Lua as a scripting language, as it's quite popular for game scripting. Luabind, a popular binding library for C++ and Lua, is pretty easy to use. SWIG is also available (a short tutorial on it popped up on a blog at GameDev.net recently).
No matter which scripting language you choose (if any), make sure you work on some separate toy programs with them first. Get used to the language and fiddle around with it. Then try small programs with minimal C++ <-> script interop. Do only a few steps at a time so you can spot errors and note what works and what doesn't. Once you feel ready to start integrating scripts into your game, do only one step at time and test it to death before moving on. Speaking of which, make sure you also plan how and where you'll connect your scripts to the game on paper first--it makes things much easier.
Generally, you'll want to put all the heavy work on C++'s shoulders (like the game loop, graphics, pathfinding, etc.). I've found that scripts are usually best for things like configuration files, behavior code for AI characters, UI, and event handling. Basically, if you're going to tweak/change something a lot or you want other people to be able to change something, it's a candidate for scripting (no recompiles for the win!). Just remember that a lot depends on your specific game--if scripting something would be too slow (use your profiler to check), too cumbersome, etc., don't be afraid to do it in C++ and call it from the script or just do it entirely in C++.
Hope that helps!
The book Programming Game AI By Example is superb, and touches on just what you are looking for regarding game loops, using scripting (like LUA), and tons of examples of stuff that seem especially pertinent to you.
By the way, potentially relevant is the Unity3D game engine that lets you use C# for scripting. And there is also Garage Games engines, including the game builder kits that could help you create an RTS type game, and I believe you may be able to code in C# for Torque as well.

state-of-the-art C++ projects

I like to go through existing software projects as a source of learning and new ideas.
doing so I discover things that I did not think were possible
in your opinion, what is the top state of the art C++ project that you have used/develop/extended? can you state reasons why you consider it state of the art and what you can learn from it.
my latest craze is boost::phoenix, http://www.boost.org/doc/libs/1_43_0/libs/spirit/phoenix/doc/html/index.html, which is very comprehensive functional programming library.
Despite its capabilities it is straightforward and easy to extend. After some tweaking I was able to write multithreaded lambda parallel loops and mathematical domain specific language, probably within 2 weeks.
What is yours? (please do not just say boost, as it is huge collection of project)
Personally, I like to look at code in Qt. I do use it everyday, but it seems like every day I use it, I find something new. In terms of total code, it is probably as big as boost. But it comes with excellent documentation and examples and complete source code and is free for LPGL & GPL versions.
For me, what I liked about Qt was that it's concepts matched the way C# works, so it was a fairly easy transition back into c++ for me. But by looking at their code, it has really given me many ways (although not as many as SO) to understand some of the complexity in C++
From what I've seen, the code-sources that I have learned the most from have been from fairly complex 3rd party software libraries. Havok is an excellent example from which I've not only learned programming practices and solutions, but also quite a few mathematical and philosophical discussions. I've also seen some other code-sources which have not been open sourced from which I've learned how to not solve things.
Game engines for AAA-titles in general tend to involve a lot of complex code that tries to push as much as possible through a piece of hardware. I guess that the recommendation goes for all software that tries to achieve something similar but I've only dived into game engines when it comes to such software. AAA-titled game engines often have good or bad solutions to study and I would generally recommend looking into those. There are some that are open source... I think Source/Valve have released theirs in different stages.

Which way to go in Linux 3D programming? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I'm looking for some answers for a project I'm thinking of. I've searched and from what I understand (correct me if I'm wrong) the only way the program I want to make will work is through 3D application. Let me explain.
I plan to make a studio production program but it's unique in the fact that I want to be able to make it fluid. Let me explain. Imagine Microsoft's Surface program where you're able to touch and drag pictures across the screen. Instead of pictures I want them to be sound samples (wavs,mp3,etc). Of course instead the input will be with the mouse but if I ever do finish the project I would totally add touch screen input compatibility! Anyway, I'm guessing there's "physics" to do with it which is why I'm thinking that even though it'll be a 2D application I'll need to code it in a 3D environment.
Assuming that I'm correct in how I want to approach my project, where can I start learning about 3D programming? I actually come from PHP programming which will make C++ easier for me to learn. But I don't even know where to start. If I'm not wrong OpenGL is the most up to date API as far as I know.
Anyway, please give me your insights guys. I could really use some guidance here since I could totally be wrong in everything that I wrote :)
I would like to add that I'm most likely looking for tutorials, Linux 3D programming sites, source/demos (google failed me for the most part).
Note: I also understand this is not a project I'll finish in weeks, months and might take years. That's fine, I want to get C++ under my belt however long it takes. I'm just looking for opinions, sources, tutorials and things that might help me (as stated above).
I don't know much about the MS Surface, but I'm a musician and multimedia artist working mostly with code, so... My advice is very much different - it doesn't matter if it's Irrlight, Orge, pure OpenGL or anything else. If you don't know much about 3D prgramming you'd better start with something different. There are several environments for artists to work with graphics, multimedia and code. Try one of them and watch the projects made in each of them on the project's websitees and on Vimeo. I think most of what you want to do is already done, but still can be very inspiring. The environments that come to my mind are:
Processing - great prototyping environment by Ben Fry and Casey Reas. I use it always before coding anything serious as it provides me with all the multimedia and communication libraries i need, it's simple like hell and it's Java so you can easli deploy your apps after all! (As far as I remember there is touch surface library for Processing)
openFramewoks - same as above but C++, but it's less clean and still under development. It's very easy to prototype in Processing and code finally in openFrameworks as the latter was very much influenced by the former. (The touch surface library is implemented for oF for sure)
NodeBox - great and very powerful environment in Python. Has a very strange but great and intuitive (after all) GUI with some very unique methodolody of work!!
SuperCollider is a wonderful sound processing and algorythimc composition programming language with a very easy to code GUI library and graphics API. It gives you everything you ever imagined about sound programming functionality.
Pure Data - graphical approach toward programming. Made by Miller Puckett (the co-author of Max/MSP) with OpenGL (GEM extension) functionality provided by the guys from IEM in Austria.
Final good advice: Books!!! Programming Interaction (O'Reilly), a few books on Processing website, classic work - Computer graphics for Java programmers (great one, really!!). Read as well all the chapters about domain languages and domain knowladge in "97 things every programmer should know". It can really help!!
BTW: if you don't concider heavy real-time procedures thing about Java (Java2D, Java3D, JOGL) - it's millions times easier then C++ and Processing is actually Java, so you have a very good prototyping environment that can produce ready to use Java classes and applets. I used Processing in real-time theatre productions where stage movement was controlling the sound (syths and hardware samplers) all made in Processing, so this "heavy real-tme" means HEAVY real-time!!
If any further questions about this particular domain programming - don't hesitate to email me.
Coming from PHP won't make C++ any easier to you as riding a bicycle won't make driving a car easier.
Now, I think for Linux, your only choice is OpenGL as an API, and use any of the many wrappers, 3D programming frameworks, and what not available.
Maybe you can go into an easier language, like Python, and if there are OpenGL bindings (which I am pretty sure there is) you can use that, that would make the learning curve more easy and fast.
Update:
Today I wouldn't recommand Ogre3D for a lot of reasons (including very poor long-term interface, which defeat the purpose of a dependency for long term usage - although it does have nice performance sinc v2.1).
There is currently a lot of other alternatives which work well on Linux.
Ogre, using OpenGL on Linux-based OSes, will save your life and time, compared to using OpenGL that is your sole alternative.
That said, to use Ogre, you'll have to know a fair amount of knowledge and practice in C++.
And you will have to know about "graphic pipeline".
You can use C with OpenGL, that seem simpler, but it make you loos time by not providing higher abstraction of the graphic pipeline as Ogre does.
And almost all graphic engines are written in C++ anyway.
Now, if you try to learn C++, take a good book like "Accelerated C++", take a deep and long breath and please forget all you learnt about php before. Be humble in your search for knowledge and you'll get it faster.
You'll be interested in:
OpenGL (obviously)
Box2D (a 2D physics engine)
SDL (a portable media library)
You can find basic tutorials for them on the web. However, think if you really want to code in C++. The language is very powerful, but not easy to learn, and really hard to master. Wouldn't it be better to use a rapid development language like Python with PyGame?
Don't get me wrong -- I love C++ and it's my language of choice, but unless you're working on top-notch performance, operating systems or compilers, it may be overkill to learn C++'s up and downsides the hard way.
You need neither 3D graphics or a physics engine for this. The UI could even be done in a browser using some funky javascript.
However, the audio engine for something like this is going to be a pretty complex, performance-oriented beast, and is probably best done in C++ (or maybe OpenCL).
Finally, are you sure you're not reinventing Pure Data?
I prefer Irrlicht as a lighter, easier-to-learn, but less feature-complete API than OGRE.
It's literally possible to write a prototype in a few minutes in Irrlicht, and the code itself is easier to understand.
The best thing about it is that it would interface seamlessly with Irrklang, a sound library that may help you with your project.

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.

(Text-Based) Games for C++ practice

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).