Skip to content

fallahn/osgc

Repository files navigation

OSGC

Open Source Game Collection

What is osgc?

OSGC is a frontend built with the xygine library which acts as an interface to load any game written in the OSGC plugin format. I started this project as I'm often creating experiments and small games with xygine (Disclaimer - I'm the author ;)), and creating a new project each time, even with a template available, can become tedious. The plugin format allows creating a new xygine game quickly starting from only one header and one source file, while linking to xygine and SFML.

All games are open source, and come with the caveat that, well, most of them probably aren't very good. In fact they'll most likely be incomplete experiments. There may be a few gems, however, and I'm hoping that the open source nature will eventually encourage others to contribute to the games they like, or even write their own game plugins.

Binary downloads can be found on itch.io !!

Getting Started

Dependencies: You'll need to have at least SFML 2.5.x built and installed as well as xygine to build the frontend. Different plugins may require further libraries, for example the Drone Drop plugin also requires tmxlite. Use the CMakeLists.txt in the root of the repository to create project files for your build chain of choice - OSGC is frequently tested on Windows, linux and macOS with Visual Studio, gcc and Apple clang. Note that the cmake file will attempt to copy all of the assets folders to create the correct directory layout (below) and place the binary files in the correct directories, although this isn't gauranteed on all platforms. Symlinks (mklink on Windows) to asset directories can be used as effectively while developing a plugin.

To create your own plugin copy the plugin_template directory and rename it to something of your choice. Edit the included CMakeLists.txt for your new project, or create a new project in your IDE if you prefer. Remember to add the template source files to your project, link against SFML and xygine (and any other libraries you require) and set the project to be built as a shared library. The library output file must be named osgc.dll/libosgc.so/libosgc.dylib depending on your platform.

Use the begin() and end() functions in the EntryPoint.cpp file to register and unregister any game states with the frontend. See the plugin example in the 'shooter' directory for further example. To learn more about creating a game with xygine follow the xygine tutorial and refer to the wiki.

Note that while OSGC is designed around xygine it is not strictly necessary to use xygine beyond implementing the plugin interface. Any game or software which will run within the event/update/draw loop of a xygine state and can be drawn to an SFML render window is entirely feasible. For example my Gameboy emulator Speljongen can be built as an OSGC plugin.

Directory Structure

To correctly load plugins and their assets, the directory structure must follow this layout:

osgc
  |
  |____osgc-frontend
  |____assets
  |       |____assets used by the front end
  |
  |____plugins
          |____directory named for plugin
          |               |________________osgc.dll/so/dylib
          |               |________________info.xgi
          |               |________________assets
          |                                   |______assets used by plugin
          |
          |____directory named for plugin
                          |________________as above

Plugin directories should have a unique name describing the game as this will be used by the front end as the display title if the info.xgi file is missing. The info.xgi file is a text file written in the xygine ConfigFile format. Its properties are used to display information on the browser screen of the front end.

game_info
{
    title = "My Game Title"
    thumb = "path/to/thumb.png"
    background = "path/to/background.png"
    version = "0.0.1"
    author = "Jimmy Jim Bob"
}

Note that these are all string properties and can in theory contain anything they like, with the exception of thumb which should be a relative path to a thumbnail image 960x540px in size, and background which should be a relative path to an image 1920x1080 in size. All properties are optional.

See the screens directory for screenshots of OSGC in action

License

The frontend project and OSGC plugin template source files are licensed under the zlib license. Further OSGC plugin source, such as the top down shooter game, may be licensed differently. See individual project directories for more information.

Many Thanks

OSGC is a collaborative project, which couldn't exist without the contribution of others either directly or indirectly via sites like Open Game Art, Freesound or Looperman, or through the awesome gamedev communities on the internet. I try to credit every resource I can, usually through the use of credits.txt files in a particular project's directory, though some may slip through the net! If you feel I have a missed a credit somewhere then please leave an issue on the Github tracker or even submit a pull request. A particular mention should go to @sadface_RL for his excellent pixel art tutorials, @ryanmusicco for his wonderful compositions and the lovely chaps and chapesses over at #sfml for their feedback and support. Do go check them out!

About

Open Source Game Collection - mini games created with xygine and SFML!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published