Tibia Idle
Active Member
- Joined
- Nov 23, 2023
- Messages
- 138
- Reaction score
- 27
everything is possible
but how to go about it? what is the best way to make otclient in browser?

Yes. WebAssembly is not magic; it has a lot of limitations. You only have access to Web APIs there, so you'd have to implement a WebGL/WebGPU renderer and use something like File System API for file access (or load everything from the server via HTTP, but still quite a lot of work). And there's also client-server communication - as mentioned above, browsers don't allow you to use raw TCP sockets (there's a draft of this feature though), so you'd have to implement WebSockets instead (on both the client side and server side).some people have talk about webassembly. Will it take a lot of work?
wowIt is possible and I spent a long time writing a NodeJS gameserver with HTML5 client using a custom protocol over websockets. You can try it out here: Forby HTML5 Open Tibia Client (https://inconcessus.nl/). The source code for it is open but it doesn't work properly out of the box (Inconcessus - Overview (https://github.com/Inconcessus)). At some point I'll invest some time to make a better release.
This is very smooth. Nice job man!!It is possible and I spent a long time writing a NodeJS gameserver with HTML5 client using a custom protocol over websockets. You can try it out here: Forby HTML5 Open Tibia Client (https://inconcessus.nl/). The source code for it is open but it doesn't work properly out of the box (Inconcessus - Overview (https://github.com/Inconcessus)). At some point I'll invest some time to make a better release.
I've adapted OTClient Redemption to work when built with emscripten.
Simple demo, no assets:
Modular version, use a .zip with any init.lua, data and modules:
Source:
![]()
feat: browser support by OTArchive · Pull Request #894 · mehah/otclient
Description Support compiling to javascript and webassembly using Emscripten. Compiling guide (PT-BR): Guia ‐ OTClient Redemption Web Notes: Changed some .lua files encoding from UTF8-BOM to UTF8 ...github.com
WebSocket connection to 'wss://testaac.otarchive.com/api/login:443' failed:
WebSocket connection to 'wss://testaac.otarchive.com/api/login' failed:
What are you trying to do?@OT Archive
Code:WebSocket connection to 'wss://testaac.otarchive.com/api/login:443' failed: WebSocket connection to 'wss://testaac.otarchive.com/api/login' failed:
I've created account on your test server and was trying to login using parameters you put in Wiki Guia ‐ OTClient Redemption Web (https://github.com/OTArchive/otclient-web/wiki/Guia-%E2%80%90-OTClient-Redemption-Web#conex%C3%A3o)What are you trying to do?
Are you trying with the demo version? If so, there are no assets.I've created account on your test server and was trying to login using parameters you put in Wiki Guia ‐ OTClient Redemption Web (https://github.com/OTArchive/otclient-web/wiki/Guia-%E2%80%90-OTClient-Redemption-Web#conex%C3%A3o)
View attachment 87473
But that way I've got
View attachment 87474
No matter if I put any credentials or client version or port.
It's pretty big PR that changes a lot in OTC/OTC setup. Is there any instruction 'how to run it all on your own server'?If you compile your own,
It's not related. This whole client is still executed in your web browser (uses your CPU/GPU/RAM) - same as .exe is executed on your PC. It's just another website. You can download it, modify (add bot) and open in any web browser. Now you can use JavaScript to write bots for itI also thought that the "game market" trend would be to no longer export clients, but to run in the cloud to avoid cheats,
Yes, there are instructions here, but in Portuguese. It's not that different from what we are used in terms of libraries, it's still vcpkg (besides lua 5.1) and I've made overlay-ports to automate the pthread patches. Just need to learn a bit how to use emscripten to compile.It's pretty big PR that changes a lot in OTC/OTC setup. Is there any instruction 'how to run it all on your own server'?
Is there any instruction how to setup web socket proxy for OTS?
My - pretty bad - OTC version AKA open-tibia-library (GitHub - gesior/open-tibia-library: Library to manipulate files used by OTS and OTClient. Written in TypeScript. (https://github.com/gesior/open-tibia-library)) is able to download files from www (that's thing that blocks it changing from 'library' to 'package' [downloading from www code is different in Node.js and web browser JS).The compiled versions I've published are this way to avoid hosting copyright protected material.
Yes, I've already done something similar for the modular version. Add the parameter gameData to the URL and the .zip will be downloaded, installed and cached, example:Is it possible to download .zip and unpack it - and CACHE it - in web browser?
I can also host all these .zips as unpacked .spr and .dat files, but is it possible to cache it in web browser or it's too big?
https://webclient.otarchive.com/?gameData=https://dominio/pasta/otclient.zip
Access-Control-Allow-Origin https://webclient.otarchive.com
This is huge in combination with the modular version!My - pretty bad - OTC version AKA open-tibia-library (GitHub - gesior/open-tibia-library: Library to manipulate files used by OTS and OTClient. Written in TypeScript. (https://github.com/gesior/open-tibia-library)) is able to download files from www (that's thing that blocks it changing from 'library' to 'package' [downloading from www code is different in Node.js and web browser JS).
All 7.1 - 10.99 .spr and .dat versions are available on my site: OTSME DL - data/tibia-clients/dat_and_spr (https://downloads.ots.me/?dir=data/tibia-clients/dat_and_spr)