• Advertisement
Sign in to follow this  

Open source projects?

This topic is 1834 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, does anyone know where i can find some simple open source c++ and sfml games. Simple games that i can play around with and see how it works. Games like pong, snake, or tetris would be nice. Thanks.

Share this post


Link to post
Share on other sites
Advertisement

I don't know of any simple games unfortunately. Try looking through The Linux Games Database or The Linux Game Tome (unfortunately this site is down at the moment).

 

 

My project, Hero of Allacrost, is an open source 2D RPG written in C++. Unfortunately however, it is not simple (over 200,000 lines of code), but it is one of the best organized, commented, and documented code bases out there as far as open source projects go. We get compliments regularly on the quality of our code, which gives me happy nerd feelings. :) If you're interested in taking a look, you can find the code here and we have a lot of documentation up on our wiki here. I recommend browsing through the wiki documentation first (especially the Quick Start Guide) to get an overview of how the code is organized and what it is capable of, then dive in to the header files and read the comments in there that describe the APIs. You can also run doxygen on the codebase to generate automated documentation if you desire.

Share this post


Link to post
Share on other sites

In addition to Hero of Allacrost you might also take a look at Secret Maryo Chronicles and Battle For Wesnoth.  Again, neither of them is really simple, and neither uses SFML, but you might find them valuable.  You could try looking through the "SFML projects" forum in the official SFML development community for anything open sourced.

 

 

I do have some advice on learning from sourcecode however:  remember that you're seeing an end product rather than the process that went along with it.  When you're looking at sourcecode you can (usually) figure out the how but not the why.  You don't know if the programmer used a particular technique because they thought it was best, because they were simply unaware of alternatives, because they had to meet specific requirements that you might have, etc.  I never go so far as to tell someone they shouldn't bother reading source-code from completed games, but be sure you take what you see with a healthy grain of salt.  Just because it worked for them doesn't necessarily make it a good choice for you.

Share this post


Link to post
Share on other sites
http://www.google.com

I tried that, and couldn't find anything

 

In addition to Hero of Allacrost you might also take a look at Secret Maryo Chronicles and Battle For Wesnoth.  Again, neither of them is really simple, and neither uses SFML, but you might find them valuable.  You could try looking through the "SFML projects" forum in the official SFML development community for anything open sourced.

 

 

I do have some advice on learning from sourcecode however:  remember that you're seeing an end product rather than the process that went along with it.  When you're looking at sourcecode you can (usually) figure out the how but not the why.  You don't know if the programmer used a particular technique because they thought it was best, because they were simply unaware of alternatives, because they had to meet specific requirements that you might have, etc.  I never go so far as to tell someone they shouldn't bother reading source-code from completed games, but be sure you take what you see with a healthy grain of salt.  Just because it worked for them doesn't necessarily make it a good choice for you.

 

Thanks, the problem i am really having is how people would set up their OO designs. I have tried a few, but most of them failed, i thought that if i had some examples that It would help me to better understand it,

Share this post


Link to post
Share on other sites

It took us a long time and a lot of trial and error before our OO design felt like it was done well. How did your previous designs fail, and why? When I'm designing a  new component to our code base, the way I go about doing the design is as follows:

 

1) Think about it for a day or two, just in the back of your mind, about what classes you would need and what their relationship to each other will be

2) Once I have a first concept of the design, I share my design proposal with my team and get feedback, adjusting it as they point out flaws or possible ways to improve it

3) Implement my design and get all of the essential components working. Use the component and make any improvements so that it works as well in practice as it does in theory.

4) Add on more advanced features as required. If I find the design is not accommodating new features well, adjust and refactor as appropriate.

5) Repeat #4

 

This is what I have found works for me, but YMMV. Also it's important to keep in mind what your goal for your code is. Do you want to just get it up and running ASAP, or do you want to invest the time to produce a robust and more maintainable architecture? Creating designs that are more focused on long term goals will cost you more time up front to build, but they will (hopefully) save you time in the long haul. There's nothing wrong with slapping together some sloppy code as a proof of concept, or just to get some ideas about what a proper design "should" do. Just use it in moderation, as no one likes sloppy code. :)

Share this post


Link to post
Share on other sites

FWIW, my Old Blog (Linked in my signature below) details the steps I take to make a fairly simple C++ game (a top-down shooter-type game).  The source code is included.

 

Also Serapth has steps he takes to make a Tetris game using SFML; that's a good one to follow. Click here.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement