Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFGE - Simple & Fast Game Engine  (Read 13055 times)

0 Members and 1 Guest are viewing this topic.

N1ghtly

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
SFGE - Simple & Fast Game Engine
« on: May 01, 2012, 05:11:53 pm »
Hi all,

I am working on a new project!
It is a game engine, built on top SFML.
The aim is to make programming easier without taking away freedom or functionality.
For this reason I have opted for a component-based architecture.For example, there is an eventsystem, resource manager, and collision detector that can be used separately from each other.

I also chose not to include any external dependencies. This is to make both the compiling and the distribution to easier!

The project is hosted on Google Code:

http://code.google.com/p/sfgengine/

The source contains many comments and  documenation is generated by Doxygen. (You can check the docs download under the Downloads tab).


Here's my blog where I frequently post updates:
http://n1ghtly.blogspot.com/


Let me know what you think!

PS: This is my first attempt at designing a game engine. Feel free to tear it apart and tell me how much it sucks. I'm here to learn.

PS: Does anyone know a license where the user is entirely free and can do anything with the source, but must give credit?
« Last Edit: May 12, 2012, 11:09:50 pm by N1ghtly »

Lo-X

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
    • My personal website, with CV, portfolio and projects
Re: SFGE - Simple & Fast Game Engine
« Reply #1 on: May 01, 2012, 05:25:53 pm »
Hi, i've a similar project so I have a few things to say :

- You can have memory leaks with your director class : at destruction you don't delete what is in your vector<State*>.
- I think you should use a std::stack instead of transforming a vector in an stack

I haven't seen anything about the component based system (Entity System), I wait this update =)

N1ghtly

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: SFGE - Simple & Fast Game Engine
« Reply #2 on: May 01, 2012, 05:49:55 pm »
Well spotted, I forgot to write the destructor!
As for the stack, I wanted to keep it a vector so that multiple states can be drawn at a time.
For example, a pause state over a game state. (functionality still needs to be implemented however).
An std::stack doesn't allow this (as far as I'm aware).

By component based system I meant most classes of the engine can be used independently of each other.
But an Entity System is actually next on the TODO list :D

For reference, what would you like the entity system to do?

EDIT: It seems I had a wrong understanding of the terms Entity System and Component Based Design. I'm reading up on it now, sure looks promising!
« Last Edit: May 01, 2012, 06:04:01 pm by N1ghtly »

Lo-X

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
    • My personal website, with CV, portfolio and projects
Re: SFGE - Simple & Fast Game Engine
« Reply #3 on: May 01, 2012, 06:13:21 pm »
Well spotted, I forgot to write the destructor!
As for the stack, I wanted to keep it a vector so that multiple states can be drawn at a time.
For example, a pause state over a game state. (functionality still needs to be implemented however).
An std::stack doesn't allow this (as far as I'm aware).

By component based system I meant most classes of the engine can be used independently of each other.
But an Entity System is actually next on the TODO list :D

For reference, what would you like the entity system to do?

Oh yes, my system only draw 1 State at time, that's why i've chosen a stack.

I just wrote an article about Entity SYstem, but in french. I'll resume it.

If you want one (and need it), you should read this article :
http://t-machine.org/index.php/2007/09/03/entity-systems-are-the-future-of-mmog-development-part-1/

