Thread: How to extend on client npc view distance?

Results 1 to 3 of 3
  1. #1 How to extend on client npc view distance? 
    Registered Member Mechanikas's Avatar
    Join Date
    Jan 2012
    Posts
    205
    Thanks given
    18
    Thanks received
    7
    Rep Power
    36
    How to extend on client npc view distance?
    Reply With Quote  
     

  2. #2  
    Donator


    Join Date
    Jul 2011
    Posts
    922
    Thanks given
    196
    Thanks received
    169
    Rep Power
    189
    15 is the default distance client-sided.
    Code:
    int l = stream.readBits(5);
    if (l > 15) {
    	l -= 32;
    }
    
    int i1 = stream.readBits(5);
    if (i1 > 15) {
    	i1 -= 32;
    }
    To increase you have to also increase the amount of bits read and change 32 to 64 for 6 bits:
    Code:
    int l = stream.readBits(6);
    if (l > 20) {
    	l -= 64;
    }
    				
    int i1 = stream.readBits(6);
    				
    if (i1 > 20) {
    	i1 -= 64;
    }
    Server-side where you send your npc position when adding npcs (the part where you send npcbits):
    Code:
    putBits(5, ...
    to
    Code:
    putBits(6, ...
    Server-sided NPC updating where you check for the distance of npcs you need to change 15 to 20 or your desired amount of distance.

    You may also want to do the same thing for players..Otherwise you would see npc-s being attacked by invisible players (cause they are not being rendered).
    Reply With Quote  
     

  3. #3  
    Registered Member
    Tamatea's Avatar
    Join Date
    Aug 2010
    Posts
    1,283
    Thanks given
    379
    Thanks received
    334
    Rep Power
    2318
    You also need to extend it in the npc updating section of player updating

    [Only registered and activated users can see links. ]



    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [PI] NPC walking distance
    By susurik in forum Help
    Replies: 1
    Last Post: 02-06-2011, 06:47 PM
  2. Max view distance
    By Rune Mud in forum Help
    Replies: 2
    Last Post: 12-12-2010, 10:20 PM
  3. [Battlescape] Npc Hitting Distance
    By rayzr in forum Help
    Replies: 0
    Last Post: 06-17-2010, 02:28 AM
  4. NPC talking distance
    By Underoath in forum Requests
    Replies: 2
    Last Post: 10-21-2009, 03:09 AM
  5. NPC Magic Distance Bug Fix
    By Zekkalkan in forum Tutorials
    Replies: 5
    Last Post: 05-06-2007, 07:21 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •