-
Notifications
You must be signed in to change notification settings - Fork 4
Description
In TheAtlasEngine, this is going to be comprised of other sub-issues. These sub-issues are going to be different parts of a much larger task.
Level streaming is going to be working towards looking into designing and developing our scene management system. Proposing ways of developing multiple scene context switching.
Proposal Details
The way this would work is by having a single constructed instance during the application's initialization.
Responsibilities involve:
atlas::world's are single instances that act as container of user-editable scenes variations.atlas::scenewill be context communicated. Which means relying on specific pieces of metadata to determine what is the currently activated scenes to other core systems (renderer, physics, audio, etc).- Edge cases for Scene: If no scene is provided or exists, level streamer will create a default scene that will be contained in
atlas::world... potentially noted as the top prioritized activated scene. - Idea: Potentially having a prioritized scene to select which scenes to preload in a specific order or to select the order of scenes to handle.
- Game code will most likely be distributed from the scenes. Then only execute the game logic corresponding to that scene (partitioning) that will be based on the current
Design Consideration
I am considering to have differences between runtime and editor instances. This differentiation is because to differentiate between resource requirements. editor_world would take in parameters that allows you to do specialized operations. Such as performing rendering operations.
Editor World
editor_world would provide exposure to the editor to perform rendering operations if need-be, such as UI-editor specific rendering capabilities that may need to cross-communicate from user-space to internally to the core-system.
These can also be used to provide configuration, layout, and potentially feature extensions that can be communicated from the editor as well.
Runtime World
In the runtime world, this would mainly be useful for packaging your game to users. Meaning if you wanted to package your game and ship for users to play.
Does not do anything special nor would it require any special resources that the editor may need. As it is not being used at all since we are in runtime.
More on Level Streamer
Level streamer is a single instance that is provided internally from TheAtlasEngine.
It is because this is a single-instance manager. It will by default only create a single instance.
The application would be given a particular resource. One of them is the level streamer instance.
Code Usage Example
An application could accept the level streamer to be passed as shown in this code snippet:
// setting the level streamer to be operated
// users do not touch this class.. EVER!
class editor_application : public atlas::application {
public:
editor_application(const string_view p_name, atlas::level_streamer& p_streamer, atlas::resource& p_resource) : atlas::application(p_name, p_streamer, p_resource) {
// probably do some operation or set to some default state.
// either load a project
p_streamer.load("project.yml");
// OR load a new project or create default state
p_streamer.default_world_state(/* default world state */);
}
};atlas::editor_world
class editor_world : public editor::world {
public:
editor_world(std::string_view p_name) : editor::world(p_name) {}
};
class level_scene : public atlas::scene {
public:
level_scene(std::string_view p_name) : atlas::scene(p_name) {
atlas::register_start(this, &level_scene::preload);
atlas::register_update(this, &level_scene::on_update);
atlas::register_deferred(this, &level_scene::late_update);
atlas::register_ui(this, &level_scene::ui_update);
}
void on_update() {
// execute general framerate
}
void late_update() {
// execute after all update sequences happen
}
void ui_update() {
// execute during late_update sequence
}
void preload() {
// executes at preload application sequence
// OR executes at reload scene sequences.
}
};