Dreikblack Posted yesterday at 03:51 AM Author Posted yesterday at 03:51 AM Uploaded this test level version to git. It takes longer, but still happens. Reduced cooldown for quick load Quote Check out Slipgate Tactics demo, which is made with Ultra Engine/Leadwerks 5: https://www.leadwerks.com/community/topic/61480-slipgate-tactics-demo/
Dreikblack Posted yesterday at 03:58 AM Author Posted yesterday at 03:58 AM 29 minutes ago, Josh said: recreating the cameras each time seems like something I would not do I tried once to make loading same map without actual Load - just component Load() and few other stuff without recreating entities if they are already on map. But faced same issue, just after more load attempts and due some annoying games issues i reverted back since it was not fixing main issue. Quote Check out Slipgate Tactics demo, which is made with Ultra Engine/Leadwerks 5: https://www.leadwerks.com/community/topic/61480-slipgate-tactics-demo/
Dreikblack Posted yesterday at 03:58 AM Author Posted yesterday at 03:58 AM Not sure how there could be 10 cameras. 1. Main camera from map. 2,3,4 created by its component 5. UI camera 6. Loading camera (in own world) Even if main menu was not unloaded it would be only 7 in total I even checked if old tactic camera component being destroyed - and it is, there is no double cameras after load Quote Check out Slipgate Tactics demo, which is made with Ultra Engine/Leadwerks 5: https://www.leadwerks.com/community/topic/61480-slipgate-tactics-demo/
Josh Posted yesterday at 04:31 AM Posted yesterday at 04:31 AM You might be right. The render stats are reporting 10 but this reports only five: int count = 0; for (auto e : entities) { if (e->As<Camera>()) count++; } Print(count); Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Josh Posted yesterday at 04:47 AM Posted yesterday at 04:47 AM Okay, there are five cameras when the game is active. I would make those cameras persistent across game loads and just create them once. The engine should be able to handle dynamically recreating them as much as you want, but something else is wrong and we don't have any way to easily identify what the problem is right now. Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Dreikblack Posted yesterday at 05:26 AM Author Posted yesterday at 05:26 AM 45 minutes ago, Josh said: I would make those cameras persistent across game loads and just create them once New world being created in every load (with old being destroyed), so no easy way to do it. And would be useless anyway: https://www.leadwerks.com/community/topic/67399-render-breaks-after-several-map-loads/page/2/#findComment-318251 20 minutes ago, Josh said: I am also seeing some extremely high numbers of entity indexes, like 50678. This is highly suspicious. What is causing such huge numbers? In which map? (Demo on New Game or test level) Every tile (where units walks) is a brush which component creates fog of war brush and outline brush (squares above them to show where you can go) at Start() And there are also air tiles (pivot with tile component) above ground tiles, usually around 5 per ground i think. Need them for flying units, and for jumps, falling, elevators etc. Each unit have outline model, two brushes arcs, 1 pivot. Also tiles and units creates some other entities when needed. Quote Check out Slipgate Tactics demo, which is made with Ultra Engine/Leadwerks 5: https://www.leadwerks.com/community/topic/61480-slipgate-tactics-demo/
Josh Posted yesterday at 05:40 AM Posted yesterday at 05:40 AM This is your problem: window->SetText(String(currentWorld->GetEntities().size())); You have tens of thousands of entities being created each time the scene is loaded, and they aren't being deleted. I win the prize. 🏆 Now I go to sleep. I am marking this solved, because this is very likely the problem. You hit 65535 entities, the newly created camera has an invalid handle, since an unsigned short is used, and the shader cannot access data from the right location in the storage buffer. Tell me if it's not, once you have had some time, but I think it is. Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Dreikblack Posted yesterday at 05:55 AM Author Posted yesterday at 05:55 AM 1 hour ago, Josh said: You have tens of thousands of entities being created each time the scene is loaded, and they aren't being deleted. But there being deleted.... Old world being destroyed with all entities. I will test a bit later to make sure. 1 hour ago, Josh said: You hit 65535 entities, Why unsigned short used? It's too easy to reach in any big game. Where is that var? CurrentWold entity count is stable every load, not sure where to look at. Both world and scene with all entities being destroyed before each load Quote Check out Slipgate Tactics demo, which is made with Ultra Engine/Leadwerks 5: https://www.leadwerks.com/community/topic/61480-slipgate-tactics-demo/
Dreikblack Posted yesterday at 07:09 AM Author Posted yesterday at 07:09 AM Tested it - every tile and unit are being deleted correctly (destructors called in every component). So if anything it would be your variable with unsigned short max count not being cleared correctly or something Quote Check out Slipgate Tactics demo, which is made with Ultra Engine/Leadwerks 5: https://www.leadwerks.com/community/topic/61480-slipgate-tactics-demo/
Dreikblack Posted yesterday at 07:24 AM Author Posted yesterday at 07:24 AM Actually "currentWorld->GetEntities().size()" is freaking zero after clearing one Game with scene and before loading new one (and i spent a lot of time and effort to rid off all possible circular references that i don't use on purpose for temporary stuff like projectiles and action effects). I keep some stuff in ResourceManager, but very few for making instances without loading some brushes and models every time. And with loading same game load all over again should not increase total entity count at all. So please check your engine size how it's handles entity, because it looks like when actual entities deleted you keep tracking them or something which make you stack overflow eventually, I still don't know what exactly var you meant, but std::list<std::weak_ptr<Entity> > m_entities in Wolrd is one of weak places if you don't clear from expired entities so i my best guess if that you are actually use some container with weak_ptr entities with 65535 max size which you and not clearing. Quote Check out Slipgate Tactics demo, which is made with Ultra Engine/Leadwerks 5: https://www.leadwerks.com/community/topic/61480-slipgate-tactics-demo/
Josh Posted yesterday at 10:18 AM Posted yesterday at 10:18 AM Actually, hold on. It looks like the number of entities might be staying steady, but the handle indexes are not being released...I'll figure it out tomorrow... Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Dreikblack Posted yesterday at 10:27 AM Author Posted yesterday at 10:27 AM 10 minutes ago, Josh said: Just add this in Application.cpp. GetEntities() does trim away expired weak pointers. That's why a method is used instead of a member. GetEntities() returns correct entity count, which is 0 after scene deletion and stable practically same after each load. I'm talking about this: 4 hours ago, Josh said: You hit 65535 entities, the newly created camera has an invalid handle, since an unsigned short is used, and the shader cannot access data from the right location in the storage buffer. What is this storage with 65535 cap? Damn, i answered to changed/deleted message and can't delete mine now Quote Check out Slipgate Tactics demo, which is made with Ultra Engine/Leadwerks 5: https://www.leadwerks.com/community/topic/61480-slipgate-tactics-demo/
Josh Posted 22 hours ago Posted 22 hours ago 4 hours ago, Dreikblack said: What is this storage with 65535 cap? An unsigned short is faster than an integer index, and no one ever comes close to hitting this limit. Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Josh Posted 21 hours ago Posted 21 hours ago What type of entity is it, that there are 8000 of them? Where is this being created? I need to reproduce this error in a simpler example. Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Dreikblack Posted 21 hours ago Author Posted 21 hours ago 16 minutes ago, Josh said: An unsigned short is faster than an integer index, and no one ever comes close to hitting this limit. Well, i can't see even single demo on Leadwerks 5 yet, expect, let alone full games. So i'm only one who face half of bugs for now. 9 minutes ago, Josh said: What type of entity is it, that there are 8000 of them? Where is this being created? I need to reproduce this error in a simpler example. Already described it: 10 hours ago, Dreikblack said: Every tile (where units walks) is a brush which component creates fog of war brush and outline brush (squares above them to show where you can go) at Start() And there are also air tiles (pivot with tile component) above ground tiles, usually around 5 per ground i think. Need them for flying units, and for jumps, falling, elevators etc. Each unit have outline model, two brushes arcs, 1 pivot. Also tiles and units creates some other entities when needed. Quote Check out Slipgate Tactics demo, which is made with Ultra Engine/Leadwerks 5: https://www.leadwerks.com/community/topic/61480-slipgate-tactics-demo/
Josh Posted 21 hours ago Posted 21 hours ago Just now, Dreikblack said: Well, i can't see even single demo on Leadwerks 5 yet, expect, let alone full games. So i'm only one who face half of bugs for now. The largest levels in Crysis or something like that will only have a few thousand individual entities. The vegetation system can have more than that, but it's a completely separate system. Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Solution Josh Posted 18 hours ago Solution Posted 18 hours ago Okay, this will definitely be fixed in the next build that goes up today. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Josh Posted 13 hours ago Posted 13 hours ago The fix for this is available now. Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Dreikblack Posted 9 hours ago Author Posted 9 hours ago Seems to be really fixed, at least 20 reloads not enough for reproducing (even tho RAM usage keep increasing, VRM now seems more stable). So what was an issue internally in the Engine? Quote Check out Slipgate Tactics demo, which is made with Ultra Engine/Leadwerks 5: https://www.leadwerks.com/community/topic/61480-slipgate-tactics-demo/
Josh Posted 9 hours ago Posted 9 hours ago 31 minutes ago, Dreikblack said: So what was an issue internally in the Engine? I was not clearing some indexes from memory, in some situations, and the iterator kept getting bigger and bigger. Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.