I implemented my system like this :
An entity isn't a class, it's just an ID in a table (because an Entity, IMHO, shouldn't have data nor functions).
I store all Entities' components in an array in a "entity manager" class.

There are many ways to implement that system, make a Class for an entity isn't wrong, there are cases where it's usefull (but IMO thre are more cases where it's useless :p)

Here is the history of my Entity System in UML :

First version, Entity is a class, I update all components at each loop (wich is very bad) :


Second version, Entity is still a class but each component can register for events types that insterest them. It's good but you need a very good Event class that doesn't just copy the sf::Event :


I haven't done this Event class well so I tested my last version :


I think there is a huge part a feeling question (how yo prefer the component to comunicate with each other, etc..)

Another famous link : http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/

Bigz

  • Full Member
  • ***
  • Posts: 154
    • View Profile
    • Bigz.fr
Re: SFGE - Simple & Fast Game Engine
« Reply #4 on: May 04, 2012, 11:57:30 am »
It's quite funny, I'm working for a few months now on a game engine that I called "SGE - Simple Game Engine". Damn, the SFML inspire us all :P

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: SFGE - Simple & Fast Game Engine
« Reply #5 on: May 04, 2012, 02:34:11 pm »
A lot of people seems to be working on something similar ^^
though my name is way off ;)

I'm interested in your choice to have it on google code? I've never used it. Do you know any advantages over Github there? Just curious.

Also I have a couple of opinions on the component/entity based system. But since I am working in Ruby this can be done much easier in another way so the opinions are more or less not valid here. Just wanted to put that out so you try and see if there is some easier way ;)
« Last Edit: May 04, 2012, 02:39:19 pm by Groogy »
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

N1ghtly

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: SFGE - Simple & Fast Game Engine
« Reply #6 on: May 04, 2012, 06:05:30 pm »
I'm not going for a component-based architecture after all.
After extensive research I came to the conclusion it brought just as many disadvantages as advantages with it.
For example when components nede access to different components. I'll let the user free to implement this if they want to.

As for google code, I just use it because it has SVN support, which Github doesn't.
I know, I know, Git is better but I don't have any experience with it. I'll need to learn it one day or another though...

N1ghtly

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: SFGE - Simple & Fast Game Engine
« Reply #7 on: May 12, 2012, 11:09:18 pm »
Big update!

Current features of the engine:

- Event System
- Collision detection and response (AABB or convex shapes)
- Logging
- StateManagement
- Animated Sprites
- ResourceManager
- Menu System

bold features are new.
Development can also be followed on my blog: http://n1ghtly.blogspot.com/

Lo-X

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
    • My personal website, with CV, portfolio and projects
Re: SFGE - Simple & Fast Game Engine
« Reply #8 on: May 13, 2012, 01:05:26 am »
Big update!

Current features of the engine:

- Event System
- Collision detection and response (AABB or convex shapes)
- Logging
- StateManagement
- Animated Sprites
- ResourceManager
- Menu System

bold features are new.
Development can also be followed on my blog: http://n1ghtly.blogspot.com/

Interesting, I'll take a look !

OutlawLee

  • Jr. Member
  • **
  • Posts: 50
  • This is my personal text. Dont read it.
    • View Profile
    • Email
Re: SFGE - Simple & Fast Game Engine
« Reply #9 on: May 14, 2012, 10:03:50 pm »
Are you close to releasing it ? or something, i wanna use it :d

N1ghtly

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: SFGE - Simple & Fast Game Engine
« Reply #10 on: May 15, 2012, 11:29:55 am »
The first version will be released today! I'll try to get cmake working, otherwisr it will be be a cb project file.

N1ghtly

  • Jr. Member
  • **
  • Posts: 96
    • View Profile

N1ghtly

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: SFGE - Simple & Fast Game Engine
« Reply #12 on: May 17, 2012, 01:03:49 pm »
Next revision the collisiondetector will use spatial hasing for *much* improved performance!
Stay tuned :)

N1ghtly

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: SFGE - Simple & Fast Game Engine
« Reply #13 on: May 18, 2012, 11:42:29 pm »
The latest revision revamps the collision detection system (only internally, no code will be broken).
It now uses Spatial Hashing which significantly improves performance. I'm think about removing the AABBCollisionDetector and AABBCollidable classes. ConvexCollisionDetector and ConvexCollidable would be renamed to CollisionDetector and Collidable. After all, I can't think of many occasions where you ONLY need AABB collision detection.

What do you guys think?

N1ghtly

  • Jr. Member
  • **
  • Posts: 96
    • View Profile

 

anything