SFML community forums

General => SFML projects => Topic started by: kurasu1415 on July 27, 2012, 10:43:01 pm

Title: 2D Platformer + Game Engine using OpenGL+SFML
Post by: kurasu1415 on July 27, 2012, 10:43:01 pm
Hey Guys,
So we have been working on a 2D platformer for quite a while now. I have been developing the toolkit to work with which I call the "Stack Toolkit". I'll get more to that later. We aren't quite ready to release any screens/demos to the public yet, but I can tell you that we are throwing up a kickstarter with a 10 Minute playable demo in 3 months. I plan to release some nice tech demos here in this thread soon to generate some interest, get feedback, maybe inspire you guys and share what I have learned.

The Game

The game is called Fobia. It is a game about a man with a horrible life, who is forced to battle his past. I can't say a whole lot about the designs, other than that we are using everything we can in a game to invoke strong emotion of impending doom, and immense sadness in the player. We want you to feel the way our hero does, and that is tired and ready to give up. Throughout the game you do grow, and become much more powerful as a result. This growth is shown through abilites, tone of dialogue, music, and color. Everything will be revealed in our Kickstarter.

The Tech

So not only am I designing the game, and managing my team, but I am also the lead developer. I decided that I wanted to focus on having linux support as well as OSX, Windows, and later Xbox. I decided wanted to go with a fully-abstracted component-based system. The system also supports Lua and Python scripting, and would be easy to integrate your favorite language into.

For those who don't know what component-based means, it's pretty simple. There is no "Object" class. There is no "Player" class.

EXAMPLE TIME! : Let's say you want to make a basketball. A basketball would be represented by 3 components : Physics, Sprite, Audio. Each component handles their own duty. So Graphics would draw our sprite, Physics would make sure our object collides and bounces properly, and Audio will make sure that it plays the correct sounds. If you wanted to add input, just tack on an Input component, and define how it reacts to input.

The event system is really the core of the toolkit. The system routes events from one component to another similar to how the old telephone operators would work. Events only get sent to components that care about that Event type.

EXAMPLE TIME! : Consider our Basketball example again. When our ball hits the ground, we want to hear a noise on collision right? Well, when it collides with something, we tell it to send a "Collided" Event. That event gets routed to any other component that cares about that. so our Graphics component will take that event, and know that it shouldn't draw the ball over or inside the thing it collided with. Also, the Audio Component will know when to play our "bouncing" noise.

This setup allows for rapid growth, as changes require little to no changes in other components.

The scripts are actually handled by a component as well. Essentially, I have little API's that wrap core event functions, and use a lot of operator overloading to allow Lua and Python scripts to send events so that a script in one component can affect other components the correct way.

I also want to bring up the topic of the Editor UI. I am using a cool little opensource API called Berkilium (http://berkelium.org/ (http://berkelium.org/)). This allows me to tie in my C++ code to a UI written 100% in HTML/CSS/Javascript. It runs very quickly, and allows for resizable, pretty,  and quick-to-write GUIs. It is actually rendering a browser as a texture over the game, but you don't even notice anything except that its very nice. The only negative here is that it uses the Chromium core, which makes it 32-Bit only. This runs in a seperate OS process so that the rest of your game can still be 64-bit.


I am just so excited about this project that I wanted to share a little bit with the people that have helped me in the past with little SFML glitches, as SFML is used in many of my components for the non-console versions of my game. I also want to point out that after I get the code better documented, and stable, this code will be released open-source and I encourage indies to use the system.

Please let me know if you have any questions or comments. Feel free to PM me as well!

Thanks Guys!
Title: Re: 2D Platformer + Game Engine using OpenGL+SFML
Post by: eXpl0it3r on July 27, 2012, 11:33:10 pm
Sounds very interesting and I hope you'll keep us updated in here.
Also you can use this thread to talk a bit more about technical stuff then on the Kickstarter site, since many here might be interested in that part. ;)
Title: Re: 2D Platformer + Game Engine using OpenGL+SFML
Post by: Grimshaw on July 28, 2012, 12:40:28 am
This project absolutely deserves a light on it! Keep going and keep us posted :)
Title: Re: 2D Platformer + Game Engine using OpenGL+SFML
Post by: kurasu1415 on July 29, 2012, 04:47:40 am
Wow,  I have to say it feels good to have you guys seem so interested in the project. Is there anything specific you have any questions about, or anything I didn't mention that you might want to know?