Forums

> Penguin Herding & Trapping <

Quick find code: 75-76-533-65301494

Shady Guy

Shady Guy

Posts: 5,994 Rune Posts by user Forum Profile RuneMetrics Profile
9.1 The Game Tick

Starting with this page, the more technical information begins to appear. Items that I am actively researching or I feel are in need of research also will appear. If you are just looking how to herd and trap a penguin effectively, most information on this page and after it will not be of interest to you.

A tick is the length of time it takes to loop around the entire game code, consequently everything should happen in a multiple of ticks.

Working backwards from some benchmark tests, Powotae estimated that 1 tick is approximately 0.63125 seconds. This could be at a different value now since the benchmark test is many years out of date!

(Thank you to Qloque here)

Ping is measured in ms, so if your connection to a game world shows a ping of 20ms, you can assume that you receive a game state update about 10ms after it has been calculated.

Since, to a first approximation, I only receive one update on the game state every 0.62 seconds (+/-), I would expect average delay between my taking an action and that action being incorporated into the game state to be about

0.5 * (ping + tick).

This is why there is click lag, as I described earlier. It takes time to integrate your feedback into the code sequence and run it. You will have to react at slightly different rates to penguin movements at different pings.

In general, a world with a lower ping is easier to herd on than a world with higher ping due to click lag!
~ Bill ^_^

18-Feb-2014 03:18:22 - Last edited on 18-Feb-2014 03:33:30 by Shady Guy

Shady Guy

Shady Guy

Posts: 5,994 Rune Posts by user Forum Profile RuneMetrics Profile
9.2 Movement Order

The basis is that during each game tick everything gets ONE chance to move.
A game tick can be thought of as 1 loop of the code and takes approximately 0.62 seconds.


For our purposes we will say there are 3 types of things that require moving, pets, players, and NPCs (NPCs not including pets).

Throughout this section I will use the term Rank. If A has a higher rank than B then A comes earlier in the code and will move first. Both A and B should be of the same type (both players or both pets or both NPCs)

Below is an example loop showing the basic ordering every time, it goes NPCs then Pets then Players.


1. NPC#1: Guard (in Yanille)
2. NPC#2: Penguin
3. NPC#3: Terror bird (gnome stronghold)
4. Pet#1: Platypus
5. Pet#2: Tooth creature
6. Player#1: A Crazy Guy
7. Player#2: Axe Wiz
8. (The rest of the code, then go to 1)

.•´¯`•._.•´¯`•.

NPC movement order cannot be manipulated. They have a specific order on every world.

Pet movement order can be easily manipulated. When you drop your pet it will move to the end of the list and have the lowest rank of all pets. So if the Platypus was called it would move below the Tooth creature.

Players movement order is 'randomly' assigned with each action now. It will change frequently. Many very effective moves that relied upon players having (fairly) consistent ranks no longer work properly and have been removed from the guide.


Why does this matter? It determines who occupies a space if two different NPCs/pets are wishing to move to the same one. The NPC higher on the movement order will move first, thus will occupy that space and will block the other from going into that space.


Also, determining the movement order of penguins is one method that was used to crack the penguin pattern.
~ Bill ^_^

18-Feb-2014 03:18:29 - Last edited on 23-Feb-2014 20:20:42 by Shady Guy

Shady Guy

Shady Guy

Posts: 5,994 Rune Posts by user Forum Profile RuneMetrics Profile
9.3 An Example - Determining Penguin Movement Order

I mentioned how this was used to help crack the penguin pattern when it changed. It is a perfect example of how the code works.

Here is how to test which penguin moves first in the code:

Set up like this and wait.

X X X X X X

X
A
B
_ _ .
Z

X X X X X X


*If* penguin A is pushing East when penguin B decides to move East then they will move off together. (or the opposite if they are on the East side of the trap)
The gap however will be smaller if penguin B is higher in the list.

Why?

The penguins NPC numbers are right next to each other.

Each time the code runs (about 0.64 seconds) the penguins get ONE chance to move, with the higher one taking it's go a fraction of a second before the lower one.

If penguin B is higher:

