Jazz Posted February 14, 2015 Share Posted February 14, 2015 See how it works for you now. DogAI.lua Quote --- Scott Using Windows 7 Ultimate 64 bit/Core I7-2700K @ 4312mhz/24G RAM/Nvidia GTX 1060 Link to comment Share on other sites More sharing options...
Rick Posted February 14, 2015 Share Posted February 14, 2015 I believe picks are done on the mesh not the physics object. Then this is where someone says it doesn't, then I find the post where Josh says it and everyone is shocked This should be posted on the front page in bold Quote Link to comment Share on other sites More sharing options...
AnthonyPython Posted February 14, 2015 Share Posted February 14, 2015 Are you kidding ? I have declared a character controller, why should i use a a trick and do more work ? Is not character controller a physic object with collision already, that pick should always detect in any case , like Unity raycast and character physic capsule volumes. There is a bug with Pick , the raycast should detect the character controller physic cylinder between two 3D points at any time (without adding any physic shapes or any tricks). I dunno, pick does have issues with the character controller Quote OS: Windows 10 Pro CPU: i3-10100 CPU @ 3.60GHz GPU: NVIDIA 2060 Super - 8 GB RAM: 32 GB Link to comment Share on other sites More sharing options...
beo6 Posted February 14, 2015 Share Posted February 14, 2015 but it seems it is not even hitting the mesh of the character-controller model. So something must be wrong there? Quote Link to comment Share on other sites More sharing options...
AnthonyPython Posted February 14, 2015 Share Posted February 14, 2015 but it seems it is not even hitting the mesh of the character-controller model. So something must be wrong there? same thing happens with aggror's turret if you don't have a box over the character, and set a pivot for it to look at the character chest to shoot at (if not it shoots at the player's origin at the feet) Quote OS: Windows 10 Pro CPU: i3-10100 CPU @ 3.60GHz GPU: NVIDIA 2060 Super - 8 GB RAM: 32 GB Link to comment Share on other sites More sharing options...
Rick Posted February 14, 2015 Share Posted February 14, 2015 I guess make a small demo and post in bugs forum for Josh to check out. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted February 14, 2015 Author Share Posted February 14, 2015 I believe picks are done on the mesh not the physics object. What says the docs on that ? I seen that you can specify the collision type like Collision.Character, so pick works on physic volumes (and bones it seems what is strange ) I just see it working but stop working on some cases turning around the mob using GotoPoint(). Quote Stop toying and make games Link to comment Share on other sites More sharing options...
AnthonyPython Posted February 14, 2015 Share Posted February 14, 2015 I guess make a small demo and post in bugs forum for Josh to check out. sounds like a plan Quote OS: Windows 10 Pro CPU: i3-10100 CPU @ 3.60GHz GPU: NVIDIA 2060 Super - 8 GB RAM: 32 GB Link to comment Share on other sites More sharing options...
Rick Posted February 14, 2015 Share Posted February 14, 2015 so pick works on physic volumes No it doesn't. You are going to make me find that post aren't you *sigh* Quote Link to comment Share on other sites More sharing options...
AnthonyPython Posted February 14, 2015 Share Posted February 14, 2015 No it doesn't. You are going to make me find that post aren't you *sigh* That might take a while xD Quote OS: Windows 10 Pro CPU: i3-10100 CPU @ 3.60GHz GPU: NVIDIA 2060 Super - 8 GB RAM: 32 GB Link to comment Share on other sites More sharing options...
YouGroove Posted February 14, 2015 Author Share Posted February 14, 2015 I made many new tests also. When the mob is using navigation and just running forward on your direction, Pick() always work. When the mob is chasing you , if you change direction , the mob is no more aligned on your direction and the Pick don't work. The mob needs to face the player to be able to have Pick work. There is a serious bug about Pick, i think it takes account of the direction, not only the two 3D points, what is weird if you read the docs and function parameters. I will ask Josh to create a new function working in any case a real raycast one using two 3D points. We will name it : RaycastBetweenAandB No it doesn't. You are going to make me find that post aren't you *sigh* The doc is imprecise about Pick, not complete, this is what you mean ? Seeing we can declare the type of physics in Pick(), it means for me it works with physic volumes not mesh polygons. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Jazz Posted February 14, 2015 Share Posted February 14, 2015 Check the script I updated in post #26. Works fine in there. Quote --- Scott Using Windows 7 Ultimate 64 bit/Core I7-2700K @ 4312mhz/24G RAM/Nvidia GTX 1060 Link to comment Share on other sites More sharing options...
YouGroove Posted February 14, 2015 Author Share Posted February 14, 2015 Check the script I updated in post #26. Works fine in there. It works , but you changed many things : - you changed the speed of the mob movement - you changed GotoPoint() to Follow() - you change position of center models for Pick() call : if (world:Pick(posMob+Vec3(0,1.2,0), posPlayer+Vec3(0,1.6,0), pi, 0, true)) == false then return 0 end I avoid Follow because with faster mob movement , it behaves like a car, having acceleration and not able to stop immediatly if the player moves near it , to it continues the trajectory and turns around like a car But i'll make more tests and perhaps do physic tricks to stop it directly (physicsSetPosition for example) and use Follow perhaps. Thanks a lot Jazzonya for the script There is a problem with physic character using GotoPoint() calling Pick() , a bug , let's not hide it under the carpet and get it fixed perhaps. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Jazz Posted February 14, 2015 Share Posted February 14, 2015 Looks like a z-axis problem. Here if you directly at or directly away pick doesn't work. :/ Quote --- Scott Using Windows 7 Ultimate 64 bit/Core I7-2700K @ 4312mhz/24G RAM/Nvidia GTX 1060 Link to comment Share on other sites More sharing options...
YouGroove Posted February 14, 2015 Author Share Posted February 14, 2015 This unexpected bug driven me nuts, i must take a break from 3D software and now Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Jazz Posted February 15, 2015 Share Posted February 15, 2015 Hmm, pick/gotopoint work fine in FPS mode... Quote --- Scott Using Windows 7 Ultimate 64 bit/Core I7-2700K @ 4312mhz/24G RAM/Nvidia GTX 1060 Link to comment Share on other sites More sharing options...
YouGroove Posted February 15, 2015 Author Share Posted February 15, 2015 Another good bug now using Follow() If i use these Y values that are good as debug spheres are above the floor, the Pick() don't work all time , and becomes as bugged when the mob is using GotoPoint() posPlayer.y = posPlayer.y +1 posMob.y = posMob.y +2.1 I don't understand changing Y values that are valid with spheres debug above the floor , makes it no more working good with Follow() ? Pick() with GotoPoint() and Follow() is definitively bugged for some cases. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
YouGroove Posted February 15, 2015 Author Share Posted February 15, 2015 Another test : Pick() just never work with these Y values for start and end points of raycast ? It never works could the mob use Follow() or just stay in front of the player. local posPlayer = self.target:GetPosition() local posMob = self.entity:GetPosition() posPlayer.y = posPlayer.y + 2 posMob.y = posMob.y +2.1 While these Y values works perfectly ? posPlayer.y = posPlayer.y + 1.5 posMob.y = posMob.y +2.1 A raycast between two 3D points when there is no obstacle should always work whatever are the Y values. I can make some game choosing good Y values, but having these bugs is not so good and it could lead to more problems in other cases of gameplay using Pick() like lasers detection, static roof or walls AI detection etc ... Quote Stop toying and make games Link to comment Share on other sites More sharing options...
YouGroove Posted February 16, 2015 Author Share Posted February 16, 2015 Has it been some changes with Pick() in last update ? it seems worst ? function Script:RaycastPlayer2() self.entity:SetPickMode(1) local posPlayer = self.target:GetPosition() local posMob = self.entity:GetPosition() posPlayer.y = posPlayer.y +1.6 posMob.y = posMob.y +1.6 self.debugSphere3:SetPosition(posPlayer) self.debugSphere:SetPosition(posMob) local world = World:GetCurrent() local pi = PickInfo() if (world:Pick(posMob , posPlayer , pi, 0, true)) == false then return 0 end -- did we hit our target? if pi.entity == self.target then return 1 end -- we hit something else return 2 end Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Jazz Posted February 17, 2015 Share Posted February 17, 2015 How do you expect to hit the player with a sphere blocking him. Quote --- Scott Using Windows 7 Ultimate 64 bit/Core I7-2700K @ 4312mhz/24G RAM/Nvidia GTX 1060 Link to comment Share on other sites More sharing options...
YouGroove Posted February 17, 2015 Author Share Posted February 17, 2015 I'm not so stupid, this the working example shadmar used also, it has spheres already are in PickMode(0) from beginning of tests. self.debugSphere = Model:Sphere() self.debugSphere:SetColor(1.0,0.0,0.0) self.debugSphere:SetPickMode(0) self.debugSphere:SetCollisionType(0) --self.debugSphere:SetPhysicsMode(Entity.RigidBodyPhysics) self.debugSphere3 = Model:Sphere() self.debugSphere3:SetColor(0,0.0,1.0) self.debugSphere3:SetPickMode(0) self.debugSphere3:SetCollisionType(0) I already posted test levels for anyone to test. There is bugs and serious ones. Quote Stop toying and make games 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.