Josh Posted October 1, 2023 Share Posted October 1, 2023 The example you posted works without incident. 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted October 7, 2023 Author Share Posted October 7, 2023 On 10/1/2023 at 5:19 PM, Josh said: The example you posted works without incident. This example causes my issue. #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world auto world = CreateWorld(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Load scene auto scene = LoadMap(world, "Maps/savetest2.ultra"); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyHit(KEY_F5)) { //Save the starting scene to a file scene->Save("game.sav"); } //Reload the starting scene when space key is pressed if (window->KeyHit(KEY_F6)) { scene->Reload("game.sav"); } world->Update(); world->Render(framebuffer); } return 0; } savetest2.zip Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted October 8, 2023 Share Posted October 8, 2023 I don't see anything wrong. I ran the program, pressed F5, then pressed F6. Nothing bad happened. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted October 8, 2023 Author Share Posted October 8, 2023 1 hour ago, Josh said: I don't see anything wrong. I ran the program, pressed F5, then pressed F6. Nothing bad happened. If I had a dollar for every time I forgot to register my components, I would have enough money to quit my job to play with Ultra Engine all day. You're correct, that example alone does not do anything (Minus make the ground darker for some reason). Registering the component that's used in the map should cause the crash. #include "UltraEngine.h" using namespace UltraEngine; #include "Components/Player/CameraControls.hpp" int main(int argc, const char* argv[]) { RegisterComponent<CameraControls>(); //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world auto world = CreateWorld(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Load scene auto scene = LoadMap(world, "Maps/savetest2.ultra"); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyHit(KEY_F5)) { //Save the starting scene to a file scene->Save("game.sav"); } //Reload the starting scene when space key is pressed if (window->KeyHit(KEY_F6)) { scene->Reload("game.sav"); } world->Update(); world->Render(framebuffer); } return 0; } 1 Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Solution Josh Posted October 8, 2023 Solution Share Posted October 8, 2023 Okay, it was a simple fix. I also notice the green block gets a little darker upon reload, but I don't know why yet. 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted October 8, 2023 Share Posted October 8, 2023 Oh, okay it just looks like the ambient light is not being saved in the game save. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted October 8, 2023 Author Share Posted October 8, 2023 9 minutes ago, Josh said: Oh, okay it just looks like the ambient light is not being saved in the game save. As I mentioned here, a lot of scene properties don't get saved from the editor. Not sure if this carries over to user saves. But can't wait to try this. I've been very conservative about making components because I couldn't test reloading them. Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted October 8, 2023 Share Posted October 8, 2023 I'm not sure what it is, but its not the ambient light setting actually. I am going to lock this thread now. If something else comes up please tell me. 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts