Alienhead Posted May 22, 2022 Share Posted May 22, 2022 I've been combing the api docs, but haven't found a way to determine if an entity is in view or not, either by off-screen or blocked by another object. I suppose a raycast from the camera to the entity would help with the blocked views but as far as the OnScreen or InView determinations? Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Josh Posted May 22, 2022 Share Posted May 22, 2022 Entity::GetCulled(): https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_GetCulled 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Genebris Posted May 23, 2022 Share Posted May 23, 2022 That returns true for both frustum and occlusion culling? What if you only need frustum? Quote Link to comment Share on other sites More sharing options...
Josh Posted May 23, 2022 Share Posted May 23, 2022 The calculation to tell if an object is in view is not too hard. Transform the entity's position from world space to camera space. If the X or Y position (whichever is bigger) is greater than the Z position it's out of view. This assumes a 90 degree vertical and horizontal FOV, but it's good enough for "can the enemy see me". Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Alienhead Posted May 23, 2022 Author Share Posted May 23, 2022 When I use the cull commands I get a system hang when loading a new map . If I don't initiate any culling commands it goes through with the map change. --Map change --------------------- if window:KeyHit(Key.F12) then Time:Pause() System:GCSuspend() --Load the next map Clearmap() Loadmap(1) LoadPlayer() System:GCResume() -- !!!!!!!!!!!!!!!!!!!!!! Hangs up right here Time:Resume() end Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
reepblue Posted May 23, 2022 Share Posted May 23, 2022 Try removing the GC functions out, especially if you're using C++. Those commands caused nothing but trouble with my game. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Alienhead Posted May 23, 2022 Author Share Posted May 23, 2022 I've been using this model since I first got LE for all types of tests, I've never seen it do this before. This is shortly after world:Clear() with no gcsuspend applied. 1 Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Josh Posted May 23, 2022 Share Posted May 23, 2022 What are we looking at? Skinned animation going crazy? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Alienhead Posted May 23, 2022 Author Share Posted May 23, 2022 yes sir. Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Josh Posted May 23, 2022 Share Posted May 23, 2022 If you upload the project I will examine it. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Alienhead Posted May 23, 2022 Author Share Posted May 23, 2022 sending now ... Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Alienhead Posted May 23, 2022 Author Share Posted May 23, 2022 Sent, press f12 to reload the map during gameplay. Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Josh Posted May 23, 2022 Share Posted May 23, 2022 Where did you send it? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Alienhead Posted May 23, 2022 Author Share Posted May 23, 2022 message system, 72mb Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Josh Posted May 23, 2022 Share Posted May 23, 2022 To my account? I have not received anything. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Alienhead Posted May 23, 2022 Author Share Posted May 23, 2022 Sorry, fixed.. 1 Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Alienhead Posted May 23, 2022 Author Share Posted May 23, 2022 I found a fix, not sure how efficient it is but I added the Asset.Unmanaged flag to the load command and it stopped the corruption. Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Alienhead Posted May 23, 2022 Author Share Posted May 23, 2022 Okay here's my full work around, besides from 'having to use' the Asset.Unmanaged flag, I've created a simple lua table to hold each and every parented entity, before calling world:Clear() I cycle through the parented list and unparent.. then call world clear.. so far no lockups or freezes or silent crashes and the mesh deformation has stopped. Now to go back through all the code and set the parent/unparent stuff correctly so i can do away with the quick hack. Scratch that, still happening on further testing ;( Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Josh Posted May 23, 2022 Share Posted May 23, 2022 Right now is a good time to just relax and let me look into it. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Alienhead Posted May 23, 2022 Author Share Posted May 23, 2022 1 Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Alienhead Posted May 23, 2022 Author Share Posted May 23, 2022 I got it working finally. I've got about 40 of them lil' skele's on screen now, with shadow. Now! back to game dev Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Josh Posted May 23, 2022 Share Posted May 23, 2022 I am still trying to download the project. For some reason Amazon is running really slowly. This is very strange. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted May 23, 2022 Share Posted May 23, 2022 And now it just suddenly sped up...4 minutes left...I guess they fixed whatever was wrong. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Alienhead Posted May 24, 2022 Author Share Posted May 24, 2022 A really good chance that when you have the following situation occur the game session randomly ( or as of late - not so randomly ) crashes without warning, error or cause. Create a sphere ( or any object or pre loaded or live loaded object ) Attach anything to it via SetParent() In my case I have a long slow traveling bullet that I attach several smoke trail emitters to as it is in flight. At any point if anything parented to the main parenting object is removed :: if em.ent:GetParent() ~= nil then em.ent:SetParent(nil) end em.ent:Release() This is a normal call, nothing happens out of the ordinary here.. the emitter ( or whatever is attached via code ), is removed as it should be. The problem comes later, it can be 5 mins or 30 mins ( or worse yet, sometimes never at all )... but when you Release() the parent entity- be it ent:Release() or by world:Clear() the entire game session crashes with no errors, warning or syntax. I've really found it best, if your parenting items shorterm -, is to Hide() them instead of releasing them and just let them die with the -parent on release() or clear(). Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Josh Posted May 25, 2022 Share Posted May 25, 2022 I am running your project now. As soon as I kill one bad guy, the game crashes. Still investigating... Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
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.