Quote:

I think result will be quite the same but c_scan is better because You may attack from behind and not be detected (enemy hasn't eyes on his back).



As I hinted elsewhere, you don't need c_scan just for that. Perhaps, it is wasteful just to use c_scan to simply emulate view angles as, seemingly, c_scan also searches for entities within a certain area (probably using a list of all or some entities) and THAT takes more time.
If the player is the only entity that can be attacked by enemies, than for 50 enemies:
*vec_dist + own angle test + trace (probably much faster than)
*scan + trace

Again, if the player is the only entity that can be attacked by enemies:
I believe (as tests seem to indicate) the vec_dot instruction can be used to do angle of view tests. Also, alternately, I think a simple vec_to_angle and a subtraction of angles, can yield satisfactory results, without the slower use of c_scan.

Quote:

use c_trace and then scan, should be the best way



I suppose for users that are just starting out, that may be true.
Otherwise, I guess I disagree with that, but it doesn't seem that anyone pays much attention to what I write about such things.

For instances where the player is not the only entity that can be attacked by enemies, for team instances, I normally use my el (entity list) plugin, as initially, in tests long ago, it was faster than scan_entity. (However, Conitec may have improved the scan algorithm since then.) It allows for greater flexibility and better linear logic in many instances. Of course, c_scan has functionality not provided in my simple plugin, so there are instances where it is still useful.

edit: I believe with 50 entities, if you don't handle it correctly, your framerate may take a nosedive.

Last edited by testDummy; 07/07/07 15:33.