2 registered members (AbrahamR, AndrewAMD),
1,278
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
What's the best/fastest way for object detection?
#132070
05/26/07 11:54
05/26/07 11:54
|
Joined: Aug 2006
Posts: 128 Papua New Guinea
Impaler
OP
Member
|
OP
Member
Joined: Aug 2006
Posts: 128
Papua New Guinea
|
Hi, In my WWII game, I have about 10 or more AI players on each team, some my allies, some my enemies. I need each actor to be able to detect it's enemies and attack them. I have been using a "radar-style" c_trace, one that constantly spins around so every 5 seconds it turns 360 degrees and scans it's surroundings for enemies. Now, this works fine, but I need the whole process to be faster, but I can't make the rotating c_trace any faster or it skip over enemies. Should I use c_scan instead of a rotating c_trace, and if I do, how can I make c_scan return YOU as the closest detected object with the enemy property, not just the closest object(which might be another ally)? Also, c_scan will go through walls, and the actor will be wasting his time trying to shoot at an enemy which he can't hit.
Murphey's Law: << if anything can go wrong, it will >> (Murphey was an optimist).
|
|
|
Re: What's the best/fastest way for object detection?
[Re: sheefo]
#132072
05/27/07 05:46
05/27/07 05:46
|
Joined: Aug 2006
Posts: 128 Papua New Guinea
Impaler
OP
Member
|
OP
Member
Joined: Aug 2006
Posts: 128
Papua New Guinea
|
I thought that's just what c_scan does, except within a certain range? Anyway, how can you access a list of objects or actors in the game, to check which ones are enemies?
Murphey's Law: << if anything can go wrong, it will >> (Murphey was an optimist).
|
|
|
Re: What's the best/fastest way for object detecti
[Re: Impaler]
#132073
05/27/07 05:51
05/27/07 05:51
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
Expert
|
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
check out ent_next(entity); in the manual. good luck with this!
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
Re: What's the best/fastest way for object detecti
[Re: Impaler]
#132075
05/27/07 15:56
05/27/07 15:56
|
Joined: Oct 2004
Posts: 1,655
testDummy
Serious User
|
Serious User
Joined: Oct 2004
Posts: 1,655
|
Quote:
I thought that's just what c_scan does, except within a certain range? Anyway, how can you access a list of objects or actors in the game, to check which ones are enemies?
Quoted Impaler. I might use eLL (entity linked lists and arrays plugin) found here for such things. I wrote it for similar purposes but I assume very few actually use it. At one time, I clocked it, and it appeared to be faster than scan_entity. Essentially it works similarly to ent_next, and maybe scan_entity, except user-defined entity link lists can be defined. In principle, fewer items might be iterated over. A version for 6.5 is currently under revision.
|
|
|
|