What is OTClient?
- π Features
The Mobile Project
- π¨ Compiling
- π³ Docker
- π©Ί Need Help?
- π Bugs
- β€οΈ Roadmap
- π― Support Protocol
- Β©οΈ License
- β€οΈ Contributors
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
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.
πΌοΈ Draw Render (optimization showcase)
460783937-d8a36c7e-b5ba-46ac-a881-a42f76a9eb01.mp4
π¦ Asynchronous Texture Loading
-
Description: with this the spr file is not cached, consequently, less RAM is consumed.
-
Video:
Asynchronous.texture.loading.mp4
π§΅ 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
π§Ή 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)
π§© UIWidgets Improvements
-
Description: Improvements in the UI algorithm; better performance in add/remove/reposition widgets. Visible in the battle module.
-
Video:
460149646-4eee68e4-7572-4232-b762-65f4d50219ee.mp4
π Auto Reload Module
Activate: g_modules.enableAutoReload()
(init.lua)
Video:
2022-11-17_17-45-35-1.1.mp4
β¨ Attached Effects System (aura, wingsβ¦)
- Compatible with .APNG
- ThingCategoryEffect
- ThingCategoryCreature
- ThingExternalTexture: images in PNG | APNG
- Wiki: https://github.com/mehah/otclient/wiki/Tutorial-Attached-Effects
- Example Code: effects.lua β’ test code
- Specific lookType settings: outfit_618.lua
[!TIP] You can adjust offsets per looktype using ThingConfig when a default offset doesnβt 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)
π§© Creature Information by UIWidget
- Enable: setup.otml
- Style: modules/game_creatureinformation
- Note: There is a performance degradation vs direct Draw Pool, about ~20%, tested with 60 monsters attacking each other.
Video:
Video_Sem_Titulo_Feito_Com_O_Clipchamp1.mp4
π§± Tile Widget
Wiki: https://github.com/mehah/otclient/wiki/Tutorial-Attached-Effects
Title Attached Effect | Title Widget | Title Particule |
π§© Support HTML/CSS Syntax
Video_Sem_Titulo_Feito_Com_O_Clipchamp1.mp4
349623570-3fa1803a-2759-4b2f-890e-05f987f43260.mp4
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)
- Compatible with ObjectBuilderV0.5.5
- Enable:
g_game.enableFeature(GameNegativeOffset)
Video:
offsets.mp4
- 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
- Client 12.85 ~ 12.92, 13.00 ~ 13.40 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.
πΉοΈ Discord RPC β @SkullzOTS *(Doesn't work with CMAKE)*
- by @SkullzOTS
- Enable via config.h: set
ENABLE_DISCORD_RPC
to 1 and configure the other definitions - 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
- by @conde2
- Paste the API folder in your www folder: https://github.com/mehah/otclient/tree/main/tools/api
- Create a folder called
files
in your www and pasteinit.lua
,modules
,data
, andexe
- Uncomment and change this line: https://github.com/mehah/otclient/blob/main/init.lua#L6
π 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
πͺ Smooth Walk Elevation β @SkullzOTS
- by @SkullzOTS
- Preview: Gyazo
- Enable in modules/game_features/features.lua: uncomment line 5 (
g_game.enableFeature(GameSmoothWalkElevation)
)
πΊοΈ Layout based on Tibia 13 β @marcosvf132
- by @marcosvf132
- Game_shop based on Store by @Oskar1121, modified/fixed by @Nottinghster
- Minimap WorldTime
- TFS C++ (old):
void ProtocolGame::sendWorldTime()
- TFS LUA (new):
function Player.sendWorldTime(self, time)
- Canary:
void ProtocolGame::sendTibiaTime(int32_t time)
- TFS C++ (old):
- Outfit windows compatible with attachEffect, shader
- Calendar
client_bottommenu
(activateServices.status
array ininit.lua
)
Status service
Put ./otclient/tools/api/status.php
in:
C:/UniServerZ/www/api/
If it doesn't work, enable curl:
Interface | In-game |
- Imbuement tracker β by @Reyaleman
- Blessing
- Screenshot
- Highscores
- Store (compatible with 1098, 12.91 ~ 13.40)
- QuickLoot
- Groups Vip
- Reward Wall (Daily Rewards)
π Browser Client β @OTArchive
- Mobile Support β by @tuliomagalhaes β’ @BenDol β’ @SkullzOTS
Interface | Density Pixel | Joystick (patrykq) |
- Support HTTP/HTTPS/WS/WSS β by @alfuveam
- Support Tibia 12.85/protobuf by @Nekiro
- Action Bar β by @DipSet
- Access to widget children via
widget.childId
β by @Hugo0x1337 - Shader System Fix (CTRL + Y) β by @FreshyPeshy
Creature | Map | Mount |
- Refactored Battle Module β by @andersonfaaria
- Health & Mana Circle β by @EgzoT, @GustavoBlaze, @Tekadon58 β’ Project
- Tibia Theme 1.2 by Zews β Forum Thread
- Add option
ADJUST_CREATURE_INFORMATION_BASED_ON_CROP_SIZE
in setup.otml β by @SkullzOTS - Lua Debugger for VSCode β see wiki β by @BenDol
- 3D Sound and Sound Effects! β by @Codinablack
Example 1 | Example 2 | Example 3 |
---|---|---|
001_example.mp4 |
002_example.mp4 |
003_example.mp4 |
-
Bot V8 β (@luanluciano93, @SkullzOTS, @kokekanon, @FranciskoKing, @Kizuno18)
- Adapted 85%
- VS Solution / CMAKE
-
Shader with Framebuffer β (@SkullzOTS, @Mryukiimaru, @JeanTheOne, @KizaruHere)
Creature | Items | UICreature |
- Full Cyclopedia β (@luanluciano93, @kokekanon, @MUN1Z, @qatari)
- Lighting System
- Floor Fading
- Path Finding
- Module Shop
- Module Outfit
- Placeholder
- UIGraph
- Keybinds
- Cam system
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
Current compiling tutorials
If you are interested in compiling this project, visit the Wiki.
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 -
Ask questions on Discord: https://discord.gg/tUjTBZzMCy
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
.
TO-DO list | Status | PR |
---|---|---|
wheel of destiny | None | |
Forge | None | |
Analyzer | #802 | |
Sound tibia 13 | #1098 |
Protocol / version | Description | Required Feature | Compatibility |
---|---|---|---|
TFS (7.72) | Downgrade nekiro / Nostalrius | force-new-walking-formula: true β’ item-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: true β’ item-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.10) | OpenTibiaBr | See Wiki | β |
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
If you are interested in supporting the project, donate here:
PayPal