So you think your server is an emulation?

_jordan

WVWVWVWVWVWVWVW
 
Nov 20, 2012
3,135
950
0
I've compiled a small yet necessary collection of gifs to show multiple scenarios that must be accounted for when it comes to RuneScape and its internal mechanics.
All of these scenarios shown are easily repeatable and are applied across the entire game, Npcs, Locs, Objs, Players, etc.

There are many gifs so I will just link to the repo here: GitHub - ultraviolet-jordan/testing-scenarios

Goodluck with your testing :)
 
  • Like
Reactions: Mgt Madness
The small things that make a big difference. Great thread.
 
I had no idea you could block NPCs damn.

Also what does AP to OP Switching mean exactly?
 
I had no idea you could block NPCs damn.

Also what does AP to OP Switching mean exactly?

OP and AP directly refer to interacting with an "Entity" and there are two ways of doing so.

OP - Operate/Operable

Green = Represents where you can interact when you are operating.
Note: This picture shown is specifically for interacting with an Npc, Player or Loc.
lZbiCj4.png


Some examples are:
- Melee combat.
- Talking to an npc.

To be within OP distance, you must have direct LineOfWalk to the target.
Code:
    inOperableDistance(target: Entity): boolean {
        if (target.level !== this.level) {
            return false;
        }
        if (target instanceof PathingEntity) { [COLOR="#FFFF00"]// targetting an Npc or Player[/COLOR]
            return reached(this.level, this.x, this.z, target.x, target.z, target.width, target.length, this.width, target.orientation, -2);
        } else if (target instanceof Loc) { [COLOR="#FFFF00"]// targetting a Loc[/COLOR]
            const forceapproach = LocType.get(target.type).forceapproach;
            return reached(this.level, this.x, this.z, target.x, target.z, target.width, target.length, this.width, target.angle, target.shape, forceapproach);
        }
        [COLOR="#FFFF00"]// targetting an Obj[/COLOR]
        const shape = isFlagged(target.x, target.z, target.level, CollisionFlag.WALK_BLOCKED) ? -2 : -1;
        return reached(this.level, this.x, this.z, target.x, target.z, target.width, target.length, this.width, 0, shape);
    }
Source: Server/src/lostcity/entity/PathingEntity.ts at main 2004scape/Server GitHub

Once you are within the correct distance, the script triggers and runs the code:
Code:
[opnpc1,obli]
~chatnpc(default, "Welcome to Obli's General Store Bwana!|Would you like to see my items?");
def_int $option = ~p_choice2("Yes please!", 1, "No, but thanks for the offer.", 2);

switch_int ($option) {
    case 1: 
    ~chatplayer(happy, "Yes please!");
    ~openshop_activenpc;
    case 2:
    ~chatplayer(default, "No, but thanks for the offer.");
}

--

AP - Approach/Approachable

Green = Represents where you can interact when you are approaching.
K0vRm3F.png

AP can be dynamically modified depending on the current action using a command called p_aprange
Code:
[command,p_aprange](int $range)
ZQyrycX.png


Some examples are:
- Ranged/Magic combat.
- Talking to Bankers which are behind the Bank Booths

To be within AP distance, you must have direct LineOfSight to the target as well as be within the specified aprange to the target.
Code:
    inApproachDistance(range: number, target: Entity): boolean {
        if (target.level !== this.level) {
            return false;
        }
        if (target instanceof PathingEntity && Position.intersects(this.x, this.z, this.width, this.length, target.x, target.z, target.width, target.length)) {
            // pathing entity has a -2 shape basically (not allow on same tile) for ap.
            // you are not within ap distance of pathing entity if you are underneath it.
            return false;
        }
        return Position.distanceTo(this, target) <= range && hasLineOfSight(this.level, this.x, this.z, target.x, target.z, this.width, target.width, target.length, CollisionFlag.PLAYER);
    }
Source: Server/src/lostcity/entity/PathingEntity.ts at main 2004scape/Server GitHub

Once you are within the correct distance, the script triggers and runs the code:
Code:
[apnpc1,_bank_teller]
if (npc_range(coord) > 2) {
    p_aprange(2);
    return;
}
@talk_to_banker;

Note: all AP interactions are initially set to 10 aprange, then the content script can modify that range and rerun the trigger, as shown in the picture above.

----

In the cow scenario as shown in the gif:
ap%20to%20op%20switching.gif


- Npcs have both an AP and OP trigger defined for op2 (which is used for attacking npc).
- The AP trigger runs first where some code checks if the Npc is already in combat and sends you the message. This is necessary because the AP trigger is needed for Ranged and Magic combat so those styles need this message.
- Because I am wearing a melee style weapon, my aprange is set to 0 and the interaction is essentially converted into an OP one.
- Upon arriving within OP distance, the OP trigger runs and sends the message again. This is necessary because the OP trigger is needed for the Melee combat.

It's a bit more nuanced but this gives general process :yes:
 
Precisely why I've tried to amend the term "emulation" to "remake" wherever I can to try and stray away from semantic egoists giving criticism about not having this or that "legitimate bug" being in the game. Mad mad props to people truly emulating the good, bad, and the ugly for archival/historical purposes, but damn lots of these make the game feel so janky and inconsistent. Especially especially the blockwalk=ALL interactions and tabled items. Pretty cool to see a compiled list of examples of niche stuff for the people really going hardcore on the emulation front, though. Super helpful.
 
Precisely why I've tried to amend the term "emulation" to "remake" wherever I can to try and stray away from semantic egoists giving criticism about not having this or that "legitimate bug" being in the game. Mad mad props to people truly emulating the good, bad, and the ugly for archival/historical purposes, but damn lots of these make the game feel so janky and inconsistent. Especially especially the blockwalk=ALL interactions and tabled items. Pretty cool to see a compiled list of examples of niche stuff for the people really going hardcore on the emulation front, though. Super helpful.

The blockwalk=ALL was interesting to say the least.
The following npcs I am aware of use this:
- Draynor Trees (not all of them obv)
- Karmaja Fly Traps (not all of them obv)
- Legends Quest boulder
- Pest Control Npcs

When you become blocked by this property, your current steps are actually still there, if the npc could move away then you would continue walking to your destination without any futher input.
 
The following npcs I am aware of use this:

The gorillas in ape atol also come to mind. As much as I like the idea of emulating RS 1:1 as much as possible. I don't blame people for not wanting to add stuff like blockwalk all.
 
The blockwalk=ALL was interesting to say the least.
The following npcs I am aware of use this:
- Draynor Trees (not all of them obv)
- Karmaja Fly Traps (not all of them obv)
- Legends Quest boulder
- Pest Control Npcs

When you become blocked by this property, your current steps are actually still there, if the npc could move away then you would continue walking to your destination without any futher input.

Yeah it like... pausing your walk steps or something is super super interesting. Also surprising it's just not outright pathed around on the fly especially for static stuff like the trees.
 

Users who are viewing this thread (total: 1, members: 0, guests: 1)