Skip to content

Cranberry Game Engine is my Personal hobby game engine

License

Notifications You must be signed in to change notification settings

jeslaspravin/Cranberry

Repository files navigation

Cranberry Game Engine

Cranberry Game Engine is my Personal hobby game engine, This is my first from scratch game engine. I work on this as best as I could during my holidays.

Why is Cranberry the name? I was eating cranberry and checking Twitter for my daily dose of imposter syndrome. Then suddenly 💡 why not write my engine? I created the project while still eating the berries!

Requirement

  • Vulkan 1.3 supported hardware is required
  • Windows platform

Instructions

  • Install CMake from CMake
  • Install Visual Studio 2022 from VisualStudio
  • Install Vulkan SDK from VulkanSDK. Necessary because I am using glslangValidator
  • Run GenerateProject.bat to generate Visual Studio solution. This will by default generate solution for Editor-DynamicLinked preset under Build folder

(or)

  • You can also run GenerateProject.bat with one of following presets(eg., GenerateProject.bat or GenerateProject.bat <preset> [Some Cmake arguments]..) Note that if using preset and not going to change library dependencies run Setup.bat first(It will download archive with necessary libraries)
    • Editor-DynamicLinked preset creates command cmake -B Build -G "Visual Studio 17 2022" -A x64 -Thost=x64 -DCMAKE_INSTALL_PREFIX:STRING=${sourceDir}/Installed -DCranberry_STATIC_MODULES:BOOL=OFF
    • Runtime-DynamicLinked preset creates command cmake -B RuntimeBuild -G "Visual Studio 17 2022" -A x64 -Thost=x64 -DCMAKE_INSTALL_PREFIX:STRING=${sourceDir}/Installed -DCranberry_STATIC_MODULES:BOOL=OFF -DCranberry_EDITOR_BUILD:BOOL=OFF

Code lookups

Right now I have two runtime applications Cranberry and TestEngine

  • For Cranberry start from Cranberry-Main
    • Right now the scenes can be manually loaded using this line of code CranberryAppLoadScene at startup of the engine
    • If engine cannot find any valid obj file then it auto creates a default scene with bunch of cubes like in the Screen Shot. It is done here CranberryAppCubeScene
  • For TestEngine start from TestEngine-Main. In order to run TestEngine additional Assets directory with raw assets are necessary. If you want to run TestEngine.exe download and extract Assets.zip in Runtime folder

Best practises

  • Whenever adding sources to Modules. If the header needs to be public place its source file together in Public folder, This makes source browsing easier. Source files will any way be considered private by module builder.

Features

Many features listed below are supported but tooling still needs to be developed

  • Reflection generator for C++
  • Reflection supports metadata classes and flags
  • Shaders are reflected and Parameters can be addressed with names
  • PBR Materials
  • Image base lighting
  • Point, Spot, Directional lights
  • Shadows, Cube mapped shadows and Cascaded shadows
  • Prototype garbage collector
  • Object tree actions like deep copy, traversal etc.,
  • Multiwindow widgets and Input handling
  • Supported inputs mouse and keyboard
  • World/Actor/Components
  • Unity style prefabs
  • Job system using CoPaT

Third parties

Licenses for third party packages used is placed under Licenses folder

Current dependencies:

  • Vulkan headers
  • glm
  • tinyObjloader
  • stb
  • LLVM(CLang). CMake configs generated required some manual tweaking to support Debug,Development and Release config
  • mimalloc. CMake configs generated required some manual tweaking to support Debug,Development and Release config
  • tracy profiler. CMake configs generated required some manual tweaking to support Debug,Development and Release config
  • xxHash (Embedded into the project)
  • CoPaT (Embedded into the project)
  • SPIRVCross (Few necessary files are copied directly rather than using as include)
  • ImGui and ImPlot (Embedded into the project)

Some screen shots

TestEngine

TestEngineSS

CranberryEditor

CranberryEdSS

Project boards

PS

If you found any piece of this software helpful or used it yourself, Please feel free to share it with your circle. I had invested substantial amount of my personal time in this project and would love some feedback in return😄