Chiblue Posted February 25, 2010 Share Posted February 25, 2010 I initially started using DBPro, then I went to Dark GDK, for various reasons only to find out that thier all encompassing Dark PHysics failed to perform raycast accurately... Now after spending several weeks with LE, and posting about this issue twice on the forums, Raycat in LE does not work, or rather is provides accurate collision reports but randomly HANGS for 500 or more miliseconds... which causes a major lag in my project and as a result makes it unviable as a FPS... I now understand why every time I have seen anything associated with bullet tracing is has been done with an object, rather than raycast... I posted a question concerning this a couple of weeks back and not once did anyone tell me Raycast dfoes not work... So please can I get this issue fixed... I know this is not exactly a feature request but it seems my posts about raycast hanging have gone completely ignored... I really like the LE Engine, but raycast is a critical part of my project requirements and without it I have no project... Quote If it's not Tactical realism then you are just playing.. Link to comment Share on other sites More sharing options...
Josh Posted February 25, 2010 Share Posted February 25, 2010 Post an example that produces the problem. 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...
Chiblue Posted February 25, 2010 Author Share Posted February 25, 2010 Post an example that produces the problem. What do you need, I posting in the programming C++ forum... my logs, timing and code... I am performing the following cast... int hit = EntityPick(&pickent,gun,weap->maximumrange,0,0,(BP)PickFilter); This is my filter, although I have removed this and get the same results... int _stdcall PickFilter( TEntity pickentity) { int EntType = GetEntityType(pickentity); switch(EntType) { case 0: // terrain return 1; case 1: // terrain return 1; // <10 no force, but effects.. case 2: // terrain return 1; // <10 no force, but effects.. case 11: // Player return 0; case 12: // Freindly return 1; // 10> force and effects. case 14: // props return 1; // 10> force and effects. case 21: // Enemy return 1; default: return 1; } } I also tried this... int hit = EntityPick(&pickent,gun,weap->maximumrange,0,0); I placed an UpdateAppTime() and wrote a log file with the apptime before and after the raycast that hung... this happens every maybe 5-10 seconds in the game loop, only when I am firing or using my sight distance functions (bothe using raycast) one uses CameraPick the other EntityPick, I was trying to ensure that both cause the same problem, and they do.. This is the log record before and after the EntityPick/CameraPick... 12254122.000000 : PlayFPSAnimation - EntityPick 12254630.000000 : PlayFPSAnimation - EntityPick Done AQs you can see the function on this case took 500 miliseconds... which causes a significant lag in gameplay... I am using a scene created with Editor, all entities have types associated with them... I cannot be sure but the problem seems most prevelant when you intersect the terrain... but as I said this is only conjecture...Also it appears to happen when moving rotating i.e. changing the raycast results... Quote If it's not Tactical realism then you are just playing.. Link to comment Share on other sites More sharing options...
Josh Posted February 25, 2010 Share Posted February 25, 2010 I need source code for a program I can run to see a problem. 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...
Chiblue Posted February 25, 2010 Author Share Posted February 25, 2010 I will try and get you something tomorrow but the problem can be easily teplicated.... Create a scene in editor then do a camerapick every iteration of the game loop and this with represent the same environment. I have even removed the filter call back and still have the problem.... You will not be able to run my code without all models textures and 3rd party classes.. I will try and create a simulation of the problem. Quote If it's not Tactical realism then you are just playing.. Link to comment Share on other sites More sharing options...
Rick Posted February 25, 2010 Share Posted February 25, 2010 How far is your z component of the CameraPick? I would imagine the higher that distance the slower it would be. I have a CameraPick() every iteration of the game loop using CameraPick(&p, camera, Vec3(MouseX(), MouseY(), 5000)); and I don't see any drops in my frame rate. Quote Link to comment Share on other sites More sharing options...
Chiblue Posted February 25, 2010 Author Share Posted February 25, 2010 The z is set to 3000, I cannot be sure but I believe that the hang happens when the pick hits terrain after hitting an object my test scene basically has a terrain with high mounds surrounding an area with grass, barrels and some trees all objects in the scene are standard ones shipped with LE. I removed all custom models incase that was causing the issue. The only other change is that I am trying to get decals to work which is not yet working but may this causes the problem. Although I have seen the hang happen from first start i up. Do you have impacts on terrain? I wish I could be more specific, could there be an issue with OpenGL? Or the windows sdk? What versions of these are you using? Quote If it's not Tactical realism then you are just playing.. Link to comment Share on other sites More sharing options...
Rick Posted February 25, 2010 Share Posted February 25, 2010 That camera pick I posted was what I do on the terrain. It's how I select where I want a unit to move to. I have version 2.31. The below code is what gets called every frame TPick p; p.entity = 0; CameraPick(&p, camera, Vec3(MouseX(), MouseY(), 5000), 0, 1); // we only care about the terrain string cls = ""; if(p.entity != 0) cls = GetEntityKey(p.entity, "classname", ""); if(cls == "Terrain") { ShowEntity(GetAoECursor()->GetPlane()); PositionEntity(GetAoECursor()->GetPlane(), Vec3(p.X - 10, p.Y, p.Z - 10)); // -10 is 1/2 the scale of the plane GetAoECursor()->Update(); } Quote Link to comment Share on other sites More sharing options...
Chiblue Posted February 25, 2010 Author Share Posted February 25, 2010 The only difference I see is that you are specifically selecting collision type 1, maybe becuase I am allowing all collisino types, transitioning from one to another is causing the problem?? not sure why this would matter... but like I said it seems the function hangs when I transition between one entity and another... i.e. Barrels and terrain... Quote If it's not Tactical realism then you are just playing.. Link to comment Share on other sites More sharing options...
Chiblue Posted February 25, 2010 Author Share Posted February 25, 2010 I need source code for a program I can run to see a problem. I really can't send the entire project even compressed it's over 200mb.. what exactly do you need? If I send you the editor file and the EntityPick function... I am not sure what else would influence this? Quote If it's not Tactical realism then you are just playing.. Link to comment Share on other sites More sharing options...
Chiblue Posted February 28, 2010 Author Share Posted February 28, 2010 Ok I fixed my problem, well found a work around.. if I remove all entities from the scene and only have the terrain, I no longer have the hangup in the raycast... So what this means I am not quite sure... The one thing I have done in the scene is changed the entity types to be within logical ranges... i.e. Terrain and fixed scene entities have a type of 1 to 10 depending upon thier type, i.e. trees, buildings, terrain etc... Props like oildrum are also in this range... Friendly entities like all player objects are 11 and friendly entities between 12 and 20, enemy entities are 21 to 30... could it be that becuase of these ranges the collision detection is hanging when the raycast moves from an entity type of 21 and the next closest collision is 1... Just a thought... Quote If it's not Tactical realism then you are just playing.. Link to comment Share on other sites More sharing options...
Josh Posted February 28, 2010 Share Posted February 28, 2010 I can't tell what the problem is from your description of your scene. However, a 4000 unit long raytrace could be a very expensive operation in some situations. 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...
Chiblue Posted February 28, 2010 Author Share Posted February 28, 2010 I understand that, about the 4000 z trace... sorry I did not make myself clear... due to the problems I am having with the camera rendering, I took my scene and removed every object except the terrain and the starting location class... this did not help the rendering issue, but when I use the raytrace there is no longer a pause.. so given that others in this post are raycasting a fair distance more or less the same... Also given that my scene only includes standard Editor objects oildrum etc... then it comes down to what is different... and my only change is that I changed all the collision types, only terrain and veg are the same... all others are different, and they range from 10 to 30 depending upon the game interaction I want... I am not using 30 entity types but I am using 11, 12 then 21... So I was wondering if the entity types used in the collisions are not close numbers does te raycast look for next entity types... i.e. 1,2,3,4, this would explain my behaviour but I do not know how the raycast was implemented so I cannot state this... I guess I should return to the preset collision types and see what happens... Quote If it's not Tactical realism then you are just playing.. Link to comment Share on other sites More sharing options...
TylerH Posted March 6, 2010 Share Posted March 6, 2010 500 milliseconds of lag, that lag in your log timing could be from the latency required to write the data to your log or print to the console... Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
Chiblue Posted March 8, 2010 Author Share Posted March 8, 2010 500 milliseconds of lag, that lag in your log timing could be from the latency required to write the data to your log or print to the console... I turned the log on to try and understand waht was happeing with the raycast... If I create a scene without any objects raycast works fine, but it seems that when I do one cast and hit an object, then do another which hits a different object it lags.. but not always... seems that from object to terrain lags... I understand this does not make sense, but this is the only pattern I have seen... and the log basically pinpointed that the lag is the cast, if I remove the case then I get no lag... Quote If it's not Tactical realism then you are just playing.. Link to comment Share on other sites More sharing options...
Rick Posted March 8, 2010 Share Posted March 8, 2010 Not sure if this was address above but are you able to provide the whole project for us? Or maybe a smaller version of it producing the same issues? Quote Link to comment Share on other sites More sharing options...
franck22000 Posted March 12, 2010 Share Posted March 12, 2010 Hello chiblue i have some freezes also wtih raycast, but compiling without debug mode ( ctrl + F5 ) in visualc++ is fixing thoses freezes, it's reported here: http://leadwerks.com/werkspace/index.php?app=tracker&showissue=79 Quote You guys are going to be the death of me. Josh Link to comment Share on other sites More sharing options...
Chiblue Posted March 12, 2010 Author Share Posted March 12, 2010 Thanks I will try that.... and let you know.. Quote If it's not Tactical realism then you are just playing.. 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.