SphereCommunity
Why do NPCs attacking eachother (Seemingly randomly) run away from each other? - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: Why do NPCs attacking eachother (Seemingly randomly) run away from each other? (/Thread-Why-do-NPCs-attacking-eachother-Seemingly-randomly-run-away-from-each-other)

Pages: 1 2 3


RE: Why do NPCs attacking eachother (Seemingly randomly) run away from each other? - WRWR - 08-02-2012 04:23 PM

IF (<SRC.isEVENT.e_AI_Hostile>)


RE: Why do NPCs attacking eachother (Seemingly randomly) run away from each other? - Rayvolution - 08-02-2012 11:00 PM

(08-02-2012 04:23 PM)WRWR Wrote:  IF (<SRC.isEVENT.e_AI_Hostile>)

That did the trick! Although, I had to change it to isTEVENT Big Grin

Thanks!


RE: Why do NPCs attacking eachother (Seemingly randomly) run away from each other? - Extreme - 08-03-2012 02:00 AM

(08-02-2012 04:05 PM)Gil Amarth Wrote:  You can try ISTEVENT.

IF (<SRC.TEVENTS.ISTEVENT.e_AI_Hostile>)

It works in my system.
(08-02-2012 04:23 PM)WRWR Wrote:  IF (<SRC.isEVENT.e_AI_Hostile>)
I agree with both of you, but, using this function, I think will do 2 operations.
<SRC.ISEVENT.E_AI_HOSTILE> one operation
and the
ISEVENT Function, second operation, that maybe already be a STRMATCH

So, if someone know, whats quickly, do the operation in the condition or call a function to do the operation?
I choose the first one because looks quickly, but I don't know.


RE: Why do NPCs attacking eachother (Seemingly randomly) run away from each other? - Anarch Cassius - 08-03-2012 09:50 AM

Quote:
  • I can't use brain_guard for my script though anyway, because when "spawned" via spawngem, they vanish. They'll only stick around if I manually add them via Axis.
  • Even stranger: Brain_None on the guard won't change his behavior. He still "runs away" from all human characters.
  • Looking more into it, it seems that basically any NPC with the same Body won't attack each other.

These sounds like issues.

The first should only be a problem if you don't have guardzones. Guard brain is meant to work with guard zones and it rescriptable if you aren't using them so this is fine.

The second is an issue. I'd be in favor of any non-defined brains having no behavior. The only downside would be logically this should include not movement behavior. Then you have a totally blank slate to work from, you just need to give it wander orders on your own.

The third is interesting because it doesn't work on Elves. Test the other ML creatures. I suspect it's code written before they existed. I'd like to see this specifically disable-able since it's no longer complete and likely to be undesired on many servers.


RE: Why do NPCs attacking eachother (Seemingly randomly) run away from each other? - Rayvolution - 08-03-2012 10:43 AM

(08-03-2012 09:50 AM)Anarch Cassius Wrote:  
Quote:
  • I can't use brain_guard for my script though anyway, because when "spawned" via spawngem, they vanish. They'll only stick around if I manually add them via Axis.
  • Even stranger: Brain_None on the guard won't change his behavior. He still "runs away" from all human characters.
  • Looking more into it, it seems that basically any NPC with the same Body won't attack each other.

These sounds like issues.

The first should only be a problem if you don't have guardzones. Guard brain is meant to work with guard zones and it rescriptable if you aren't using them so this is fine.

The second is an issue. I'd be in favor of any non-defined brains having no behavior. The only downside would be logically this should include not movement behavior. Then you have a totally blank slate to work from, you just need to give it wander orders on your own.

The third is interesting because it doesn't work on Elves. Test the other ML creatures. I suspect it's code written before they existed. I'd like to see this specifically disable-able since it's no longer complete and likely to be undesired on many servers.

The first sounds like that's the issue, since I'm still in heavy dev on my maps I haven't even bothered writing the region/map flags for anything, and my main city is by-the-scripts in the middle of no where. But, even when I do write the map flags, my cities won't have the "Guarded" flag anyway. My new guards don't use brain_guard anyway and my cities won't technically (As far as Sphere is concerned) be "guarded" areas since the guards will just be regular NPCs wandering the streets. Wink

Second won't be an issue, since I overcame that with my new AI system I'm writing. I'll just be keeping their brains as-is. Tongue

Third actually does the same with elves, and all other bodies I've tried. The only reason elves "fix" my problem is because I don't use elves anywhere on my server, so if the only elves are the guards, the guards should operate correctly 100% in all situations now. Unless they attack each other, but there's no AI flags (or plan to have any) to ever make them do that.


