otclient-redemption/README.md
Eduardo Dantas 44a980b07e
build(cache): share vcpkg dependencies across CMake and Visual Studio (#1800)
Add shared vcpkg dependency cache for CMake and Visual Studio builds

This commit adds a content addressed vcpkg dependency cache that can be reused across compatible Git worktrees independent forks CMake presets and Visual Studio Solution builds.

The goal is to reduce repeated dependency installation and rebuild time while keeping build outputs isolated per worktree. The cache only shares dependency artifacts that are proven compatible through a complete dependency contract. Project build outputs such as object files PCH files PDB files generated sources intermediate files and executables remain local to each checkout.

The shared cache is opt in. When the cache is not configured or when the resolver cannot prove that reuse is safe both CMake and Visual Studio fall back to local worktree specific vcpkg roots.

Main behavior added

• Shares vcpkg downloads globally

• Shares vcpkg binary packages globally

• Shares expanded vcpkg installed trees only when the dependency fingerprint matches

• Shares vcpkg buildtrees and packages only when the dependency fingerprint matches

• Keeps CMake build trees local to each worktree

• Keeps Visual Studio output directories local to each worktree

• Keeps generated files intermediate files executables PCH files PDB files and object files local

• Allows compatible Git worktrees to reuse dependency artifacts

• Allows compatible forks to reuse dependency artifacts

• Allows compatible CMake presets and Visual Studio configurations to converge on the same dependency cache

• Falls back to local vcpkg storage when shared cache safety cannot be verified

CMake integration

The new CMake shared cache module runs before project initialization and resolves the vcpkg dependency contract before the normal configure flow continues.

The resolver validates the manifest registries overlays triplets features vcpkg revision compiler toolset SDK and cache implementation before selecting fingerprinted dependency roots. This prevents incompatible configurations from sharing the same expanded dependency tree.

If the CMake version is too old for the shared cache module and shared cache variables are present the build warns and continues with build local vcpkg storage instead.

CMake preset changes

• Removes hardcoded VCPKG_INSTALLED_DIR values from presets

• Lets the shared cache resolver select the installed root when safe

• Keeps local fallback behavior available

• Replaces the previous preset binary source override with clean packages and clean buildtrees options

• Prevents Visual Studio CMake presets from inheriting Ninja compiler overrides where they should not

• Keeps CMake build outputs under their configured build preset directories

Visual Studio integration

The Visual Studio bridge uses the same dependency resolver as CMake. It evaluates each Solution configuration through MSBuild, generates a machine local ignored SharedVcpkgCache props file and revalidates the complete contract before vcpkg manifest installation.

Different Visual Studio configurations receive separate consumer fingerprints. They can still share an expanded dependency tree when their dependency inputs are identical, but their consumer contracts remain separate so MSBuild specific details cannot corrupt CMake or another Solution configuration.

The Visual Studio project now imports vcpkg props more reliably, supports the generated shared cache props, and validates the generated contract through SharedVcpkgCache targets before dependency installation and build preparation.

Visual Studio changes included

• Adds SharedVcpkgCache targets

• Adds generated SharedVcpkgCache props support

• Adds vcpkg bootstrap property resolution from VCPKG ROOT

• Keeps local fallback when the shared Solution cache is inactive

• Validates manifest root target triplet host triplet configuration toolset SDK and install options before using the shared cache

• Pins the Visual Studio instance used by vcpkg for the shared Solution contract

• Requires the dependency CMake tool used by the generated contract

• Revalidates the generated contract before vcpkg manifest install

• Uses fingerprinted installed buildtrees and packages roots for compatible Solution builds

• Keeps Solution outputs local

Shared cache safety boundaries

The shared cache is intentionally conservative. It only activates when the environment and contract can be fully validated.

Safety rules enforced

• The shared pool must be on a verified local fixed filesystem

• The shared pool must live outside every registered checkout

• UNC paths are rejected for the shared cache root

• Reparse points and symlink escapes are rejected in sensitive paths

• Mutable dependency roots are isolated by full contract fingerprint

• vcpkg and shared cache operation locks protect mutable cache operations

• Existing authenticated VCPKG BINARY SOURCES values are preserved

• Existing authenticated binary source values are never printed

• Existing authenticated binary source values are never persisted by the helper

• Cleanup fails closed when validation is incomplete

• Cleanup refuses to run while build related processes are active

• Cleanup validates repositories configure trees generated contracts paths identities and locks before removing transient data

• CI containers runtime data deployment paths and release behavior remain unchanged unless shared cache is explicitly enabled

PowerShell tooling

This commit adds setup audit cleanup repository registration and Solution contract generation tools.

The main shared cache setup script configures the cache root registers the current Git repository family manages relevant user environment variables configures vcpkg downloads and binary cache locations updates managed sccache base directories and can invoke the Solution bridge when applicable.

The Solution cache script evaluates MSBuild properties resolves the shared dependency contract through the CMake resolver writes the generated props file and supports audit only and validate only modes.

Both PowerShell tools require PowerShell 7 2 and run under strict mode.

Tooling added

• tools configure shared build cache ps1

• tools configure shared solution cache ps1

• setup mode for shared cache configuration

• audit only mode for validating existing shared cache state

• guarded transient vcpkg cleanup

• guarded fingerprint specific transient cleanup

• repository registration and unregister support

• generated Solution props creation

• generated Solution props validation

• generated Solution props audit

• MSBuild property based contract evaluation

• local fixed filesystem validation

• active build process protection before cleanup

Protobuf and Solution build fixes

This branch also includes follow up fixes around protobuf generation and Solution build behavior.

Protobuf and Solution changes

• Fixes Solution protobuf generation by using one normalized absolute proto root

• Uses the host triplet protoc path for protobuf generation

• Adds incremental inputs and outputs to the ProtoCompile target

• Excludes generated protobuf compile items when protobuf support is disabled

• Keeps protobuf generated source handling tied to RunProtoCompile

• Lets both CMake and Solution builds honor configured global vcpkg binary sources

• Avoids leaking Ninja compiler overrides into Visual Studio CMake presets

Documentation and repository updates

• Adds shared build cache documentation

• Documents setup and migration flow

• Documents CMake and Visual Studio integration

• Documents cache contract rules

• Documents concurrency and locking behavior

• Documents fallback behavior

• Documents recovery and cleanup procedures

• Documents cross fork compatibility rules

• Updates README with shared cache guidance

• Updates gitignore for generated local shared cache files

• Updates CI path filters so vcpkg configuration overlay and cache related changes trigger the correct workflows

Validation performed

• PowerShell parser validation for both cache tools

• PowerShell 5 1 prerequisite failure verified

• CMake preset validation

• JSON validation

• Visual Studio project XML validation

• Evaluated MSBuild property and item checks

• Checked protobuf enabled mode

• Checked protobuf disabled mode

• Local shared cache Solution build validation

• GitHub Actions Windows CMake matrix

• GitHub Actions Windows Solution matrix

Overall this commit adds a safe content addressed shared dependency cache for OTClient builds. It lets compatible CMake and Visual Studio configurations reuse expensive vcpkg dependency artifacts while keeping all build outputs local and falling back to worktree local storage whenever the shared contract cannot be fully validated.
2026-08-13 18:47:47 -03:00

26 KiB
Raw Permalink Blame History

logo OTClient - Redemption

Discord Shield CI License: MIT


📋 Table of Contents

  1. Logo What is OTClient?
  2. 🚀 Features
  3. The Mobile Project
  4. 🔨 Compiling
  5. 🐳 Docker
  6. 🩺 Need Help?
  7. 📑 Bugs
  8. ❤️ Roadmap
  9. 💯 Support Protocol
  10. ©️ License
  11. ❤️ Contributors
  12. 📦 Client Assets Auto-Install

Logo What is OTClient?

OTClient is an alternative Tibia client for usage with OTServ. It aims to be complete and flexible:

  • LUA scripting for all game interface functionality
  • CSS-like syntax for UI design
  • Modular system: each functionality is a separate module, allowing easy customization
  • Users can create new mods and extend the interface
  • Written in C++20 and heavily scripted in LUA

For a server to connect to, you can build your own with theforgottenserver or canary.

Note

Based on edubart/otclient • Rev: 2.760


🚀 Features

Beyond its flexibility with scripts, OTClient comes with many features that enable client-side innovation in OTServ: sound system, graphics effects with shaders, modules/addons, animated textures, styleable UI, transparency, multi-language, in-game LUA terminal, and an OpenGL 2.0 ES engine that allows porting to mobile platforms. It is also flexible enough to create Tibia tools like map editors using scripts—OTClient is a framework + Tibia APIs.

Performance & Engine

🖼️ Draw Render (optimization showcase)

https://github.com/user-attachments/assets/fe5f1d7f-7195-4d65-bca6-c2b5d62d3890

📦 Asynchronous Texture Loading
🧵 Multi-threading

Main Thread

  • Sound
  • Particles
  • Load Textures (files)
  • Windows Events (keyboard, mouse, ...)
  • Draw texture

Thread 2

  • Connection
  • Events (g_dispatcher)
  • Collect information on what will be drawn on the Map

Thread 3

  • Collect information on what will be drawn in the UI

Image:
multinucleo

🧹 Garbage Collection

Description (1):

Garbage Collection is the feature responsible for automatically managing memory by identifying and releasing objects that are no longer in use. This allows the client to maintain efficient memory usage, avoid unnecessary data accumulation, and improve overall stability.

Description (2):
Garbage collector is used to check what is no longer being used and remove it from memory. (lua, texture, drawpool, thingtype)

🧭 Texture Atlas System

(coming with engine improvements and draw-call reduction)

  • C++20 ( v17 , Unity build and Manifest Mode (vcpkg.json) ) build in x32 and x64
  • Walking System Improvements
  • Supports sequenced packages and compression
  • Asserts load (Tibia 13)

🎛️ UI & UX

🧩 UIWidgets Improvements
🔁 Auto Reload Module

Activate: g_modules.enableAutoReload() (init.lua)
Video:

https://github.com/kokekanon/otclient.readme/assets/114332266/0c382d93-6217-4efa-8f22-b51844801df4

Attached Effects System (aura, wings…)

Tip

You can adjust offsets per looktype using ThingConfig when a default offset doesnt align perfectly for a given sprite.

ThingCategory Attached Effect Texture (PNG) Attached Effect Particule

🧭 Module Controller System

A safer way to create modules, without the need to unbind keys, disconnect events, or destroy widgets.
Example: (modules/game_minimap/minimap.lua)

🖼️ Anti-Aliasing Mode Options
  • Note: Smooth Retro will consume a little more GPU.

GIF:
aa

🧩 Creature Information by UIWidget

Video:

https://github.com/kokekanon/otclient.readme/assets/114332266/c2567f3f-136e-4e11-964f-3ade89c0056b

🧱 Tile Widget

Wiki: https://github.com/mehah/otclient/wiki/Tutorial-Attached-Effects

Title Attached Effect Title Widget Title Particule

🧩 Support HTML/CSS Syntax

https://github.com/user-attachments/assets/b16359d3-09a4-4181-bcb8-c76339b64b37

https://github.com/user-attachments/assets/d3844223-7e35-45da-a872-3141f1c5860a

https://github.com/user-attachments/assets/9f20814f-0aed-4b70-8852-334ac745ec11

https://github.com/user-attachments/assets/3ac8473c-8e90-4639-b815-ef183c7e2adf

Module examples:

🎥 Latency-adaptive camera

Basically the camera adapts to the server latency to always remain smooth and avoid stuttering while walking.
If the ping gets high, the camera moves slower to keep up with the server's response time; if the ping drops, the camera moves faster. (Depends on character speed.)

🧭 Support Negative Offset (.dat)

Video:

https://github.com/kokekanon/otclient.readme/assets/114332266/16aaa78b-fc55-4c6e-ae63-7c4063c5b032

  • Floor Shadowing
  • Highlight Mouse Target (press Shift to select any object)
  • Floor View Mode (Normal, Fade, Locked, Always, Always with transparency)
  • Floating Effects Option
  • Refactored Walk System
  • Support for more mouse buttons (e.g., 4 and 5)
  • Support DirectX
  • Hud Scale

🔗 Compatibility & Protocols

  • Client 7.6 ~ 12.85 ~ 12.92, 13.00 ~ 15.24 support (protobuf)
  • Market rewritten (compatible with TFS and Canary)
  • Async Texture Loading (engine-level feature)
  • Supports sequenced packages and compression

Note

See section 💯 Support Protocol for a full compatibility matrix and required flags.


🧩 Community Mods & Integrations

🙋 Community (Features)

🕹️ Discord RPC — @SkullzOTS
  • by @SkullzOTS, @surfaceflinger and @libergod
  • To enable just go to config.h, set 1 in ENABLE_DISCORD_RPC and configure the others definitions
  • If using CMake execute:
    • Removes Content of Build Folder if needed
    • if (Test-Path -Path build) { Remove-Item -Path build -Recurse -Force; New-Item -Path build -ItemType Directory }
    • Configure CMake
    • cmake -B build -G "Ninja" -DENABLE_DISCORD_RPC=ON
    • Build it
    • cmake --build build
  • Step-by-step on YouTube: https://www.youtube.com/watch?v=zCHYtRlD58g

Example interface Example in game future discord-game-sdk

🔐 Encryption System — @Mrpox *(unsafe implementation)*
  • by @Mrpox
  • Enable via config.h: set ENABLE_ENCRYPTION=1 and change ENCRYPTION_PASSWORD
  • To enable building encryption with --encrypt, set ENABLE_ENCRYPTION_BUILDER=1 (by @TheMaoci) — removes encryption code from production build
  • Generate encrypted files by running client with: --encrypt SET_YOUR_PASSWORD_HERE (or omit to use the password from config.h)

Warning

This encryption implementation is considered unsafe. Use at your own risk.

⬆️ Client Updater — @conde2
🌈 Colored Text — @conde2
  • by @conde2
  • Usage: widget:setColoredText("{Colored text, #ff00ff} normal text")
🔳 QR Code support — @conde2
  • by @conde2
  • UIQrCode properties example:
    • code-border: 2
    • code: Hail OTClient Redemption - Conde2 Dev
💬 Typing Icon — @SkullzOTS

🪜 Smooth Walk Elevation — @SkullzOTS

🗺️ Layout based on Tibia 13 — @marcosvf132

Status service
Put ./otclient/tools/api/status.php in:
C:/UniServerZ/www/api/

If it doesn't work, enable curl:

image image

Interface In-game

  • Imbuement tracker — by @Reyaleman
  • Blessing
  • Screenshot
  • Highscores
  • Store (compatible with 1098, 12.91 ~ 15.24)
  • QuickLoot
  • Groups Vip
  • Reward Wall (Daily Rewards)
🌐 Browser Client — @OTArchive

Interface Density Pixel Joystick

Creature Map Mount

Example 1 Example 2 Example 3

💸 Sponsored (Features)

Creature Items UICreature

🔦 OTClient V8 (Features)

  • Lighting System
  • Floor Fading
  • Path Finding
  • Module Shop
  • Module Outfit
  • Placeholder
  • UIGraph
  • Keybinds
  • Cam system

The Mobile Project

This is a fork of edubart's OTClient. The objective of this fork is to develop a runnable OTClient on mobile devices.

Tasks

  • Compile on Android devices
  • Compile on Apple devices
  • Adapt the UI reusing the existing LUA code

🔨 Compiling

If you are interested in compiling this project, visit the Wiki.

For content-addressed vcpkg reuse across CMake presets, Visual Studio Solutions, worktrees, and compatible forks, see the shared build cache guide.


🐳 Docker

In order to build the app for production, run the following commands:

1) Build the image

