Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, degenerate_762, ozgur), 1,311 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
What would be faster? #140021
07/07/07 13:14
07/07/07 13:14
Joined: Mar 2007
Posts: 27
P
PeterM Offline OP
Newbie
PeterM  Offline OP
Newbie
P

Joined: Mar 2007
Posts: 27
Hi.

If I have 50 enemys.
what is faster??
If each has c_scan to detect and attack me? Or if each has
vec_dist(my.x,player.x) and when
I'm for example 200 quants away they attack?

Tnx for reply.

Re: What would be faster? [Re: PeterM] #140022
07/07/07 13:19
07/07/07 13:19
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline
User
tompo  Offline
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
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).
But remember that c_scan see through the walls so you have to use c_trace also.

Cheers

Last edited by tompo; 07/07/07 13:20.

Never say never.
Re: What would be faster? [Re: tompo] #140023
07/07/07 14:15
07/07/07 14:15
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
c_scan is slower...but he's right...use c_trace and then scan, should be the best way

Re: What would be faster? [Re: Scorpion] #140024
07/07/07 15:15
07/07/07 15:15
Joined: Mar 2007
Posts: 27
P
PeterM Offline OP
Newbie
PeterM  Offline OP
Newbie
P

Joined: Mar 2007
Posts: 27
tnx a lot.

Re: What would be faster? [Re: Scorpion] #140025
07/07/07 15:30
07/07/07 15:30
Joined: Oct 2004
Posts: 1,655
T
testDummy Offline
Serious User
testDummy  Offline
Serious User
T

Joined: Oct 2004
Posts: 1,655
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.
Re: What would be faster? [Re: testDummy] #140026
07/07/07 16:00
07/07/07 16:00
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline
User
tompo  Offline
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
another quick way is c_trace + fec_diff to searching enemy


Never say never.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1