Technology

How BeaTzVision Works Internally:
From Capture to Click

· 7 min read · BeaTzTools

In short: BeaTzVision does the same thing in a loop: it photographs the game window, converts the image so that detection stays stable, searches it for the Metins you captured, picks the closest target and then simulates mouse and keyboard. The game process is never touched.

In this article
  1. Capturing the window
  2. Preparing the image
  3. Finding stones
  4. Picking a target
  5. Clicking and typing
  6. Why this matters on private servers

1. Capturing the window

The bot does not photograph the whole screen, only the area of your game window. That is faster, and it keeps Discord, a browser or a second client out of the detection.

Areas that get in the way can be hidden with masks. The bot paints them black in the captured image before it even starts searching. Typical candidates are the chat, the minimap or a status bar where something occasionally appears that resembles a Metin.

2. Preparing the image

The colour image then becomes a greyscale image. That sounds like losing information, but it is exactly right: shape and contrast decide a match, not colour.

CLAHE runs on the greyscale image, a contrast equalisation that splits the picture into 8×8 tiles and brightens or darkens each tile on its own. The difference to global brightening is large: a stone in the shade of a tree and the same stone in bright sunlight end up looking similar enough that one template finds both.

Why this matters

Most detection problems on private servers come from brightness: different gamma values, different effects, a different time of day in game. Contrast equalisation absorbs part of that. The rest is down to how you capture.

3. Finding stones

Now comes the actual search, template matching. Your captured image is slid across the live image, and for every position OpenCV calculates how well the two fit. The result is a value between 0 and 1. Above your threshold, the stone counts as found.

Two things make this more robust than it sounds:

For things that are more reliably recognised by colour, such as health bars or player dots on the minimap, the bot works in the HSV colour space instead. There, hue, saturation and brightness are separate, which lets you say "this hue, no matter how bright".

4. Picking a target

Usually the bot finds several stones at once. All matches are sorted by their distance to the centre of the screen, and the centre is your character. The nearest stone goes first, because the shortest walk yields the most stones per hour.

Around your own character there is an exclusion zone of roughly 80 pixels. Matches inside it are discarded. Without it, the bot would occasionally click your own horse, your own name or an effect on the character.

5. Clicking and typing

Finally the image coordinates become an input. The mouse moves to the position, waits briefly and then clicks. Key presses are held for roughly 70 to 140 milliseconds, and releasing takes another 40 to 80. These times differ slightly with every single click.

The input goes through the normal Windows input path, optionally through a driver at the level of a real mouse. In both cases it is an ordinary input event, the kind any other program produces.

Why this matters on private servers

Every private server has its own Metin models, its own interface and often its own effects. That is exactly why you capture the stones yourself instead of using a shipped list, and why captures are stored per server. Switch servers and the bot switches templates with you. Whether yours is in the server list, you can check there.

The second point is the architecture: no access to the game process, no hook, no modified file. What that means technically is covered in Pixel Bot vs. Memory Injection. How to configure detection in practice is in the farmbot guide, and if nothing is detected at all, the troubleshooting guide helps.


Frequently asked questions

Does BeaTzVision read the game's memory?
No. The bot never touches the game process. It captures the image of the game window, analyses it with OpenCV and simulates mouse and keyboard input. There is no handle on the game, no hook and no modified game file.
Why do I have to capture the stones myself?
Because every private server looks different: other Metin models, another interface, other colours. The bot searches for exactly the image you captured. That is also why captures are stored separately per server.
What does the detection threshold mean?
Template matching returns a value between 0 and 1 for every position in the image. The threshold decides when a match counts. Too high and stones are missed; too low and the bot finds stones where there are none.
Why does the bot click the nearest stone first?
All matches are sorted by their distance to the centre of the screen, and the centre is your character. The shortest path saves walking time and therefore yields more stones per hour.

Ready to try it yourself?

Join the BeaTzTools Discord and get access to BeaTzVision and BeaTzSignal, setup guides and support.

Try it free →