Giter Club home page Giter Club logo

simplegameengine's Introduction

SimpleGameEngine

Simple game engine using SFML2. This engine is designed to quickly prototype games, as it was created to be used in Ludum Dare Competition (http://www.ludumdare.com/compo/). The code is distributed under license GPLv3.

Features

Screens

Different game states are handled using "Screens".

Sprite animations

TBD

Physics engine

Quadtrees

TBD

Continuous map

TBD

Doxygen documentation

TBD

Asynchronous tasks

Run tasks on a secondary thread.

Resources managing

Create resources handles from a manager, and the file will be loaded automatically on a secondary thread. If the resource is not ready when you need it, the game will freeze until it is

Planned features

Networking

...maybe

Third party

SGE use the following libraries and tools :

To build SGE, you have to download and build SFML2. You will also need binaries of Premake4.

simplegameengine's People

Contributors

meoo avatar

Watchers

 avatar  avatar

simplegameengine's Issues

Threading CPU overhead

Enabling threading with RESOURCES_THREADING (Config.hpp) causes a serious CPU overhead.

The number of workers does not change anything : the CPU usage is the same with 1 or 32 workers.
This is confirmed as the CPU usage doesn't change when multiple empty tasks with long sleep commands are issued.

Strangely enough, there is a downpeak when changing from intro screen to menu screen, or from menu screen to game screen (when TransitionScreen is active?)

Better error handling

Following #2

  • Add more assertions checks (pre/post conditions)
  • Add more exceptions checks (runtime errors)
  • Done Replace current Exception enum (Config.hpp) with something better (e.g. custom classes)

Export Pause from main

Although pause should be handled in main, it can be a screen overlapping the current one instead of the modal mechanism it is actually.

Particle System

Require #3 Memory pools

Particle system allow to have cheap, but still good looking effects easily.

The use of sf::VertexArray is highly recommended to draw multiple sprites with a single texture, as it is much faster.

Memory pools

Reduce allocation times by using memory pools.

Quadtrees and Particles could profit a lot from theses pools, as they do frequent allocations/deallocations.

Entities would not benefit as much, because they can have varying sizes, and stay on the screen for a relatively long time

Fix FPS bug on Windows

This problem is known in SFML, and seems to come from the resolution of the sleep function Windows use.

It causes random variations of the FPS count depending on the other running applications (try closing / opening your web browser and check the FPS counter).

Possible solutions :

  • Use custom active sleep (with tinythread yield) for short times
  • Find a way to fix it in SFML

VSync is also affecting the FPS counter...

Better critical error handling

asserts is not a good exception handling mechanism.
Some errors must be catched even in release mode.

  • Create an exception type / class to handle critical errors
  • Check every assert for it's validity
  • Replace errors that must always be verified by exception throws
  • Print errors on the screen nicely

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.