Nearest entity...

Blitz3D Forums/Blitz3D Programming/Nearest entity...

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I fail to see how 10-15 EntityDistance() calls every 4 seconds would consume any CPU time whatsoever.

But I'll throw some psuedu towards ya anyways... Break your map up into grids.. these grids can be waypoints, nodes or single pivots with a distance entity around them..

Your turrents would then only check the grids in it's location therefore not having to check every targetable mesh on the map.

ie: if targetable=turrentgridrange then ;preform check

A simple equation can be used to automatically break your worldspace into grid chunks based on max x,z... Y should'nt filter into grid locales unless you have very high stacking maps.