RE: Why do NPCs attacking eachother (Seemingly randomly) run away from each other? - Extreme - 08-03-2012 12:15 PM

A sux but funny 'invasion'.
To works, create I_SPAWN_INVADER and I_SPAWN_DEFENDER and it will summon the mobs and will have an infinity combat hahaha


RE: Why do NPCs attacking eachother (Seemingly randomly) run away from each other? - WRWR - 08-03-2012 06:08 PM

Funny orcs but
Code:
14:05:DEBUG:__ thread (9460) __ |  # | _____ function _____________ | ticks passed from previous function start ______
14:05:DEBUG:>>         9460     |  0 |          NetworkThread::tick | +0
14:05:DEBUG:>>         9460     |  1 | NetworkOutput::processOutput | +0
14:05:DEBUG:>>         9460     |  2 | NetworkOutput::processPacketQueue | +0 <-- exception catch point (below is guessed and could be incorrect!)
14:05:DEBUG:>>         9460     |  3 |    NetworkOutput::sendPacket | +0
14:05:CRITICAL:Exception, in NetworkOutput::processPacketQueue() #1 "sending"
14:05:DEBUG:id='1', pri='2', packet '2' of '25' to send, length '34' of '12000'
14:05:DEBUG:__ thread (9460) __ |  # | _____ function _____________ | ticks passed from previous function start ______
14:05:DEBUG:>>         9460     |  0 |          NetworkThread::tick | +0
14:05:DEBUG:>>         9460     |  1 | NetworkOutput::processOutput | +0
14:05:DEBUG:>>         9460     |  2 | NetworkOutput::processPacketQueue | +0 <-- exception catch point (below is guessed and could be incorrect!)
14:05:DEBUG:>>         9460     |  3 |    NetworkOutput::sendPacket | +78
14:05:DEBUG:id='1', pri='2', packet '3' of '25' to send, length '51' of '12000'



RE: Why do NPCs attacking eachother (Seemingly randomly) run away from each other? - Extreme - 08-04-2012 02:20 AM

(08-03-2012 06:08 PM)WRWR Wrote:  Funny orcs but
Code:
14:05:DEBUG:__ thread (9460) __ |  # | _____ function _____________ | ticks passed from previous function start ______
14:05:DEBUG:>>         9460     |  0 |          NetworkThread::tick | +0
14:05:DEBUG:>>         9460     |  1 | NetworkOutput::processOutput | +0
14:05:DEBUG:>>         9460     |  2 | NetworkOutput::processPacketQueue | +0 <-- exception catch point (below is guessed and could be incorrect!)
14:05:DEBUG:>>         9460     |  3 |    NetworkOutput::sendPacket | +0
14:05:CRITICAL:Exception, in NetworkOutput::processPacketQueue() #1 "sending"
14:05:DEBUG:id='1', pri='2', packet '2' of '25' to send, length '34' of '12000'
14:05:DEBUG:__ thread (9460) __ |  # | _____ function _____________ | ticks passed from previous function start ______
14:05:DEBUG:>>         9460     |  0 |          NetworkThread::tick | +0
14:05:DEBUG:>>         9460     |  1 | NetworkOutput::processOutput | +0
14:05:DEBUG:>>         9460     |  2 | NetworkOutput::processPacketQueue | +0 <-- exception catch point (below is guessed and could be incorrect!)
14:05:DEBUG:>>         9460     |  3 |    NetworkOutput::sendPacket | +78
14:05:DEBUG:id='1', pri='2', packet '3' of '25' to send, length '51' of '12000'
Strange... I runned it for one day and don't get any errors...
Maybe is your settings in sphere.ini...
What about network settings?


RE: Why do NPCs attacking eachother (Seemingly randomly) run away from each other? - darksun84 - 08-04-2012 02:42 AM

it's a very interesting script Shock

The only problem is that sometime the orcs spawns on the wrong place(like above a wall), still it's very funny Big Grin


RE: Why do NPCs attacking eachother (Seemingly randomly) run away from each other? - Extreme - 08-04-2012 02:45 AM

(08-04-2012 02:42 AM)darksun84 Wrote:  it's a very interesting script Shock

The only problem is that sometime the orcs spawns on the wrong place(like above a wall), still it's very funny Big Grin
Ah.. thats because I set to spawn around the spawner.. of course we can fix it, its easy =D