SphereCommunity
NPC turn rate - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: NPC turn rate (/Thread-NPC-turn-rate)

Pages: 1 2


NPC turn rate - Indiaret - 07-01-2017 12:02 AM

Hi,

need help with turn rate of monsters ... Actually npc is not enough quick to give hit (or pre-swing) like player in combat. His turn rate is too slow to do this, when the player is moving there and back repeatly ...

So any ideas how increase turn rate of monster (not through Nonface combat) ? Ideal way that monster combat works exactly like player combat.

Thanks.


RE: NPC turn rate - Indiaret - 07-10-2017 08:18 AM

I have made video to explain whats going on ... im trying to 'convert' scripts to new sphere - Here is comparison of new sphere 56c with turnrate bug and old sphere 0.99z ... Well i need somehow increase turn rate of monsters like it is in old sphere :/ Nothing helps - increasing dex, moverate or changing speedscalefactor or formula - simply his turn rate is so slow in every case.
Video :
https://www.youtube.com/watch?v=GqVt9Y4Kjo0&feature=youtu.be


RE: NPC turn rate - darksun84 - 07-10-2017 08:52 PM

try to add the MT_RUN flag to the NPC Can Property, then tweak moverate for certain npcs.


RE: NPC turn rate - Indiaret - 07-10-2017 09:29 PM

Tried - he swings only in the moment, when he steps. If he is ultra speed then yea, he can swing everytime - problem is still with slower monsters.


RE: NPC turn rate - Indiaret - 07-12-2017 09:13 AM

Is here some trigger which runs faster(more repeats) then @Hitcheck in combat ?


RE: NPC turn rate - PePs1Man - 07-14-2017 06:13 AM

Hello,

I did some testing and yes, this might be considered as a sphereserver bug.

Using Sphere 0.56c, from april 10th.

I've checked the youtube video, then I did the same on my own server and it is real, NPC turn rate is lacking big time.

In order to counter this, I had to use a fast timer, so, the fastest timer available is TimerD.

I've created a memory object using TimerD and then the creature is facing the ATTACKER's uid correctly.

For your testing purpose, here's my testing code.

Code:
[Function f_FaceInCombat2]
Serv.NewItem i_FaceInCombat2
New.Attr=082 // decay/invis
New.Timer=1
New.Link=<Src.Uid>
New.P=<Src.P>
New.Update

[ItemDef i_FaceInCombat2]
Id=i_gold
Type=T_Script
Name=Face In Combat 2 Script

On=@Create
More=1000 // expire in X tenth of sec

On=@Timer
Serv.Log <More>
    If <More> > 0
        More -= 1
    Else
        Serv.Log <Name> has expired
        Remove
    EndIf
    
    If <Link.Attacker>
        Link.Face <Link.Attacker.0>
        Link.Say Facing <Link.Attacker.0.Name>
    EndIf
    
    TimerD=1
    Return 1

Event that you put on a player :
Code:
On=@CombatStart
    Say Starting a new combat with <Src.Name>
    If !<ISTIMERF.f_FaceInCombat2>
        Src.TimerF 5,f_FaceInCombat2
    Endif

Please note that the code is totally untweaked and badly programmed to be used, but this will give you the idea.
I'll redo it and include in my shard but take these important notes...

TimerD should stress the server a lot so you have to limit it's usage.

I'd script it differently

Have fun testing!


RE: NPC turn rate - Indiaret - 07-15-2017 12:41 AM

Yea itts pretty bad this facing - suprise for me that nobody havent reported it yet ( or i havent found it).
Anyway thanks for idea, @Hitcheck is too slow to fix it, i will try timerd too.


RE: NPC turn rate - darksun84 - 07-20-2017 10:36 PM

I tried with the trigger @NpcActFollow ( http://wiki.spherecommunity.net/index.php?title=@NPCActFollow )

Code:
[events e_npc]
ON=@NpcActFollow
face <src>

The npcs seems more responsive when fighting, of course, the trigger must be defined better for combat also don't know how much the performance will suffer.


RE: NPC turn rate - Indiaret - 07-21-2017 03:02 AM

Tried aswell. Not helps a lot, because this fires only when he do some action - best solution is through item + timerd, as wrote pepsi.


RE: NPC turn rate - Coruja - 07-27-2017 12:25 PM

IDK if this can be really considered an bug, since NPC AI is designed to update the NPC AI actions at every 1.0s instead 0.1s

of course 0.1s will make the AI faster and more realistic, but this will also make sphere CPU usage 10x higher