• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

TFS Rust Port

Dynamics

Well-Known Member
Joined
Jul 9, 2007
Messages
214
Reaction score
73
Hey,

I 100% vibe coded this. It's just been a hobby of mine I do in my spare time, it started as improving TFS 1.4 which I think i made a good effort in (the C++ src is included if anyones interested).
After reading about rust I wanted to see if i could utilise it by porting TFS into rust from the ground up, leveraging all the good things rust have to offer. It's still a work in progress and I've slowed down a bit due to RL commitments.

Currently where i'm at -
  • Login handshake (RSA + XTEA), character list, full login packet sequence
  • OTBM map load, map description, floor changes
  • Player walking (step, auto-walk, speed, cancel)
  • Item runtime — containers, inventory, equip/deequip, move/throw
  • Config from config.lua + player save on logout/shutdown
  • Partial Lua — script loading, onLogin, inventory hooks
You can connect with OTClient, log in, walk the map, and move items around.

My plan for it is to be backwards compatible with TFS data packs.

 
Some progress today -

  • Inventory, equipment and containers are complete
  • Creature spawning is in
  • Monster AI (targetting, pathing, fleeing and return to spawn)
  • Bcrypt over SHA1 with a lazy converter
 
One of the most annoying things about TFS is fragmentation. For each Tibia protocol (7.6, 8.0, 8.6, 10.98, 13+), there is a different fork of TFS.
I suggest designing the architecture of this fork to support multiple Tibia versions.
 
One of the most annoying things about TFS is fragmentation. For each Tibia protocol (7.6, 8.0, 8.6, 10.98, 13+), there is a different fork of TFS.
I suggest designing the architecture of this fork to support multiple Tibia versions.

Yeah I did have that idea of making it easily interchangeable, I'll have to start laying the ground work for it
Post automatically merged:

Okay I spent some time auditing and laying out a path to implement this idea.

The ground work will be relatively easy to implement and will make it easier for future protocol versions to be added. I will start with 7.72.

I used @Ezzz leaked TVP as the baseline for it and then did a big audit of @fusion32 decompiled CIP binary to map the mechanics to try emulate it as close as possible.

Some things can be shared across versions.

You will be able to select your version from config.lua.

I will push the document later probably with the ground work done too.
 
Last edited:
I've pushed an update -

Scaffolding
  • clientVersion in config (default 1098), with ProtocolCaps for what differs per era (Adler checksum, item MARK byte, login shape, etc.)
  • Version threaded through net config; no wire behavior change yet
Codec seam (10.98 only)
  • Introduced a ProtocolCodec boundary: game logic builds neutral wire structs; Codec1098 writes the bytes
  • Core packet emission (login, walk, map, inventory, containers, spawns, stats) goes through GameWorld.codec
Adding 7.72 (or another protocol) is mostly a new codec impl + transport/login phases, not rewriting game_world.rs for every packet.

The plan is in docs/PROTOCOL_VERSIONING.md
 
Back
Top