The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NPC turn rate
Author Message
Indiaret
Apprentice
*

Posts: 45
Likes Given: 3
Likes Received: 1 in 1 posts
Joined: Apr 2016
Reputation: 0



Post: #1
NPC turn rate
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.
07-01-2017 12:02 AM
Find all posts by this user Like Post Quote this message in a reply
Indiaret
Apprentice
*

Posts: 45
Likes Given: 3
Likes Received: 1 in 1 posts
Joined: Apr 2016
Reputation: 0



Post: #2
RE: NPC turn rate
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=GqVt9Y4K...e=youtu.be
(This post was last modified: 07-10-2017 08:19 AM by Indiaret.)
07-10-2017 08:18 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #3
RE: NPC turn rate
try to add the MT_RUN flag to the NPC Can Property, then tweak moverate for certain npcs.
07-10-2017 08:52 PM
Find all posts by this user Like Post Quote this message in a reply
Indiaret
Apprentice
*

Posts: 45
Likes Given: 3
Likes Received: 1 in 1 posts
Joined: Apr 2016
Reputation: 0



Post: #4
RE: NPC turn rate
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.
07-10-2017 09:29 PM
Find all posts by this user Like Post Quote this message in a reply
Indiaret
Apprentice
*

Posts: 45
Likes Given: 3
Likes Received: 1 in 1 posts
Joined: Apr 2016
Reputation: 0



Post: #5
RE: NPC turn rate
Is here some trigger which runs faster(more repeats) then @Hitcheck in combat ?
07-12-2017 09:13 AM
Find all posts by this user Like Post Quote this message in a reply
PePs1Man
Apprentice
*

Posts: 32
Likes Given: 8
Likes Received: 2 in 2 posts
Joined: Jun 2017
Reputation: 0



Post: #6
RE: NPC turn rate
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!
07-14-2017 06:13 AM
Find all posts by this user Like Post Quote this message in a reply
Indiaret
Apprentice
*

Posts: 45
Likes Given: 3
Likes Received: 1 in 1 posts
Joined: Apr 2016
Reputation: 0



Post: #7
RE: NPC turn rate
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.
07-15-2017 12:41 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #8
RE: NPC turn rate
I tried with the trigger @NpcActFollow ( http://wiki.spherecommunity.net/index.ph...CActFollow )

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.
07-20-2017 10:36 PM
Find all posts by this user Like Post Quote this message in a reply
Indiaret
Apprentice
*

Posts: 45
Likes Given: 3
Likes Received: 1 in 1 posts
Joined: Apr 2016
Reputation: 0



Post: #9
RE: NPC turn rate
Tried aswell. Not helps a lot, because this fires only when he do some action - best solution is through item + timerd, as wrote pepsi.
07-21-2017 03:02 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Indiaret's post
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #10
RE: NPC turn rate
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
07-27-2017 12:25 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Coruja's post
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)