Jump to content

Dreikblack

Members
  • Posts

    315
  • Joined

  • Last visited

Everything posted by Dreikblack

  1. Error: Failed to load texture "progs/s_explod.spr" rerelase pak0.pak Quad model loads without errors in a console in this example #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 framebuffer auto framebuffer = CreateFramebuffer(window); auto plg = LoadPlugin("Plugins/FITextureLoader"); auto quakeLoaderPlugin = LoadPlugin("Plugins/QuakeLoader"); WString path = AppDir(); auto pak = LoadPackage(path + "/PAK0.PAK"); //Create world auto world = CreateWorld(); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetPosition(0, 0, -4); //Create a light auto light = CreateBoxLight(world); light->SetRotation(45, 35, 0); light->SetRange(-10, 10); light->SetColor(2); auto box = CreateBox(world, 1); auto pixmap = CreatePixmap(100, 100); pixmap->Fill(Vec4(0.5f, 0.5f, 0.5f, 1.0f)); auto texture = LoadTexture("progs/s_explod.spr"); auto model = LoadModel(world, "progs/quaddama.mdl"); auto material = CreateMaterial(); material->SetTexture(texture); material->SetShadow(false); material->SetTransparent(true); //Create sprite auto sprite = CreateSprite(world, 10, 10); sprite->SetPosition(0, 0, 0); sprite->SetMaterial(material); box->SetMaterial(material); //Main loop while (window->Closed() == false and window->KeyHit(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; }
  2. #include "UltraEngine.h" using namespace UltraEngine; shared_ptr<Window> window; shared_ptr<Framebuffer> framebuffer; shared_ptr<World> world; shared_ptr<Interface> ui; shared_ptr<Camera> uiCamera; shared_ptr<Widget> label; static bool EventCallback(const Event& e, shared_ptr<Object> extra) { Print("Callback"); return true; } void initGui() { auto default_font = LoadFont("Fonts\\arial.ttf"); ui = CreateInterface(world, default_font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(0.0f, 0.0f, 0.0f, 1.0f); uiCamera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); uiCamera->SetPosition((float)framebuffer->GetSize().x * 0.5f, (float)framebuffer->GetSize().y * 0.5f, 0); uiCamera->SetRenderLayers(2); uiCamera->SetClearMode(CLEAR_DEPTH); label = CreateLabel("Btn", 20, 20, 100, 100, ui->root); } int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window window = CreateWindow("Ultra Engine", 0, 0, 300, 300, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world world = CreateWorld(); //Create a framebuffer framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0, 0, 0); initGui(); ListenEvent(EVENT_DATA, NULL, EventCallback, label); auto color = Vec4(0.5, 0, 1, 0.5f); label->SetColor(color); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyDown(KEY_SPACE)) { label->SetText("New Text"); float fonstScale = 14.0 / (float)13; label->SetFontScale(0.9); } world->Update(); world->Render(framebuffer); } return 0; }
  3. 1. At start.ultra map copy a player. 2. Change a value in copied entity's ThirPersonControls. 3. First entity have same value now
  4. Also application seems to crash if package has same file as in usual folder which nakes harder to test game distribution with packing flies
  5. Most visible changes since the last video: Loading screen Icons from Quake for ammo in inventory Ammo is now spent while shooting, and its quantity is displayed in the inventory and weapons bar Ammo can be splitted in inventory Action dialog hides movement squares and shows which targets are visible with yellow lines Added sounds for the interface from Quake (when you hover over buttons, press them, etc.) Added sounds to enemies when they are moving and player target them Added credits, where I list a bunch of studios related to Quake Rerelease and Quake sounds Added a difficulty selection, which determines the AI and the number of enemies on the map for tests Reworked the AI of bots. I took GOAP as a basis, but simplified it to a choice of tactics, which choose a next action, and after the action is completed, the tactic is selected again. On hard, bots choose a target with the smallest health and armor and on which the most damage can be dealt, flank targets, retreat a bit after the attack and turn towards the player’s units. On the easy, they simply attack the one closest to them; if there are several at the same distance, then choose the one with the larger health and armor. On normal difficulty, the bot logic is the most plausible without try harding, but also without giveaways. Before choosing a tactic, bots take the targets that they see or smell and remember the tiles on which the targets are located. I'll add the hearing later. I will improve memory further so that bots remember the enemies they see outside of their turn.
  6. My tetsts of Ultra benchmarks 2023 and compiled sources with beta 0.9.5 (RTX 4080): Old/new FPS Unique Geometry ~7500 / 6400-6800 Lighting 2500 / 2100 Instanced Geometry 1700-2100 / 3600 Animation 3000 / 3400
  7. 3200-3500 in debug for me, 3800 fps in release mode
  8. Another world render before a loop causing a problem #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create window auto window = CreateWindow("Ultra Engine", 0, 0, 800, 600, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create world auto world = CreateWorld(); auto world2 = CreateWorld(); //Create framebuffer auto framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); camera->SetClearColor(0.125); world2->Render(framebuffer); while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { while (PeekEvent()) { auto ev = WaitEvent(); if (ev.id == EVENT_STARTRENDERER) { if (ev.data == 0) { Print("Renderer failed to start"); Notify("Renderer failed to initialize.", "Error", true); return 0; } } } world->Update(); world->Render(framebuffer); } return 0; }
  9. Yeah, camera supposed to be in loading world, just a typo from copy pasting ig. Still "Renderer failed to initialize". I wonder if it can be related to few screens somehow since idk what else can it be if it works for you on amd and nvidia cards,
  10. I meant Vulkan is gone just like issue and vice versa
  11. It's not fully resolved but probably it's ok as it is for now
  12. Ah, extra 1 is because it's root have it. Maybe it's not big problem as i thought.
  13. Tried to do clearing - still does not look right. Not increasing now every time but still to many extra uses. #include "UltraEngine.h" using namespace UltraEngine; shared_ptr<Window> window; shared_ptr<Framebuffer> framebuffer; shared_ptr<World> world; shared_ptr<Interface> ui; shared_ptr<Camera> uiCamera; shared_ptr<Widget> btn; static bool EventCallback(const Event& e, shared_ptr<Object> extra) { Print("In callback:" + WString(btn.use_count())); return true; } void initGui() { auto default_font = LoadFont("Fonts\\arial.ttf"); ui = CreateInterface(world, default_font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f); uiCamera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); uiCamera->SetPosition((float)framebuffer->GetSize().x * 0.5f, (float)framebuffer->GetSize().y * 0.5f, 0); uiCamera->SetRenderLayers(2); uiCamera->SetClearMode(CLEAR_DEPTH); btn = CreateButton("Btn", 20, 20, 100, 100, ui->root); } int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window window = CreateWindow("Ultra Engine", 0, 0, 300, 300, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world world = CreateWorld(); //Create a framebuffer framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0, 0, 0); initGui(); ListenEvent(EVENT_DATA, NULL, EventCallback, btn); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { while (PeekEvent()) WaitEvent();// Clears event queue if (window->KeyHit(KEY_SPACE)) { Print("Before:" + WString(btn.use_count())); EmitEvent(EVENT_DATA, btn); Print("After:" + WString(btn.use_count())); } world->Update(); world->Render(framebuffer); } return 0; }
  14. Should not ListenEvent clear event then? Also i would prefer events to keep weak_ptr. I have PeekEvent and WaitEvent in main project and still had some problems with extra shared_ptr held by events. I will investigate again what exact problems i had with it later to make new example in case if it can't be fixed with current engine build.
  15. Problem is a same with full GUI recreation when display changes including camera with code from another thread So probably Ultra takes DPI from first created window?
  16. idk, such things should not happens no matter what dpi user have on screens imho
  17. You are right. 2nd screen different display scale. Tried same - works as intended but impossible to use this screen because everything is too big then
  18. In new build debug mode have too low fps again. Seems to be related to GUI. 4000 if i do nothing and i hit a button to create widget it's dropping to 600. In my game it's 30-40 fps. In release same as in prev build
  19. Normal look On my 2nd screen. Normal on 3rd one tho. Also UI mouse input works like if no offset happen #include "UltraEngine.h" using namespace UltraEngine; shared_ptr<Window> window; shared_ptr<Framebuffer> framebuffer; shared_ptr<World> world; shared_ptr<Interface> ui; shared_ptr<Camera> uiCamera; shared_ptr<Widget> btn; shared_ptr<Widget> btn2; static bool EventCallback(const Event& e, shared_ptr<Object> extra) { Print("Callback"); return true; } void initGui() { auto default_font = LoadFont("Fonts\\arial.ttf"); ui = CreateInterface(world, default_font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(0.2f, 0.1f, 0.1f, 1.0f); uiCamera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); uiCamera->SetPosition((float)framebuffer->GetSize().x * 0.5f, (float)framebuffer->GetSize().y * 0.5f, 0); uiCamera->SetRenderLayers(2); uiCamera->SetClearMode(CLEAR_DEPTH); btn = CreateButton("Btn", 20, 20, 100, 100, ui->root); btn2 = CreateButton("Btn", 20, 150, 100, 100, ui->root); } int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window window = CreateWindow("Ultra Engine", 0, 0, 300, 300, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world world = CreateWorld(); //Create a framebuffer framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0, 0, 0); initGui(); ListenEvent(EVENT_DATA, NULL, EventCallback, btn); auto color = Vec4(0.5, 0, 1, 0.5f); btn->SetColor(color); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { while (PeekEvent()) { const Event ev = WaitEvent(); ui->ProcessEvent(ev); } world->Update(); world->Render(framebuffer); } return 0; }
  20. Tried this example - windows stays if i hold a button for few seconds (removed offset for y - window was hiding below before reaching 2nd screen)
  21. Now it seems to be working but UI mouse input have a strange offset on my second screen whenever i drag a window to it or recreate Created another thread for UI issue Red for cursor placement:
  22. Still same issue with new build. Can anybody else to try it?
  23. tbh i'm not sure since example was created after issue appeared in main project and was not tested on stable branch. atm it's just white screen for me.
×
×
  • Create New...