Open source projects?

Started by
6 comments, last by BeerNutts 11 years, 4 months ago

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.

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.

Hero of Allacrost - A free, open-source 2D RPG in development.
Latest release June, 2015 - GameDev annoucement

http://www.google.com
void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

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.

- Jason Astle-Adams

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,

.

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

Hero of Allacrost - A free, open-source 2D RPG in development.
Latest release June, 2015 - GameDev annoucement

I think you can not glean on some sourcecode to find out how to do OOD. It would be better to read about SOLID: http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod

And yes I know these are old, but still very helpful.

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.

My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

This topic is closed to new replies.

Advertisement