1. Penguin B decides to move East and tells the game to block that square and unblock the square it is on
2. now its Penguin A's turn to try to move, it was pushing East and can see it is now available so moves onto it.
3. The rest of the code is run.

If penguin A is higher:

1. Penguin A takes it's go to move, it pushes East but can not move.
2. Penguin B takes his go, decides to move East and tells the game to block that square and unblock the square it is on
3. The rest of the code is run.
4. Now, finally, it's Penguin A's go again, it still wants to move East and now it is available so moves.

.•´¯`•._.•´¯`•.

The gap is small, but can be noticed with a sharp eye.

How this helped us is that the 2 point penguin on strand 1 (we called it 2.1) always moved before every other penguin, followed by the one point penguin on strand 1 (1.1).

After that, the movement order is 2.2, 1.2, 2.3, 1.3, 2.4, 1.4, 2.5, and finally 1.5. Doing move tests told us which strand a penguin was on.

Later on in the thread, I'll reveal the other tactic we used to keep track of the penguins week to week.
~ Bill ^_^

18-Feb-2014 03:18:35 - Last edited on 18-Feb-2014 03:34:34 by Shady Guy

Shady Guy

Shady Guy

Posts: 5,994 Rune Posts by user Forum Profile RuneMetrics Profile
9.4 Types of NPCs

Different NPCs have different attributes defining how they move / interact with penguins, I will do my best to replicate that list, even though some are of little or no consequence to penguins. Some of these have little evidence backing them up. If you find an anomally please tell me so I can look into it.

An NPC, in theory could have any combination of the below attributes, which are mostly either Yes or No.

a. Act as a block to other NPCs of this type.
b. Move Diagonally (like penguins) or 8 way
c. Stationary
d. a Quest NPC who do not always show (invisible NPC)
e. Always block all other npcs
f. Always block players. (same as f?)
g. Roam range, a square of X squares from the spawn point
h. Roam range if trying to attack someone.
i. Roams on a very specific path that is consistent
j. Reset time is Y mins (usually 5-7)
k. Aggresive or follows (if cant be killed)
l. Can be killed
m. IMPORTANT

The NPC#

To the best of our understanding, every NPC in the game has an id number assigned to it. When the code runs to decide which ones should move where it takes each one of these in turn, and allocates them their new spot.

This means that if 2 NPCs wanted to get to the same spot (who block squares) then the first one in this list would take that spot, with the other one moving elsewhere/nowhere.

Penguins, as shown in the above post, have their own NPC#. Any NPC above them on the master movement list will move in the code before a penguin. Any after the penguin will wait for the penguin to move!

This also means NPCs who are higher/earlier in this list than penguins can be used as permanent blocks to penguins as they will reclaim that spot before the penguin can claim it. If you can get it to reset quickly and frequently if it cannot reach you, the penguin is permanently trapped behind it!
~ Bill ^_^

18-Feb-2014 03:18:41 - Last edited on 18-Feb-2014 03:35:19 by Shady Guy

Shady Guy

Shady Guy

Posts: 5,994 Rune Posts by user Forum Profile RuneMetrics Profile
9.5 Explaining NPC Attributes

See the above post before reading this one.


a. Either NPCs block, or they don't. So if an npc is blocked by a pet, it will block a penguin. If NPCs block then players can block them too.
The 1 exception to this is implings, see post 9.7 for more details.


b. The pirates on Mos Le Harmless move 8 ways, and effect the usability of special traps like the small building N.W of the bank.

d. Some Quest and other NPCs who are not always there. I call these 'invisible NPCs'. More on these on post 9.6.

e/f. The Apes in the Jail on Ape Atoll. Players and other NPCs cannot break or move past them.

h. The roam range when attacking is usually 1 more than the natural roam range (attribute g) but sometimes it can be a lot different, such as the rams near the Make Over Mage.

i. Hans in Lumbridge and Will in the Sawmill are perfect examples. If you block them, they will eventually teleport/walk through the obstacle on their way to the next stopping point.

j. NPCs can be reset the same way penguins can (keeping them trapped on 1 spot). They usually reset after 5 minutes. See post 9.8 for reset theory information.

