Skip to content

dwjclark11/Scion2D

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

new_logo

๐ŸŽฎ Scion2D โ€“ A Simple 2D Game Engine for Learning and Teaching

Scion2D is a lightweight, educational 2D game engine built with the goal of learning by doing ๐Ÿง ๐Ÿ’ก. It's part of my journey to understand game development from the ground up โ€” and share everything I learn through my YouTube channel ๐Ÿ“บโœจ.

This engine isnโ€™t meant to compete with big names like Unity or Godot โ€” and thatโ€™s okay!
Itโ€™s about exploring, building, breaking things, and growing as a developer ๐Ÿš€.

Whether you're here to learn alongside me, peek at the source, or just curious about making your own engine, welcome! ๐Ÿ‘‹


๐Ÿ›  Why Scion2D?

  • โœ… Made with โค๏ธ for education
  • ๐ŸŽ“ Teach what I learn, and learn what I teach
  • ๐ŸŽฎ Build real 2D games from scratch
  • ๐Ÿ’ฌ Collaborate, share ideas, and grow together

๐Ÿ“– Documentation

โš ๏ธ Active Development Notice: This engine and editor are currently under active development. The documentation is still a work in progress and will not be up to date. Scion2D Docs

๐Ÿš€ Features

  • Cross-Platform: Builds on Windows and Linux. Currently Mac is not supported.
  • Modern C++20: Use of modern c++ standards and functionality.
  • Integrated Tilemap Editor: Ability to create tilemaps, create game objects, and more.

Hub

scionhub


Scion Editor

neweditorpic


Build


Requires CMake 3.26 and vcpkg

Get VCPKG:

git clone https://github.com/microsoft/vcpkg
./vcpkg/bootstrap-vcpkg.bat -disableMetrics

Make sure the following environment variables are set:

VCPKG_ROOT=[path_to_vcpkg]
VCPKG_DEFAULT_TRIPLET=x64-windows
  • Windows

    Add the following line in your Path environnment variable:

     <path_to_vcpkg_installation_folder>
    

    Open a terminal and type the following:

     vcpkg integrate install
     vcpkg integrate powershell
    
  • Linux

    Edit your profile's bashrc file:

     nano ~/.bashrc
    

    Add the following lines at the end:

     export PATH=<path_to_vcpkg_installation_folder>:$PATH
     export VCPKG_ROOT=<path_to_vcpkg_installation_folder>
     export VCPKG_DEFAULT_TRIPLET=x64-linux
    

    Apply changes:

     source ~/.bashrc
    

    Open a terminal and type the following:

     vcpkg integrate install
     vcpkg integrate bash
    

Install dependencies

  • Windows
     vcpkg install fmt glm entt glad soil2 sdl2 sdl2-mixer[mpg123] lua sol2 stb tinyfiledialogs rapidjson libzippp
    
  • Linux[debian based]
     sudo apt install python-jinja2 autoconf automake libtool pkg-config libibus-1.0-dev
    
    • if[Xorg]
      sudo apt install libx11-dev libxft-dev libxext-dev
      
    • if[Wayland]
       sudo apt install libwayland-dev libxkbcommon-dev libegl1-mesa-dev
      
    • Optional but good practice
       sudo apt install build-essential
      
     vcpkg install fmt glm entt glad soil2 sdl2[alsa] sdl2-mixer[mpg123] lua sol2 stb tinyfiledialogs rapidjson libzippp
    
  • ImGui Docking and SDL2-Binding
    • It seems like the ImGui[sdl2-binding] no longer exists in vcpkg. Also the current Imgui[docking-experimental] does not seem to be up to date either.
    • For now, we grabbed the latest from the docking imgui branch and build with the editor. I have added the necessary files under the thirdparty folder.
    • These should already be setup in cmake.
    • Will move back to using vcpkg bindings once the correct version is available.
  • Box2d Install
    • There has been a huge change in the latest box2d that is a breaking change to our codebase.
    • We are using Box2D 2.41, the latest 3.1, uses a C-API that is done in a completely different way.
    • Eventually we are going to have to update the code to support the latest; however, we currently have a work around.
    • Please see the Readme.md file here SCION_PHYSICS for the workaround steps.

Clone the repository

git clone https://github.com/dwjclark11/Scion2D.git
cd Scion2D
cmake -S . -B build
  • Also, in the main.lua file for the editor, comment out the loaded assets and files that don't exist. They will just error out.

Use the built-in OpenGL debugger

Note: this requires a graphics adapter with OpenGL version >= 4.3 capabilities.

In Scion2D/CMakeLists.txt:

  • Set the variable SCION_OPENGL_DEBUG_CALLBACK to ON.
  • Optionnaly, set the variable SCION_OPENGL_DEBUG_FORWARD_COMPATIBILITY to ON in order to enable warnings about deprecated OpenGL functions.

Activate the debugger in your code as soon as you have a valid OpenGL context made current:

  • SCION_RENDERING::OpenGLDebugger::init().

  • Optionnaly, you can opt out a list of warning wy doing the following:

     std::vector<unsigned int> ignore{ 1281, 131169, 131185, 131204, 31218 };
     SCION_RENDERING::OpenGLDebugger::init( ignore );
    
  • To allow the debugger to break, call SCION_RENDERING::OpenGLDebugger::breakOnError( true/false ) and/or SCION_RENDERING::OpenGLDebugger::breakOnWarning( true/false ).

  • To ignore a specific warning, call SCION_RENDERING::OpenGLDebugger::push( Id ).

  • To reinstate, call SCION_RENDERING::OpenGLDebugger::pop( Id ).

  • To set the severity level, call SCION_RENDERING::OpenGLDebugger::setSeverityLevel( SCION_RENDERING::OpenGLDebuggerSeverity::Disable/Notification/Low/Medium/High ).

Force the discrete GPU on Optimus laptops

In Scion2D/CMakeLists.txt:

  • Set the variable SCION_OPENGL_FORCE_DISCRETE_GPU to ON. Note: Ids can differ between platforms or drivers. Note for linux users: this is currently working only on nVidia GPUs.

๐ŸŽฏ Supported Platforms

Platform Compiler Status
Windows MSVC 2019+ โœ… Fully Supported
Windows MinGW/GCC ๐Ÿ”ง To be tested
Linux GCC 10+ โœ… Partially Supported
Linux Clang 12+ ๐Ÿ”ง To be tested

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

This project would not be possible without the help of all the contributors, the motivation to keep working forward through the wonderful comments and supporters from my YouTube Channel. Also from all the wonderful open source projects that I have been able to use in the creation of the engine.

Open Source Dependencies

Check out these amazing open source projects that we are using in the engine. Make sure to give them all a star! for all of their amazing work.

  • EnTT - Fast and reliable Entity Component System.
  • SDL2 - a cross-platform library that provides an abstraction layer for computer multimedia hardware components.
  • SDL_mixer - An audio mixer that supports various file formats for Simple Directmedia Layer.
  • Dear ImGui - Immediate mode GUI for C++.
  • Box2D - 2D physics engine for games.
  • GLM - Mathematics library for graphics software.
  • RapidJSON - Fast JSON parser and generator.
  • sol2 - C++ Lua binding library.
  • stb - Single-file public domain libraries.
  • Lua - Powerful, efficient scripting language.
  • tinyfiledialogs - Cross-Platform Native dialog library for WINDOWS MAC OSX GTK+ QT CONSOLE Official.
  • Libzippp - C++ wrapper around the libzip library.

Thank you to all the contributors and maintainers of these projects! โค๏ธ

About

Scion2D - 2D Game Engine

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •