Little update on this. I had problem with compilation of OTClient on Windows, so I made it compile and run on Linux using docker and display client on Windows.
I've tested it with old version of edubart OTC (
GitHub - gesior/otclient_mapgen: Open Tibia map images generator [for LeafletJS]. Loads .otbm file and generate .png images 256x256 px (https://github.com/gesior/otclient_mapgen) ) on Windows 10.
It copies
data
(including Tibia.dat and Tibia.spr) into docker image, so to update
data
, you have to rebuild docker image.
It's because Windows -> Linux shared files are loaded super slow. Loading 500 MB Tibia.spr from directory shared using
docker-compose
volumes takes around 30 second vs 0.5 sec with file inside container.
Other direction (Linux -> Windows) is super fast and OTC was able to generate over 1000 .png images per second on shared volume.
How to do it:
1. Install Xserver ex.
https://sourceforge.net/projects/vcxsrv/files/latest/download
2. Run XLaunch - all default, just click Next, Next, Next.
3. In OTC directory create file
Dockerfile
with:
Bash:
FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/London
RUN apt update
RUN apt install -y build-essential cmake git-core libboost-all-dev libphysfs-dev libssl-dev liblua5.1-0-dev libglew-dev libvorbis-dev libopenal-dev zlib1g-dev
RUN mkdir build
RUN git clone -b stable-3.0 https://github.com/icculus/physfs.git && cd physfs && mkdir build && cd build && cmake .. && make -j $(nproc) && make install && cp /usr/local/lib/libphysfs.a /usr/lib/x86_64-linux-gnu/.
WORKDIR /usr/src/otclient/build
COPY src /usr/src/otclient/src/
COPY CMakeLists.txt /usr/src/otclient/
RUN cmake .. && make -j $(nproc) && mv otclient ../otclient
COPY data /usr/src/otclient/data
COPY mods /usr/src/otclient/mods
COPY modules /usr/src/otclient/modules
COPY init.lua /usr/src/otclient/init.lua
COPY otclientrc.lua /usr/src/otclient/otclientrc.lua
ENV DISPLAY=host.docker.internal:0.0
CMD cd /usr/src/otclient && ./otclient
4. In OTC directory create file:
Code:
version: "3.7"
services:
server:
build:
context: .
volumes:
- ./exported_images:/usr/src/otclient/exported_images
5. To build docker image type:
docker-compose build
6. To start client type:
docker-compose up
It looks like normal client on Windows, but it's running on Linux and streaming screen to Windows.
There are 2 problems:
- it - probably - does not use GPU, so it's 100% CPU rendering - on my 13900K it gets 12 FPS in OTC menu
- it uses extra 2-4 CPU cores to encode -> transfer using network -> decode and display these 12 FPS