Home

Awesome

Focus Engine

Welcome to the Focus Engine source code repository!

Focus is an open-source C# game engine for realistic rendering and VR based off of Xenko/Stride. You'll still see "Xenko" in many places. The engine is highly modular and aims at giving game makers more flexibility in their development. Focus comes with an editor that allows you create and manage the content of your games or applications in a visual and intuitive way.

Focus Game Studio

To learn more about Stride3D, visit stride3d.net.

Why this fork?

My games require the engine to be developed at a faster pace than Stride. I'm in need of fixes, new features and better performance. These changes will not be supported by the core team, and the absolute most recent changes may not be fully stable. However, you may find them very helpful, and in some cases, essential to projects.

Any games made with this engine?

Yes, and it is free for you to try! Works on all operating systems and supports VR in Windows: https://store.steampowered.com/app/1256380/FPS_Infinite/

Other paid games:

8089: https://store.steampowered.com/app/1593280/8089_The_Next_Action_RPG/

Spermination: https://store.steampowered.com/app/2001910/Spermination_Cream_of_the_Crop/

PerformVR: https://store.steampowered.com/app/1868400/PerformVR/

What is different?

Most of Focus is similar to Stride and there shouldn't be any loss of functionality over the original. Changes are focused on fixes, performance improvements and new features. However, I do not maintain different languages, Android support or the Launcher. The following is a rough list of "major" changes, but might not accurately reflect the current state of differences (since both githubs are moving targets which are hopefully improving):

OK, show me something neat!

Lots of Boxes

This is 6700+ physical boxes being rendered @ 50fps, which may not be the fastest thing out there, but it is pretty good! It is using BepuPhysics + Vulkan + https://github.com/phr00t/FocusEngine/blob/master/sources/engine/Xenko.Engine/Engine/Batching/BatchedMeshDraw.cs to draw all these boxes with 1 material, 1 mesh & 1 draw call. BatchedMeshDraw allows custom UV offsets per copy, hence why you see some boxes with different textures. Neat!

Steam Deck Support

FPS Infinite, powered by Focus Engine, running on the Steam Deck! Should work out-of-the-box when publishing Linux executables.

What is worse in this fork?

Android/mobile support, different languages, and Universal Windows Platform support. I also work very little with DirectX, which is maintained just for the editor. Some changes I make to improve Vulkan might cause a (hopefully minor) bug in the DirectX API, which will be of low priority to fix. GPU instancing isn't implemented on Vulkan yet (although you may find the ModelBatcher & BatchedMeshDraw covers this in most cases).

Documentation is worse in this fork, as I don't have time to go back and properly document the new features I add. The list above isn't updated often enough to showcase the latest improvements. I try to comment new additions, but would require looking at the source to see them. Stride documentation is mostly still applicable, but there may be better ways to do things in this fork (VR for example).

Community support doesn't exist for this fork. The community usually revolves around the original Stride.

You can now export games and projects targeting .NET 6 & Visual Studio 2022 is now supported. However, GameStudio (the editor) is still running on .NET Framework 4.8 (not a big deal, in my humble opinion).

Creating templates with this fork is semi broken (you'll get an error, but it still gets created). Just browse for it next time you open Focus. There is an issue for it on the issues tab.

Why don't you merge all these improvements back into Stride?

The Stride team doesn't really want most of my work, or they don't think these improvements are necessary. I've made decisions without their input to save time, so taking my work now would take significant review and likely significant rewrites to adhere to their opinions and standards. I stand by my code and its quality (otherwise I wouldn't trust making commercial games with it), but the Stride team would rather do it their way (if and when they ever get to it). Sometimes, some improvements do make it into Stride in some form, like the Fog and Outline post processing filters. Recently, I kickstarted bringing OpenXR support into Stride (but not all of my VR improvements), and they seem to be getting it to work with DirectX. Fully merging would take much more work than us "spare time devs" have. If you want to use my improvements, I only can recommend using (and building off of) my fork.

License

Focus is covered by MIT, unless stated otherwise (i.e. for some files that are copied from other projects).

You can find the list of third party projects here.

Documentation

Find explanations and information about Xenko:

Community

Ask for help or report issues:

Building from source

Prerequisites

  1. Git (recent version that includes LFS, or install Git LFS separately).
  2. Visual Studio 2022 (Use v17.2 LTS, MSBuild broken with v17.3+) with the following workloads:
  1. FBX SDK 2019.0 VS2015

Build & Use Focus

  1. Clone Focus: git clone https://github.com/phr00t/FocusEngine.git
  2. Run <FocusDir>\build\Xenko.PCPlatforms.bat, which starts Visual Studio.
  3. Select building for "Release" for the best performance and compatibility.
  4. After building, find the GameStudio executable and run it (probably <FocusDir>\sources\editor\Xenko.GameStudio\bin\Release\net48).
  5. Some templates are outdated, especially the VR one... an empty game is your best bet.
  6. Use Focus Engine's GameStudio alongside Visual Studio for building the project (you can open projects from GameStudio into Visual Studio with a toolbar icon at the top)
  7. If using Bepu physics, make sure to add a reference to BepuPhysics.dll in <FocusDir>\deps\bepuphysics2