-
Posts
516 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Dreikblack
-
I'm not sure if it would be same for new objects with same component but in this case i made a prefab and copied it couple times In Load() i assign a pointer if it was not yet, but it is with first pointer in next component instances. I think something was changed in Ultra not too long time ago because i noticed this issue only recently in my game Expected: 3 assigns in 3 objects and 3 different values in result check in main. But have atm 1 assign due issue above and as result getting same value from same pointer: Example with prefab, map, main and component CompLoad&PointerIssue.zip
-
1. Load prefab like that: 2. Editor keep thinking map is still opened and prefab will rewrite map. If no map was opened Editor will try to save it as a map
- 1 reply
-
- 1
-
Replace AirTile.cpp content with: #include "UltraEngine.h" #include "AirTile.h" #include "GroundTile.h" #include "../../Game/GameEditor.h" #include "../../Game/Game.h" AirTile::AirTile() { name = TILE_AIR; walkable = false; } void AirTile::Start() { Tile::Start(); auto entity = GetEntity(); if (!entity) { return; } entity->AddTag(TILE_AIR); return; } void AirTile::initPosition() { tileHeight = TILE_LENGTH; Tile::initPosition(); } void AirTile::updateVisibility(shared_ptr<Unit> movedUnit) { return; } bool AirTile::isVisible() { return true;// fogBox->GetHidden(); } void AirTile::Update() { } shared_ptr<Component> AirTile::Copy() { return std::make_shared<AirTile>(*this); } Almost no difference for performance for me
-
Half of vr related code lines are not even from Ultra API I don't have VR device to test examples but here some tips: https://www.ultraengine.com/learn/Hmd?lang=lua - VR display, you can set position and rotation with: local position = Vec3(0, 0, 0) local rotation = Vec3(0, 0, 0) hmd:SetOffset(position, rotation) Controllers can be got from display, their api https://www.ultraengine.com/learn/VrController?lang=lua local leftController = hmd.controllers[0] local rightController = hmd.controllers[1] local forward = leftController:GetAxis(VRAXIS_TOUCHPAD)
-
Thats what Canardia uses, but i was not sure if it's fine to use for not profiling purposes but i see it is now. His code: // Stopwatch.h #pragma once class Stopwatch { public: LARGE_INTEGER StartTime, Frequency, StopTime, ElapsedTime; Stopwatch(); void Start(); double Elapsed(); }; // Stopwatch.cpp #include "UltraEngine.h" #include "Stopwatch.h" Stopwatch::Stopwatch() { QueryPerformanceFrequency(&Frequency); } void Stopwatch::Start() { QueryPerformanceCounter(&StartTime); } double Stopwatch::Elapsed() { QueryPerformanceCounter(&StopTime); ElapsedTime.QuadPart = StopTime.QuadPart - StartTime.QuadPart; return (double)(ElapsedTime.QuadPart) / (Frequency.QuadPart); }
-
Frame-Independent calculation (in Leadwerks called "Time:GetSpeed()")
Dreikblack replied to beo6's topic in Suggestion Box
In debug it's not 16,667 and varies significantly, at least in specific component. Maybe i should get delta between world->updates since entity movement will happen at render i suppose. Anyway if fps is lower 60 due performance reasons updates are definitely happens more rare than 60 hz. -
Frame-Independent calculation (in Leadwerks called "Time:GetSpeed()")
Dreikblack replied to beo6's topic in Suggestion Box
We need something like Microseconds() to measure a difference between Updates() in Component for applying a coefficient to camera speed and other stuff -
Added HUD toggle to see if visible GUI affects performance - barely any difference (F11 key be default). Did test with RTX 2070: 150-160 in menu and at Easy map on both builds. 700 fps at TestLevel with disabled z-sorting and 650 on prev build with enabled z-sorting
-
btw 2500 fps on TestLevel now and 2200 on same map on prev build before z-sorting update. 1000 fps on Easy map which basically is just bigger. Also main menu have only ~1000 fps. Take in mind maps are made with many cube brushes for every tile. Maybe it's not optimal but i started a project before Ultra got an Editor
-
Yep. This is how it looked before: I guess just in general. At most heavy map where fps drops almost by half it happens if few dynamic lights on screen. On RTX 2070 is low on any map tho. 900 here: ~500 here: This map loads with New Game button. Make sure you have latest version from "master" branch. Not sure why localization was not working for you tho. It should work fine if you have "English.local" at "Quake Tactics\Resources\Localization" and .exe in Quake Tactics folder
-
Well, thats what i have FPS in my case seems to be same as before this update so bottleneck is not z-sorting i suppose
-
In compare with stable version? Hard to say, seems close. In general? Way lower than it was after switch to OpenGL and it was already worse than Vulkan in most case for Nvidia cards. Except Instanced Geometry, this benchmark have similar result now and it was better for OpenGL as well. On PC with RTX 2070 in my game fps used to be 250-300 few months ago in 1080p and now it's 150 (on simple map). Maybe because map was smaller. Even in menu it's barely 170 and it's just few brushes, 1 model with Mover for rotation and point light on this model. On proper demo map barely 100 fps. Found 22th Jule build - 190-200 fps, 170 fps on latest build on same map. And i used to play Quake Champions (which is often being criticized for poor performance by players) on this PC on Ultra settings and was getting 141 fps with a fps lock in 1080p. On PC with 4080 in compare with games with proper performance my game is barely runs better meanwhile graphic is 10x worse since i use low res assets from Quake rerelase and i did not start using particles and decals yet. Can't do proper compare to Quake Champions since it's have max fps lock 300 fps atm. GUI was always weak spot for performance in Ultra. For example FPS drop from 6800 to 2000 after gui init: #include "UltraEngine.h" using namespace UltraEngine; shared_ptr<Window> window; shared_ptr<Framebuffer> framebuffer; shared_ptr<World> menuWold; shared_ptr<Interface> ui; shared_ptr<Camera> uiCamera; shared_ptr<Widget> panel; shared_ptr<Icon> icon1; void initGui() { auto default_font = LoadFont("Fonts\\arial.ttf"); ui = CreateInterface(menuWold, default_font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f); uiCamera = CreateCamera(menuWold, PROJECTION_ORTHOGRAPHIC); uiCamera->SetPosition((float)framebuffer->GetSize().x * 0.5f, (float)framebuffer->GetSize().y * 0.5f, 0); uiCamera->SetRenderLayers(2); uiCamera->SetClearMode(CLEAR_DEPTH); icon1 = LoadIcon("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Icons/help.svg"); for (int i = 1; i < 12; i++) { for (int j = 0; j < 20; j++) { auto panelI = CreatePanel(64 * j + 70, 64 * i + 70, 64, 64, ui->root, PANEL_DEFAULT); panelI->SetIcon(icon1); } } } int main(int argc, const char* argv[]) { auto displays = GetDisplays(); window = CreateWindow("Ultra Engine", 0, 0, 1600, 900, displays[0], WINDOW_DEFAULT); menuWold = CreateWorld(); menuWold->RecordStats(); framebuffer = CreateFramebuffer(window); auto light = CreateBoxLight(menuWold); light->SetRange(-10, 10); light->SetRotation(15, 15, 0); light->SetColor(2); auto camera = CreateCamera(menuWold); camera->SetClearColor(0.125); camera->SetPosition(0, 0, -3); camera->SetFov(70); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyHit(KEY_SPACE)) { if (!ui) initGui(); } window->SetText("FPS: " + String(menuWold->renderstats.framerate)); menuWold->Update(); menuWold->Render(framebuffer, false); } return 0; }
-
Loading seems taking too long with this issue, like few mins and more with any big maps. Yes, that's it! Can't believe i did not try to remove it before knowing that update with GetMemoryUsage() changes caused this issue After removing it fps became normal for debug.
-
Tried in lua and c++ projects with standard map and main.cpp/lua. Both synced. If i remove particle from map - no crash
-
LoadMap does not load saved in program code map and even remove light
Dreikblack replied to Dreikblack's topic in Bug Reports
Reload does not restore deleted entities and don't delete that were added after a save. All those entities in same reloaded scene -
LoadMap does not load saved in program code map and even remove light
Dreikblack replied to Dreikblack's topic in Bug Reports
By saving nothing? If i change boxes to brushes, they fall through ground brush but now being saved, but lightning is broken after load. Before load: After load #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto displays = GetDisplays(); auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); auto world = CreateWorld(); auto framebuffer = CreateFramebuffer(window); auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetPosition(0, 15, -8); camera->SetRotation(70, 0, 0); auto light = CreateBoxLight(world); light->SetRange(-10, 10); light->SetArea(30, 30); light->SetRotation(45, 45, 0); light->SetColor(2); //Create the ground auto ground = CreateBoxBrush(world, 30, 1, 30); ground->SetPosition(0, -0.5, 0); ground->SetColor(0, 1, 0); //Create a scene auto scene = CreateMap(); scene->AddEntity(ground); scene->AddEntity(light); //ground = NULL; light = NULL; //Add some boxes for (int n = 0; n < 5; ++n) { auto box = CreateBoxBrush(world, 0.5, 0.5, 0.5); box->SetColor(0, 0, 1); box->SetPosition(Random(-10, 10), Random(1, 5), Random(-10, 10)); //box->SetMass(1); scene->AddEntity(box); } WString filePath = GetPath(PATH_DESKTOP) + "/game.sav"; //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyHit(KEY_A)) { auto box = CreateBoxBrush(world, 0.5, 0.5, 0.5); box->SetColor(1, 0, 1); // box->SetMass(1); box->SetPosition(Random(-10, 10), Random(1, 2), Random(-10, 10)); scene->AddEntity(box); } if (window->KeyHit(KEY_D)) { for (auto box : scene->entities) { if (box->As<Brush>() && box != ground) { scene->RemoveEntity(box); break; } } } if (window->KeyHit(KEY_S)) { //Save the scene to a file scene->Save(filePath); } if (window->KeyHit(KEY_R)) { //Save the scene to a file if (scene->Reload(filePath)) { Print("Reloaded"); } } //Load the scene when space key is pressed if (window->KeyHit(KEY_SPACE)) { scene = LoadMap(world, filePath); } world->Update(); world->Render(framebuffer); } return 0; } -
Widget's icon can't change a color in real time
Dreikblack replied to Dreikblack's topic in Bug Reports
Can't say it's rare since color often shows current state of buttons or status of icons in games -
Updated drivers on PC with RTX 2070 - issue is there
-
Widget's icon can't change a color in real time
Dreikblack replied to Dreikblack's topic in Bug Reports
Found work around with panel->SetIcon(nullptr); -
#include "UltraEngine.h" using namespace UltraEngine; shared_ptr<Window> window; shared_ptr<Framebuffer> framebuffer; shared_ptr<World> menuWold; shared_ptr<Interface> ui; shared_ptr<Camera> uiCamera; shared_ptr<Widget> panel; shared_ptr<Icon> icon; bool isFirst = true; void initGui() { auto default_font = LoadFont("Fonts\\arial.ttf"); ui = CreateInterface(menuWold, default_font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f); uiCamera = CreateCamera(menuWold, PROJECTION_ORTHOGRAPHIC); uiCamera->SetPosition((float)framebuffer->GetSize().x * 0.5f, (float)framebuffer->GetSize().y * 0.5f, 0); uiCamera->SetRenderLayers(2); uiCamera->SetClearMode(CLEAR_DEPTH); panel = CreatePanel(10, 50, 64, 64, ui->root, PANEL_DEFAULT); icon = LoadIcon("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Icons/help.svg"); icon->SetColor(0.5, 0.5, 1.0); panel->SetIcon(icon); panel->Redraw(); } int main(int argc, const char* argv[]) { auto displays = GetDisplays(); window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_DEFAULT); menuWold = CreateWorld(); menuWold->RecordStats(); framebuffer = CreateFramebuffer(window); auto light = CreateBoxLight(menuWold); auto camera = CreateCamera(menuWold); camera->SetClearColor(0.125); initGui(); while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyHit(KEY_SPACE)) { isFirst = !isFirst; if (isFirst) { panel->icon->SetColor(0.5, 0.5, 0.5); panel->SetIcon(panel->icon); panel->Redraw(); } else { panel->icon->SetColor(1.0, 1.0, 0.5); panel->SetIcon(panel->icon); panel->Redraw(); } } menuWold->Update(); menuWold->Render(framebuffer); } return 0; }
-
In game performance in release seems to better as well but still lower than used to be at in biggest map
-
Press space to show panel with icon #include "UltraEngine.h" using namespace UltraEngine; shared_ptr<Window> window; shared_ptr<Framebuffer> framebuffer; shared_ptr<World> menuWold; shared_ptr<Interface> ui; shared_ptr<Camera> uiCamera; shared_ptr<Widget> panel; shared_ptr<Icon> icon1; shared_ptr<Icon> icon2; bool isFirst = true; void initGui() { auto default_font = LoadFont("Fonts\\arial.ttf"); ui = CreateInterface(menuWold, default_font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f); uiCamera = CreateCamera(menuWold, PROJECTION_ORTHOGRAPHIC); uiCamera->SetPosition((float)framebuffer->GetSize().x * 0.5f, (float)framebuffer->GetSize().y * 0.5f, 0); uiCamera->SetRenderLayers(2); uiCamera->SetClearMode(CLEAR_DEPTH); panel = CreatePanel(10, 50, 64, 64, ui->root, PANEL_DEFAULT); icon1 = LoadIcon("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Icons/help.svg"); icon2 = LoadIcon("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Icons/new.svg"); } int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_DEFAULT); //Create a world menuWold = CreateWorld(); menuWold->RecordStats(); //Create a framebuffer framebuffer = CreateFramebuffer(window); //Create light auto light = CreateBoxLight(menuWold); light->SetRange(-10, 10); light->SetRotation(15, 15, 0); light->SetColor(2); //Create camera auto camera = CreateCamera(menuWold); camera->SetClearColor(0.125); camera->SetPosition(0, 0, -3); camera->SetFov(70); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyHit(KEY_SPACE)) { if (!ui) initGui(); isFirst = !isFirst; if (isFirst) { panel->SetIcon(icon1); } else { panel->SetIcon(icon2); } } window->SetText("FPS: " + String(menuWold->renderstats.framerate)); menuWold->Update(); menuWold->Render(framebuffer, false); } return 0; }
-
Component text fields do not save pasted text in the Editor
Dreikblack posted a topic in Bug Reports
If i paste a text with Ctrl-V text is not saved in a field. Had to type something to make it save