EntityDistance Question...
Blitz3D Forums/Blitz3D Programming/EntityDistance Question...
| ||
I'm planning on using EntityDistance to check the distance between projectiles and various parts of characters. My concern is, if the projectiles are travelling at fairly high speeds, might they bypass the model entirely? I haven't started coding the NPC's yet, but I'd like to know if this is going to be an issue before I start... |
| ||
It will be an issue if you're not using collision. However, if your game core is running at a 200fps for example then things aren't really moving that fast so it might not be a problem. I fix my game core speed and let the frames render as fast as the card can handle it. Even low spec machines can keep the core without rendering at nice high speeds. |
| ||
I found it to be a problem for me in my project. I use entity distance to check if the club is near a golf ball, thus triggering my ball flight code. The mouse speed determines the power of the shot so if I move my mouse really fast sometimes the club passes right thru the ball without my distance check being met. I'll have to switch to collisions as a result. |
| ||
That's my point about making your game code run nice and fast then that's not a problem. |
| ||
I suppose that's something I should learn sooner or later then. |
| ||
Yeah, Collisions will 'realise' if an Entity moves 'through' another entity each update. So if EntityA is at location 0,0,0 and it moves upwards (Y dimension) through 20 units, and EntityB is at 0,10,0 then a collision will occur. |
| ||
hmmm, well, I might as well just use collisions then. Shouldn't cause any problems... |