Inside3D!
     

CheckClient

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
leileilol



Joined: 15 Oct 2004
Posts: 1321

PostPosted: Tue Oct 28, 2008 9:18 pm    Post subject: CheckClient Reply with quote

I hate this function because it makes monsters see only player clients and not other monsters
Is there a replacement that lets it see both? Because I want a monster to hate another monster by getting into its view rather than provoked by friendly fire from monster.
Back to top
View user's profile Send private message
Chris



Joined: 05 Aug 2006
Posts: 78

PostPosted: Tue Oct 28, 2008 10:43 pm    Post subject: Reply with quote

I agree it would be nice, and a bit too taxing to do in QC. Possibly a generic findentity search function that you can pass a 'classname' string into or something along those lines.
Back to top
View user's profile Send private message MSN Messenger
Wazat



Joined: 15 Oct 2004
Posts: 732
Location: Middle 'o the desert, USA

PostPosted: Wed Oct 29, 2008 6:25 am    Post subject: Reply with quote

If you give a special string (such as .targettype) to all valid "squishy" entities that monsters should be considering for possible aggression, then you could simply use the find command.

However, find would have every monster looking at every monster in the map. To take some of the burden off the QC, you could instead use findradius. This would trim all entities that are outside of the monster's "wake up and kill" range (I think this is RANGE_FAR in QC but not sure) in the engine with much less work on the QC end. Findradius also ignores entities that are nonsolid I think, so really it's ammo, buttons, monsters, players, triggers, things like those that you'd be sorting through.

Another advantage is if a monster checks another monster and says "oh, that guy's my ally and I don't want to attack him", it can then check "hmm... is he mad at something I can see? Or if I can see him, is he mad at something he can still see? Well then I'm mad at it too" and accomplish multiple tasks with the same loop.

Even if there's a lot of entities in a small area, if the monsters are each only scanning every 0.1 or even 0.5 seconds (using some .float timer to space out the scans), then it shouldn't be bad at all.

I hope that helps!
_________________
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Back to top
View user's profile Send private message MSN Messenger
jim



Joined: 05 Aug 2005
Posts: 400
Location: In The Sun

PostPosted: Wed Oct 29, 2008 12:29 pm    Post subject: Reply with quote

Cool, I've been wanting to do this too!
_________________
zbang!
Back to top
View user's profile Send private message Visit poster's website
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Wed Oct 29, 2008 9:33 pm    Post subject: Reply with quote

the problem is the function returns one player per frame.
make it return one player or monster per frame and you end up with really slow reacting monsters (average map of 60? thats 6 seconds to see a nearby monster).
So any 'replacement' would have to be noticably different in design.

'Findradius also ignores entities that are nonsolid I think'
DP finds them.

Findradius is a suitable replacement, so long as its slightly staggered between monsters. While 6 seconds is too slow, 0.5 is imho fine for non-player entities, though you'd want to spot players a little faster really.

if (e.flags & (FL_MONSTER | FL_CLIENT))
that would do nicely.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
MauveBib



Joined: 04 Nov 2004
Posts: 602

PostPosted: Sun Nov 02, 2008 1:14 am    Post subject: Reply with quote

Spike wrote:

Findradius is a suitable replacement, so long as its slightly staggered between monsters. While 6 seconds is too slow, 0.5 is imho fine for non-player entities, though you'd want to spot players a little faster really.


That's pretty much what I've always done for bots, RTS units etc.

I normally have them do a findradius at random times between 0.1 and 1 seconds each, to nicely stagger them out and have a slight variance in reaction times.
_________________
Apathy Now!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group