docker build -t mehah/otclient .

2) Run the built image

# Disable access control for the X server.
xhost +

# Run the container image with the required bindings to the host devices and volumes.
docker run -it --rm \
  --env DISPLAY \
  --volume /tmp/.X11-unix:/tmp/.X11-unix \
  --device /dev/dri \
  --device /dev/snd mehah/otclient /bin/bash

# Enable access control for the X server.
xhost -

🩺 Need Help?

Ask questions on Discord: https://discord.gg/tUjTBZzMCy


📑 Bugs

Found a bug? Please create an issue in our bug tracker.

Tip

If using Nostalrius 7.2, Nekiro TFS-1.5-Downgrades-7.72 OR any protocol below 860 and the walking system is stuttering, set
force-new-walking-formula: true in data/setup.otml.
In old protocols, if item speed feels too fast, adjust
item-ticks-per-frame: 75 in data/setup.otml.

if you use TVP or Nostalrius 7.72 activate the feature g_game.enableFeature(GameTileAddThingWithStackpos) in game_feature .


❤️ Roadmap

TO-DO list Status PR
Sound tibia 13 #1098
Prey and tasks #1380
Compendium #1625
Party List None
Proficiency #1593
New Imbui 15x/14x #1616

💯 Support Protocol

Protocol / version Description Required Feature Compatibility
TFS (7.72) Downgrade nekiro / Nostalrius force-new-walking-formula: trueitem-ticks-per-frame: 500
TFS 0.4 (8.6) Fir3element item-ticks-per-frame: 500
TFS 1.5 (8.0 / 8.60) Downgrade nekiro / MillhioreBT force-new-walking-formula: trueitem-ticks-per-frame: 500
TFS 1.4.2 (10.98) Release Otland
TFS 1.6 (13.10) Main repo otland (2024) See wiki
Canary (13.21 / 13.32 / 13.40) OpenTibiaBr See Wiki
Canary (14.00 ~ 14.12) OpenTibiaBr See Wiki
Canary (15.00 ~ 15.24) OpenTibiaBr See Wiki

©️ License

OTClient is made available under the MIT License — you are free to use it for commercial, non-commercial, closed or open projects.
See: MIT License


❤️ Contributors

If you are interested in supporting the project, donate here:
PayPal