One exception however is when NPCs are 1 spotted within X squares from their respawn point. (X is at least 2) They will walk through unwalkable objects toward their respawn spot at the time they were due to reset.


k. e.g. The stray dogs in Varrock move in the same way monsters do when attacking you.
~ Bill ^_^

18-Feb-2014 03:18:48 - Last edited on 18-Feb-2014 03:35:41 by Shady Guy

Shady Guy

Shady Guy

Posts: 5,994 Rune Posts by user Forum Profile RuneMetrics Profile
9.6 Invisible NPCs (Caspers) and Blocks

NOTE: Powotae called them 'ghost herders', but with the new ghost penguin, I have changed that terminology to avoid confusion.


You are herding a penguin over what appears to be open terrain. Suddenly, the penguin does something very bizzare, like go in a straight line direction (west, east, north, or south)! You walk over the same terrain as the penguin did, and there are no odd squares there that are hidden blocks (more on these in a bit).

It is likely (though not 100% certain) that a 'casper' is responsible for how the penguin behaved. No, these are not NPC* that can be seen with a ring of visibility. These are all of the NPC* that appear because of quests or other events.

The code treats these NPCs as if they are always present, no matter if you can see them or not. They have an NPC#, can block penguins/pets/other NPCs, and can even bump penguins out of special traps! Frankly, they are a nuisance if you aren't expecting them.

Some of you are no doubt questioning my sanity at this point. If you have hired a servant for your POH, take your pet to the Servant's Guild in Ardougne. Try to herd as many NPCs as possible into the northern room. You will begin to see them act weirdly.

That is because the servant you hired is still there, only it is a 'casper'!


Invisible Blocks

To make herding even more fun, there are places where items can appear and disappear causing more spaces to be unwalkable. These are invisible blocks that will also cause your penguin to act weirdly.

The table at Frenkenstrain's castle (in the middle room) is a perfect example. It is invisible to most, but it is always there. A penguin cannot move there.

The circus locations are also invisible blocks. Neither you nor the penguin can step on them, even if the circus is not there.

There are likely many more places like this throughout the game.
~ Bill ^_^

18-Feb-2014 03:18:54 - Last edited on 18-Feb-2014 03:36:06 by Shady Guy

Shady Guy

Shady Guy

Posts: 5,994 Rune Posts by user Forum Profile RuneMetrics Profile
9.7 Impling Movement

Implings are funny creatures, they seem to gravitate towards the same locations as penguins do.

What this post is mainly about though is how implings act when moving.

Observations:

a. Implings DO NOT block penguins / other npcs / implings from moving over them.

b. npcs like penguins and players DO block implings from moving over them.

c. Implings move on what I like to call lvl 0.5, meaning they can fly over low objects the same way spying penguins works, or mage / ranging things.

Shades in Mort'on, and Ghasts also seem to move on this level.

I also suspect that the
Ghost Penguin
might be programmed to move at this level, with the added stipulation that NPCs, pets, and players cannot block it. It would explain why the ghost can move over water and hillsides but NOT through buildings or fences.


If you feel any other NPCs move on this level, post here.

d. If reset that impling will respawn, as the same type, in the same place as it originally appeared and will not make the spawning sound they make.

e. Implings in most cases do not block each other.

I think this is because when implings check to see if they can move in a direction they first check ground level. If that is free then they move. If not they then check level 0.5, and if that is free they move.

As implings are only on level 0.5 they do not block each other when there is space below them. however if there is no space below them (like water, and other low object) they will block each other from moving.

