Replies: 10 comments 12 replies
-
|
Totally agree. This has been on my backlog since the editor first landed. The core runtime (rendering, physics, collision, input) is already independent of game logic, which is initialized via a GameScene and importing UntoldEngine. The gap is that editor code is still interleaved with macOS specifics, which forces #if os(macOS) fences across the codebase. I plan to extract all editor/UI and macOS-only services into a separate UntoldEditorKit module (macOS-only) and keep the core (runtime) platform-agnostic. Targets like iOS/tvOS/watchOS will build only the runtime; macOS will build the runtime + editor. Goal is to eliminate #if os(macOS) from the core, simplify the build matrix, and make tvOS/watchOS deploys purely “playback” (rendering + game logic) with zero editor baggage. |
Beta Was this translation helpful? Give feedback.
-
Plan of ActionI’ve created a new branch in our fork: While moving the code and working to make the editor compile again, I also reviewed the globals and functions (most of which are global functions). At this point, the branch compiles, but I think some cleanup is needed. I plan to:
Immediate FocusMy first goal is to establish a clear solution for adding a SwiftUI view capable of rendering graphics. This render layer should be compatible across all Apple OSes. I’ll expand the Next Steps
Long-Term VisionThe idea is to enable independent work across several layers of the engine. To support this, I’m building a SwiftUI demo with the first layer, ensuring it runs seamlessly on every Apple OS. |
Beta Was this translation helpful? Give feedback.
-
Editor Package Separation from Engine - Initial Implementation PlanOverviewI will implement the first phase of separating the Untold Engine editor from the core engine library. The goal is to create a clean separation between editor-specific functionality and the game runtime, allowing for smaller binary sizes and platform-specific optimizations. Approach: Mirror and ExtendThe current approach will use a "copy-and-extend" pattern where editor-specific code will be moved to a new Key Changes1. Editor UI MigrationAll SwiftUI views will be moved from the engine to the editor package:
2. System SeparationEditor-specific systems will reside in the editor package:
3. Platform-Aware CompilationThe engine will use conditional compilation to support multiple platforms:
4. Rendering Pipeline SplitWe will create separate render graphs:
Rationale for This Approach1. Maintaining Structure ParityBy keeping the same folder structure between engine and editor, we will ensure:
2. Fast Initial SplitThis copy-first approach will allow us to:
3. Platform Benefits
Implementation DetailsBuild Configuration
Code Organization// Engine side (platform-agnostic)
public var gameMode: Bool = {
#if os(iOS)
return true
#else
return false
#endif
}()
// Editor side (macOS only)
#if os(macOS)
extension UntoldEngine {
// Editor-specific functionality
}
#endifTemporary SolutionsSeveral aspects will be temporary in this initial implementation:
Expected OutcomeThe editor will compile and run as a separate macOS executable, while the core engine will be usable independently for games on both platforms. The separation will be functional but intentionally kept simple for this first iteration. Benefits
Next StepsThis will be explicitly a temporary solution designed for speed of implementation. Future improvements will include:
What do you think? |
Beta Was this translation helpful? Give feedback.
-
|
Another question, I already did the split of the editor on my branch, but even though it's compiling and running (well kind of running because I had to comment some things out, I found that the I moved all the related editor stuff to the new target, but |
Beta Was this translation helpful? Give feedback.
-
|
This PR is becoming complex. I tried to minimize the changes to have a working commit, but moving from several global variables to a more component approach and extensibility required a lot of changes. Also, I had to implement singleton patterns in the LoadingSystem and InputSystem to be able to be customizable for the project, game, or the editor and still have a point of access to all global functions, which still requires access to those systems. I think this PR will be ready tomorrow as I already have the editor working like a standalone project. I still need to figure out some input bugs. |
Beta Was this translation helpful? Give feedback.
-
|
One question, after the split, I don't fully understand why you have 2 cameras, the scene camera and the game camera? What is the purpose of that? I'm learning how the code is structured as I'm doing the splitting but as far as I understand, in the editor, we need just the editor camera ( is the scene camera? ), and when we play, switch to any active game camera, but why are both created in the UntoldRenderer init? |
Beta Was this translation helpful? Give feedback.
-
|
The new Editor standalone package will need an app icon. :) I will try to put one of the designers on top of that. Any preference about the style or design? |
Beta Was this translation helpful? Give feedback.
-
|
Good news here! I already finalized a branch that I have fully working (as the develop brach is working) the editor. Still, I don't want to commit because I took at the beginning some considerations that I don't like how I did at the beginning, so I will rewrite it in more simple ways. I will push the PR tomorrow morning so you can review. |
Beta Was this translation helpful? Give feedback.
-
|
Well, well — the first version of the editor package is done! 🎉 I’ve pushed the PR. There’s still work to do on several redesigns (like the input systems and so on), but for now everything runs as it does on the develop branch. I made some design decisions that we might revisit in the future, but at least we now have a stable foundation to keep building features and improving the editor. This also makes it easier to expand runtime/game functionality. One thing I still need to address is the plug-in system. It’s not working at the moment — I had to comment it out in the demo app because the editor is now a separate entity from the core. To support it, I’ll need to create an editor plugin extension, but I need more time to figure out the best approach. |
Beta Was this translation helpful? Give feedback.
-
|
@untoldengine Now that the editor has his own repo, I think we should put all related things, ideas, discussions, etc., in that repo, but I didn't see any discussion tab there, or do you want to keep all the discussions in the engine repo? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Background & Problem
While working to make Untold Engine compatible across all Apple platforms, I’ve run into a recurring issue: much of the editor functionality is tightly coupled with macOS-specific code. To prevent errors, I’ve been forced to rely heavily on
#ifdefdirectives, essentially excluding editor-related code on platforms where it doesn’t make sense (tvOS, watchOS).This creates unnecessary complexity and reduces portability. For example, deploying to Apple TV or Apple Watch should focus solely on running the game (rendering and game logic), not on editor functionality that will never be usable on those platforms.
Proposal: Separation of Concerns
I propose splitting the engine into distinct layers of functionality:
1. Render Layer
2. Game Layer
3. Editor Layer
This separation allows each compiled target to include only the necessary code, reducing complexity and build size, while maximizing platform relevance.
Benefits
#ifdefmacros for excluding editor-only code.Implementation Approach
Future Possibilities
Architecture Diagram
Platform Support Matrix
The following chart shows which layers of the Untold Engine are relevant to each Apple platform:
Summary
By splitting Untold Engine into Render (library), Game (library), and Editor (standalone application), we gain portability, cleaner code, and flexibility across all Apple platforms.
This modular approach ensures that each platform only carries the functionality it needs—making the engine lighter, more efficient, and more scalable into the future.
Beta Was this translation helpful? Give feedback.
All reactions