Jump to content

reepblue

Developers
  • Posts

    2,490
  • Joined

  • Last visited

Everything posted by reepblue

  1. Oh, so it's just a more efficient LoadMap so I can use this for any save files for any map at any time? You can get my seek error with this code and the map below. It has something to do with loading editor made maps. 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); auto scene = LoadMap(world, "Maps/savetest.ultra"); ////Create a camera //auto camera = CreateCamera(world); //camera->SetClearColor(0.125); //camera->SetPosition(0, 1, -4); //camera->AddComponent<Player>(); ////Create light //auto light = CreateBoxLight(world); //light->SetRange(-10, 10); //light->SetArea(15, 15); //light->SetRotation(45, 35, 0); //light->SetColor(2); ////Create the ground //auto ground = CreateBox(world, 10, 1, 10); //ground->SetPosition(0, -0.5, 0); //ground->SetColor(0, 1, 0); ////Create a scene //auto scene = CreateMap(); //scene->entities.push_back(ground); //scene->entities.push_back(light); //ground = NULL; //light = NULL; ////Add some boxes //for (int n = 0; n < 10; ++n) //{ // auto box = CreateBox(world); // box->SetColor(0, 0, 1); // box->SetPosition(Random(-5, 5), Random(5, 10), Random(-5, 5)); // box->SetMass(1); // scene->entities.push_back(box); //} //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; } savetest.zip
  2. I got this error when using Map::Reload(). My map has a component for the player. This map has two components in it. When using Map::LoadMap on the sav file, it works fine minus me forgetting to save a few values. It looks like I'll need to do work on my end. I'm not 100% sure what Reload would do if the map is completely different. It seems safer to load the save file as a new map and trick the rest of my system to think you're playing the actual map file.
  3. Looks good. I'll reimplement my quick save/load feature soon and I'll try this with components.
  4. Why don't you take a copy out of Valve's book and just make a map a package (zip) file. It might sound like the stupidest idea ever but hear me out: You can keep your bin/json setup. You can store baked cubemap files in there. People can put in custom assets exclusive for that map. I love the fact that map files are raw text. It makes it 100% easier to debug and find issues but we need binary and information available too.
  5. Same issue today. This time both Debug and Release are throwing the "library is corrupt" error.
  6. Ok, I guess I'll wait until this is all squared and synced between editor and library. I'm not doing any production work when it comes to maps. As long as I can add components to entities I'll be happy for the time being.
  7. It was, but I recall making it 200, and then making it 400 again before closing the application. Maybe I re-triggered something? Had the editor regenerate the settings file and it works as intended.
  8. This seems to be working since the last update a few minutes ago. Not sure if it's a hiccup or you quietly patched this. Hopefully this doesn't happen again.
  9. You're the best! hopefully It'll stay working.
  10. Both faces report a scale of 1.0 but textures on new brushes after today's update are twice as big. In the non-updated game, it's normal sized. The below attached are my dev textures. Developer.zip
  11. While this works as it did before, the other issue I've mentioned still is present. If a component does not have any modifiable properties, it can be attached but doesn't get saved. Please make a json script with the contents below, add it to an entity, save the map and reload it. { "component": { "properties": [ ] } }
  12. Make sure all those options actually work! I recall the grid on brushes not being able to be turned off.
  13. While I understand the decision to not have a selection tool, there is one use case that I've in countered not having one. In one of my maps, I've created a ton of boxes. Now, in order to move all of these boxes, I would need to select each box one by one to ensure I only get the physics boxes and not the ground scene. Mass selecting via the scene tree isn't always a guarantee that I'll select the things I want. Especially if everything is called "Box 1" as shown below. I have very often used the "Drag to Select" feature to move large chunks of my map around which is not as easy as it was done in the Leadwerks editor. I would say allowing grouping of objects or making this into a prefab would be the solution, but if the end user didn't think 3 steps ahead, they are screwed and have to re-add all their objects again. This is just food for thought and I'm interested in what you think about this issue. But overall, my brain just wants to make a box around it to select all the boxes in the air.
  14. Over the weekend, I ran into an issue when trying to attach a few of my components. I recalled if there wasn't any modifiable value listed in the json file, the component wouldn't be saved into the map. I was trying to reproduce this tonight, but I now see that none of my components are being saved. As of writing, I'm thinking that this was disabled so you can figure out how Lua components should integrate with the editor. If so, take this post as a PSA that components are no longer attachable in editor. Hopefully this will be back in by this weekend.) I should be able to attach a file as long as a json file for that component exists. Right now, you need to have the following information. { "component": { "properties": [ ] } }
  15. I recall suggesting things like Vec3().Forward()/Up() after I was trying to apply a concept done in Unity to Leadwerks.
  16. The map seems to be saving the real path of the material instead of a relative path. "material": { "path": "D:/Projects/UltraGame/Materials/Developer/measuregrid.mat" }, I caught this because I thought this was due to a line ending issue with my git but it seems to be this.
  17. This might be related. I just set up a machine today for testing and I can confirm that when Ultra Engine on release will crash when creating the framebuffer. In debug mode, the project works fine but we have artificing. The Vulkan SDK isn't really helpful. No popups or anything (Ignore the material loading messages, this is an issue I've discovered with my git server. 🤪) Loading plugin "Plugins/Basis.dll" Loading plugin "Plugins/FITextureLoader.dll" Loading plugin "Plugins/ISPCTexComp.dll" Loading plugin "Plugins/KTX2TextureLoader.dll" Warning: Failed to load controller bindings. Target Display: 2560, 1080 at scale 1 Loading shader family "Shaders/PBR.fam" Loading pixmap "UI/Splash/abstractblue.dds" Loading pixmap "UI/Splash/logos.dds" Loading font "Fonts/arial.ttf" Loading icon "UI/Icons/ultraengine.svg" Loading pixmap "UI/Loading Screens/loadingscreen_default.dds" Loading pixmap "UI/Loading Screens/loadingicon_default.dds" Running script "Scripts/System/ComponentSystem.lua" Loading shader family "Shaders/Sky.fam" Loading shader family "Shaders/unlit.fam" Loading shader family "Shaders/WidgetBlock.fam" Loading posteffect "Shaders/Refraction.fx" Loading shader module "Shaders/BlurX.frag.spv" Loading shader module "Shaders/BlurY.frag.spv" UNASSIGNED-CreateInstance-status-message(INFO / SPEC): msgNum: -2016116905 - Validation Information: [ UNASSIGNED-CreateInstance-status-message ] Object 0: handle = 0x19ea012f5b0, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0x87d47f57 | Khronos Validation Layer Active: Settings File: Found at C:\Users\reepb\AppData\Local\LunarG\vkconfig\override\vk_layer_settings.txt specified by VkConfig application override. Current Enables: None. Current Disables: None. Objects: 1 [0] 0x19ea012f5b0, type: 1, name: NULL UNASSIGNED-cache-file-error(INFO / SPEC): msgNum: -256165483 - Validation Information: [ UNASSIGNED-cache-file-error ] | MessageID = 0xf0bb3995 | Cannot open shader validation cache at C:\Users\reepb\AppData\Local\Temp/shader_validation_cache.bin for reading (it may not exist yet) Objects: 0 Loading scene "Maps/box.ultra" Loading material "D:/Projects/UltraGame/Materials/Developer/measuregrid.mat" Error: Failed to load material "D:/Projects/UltraGame/Materials/Developer/measuregrid.mat". Error: Failed to load material "D:/Projects/UltraGame/Materials/Developer/measuregrid.mat". Loading material "D:/Projects/UltraGame/Materials/Developer/defaultmeshface.mat" Error: Failed to load material "D:/Projects/UltraGame/Materials/Developer/defaultmeshface.mat". Error: Failed to load material "D:/Projects/UltraGame/Materials/Developer/defaultmeshface.mat". Loading material "D:/Projects/UltraGame/Materials/Developer/defaultmeshface.mat" Error: Failed to load material "D:/Projects/UltraGame/Materials/Developer/defaultmeshface.mat". Error: Failed to load material "D:/Projects/UltraGame/Materials/Developer/defaultmeshface.mat". Loading material "D:/Projects/UltraGame/Materials/Developer/defaultmeshface.mat" Error: Failed to load material "D:/Projects/UltraGame/Materials/Developer/defaultmeshface.mat". Error: Failed to load material "D:/Projects/UltraGame/Materials/Developer/defaultmeshface.mat". Loading material "D:/Projects/UltraGame/Materials/Developer/defaultmeshface.mat" Error: Failed to load material "D:/Projects/UltraGame/Materials/Developer/defaultmeshface.mat". Error: Failed to load material "D:/Projects/UltraGame/Materials/Developer/defaultmeshface.mat". Loading material "D:/Projects/UltraGame/Materials/Developer/defaultmeshface.mat" Error: Failed to load material "D:/Projects/UltraGame/Materials/Developer/defaultmeshface.mat". Error: Failed to load material "D:/Projects/UltraGame/Materials/Developer/defaultmeshface.mat". Debug: Scene successfully loaded. Debug: Flushed controller. Debug: Game Paused Debug: Flushed controller. Hope this helps.
  18. reepblue

    Fun with brushes

    Some WIP development textures with an FPS player in Ultra Engine,
  19. I re-arranged the source code so it's isolated from everything else in your project. It's less of a template and more of a system you drop in and call from your main.cpp file. I think I'll be shipping just this folder and the config.json file. As for the main.cpp, I think I'm just going to post an example of one in the readme. But it's not that complicated. The idea is you register your components and input controls here. You can also install a custom loading screen if you don't like the default one. #include "UltraEngine.h" #include "Game/Game.h" using namespace UltraEngine; using namespace UltraEngine::Game; // Components #include "Components/Motion/Mover.hpp" #include "Components/Player/CameraControls.hpp" static void RegisterComponents() { RegisterComponent<Mover>(); RegisterComponent<CameraControls>(); } // Define default controls. static void InstallControls(shared_ptr<GameController> controller) { if (controller == NULL) return; // Program actions controller->SetAction("Pause", BUTTON_KEY_ESCAPE); controller->SetAction("Terminate", BUTTON_KEY_END); controller->SetAction("ConsoleApp", BUTTON_KEY_F1); controller->SetAction("Fullscreen", BUTTON_KEY_F11); controller->SetAction("Screenshot", BUTTON_KEY_F2); // Camera ButtonAxis moveaxis = { BUTTON_KEY_W, BUTTON_KEY_S, BUTTON_KEY_A, BUTTON_KEY_D }; controller->SetAction("Movement", moveaxis, "InGameControls"); controller->SetAction("Sprint", BUTTON_KEY_SHIFT, "InGameControls"); controller->SetAction("Crouch", BUTTON_KEY_CONTROL, "InGameControls"); controller->SetAction("Climb", BUTTON_KEY_Q, "InGameControls"); controller->SetAction("Desent", BUTTON_KEY_E, "InGameControls"); controller->SetAction("Camera", AXIS_MOUSE, "InGameControls"); controller->SetAction("Jump", BUTTON_KEY_SPACE, "InGameControls"); // Settings controller->SetSetting("Raw Mouse", false); controller->SetSetting("Inverse Mouse", false); controller->SetSetting("Mouse Smoothing", 0.0f); controller->SetSetting("Mouse Look Speed", 1.0f); } int main(int argc, const char* argv[]) { // Register Components. RegisterComponents(); // Init the program! auto app = GetProgram(); app->commandline = ParseCommandLine(argc, argv); if (!app->Initialize()) return 1; // Load all plugins. if (!app->LoadPlugins()) { Print("Warning: Failed to successfully load all plugins!"); } // Load packages if (!app->LoadPackages()) { Print("Warning: Failed to load one or more packages."); } // Load Settings if (!app->LoadSettings()) { Print("Warning: Failed to load program settings."); } // Set the correct program app type based on the commandline. ProgramApp programtype = PROGRAMAPP_GAME; if (app->commandline[CFLAG_SETTINGSAPP] == true) { programtype = PROGRAMAPP_SETTINGS; } else if (app->commandline[CFLAG_LUASCRIPT] == true) { programtype = PROGRAMAPP_LUASCRIPT; } // Init the game controller. app->gamecontroller = CreateGameController(); InstallControls(app->gamecontroller); if (!app->LoadControllerBindings()) { Print("Warning: Failed to load controller bindings."); } // Launch the app. if (app->LaunchApp(programtype) == false) return 1; // Install the loading screen. app->stage->SetLoadingScreen<LoadingScreen>(); // Main Loop bool running = true; while (running) { while (PeekEvent()) { const auto e = WaitEvent(); if (!app->ProcessEvent(e)) { EmitEvent(EVENT_QUIT); } if (e.id == EVENT_QUIT) { if (app->Shutdown()) { if (!app->SaveSettings()) { Print("Error: Failed to save program settings."); } running = false; break; } } } app->Update(); } // Write this line before we terminate! Print("Application terminated successfully!"); return 0; }
  20. The light properties also don't seem to apply to the lights and reset upon deselecting them.
  21. While this example works, it's not working in the way needed for game saves. The reload function throws an exception when trying to read a file and you get a bufferstream overflow with the example below. Also, since Reload doesn't create anything, would I need to load the map file before the save file? If so, what's the best way to know way to know what save file goes to which map? #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); //Create a scene auto scene = LoadMap(world, "Maps/savetest.ultra"); //Save the starting scene to memory shared_ptr<BufferStream> stream = NULL; shared_ptr<BufferStream> binstream = NULL; //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyHit(KEY_F5)) { Print("SAVE"); if (stream) stream = NULL; if (binstream) binstream = NULL; stream = CreateBufferStream(); binstream = CreateBufferStream(); scene->Save(stream, binstream); } //Reload the starting scene when space key is pressed if (window->KeyHit(KEY_F6)) { if (stream and binstream) { stream->Seek(0); binstream->Seek(0); scene->Reload(stream, binstream); } } world->Update(); world->Render(framebuffer); } return 0; }
  22. I now see the updated example. I'll implement this tonight, thank you!
  23. The example needs to be updated but I think I know how it works.
×
×
  • Create New...