Jump to content
Existing user? Sign In

Sign In

Sign Up

Increasing maximum amount of NPC's


Recommended Posts

A lot of servers are starting to use OSRS spawn dumps + have their own custom NPC spawns/instances, issue is most 317 clients are still only allowing 16k or 32k npcs, this is how to increase it too 65k(what OSRS currently uses)


Client side:

Change npc array size

npcs = new Npc[65536];


Find the following still in Client.java

 = new Npc();

Above it change the while() loop/break + the first bit read to match

while (stream.bitsRemaining(i) >= 28) {
    int k = stream.readBits(16);
    if (k == 65535) {
    if (npcs[k] == null) {
       npcs[k] = new Npc();



Server Side

Again change your npc collection to support 65k npc's

Find where your npc update packet sends the npc index, below is for Xeros

public void addNewNPC(NPC npc, Stream str, Stream updateBlock, boolean flag) {
    int id = npc.getIndex();
    npcList[npcListSize++] = npc;
    str.writeBits(14, id);

Change the writeBits(14, id) too writeBits(16, id);


Next server side you'll want to find the following

writeBits(14, 16383);

Change this too

writeBits(16, 65535);

And this should be it, you can now properly support 65k npcs. The examples used here are for Xeros, but it shouldn't be hard to replicate for other bases

Edited by Adam
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



RSPS Partners


What is a RSPS?

A RSPS, also known as RuneScape private server, is an online game based on RuneScape, and controlled by independent individuals.

Popular RSPS Servers

oldschoolrsps Runewild RedemptionRSPS


Runesuite is not affiliated with runescape, jagex, rune-server and runelocus in any way & exists solely for educational purposes.

  • Create New...