• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

UniqueIDs and how to use it / How the Tibia Client differentiates mobs/npcs/players

Status
Not open for further replies.

Galdia

Banned User
Joined
Oct 5, 2025
Messages
13
Reaction score
4
Hey Guys,

I just read this post about using CIDs in the OT server to simplify things (not sure it's a great idea, but it did get me thinking):
Removing .otb – Only Using .dat (https://otland.net/threads/removing-otb-only-using-dat.301613/#post-2789558)

One topic that's not talked about as often in OTdev is UniqueIDs:

Note: By ‘UniqueID’ here I mean the per-session ID assigned by the server to each item/creature, not the static map UniqueID or the OTB Item ID.

You can actually sort of take advantage of these to unlock basically cool new additional functionality in the game!

While these values may look like random, there’s actually some meaningful structure behind them: Digging into the code, we see some meaning is encoded into the upper UniqueID bits.

For example:
  • All monster UniqueIDs start with: 0x4(0000000)
  • While player UniqueIDs start with: 0x1(0000000)

These values actually get interpreted by the Tibia client and directly affect how the game treats the entity.
For instance, if an ID starts with 0x1, the client treats it exactly like a player: enabling options like:
  • Add to VIP
  • Open trade
  • Add to party (note these all function, Even if the entity is actually a mob or NPC.)

To clarify; there may be even more to this, but what I'm explaining here is simply that by using the 0x10000000 ID prefix you can enable player-specific options.

How We Use It:
To get more interesting interactions between players and NPCs we've been using 0x1 uniqueIDs to allow NPCs to be added to VIP lists and messaged privately.
For example if you message the 'Maya' NPC she will write down any issues or suggestions and then automatically emails the game devs (us).
Btw: To deal with the ambiguousness of player messages we use a free LLM (Gemma3) for language understanding / response generation.

Future Ideas:
In theory, this could open the door to more creative mechanics, like:
  • Letting neutral mobs join a player’s party
  • Allowing trades with wild orc NPCs etc
Discussion is always welcome, also please share if this trick inspires any ideas.
Do let me know if I have messed up any terminology or failed to explain fully,

OT dev is so fun, We really appreciate you guys!
 
In my opinion there are two lines of thought on what you just said if we generalize it.

We start by thinking of a new game mechanic and then:
  1. Try to implement it on the original client with these kinds of hacks you mentioned.
  2. Use custom client with the option of changing the game protocol as needed.
Both of them are valid.

Another one is that monsters can also have skulls (not sure about NPCs). So you can create a poor's man "fiend" creature on the old client too using the white, yellow, red and black skulls (is there an orange one? I can't remember).

In the end we are just limited by how old the client is.
If you use a custom client you are not limited at all.
 
Getting the most out of the official protocol is a bit of a dark art!

Using custom client / protocols anything is indeed possible, though writing servers which support all clients is also very nice.
 
Hey Guys,

I just read this post about using CIDs in the OT server to simplify things (not sure it's a great idea, but it did get me thinking):
Removing .otb – Only Using .dat (https://otland.net/threads/removing-otb-only-using-dat.301613/#post-2789558)

One topic that's not talked about as often in OTdev is UniqueIDs:

Note: By ‘UniqueID’ here I mean the per-session ID assigned by the server to each item/creature, not the static map UniqueID or the OTB Item ID.

You can actually sort of take advantage of these to unlock basically cool new additional functionality in the game!

While these values may look like random, there’s actually some meaningful structure behind them: Digging into the code, we see some meaning is encoded into the upper UniqueID bits.

For example:
  • All monster UniqueIDs start with: 0x4(0000000)
  • While player UniqueIDs start with: 0x1(0000000)

These values actually get interpreted by the Tibia client and directly affect how the game treats the entity.
For instance, if an ID starts with 0x1, the client treats it exactly like a player: enabling options like:
  • Add to VIP
  • Open trade
  • Add to party (note these all function, Even if the entity is actually a mob or NPC.)

To clarify; there may be even more to this, but what I'm explaining here is simply that by using the 0x10000000 ID prefix you can enable player-specific options.

How We Use It:
To get more interesting interactions between players and NPCs we've been using 0x1 uniqueIDs to allow NPCs to be added to VIP lists and messaged privately.
For example if you message the 'Maya' NPC she will write down any issues or suggestions and then automatically emails the game devs (us).
Btw: To deal with the ambiguousness of player messages we use a free LLM (Gemma3) for language understanding / response generation.
creador de super bear adventure
Future Ideas:
In theory, this could open the door to more creative mechanics, like:
  • Letting neutral mobs join a player’s party
  • Allowing trades with wild orc NPCs etc
Discussion is always welcome, also please share if this trick inspires any ideas.
Do let me know if I have messed up any terminology or failed to explain fully,

OT dev is so fun, We really appreciate you guys!
Fascinating! So the server encodes structured data in those upper bits of the session UniqueID. This could open up possibilities for dynamic item tracking or custom server-side logic.
 
Why is this thread full AI, both the post itself and the comments..
This so called unique Id is just "cid", everything is already used, for npc/player/monster detection, its based exactly on that. We are also getting player/monster/npc by cid as well.
 
Status
Not open for further replies.
Back
Top