Swift with Unreal Engine, using Swift programming language for UE5/Game Development

Hello all!

I have been focusing my efforts lately on bringing many of the widely adopted computer graphics libraries to the Swift programming language, all made possible with Swift 5.9’s C/C++ Interop Feature, which allows a great variety of C++ APIs to be called directly from Swift, and select Swift APIs can be used from C++, along with the ability to remove CMake entirely, vastly reducing the development overhead of maintaining often hundreds of thousands of lines of CMake code in existing C/C++ projects by authoring a single Swift Package Manager (SPM) manifest file, called Package.swift, which defines the package’s name, its source code, and resource contents and is created at the root (top level directory) of the Swift, and/or C/C++ project repository.

So far, by using this approach I have been able to successfully build 30 foundational C/C++ computer graphics libraries within a single monolithic swift package which encapsulates much of the Academy Software Foundation (ASWF) Software Landscape, allowing the C/C++ APIs of all these libraries to be called directly from Swift, in addition to also allowing this swift package to be used as a single package dependency to build other Swift, C, and C++ projects. See MetaverseKit to learn more and use it in your existing project.

In addition to MetaverseKit, I have been able to bring Pixar’s Universal Scene Description (USD), a widely adopted (C++ and Python) computer graphics library, to use directly in Swift as well, with SwiftUSD.

Which leads me to the conclusionary topic of discussion:

Is there any developer interest in using the Swift programming language for video game development, and the potential for writing Swift code either as a replacement for or in addition to existing Unreal Engine games written in C/C++?

In addition to building games in Swift with Unreal Engine, I could additionally get the Unreal Engine application itself to build and run cross-platform (Linux, Microsoft Windows, macOS) through a single terminal command:

$ swift run UnrealEngine

I am curious to all of your thoughts in an open discussion, thanks!

2 Likes

Hello!

Basically I am a iOS/Swift Developer with Unity/C# experience and I would love to try Unreal Engine but the thing with C++ is holding me back. I’ve worked with C++ already in the past but in comparison with any modern language, C++ is really old and unfriendly. If there would be any possibility to enable Swift in Unreal Engine, that would be a game changer for me.

1 Like

That would be cool. Even cooler would be if Unreal Engine could integrate directly into SwiftUI, so there could be a ‘view’ that UE renders into, but interops with the rest of SwiftUI.

1 Like

I’m very interest in this!

But looking at the GitHub site, there are not any examples on how to use this much less where this stands (alpha, beta, release?). I’m loathe to spend time on something that may end up as abandonware.

I’m also very concerned that this appears to be a one-person project and that changes in UE may require waiting for updates in the MetaverseKit. While this may be fine for one-person shops, it introduces an element of risk.

Lastly, how does this work for moving games to PS5 or Xbox? I see that iOS is supported, but that can be seriously limiting.