# Navigation UI

<figure><img src="/files/CGk1SwP92I2HWMvhFrnl" alt=""><figcaption></figcaption></figure>

### What Is the Navigation UI?

The **Navigation UI** is a built-in client feature that helps players find their way around the world of The Ragnarok Classic. Instead of memorizing every map, warp, and NPC location, you can simply open the navigation window and let the system plot a path for you — complete with an on-screen arrow guiding you step by step.

The Ragnarok Classic's navigation data is **custom-generated** from the server's own map, NPC, warp, and monster databases, so the information you see always matches what is actually in-game.

***

### How to Open Navigation

| Method                | Description                                                                                        |
| --------------------- | -------------------------------------------------------------------------------------------------- |
| **Shortcut Key**      | Press **Alt + Enter** (default) or check your `/keyconfig` for the Navigation toggle.              |
| **Menu Bar**          | Click the **Navigation** icon on your Basic Info window.                                           |
| **NPC / Quest Links** | Some quests and NPCs will automatically open the navigator and point you to your next destination. |

***

### What Can You Search For?

The Navigation UI indexes three main categories of in-game objects:

#### NPCs

| Type             | Description                                                                         |
| ---------------- | ----------------------------------------------------------------------------------- |
| **Regular NPCs** | Quest givers, service NPCs, and other interactable characters displayed on the map. |
| **Shop NPCs**    | Tool Dealers, weapon shops, and other merchants (including Cash Shop NPCs).         |

> Hidden NPCs, invisible warps, and Guild Flags are **excluded** from the navigation index — you won't see placeholder or script-only objects cluttering the list.

#### Monsters

You can search for any monster by name. The navigator will show you:

| Info            | Details                                                                        |
| --------------- | ------------------------------------------------------------------------------ |
| **Map**         | Which map(s) the monster spawns on.                                            |
| **Spawn Count** | How many of that monster exist on each map.                                    |
| **Level**       | The monster's base level.                                                      |
| **Properties**  | Element, element level, size, and race — useful for planning your damage type. |
| **MVP Flag**    | MVPs are visually distinguished from regular monsters.                         |

#### Maps & Warps

The system knows every warp portal and NPC-scripted teleporter on the server. When you select a destination:

1. The pathfinder calculates the **shortest walkable route** from your current position.
2. If the destination is on a **different map**, it chains together warp portals to build a multi-map route.
3. An on-screen arrow guides you to each warp in sequence until you arrive.

***

### Transportation Services

When plotting a route, the Navigation UI can factor in various transportation methods to find the fastest path:

| Service                    | Description                                                          |
| -------------------------- | -------------------------------------------------------------------- |
| **Walking Only**           | Navigate purely on foot through warp portals.                        |
| **Kafra Teleport**         | Include Kafra warp services in the route.                            |
| **Airship**                | Include airship routes (airport maps) in the route.                  |
| **Scroll / Special Warps** | Include special scroll-based or event warps.                         |
| **Combined**               | The system can mix any combination of the above for optimal routing. |

***

### Map Classifications

Behind the scenes, each map is classified into a type so the pathfinder knows how to handle it:

| Type                     | Code | Description                                                                                                         |
| ------------------------ | :--: | ------------------------------------------------------------------------------------------------------------------- |
| **Normal**               | 5001 | Standard open maps — fields, towns, and dungeons where all areas are walkable between each other.                   |
| **Airport / Airship**    | 5002 | Special transportation maps tied to the airship system.                                                             |
| **Segmented**            | 5003 | Maps with disconnected walkable areas (e.g., multi-floor indoor maps). You must use a warp to reach other sections. |
| **Segmented + Monsters** | 5005 | Same as segmented, but with monster spawns — typically dungeon maps with separated floors or wings.                 |

***

### How Pathfinding Works

The Ragnarok Classic uses the **A\* (A-star) algorithm** — the same pathfinding method the game client uses — to pre-compute navigation data. Here's what happens:

1. **Cell-level walkability** is checked against the map's collision data. Walls, water, and non-walkable cells are respected.
2. **Diagonal movement** is only allowed when **both** adjacent cardinal cells are walkable, preventing the path from cutting through wall corners.
3. **Manhattan distance** is used as the heuristic (estimated cost), matching the client's own behavior.
4. The maximum path length is **1,024 cells** per single map — more than enough to cross even the largest fields.

#### Multi-Map Routing

For destinations on a different map, the system pre-computes two distance tables:

| Table             | Purpose                                                                                                                                                                          |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **NPC Distance**  | For every NPC, the walking distance to every warp that leads *into* that NPC's map. This lets the system know the "last mile" cost.                                              |
| **Link Distance** | For every warp *out* of a map, the walking distance from the warp's destination to every other warp *out* of that destination map. This lets the system chain warps efficiently. |

By combining these tables, the navigator can instantly find the optimal sequence of warps to reach any point in the game world.

***

### Navigation Data Files

The Ragnarok Classic generates the following client-side navigation data files:

| File                          | Contents                                                                                                   |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------- |
| `navi_map_krpri.lub`          | All map entries — name, type, and dimensions.                                                              |
| `navi_npc_krpri.lub`          | All visible NPC entries — name, sprite, position, and type (NPC or Shop).                                  |
| `navi_mob_krpri.lub`          | All monster spawn entries — name, sprite, level, count, element, size, race, and MVP status.               |
| `navi_link_krpri.lub`         | All warp connections — source map/position, destination map/position, and link type (portal vs. NPC warp). |
| `navi_npcdistance_krpri.lub`  | Pre-computed walking distances from every NPC to nearby warps.                                             |
| `navi_linkdistance_krpri.lub` | Pre-computed walking distances between connected warps for multi-map routing.                              |

These files are regenerated whenever the server's map or NPC data changes, ensuring the navigation UI always stays accurate.

***

### Tips

* **Navigate to a monster** — Type a monster name in the search bar and the navigator will show every map it spawns on, along with spawn counts. Great for finding farming spots.
* **Navigate to an NPC** — Looking for a specific NPC like the Refiner or a quest giver? Just search their name.
* **Follow the arrow** — Once a destination is set, a directional arrow appears on your screen pointing you toward the next waypoint. Just follow it.
* **Multi-map paths** — If your destination is several maps away, the navigator will guide you through each warp in order. No need to memorize the dungeon entrance locations.

***

{% hint style="info" %}
**Note:** The navigation data is generated directly from The Ragnarok Classic's server files, so every NPC, warp, and monster location you see in the navigator matches the live server. If something was added or moved, the navigation data reflects it.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://the-ragnarok-classic-1.gitbook.io/wiki/server-features/navigation-ui.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
