Jump to content

Josh

Staff
  • Posts

    24,629
  • Joined

  • Last visited

Everything posted by Josh

  1. This will take a while to work out. I know why it is happening, I just need to do this carefully...
  2. Is it possible to provide an example project that is ready to compile? There's a lot of things that could go wrong if I have to guess and recreate your project. I also have the "Wild West" project you sent but I don't know what to do to demonstrate the error.
  3. Are you on the beta / development branch? I just tried this model and it had no issues converting.
  4. Actually, there is some more advanced functionality available. You can see an event is emitted with ID EVENT_LOBBYUSERDISCONNECT and the event source is a LobbyEventInfo object. You have to cast like this: auto info = event.source->As<LobbyEventInfo>() And that has the lobby and user IDs. void CallbackManager::OnLobbyChatUpdate(LobbyChatUpdate_t* pCallback) { auto info = std::make_shared<LobbyEventInfo>(); info->lobbyid = pCallback->m_ulSteamIDLobby; info->userid = pCallback->m_ulSteamIDUserChanged; if ((k_EChatMemberStateChangeEntered & pCallback->m_rgfChatMemberStateChange) != 0) { __queuedevents.push_back(Event(EVENT_LOBBYUSERJOIN, info)); SteamNetworking()->AcceptP2PSessionWithUser(pCallback->m_ulSteamIDUserChanged); } if ((k_EChatMemberStateChangeLeft & pCallback->m_rgfChatMemberStateChange) != 0) __queuedevents.push_back(Event(EVENT_LOBBYUSERLEAVE, info)); if ((k_EChatMemberStateChangeDisconnected & pCallback->m_rgfChatMemberStateChange) != 0) __queuedevents.push_back(Event(EVENT_LOBBYUSERDISCONNECT, info)); }
  5. Okay, I was able to identify the cause...sort of. I was getting very aggressive with optimization. Some say too aggressive, but I say not enough. I'll wait until tomorrow morning to update.
  6. Okay, the problem is not the textures. The problem is the new material that is being created under the hood. Somehow it is pointing to an invalid texture slot in the shader...
  7. I know it is caused by a texture being prematurely released, but I don't see how it is happening...
  8. It doesn't. All the components I wrote come in a C++ or a Lua version.
  9. It seems to not occur the first time the icon is set. I suspect this has to do with a texture handle being reset while the old visibility set is still referencing it, resulting in the display of the default pink texture: #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"); //panel->SetIcon(icon1); } int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window window = CreateWindow("Ultra Engine", 0, 0, 200, 200, displays[0], WINDOW_DEFAULT); //Create a world menuWold = CreateWorld(); //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); initGui(); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyHit(KEY_SPACE)) { isFirst = !isFirst; if (isFirst) { panel->SetIcon(icon1); } else { panel->SetIcon(icon2); } } menuWold->Update(); menuWold->Render(framebuffer); } return 0; }
  10. Problem goes away if I disable multithreading. Press space to switch the 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"); panel->SetIcon(icon1); } int main(int argc, const char* argv[]) { EngineSettings settings; settings.asyncrender = false; Initialize(settings); //Get the displays auto displays = GetDisplays(); //Create a window window = CreateWindow("Ultra Engine", 0, 0, 200, 200, displays[0], WINDOW_DEFAULT); //Create a world menuWold = CreateWorld(); //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); initGui(); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyHit(KEY_SPACE)) { isFirst = !isFirst; } if (isFirst) { panel->SetIcon(icon1); } else { panel->SetIcon(icon2); } menuWold->Update(); menuWold->Render(framebuffer); } return 0; }
  11. What I can tell so far is that the icon is continuously being rasterized to generate new pixmaps, because the old pixmap is getting dumped from memory...
  12. https://www.ultraengine.com/learn/Steamworks_GetLobbyMembers
  13. I copied the Materials and Models folders from a Leadwerks project into an Ultra project, browsed around using Ultra 0.9.3, and had no problems. I downloaded this package: https://steamcommunity.com/sharedfiles/filedetails/?id=1147729191&searchtext=mod+builder Ultra 0.9.3 was able to browse through it and generate thumbnails with no issues.
  14. General Spawner TeleportField TriggerField PlayerSpawnPoint Waypoint CollisionDamage HealthManager Laser Logic NOT AND OR XOR LATCH Motion Sliding Door Swinging Door Mover Oscillate MatchRotation MatchPosition Follow Point Platform Player FPSControls CameraControls ThirdPersonControls VRPlayer Enemies Soldier Monster Spider HUD GameMenu StatsDisplay Crosshair Sound AmbientNoise ImpactNoise ProximityNoise Appearance ColorChanger Outline
  15. Fixed, thank you. Page will re-cache in a few hours.
  16. Full update with a big batch of bug fixes. Camera::SetOrder is now available in Lua Fixed some red / blue channel swapping errors
  17. Done, build will be up soon.
  18. Ah, it was just because the brush was not being rebuilt after applying the material. This is a little bit better code: #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); //Load FreeImage plugin auto plg = LoadPlugin("Plugins/FITextureLoader"); //Create a world auto world = CreateWorld(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetPosition(0, 1, -4); //Create light auto light = CreateBoxLight(world); light->SetRange(-10, 10); light->SetArea(15, 15); light->SetRotation(45, 35, 0); light->SetColor(2); //Create a scene auto scene = CreateMap(); //Load model auto t = CreateBoxBrush(world, 4, 4, 4); auto texture = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/tiles.dds"); auto material = CreateMaterial(); material->SetTexture(texture); t->SetMaterial(material); t->Build(); scene->AddEntity(t); scene->Save(GetPath(PATH_DESKTOP) + "/game.sav"); t = nullptr; //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyHit(KEY_SPACE)) { scene = LoadMap(world, GetPath(PATH_DESKTOP) + "/game.sav"); } world->Update(); world->Render(framebuffer); } return 0; }
  19. Okay, I added some code so that embedded materials will be loaded correctly. It does appear that brush texcoords are not getting reloaded correctly, but I think that is a separate issue.
  20. Map file appears to have all the info: "scene": { "ambientlight": [ 0.25, 0.25, 0.25 ], "base": "", "entities": [ { "camera": { "clearcolor": [ 0.125, 0.125, 0.125 ], "clearmode": 3, "fov": 90.0, "range": [ 0.10000000149011612, 1000.0 ] }, "castshadows": false, "collisiontype": 0, "friction": [ 0.5, 0.8999999761581421 ], "matrix": [ "0x3f800000", "0x0", "0x0", "0x0", "0x0", "0x3f800000", "0x0", "0x0", "0x0", "0x0", "0x3f800000", "0x0", "0x0", "0x3f800000", "0xc0800000", "0x3f800000" ], "physicsmode": 0, "pickmode": 0, "position": [ "0x0", "0x3f800000", "0xc0800000" ], "reflection": true, "uuid": "daad0d12-ac3e-41cf-968b-84119150c110" }, { "boxlight": { "area": [ 15.0, 15.0 ], "range": [ -10.0, 10.0 ] }, "castshadows": true, "collisiontype": 0, "color": [ 2.0, 2.0, 2.0, 1.0 ], "friction": [ 0.5, 0.8999999761581421 ], "matrix": [ "0x3f51b3f3", "0xb2800000", "0xbf12d5e7", "0x0", "0x3ecfa828", "0x3f3504f2", "0x3f144849", "0x0", "0x3ecfa826", "0xbf3504f3", "0x3f144848", "0x0", "0x0", "0x0", "0x0", "0x3f800000" ], "physicsmode": 0, "pickmode": 0, "quaternion": [ "0xbebadd92", "0xbe8e3de3", "0x3debac83", "0x3f61910d" ], "reflection": true, "rotation": [ "0x42340000", "0x420c0000", "0x0" ], "uuid": "f414b4a1-c817-4d48-9861-e3e605146623" }, { "brush": { "faces": [ { "indicecount": 4, "indices": 96, "mappingplane": [ [ 1.0, -0.0, -0.0, 0.0 ], [ -0.0, -0.0, -1.0, 0.0 ] ], "mappingscale": [ 400.0, 400.0 ] }, { "indicecount": 4, "indices": 104, "mappingplane": [ [ -1.0, -0.0, -0.0, 0.0 ], [ -0.0, -0.0, -1.0, 0.0 ] ], "mappingscale": [ 400.0, 400.0 ] }, { "indicecount": 4, "indices": 112, "mappingplane": [ [ -1.0, -0.0, -0.0, 0.0 ], [ -0.0, -1.0, -0.0, 0.0 ] ], "mappingscale": [ 400.0, 400.0 ] }, { "indicecount": 4, "indices": 120, "mappingplane": [ [ 1.0, -0.0, -0.0, 0.0 ], [ -0.0, -1.0, -0.0, 0.0 ] ], "mappingscale": [ 400.0, 400.0 ] }, { "indicecount": 4, "indices": 128, "mappingplane": [ [ -0.0, -0.0, -1.0, 0.0 ], [ -0.0, -1.0, -0.0, 0.0 ] ], "mappingscale": [ 400.0, 400.0 ] }, { "indicecount": 4, "indices": 136, "mappingplane": [ [ -0.0, -0.0, 1.0, 0.0 ], [ -0.0, -1.0, -0.0, 0.0 ] ], "mappingscale": [ 400.0, 400.0 ] } ], "material": 1, "vertexcount": 8, "vertices": 0 }, "castshadows": true, "collisiontype": 2, "friction": [ 0.5, 0.8999999761581421 ], "physicsmode": 1, "pickmode": 1, "reflection": true, "uuid": "e8571be5-05a9-4c18-a137-f115abdd2605" } ], "gravity": [ 0.0, -9.8100004196167, 0.0 ], "iblintensity": 1.0, "materials": [ { "displacement": [ 0.05000000074505806, -0.02500000037252903 ], "metallic": 0.0, "roughness": 1.0, "shadow": true, "texture0": "https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/tiles.dds" } ] }
  21. I see what was happening. The mesh collider routine creates an instance of the model and collapses it, then uses that mesh data to build the shape. But it was using the default parameters for instantiation, which includes running the start function for any attached components on the new model. So it was creating an infinite recursive loop.
  22. This works fine: #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto world = CreateWorld(); auto model = LoadModel(world, "Models/Developer/Player/player.mdl"); auto inst = model->Instantiate(world); return 0; }
  23. The problem has to do with instantiating an animated model. Still investigating...
×
×
  • Create New...