It will be nigh impossible to test that theory out though. :(
~ Bill ^_^

18-Feb-2014 03:19:00 - Last edited on 18-Feb-2014 03:36:32 by Shady Guy

Shady Guy

Shady Guy

Posts: 5,994 Rune Posts by user Forum Profile RuneMetrics Profile
9.8 Pets and Familiars

As stated on post 1.10 , only three pets/familiars have been discovered that can block an NPC. They are as follows:

platypus
tooth creature
holiday squirrels from a long time ago


Most pets or familiars have not been tested, especially with the Solomon General Store coming out. If anyone finds a pet or familiar that can block, let us know ASAP!



I can confirm that the following pets/familiars HAVE been tested and proven that they cannot block:

troll pet
fire pet
'The Jad pet'
Baby Dragon (tested Blue/black/green/red hatchling and blue baby)
Raven (tested adult and chick)
Pack Yak
Spirit graahk
Gecko
Penguin
Broav
Cat (Wily hellcat, kitten, overgrown, lazy hellcat tested)
Clockwork cat
10. Rune Guardian
Giant Crab
Imp Banner Carriers
Meercats
Geyser titan
Labrador (puppy tested)
Spirit terrorbird
Moss titan
Monkey (baby tested)
Giant crab (baby tested)
20. Arctic bear
Macaw
Bull ant
Giant ent
Saradomin Owl (middle stage tested)
Spirit spider
Abyssal parasite
Fire titan
Unicorn stallion
Mean phoenix eggling
30. Abyssal lurker
War tortoise
Void ravager
The Ex-ex-parrot
Rac****
Guthix raptor (adult tested)
Bunyip
Magpie
Stranger plant
Barker toad
40. Mithril minotaur
Hydra
Granite lobster
Lava titan
Spirit kyatt
Wise old man (During "Love Story" quest)
SneakerPeeper (baby tested)
Creeping hand
~ Bill ^_^

18-Feb-2014 03:19:07 - Last edited on 03-Dec-2015 23:58:48 by Shady Guy

Shady Guy

Shady Guy

Posts: 5,994 Rune Posts by user Forum Profile RuneMetrics Profile
9.9 NPC Reset Theory


ALL NPCs (including penguins) reset after 40 failed move sequences.

Most have a move sequence of 12 ticks (7.575 seconds), this was timed using penguins as you can hear / see it if they fail to move.

This gives a total time of 7.575*40 /60 = 5:03 for NPCs to reset.

Powotae has reset a Tooth creature in a POH. It has no 'stop' command and it's reset time is exactly 5:03 (3 times). I used this to work backwards to get the figure of 0.63125 seconds per tick using the guess of 40 moves. My previous estimate was 0.64. (c)


.•´¯`•._.•´¯`•.


With penguins, it is a bit different.


I think each move sequence for a penguin is 12 ticks and that sequence comes with 2 move attempts, probably 6 ticks apart. Every 12 ticks the penguin sticks it's head up, but it can move at a point between this.

Because of this, penguins take about 7 minutes to reset, and the time varies a bit, this is due to the way the 'stop' command works. If they chose to stop, then the start of the next 2 move sequences will not result in a movement, in other words, they will stick their head up and down 2 times without moving. (Although they could move before they stick their head up a 3rd time).

Take this time out of the moves required for reset, since the penguin has no choice to start move at these point.

A penguin has an equal chance of picking any 1 of the diagonals or choosing not to move (1/5 each). so 1/5 of these 40 moves when 1 spotted will take roughly 3 times longer than the 7.575 seconds per move sequence. (22.7 seconds for 3 complete no moves, or 18.9 seconds for 2.5 sequences)

So on average the penguin reset time will be
4/5 *40 *7.575 + 1/5 *40 *(22.7+18.9)/2 = 6:49

Yet this is not the case, as shown in the next post. Something else is missing. Hopefully, I can figure out where the math goes wrong.
~ Bill ^_^

18-Feb-2014 03:19:14 - Last edited on 18-Feb-2014 03:37:08 by Shady Guy

Shady Guy

Shady Guy

Posts: 5,994 Rune Posts by user Forum Profile RuneMetrics Profile
9.10 Penguin Reset Stats

This is currently a small sample size. The tests were conducted by Powotae. I am hoping on a quiet week (yeah, right) to conduct about 100 more for a decent sample size and then average them out.

Powotae testing:

7:01.60
7:06.52
7:08.60
7:13.08
7:17.12
7:32.40
7:34.92
7:41.00
7:42.60
7:51.32
7:56.20
7:56.40
8:07.12
8:28.52
~ Bill ^_^

18-Feb-2014 03:19:20 - Last edited on 18-Feb-2014 03:37:39 by Shady Guy

Quick find code: 75-76-533-65301494 Back to Top