• 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!

From Windows 10 to OTS development machine for dummies

Gesior.pl

Mega Noob&LOL 2012
Senator
Joined
Sep 18, 2007
Messages
2,955
Solutions
98
Reaction score
3,350
Location
Poland
GitHub
gesior
I made this tutorial on clean machine just after installing Windows 10 Pro (64bit) on 2020-02-16.
Installing everything took around 1 hour.
In this tutorial we will use Visual Studio 2019, not 2017 recommended for TFS compilation. It will work!

I used polish version of Windows and installed every possible application in polish.
I did this, to be sure, that it will work with any other language. One thing I found out is that you need English language pack in Visual Studio to install TFS libraries from vcpkg.

What do you need before start?
  • Windows 10
  • Web Browser (tutorial created with Google Chrome)

What will you have after completing this tutorial?
  • GIT client integrated with Windows 10
  • ‘linux console’ integrated with Windows 10
  • Visual Studio 2019 Community with C++ dev tools – IDE that let you compile TFS/OTClient easily (generate ‘.exe’ file)
  • vcpkg – C++ Library Manager for Windows, it will let you compile TFS/OTClient without searching for C++ libraries for hours
  • IDEA Community Edition with EmmyLUA plugin – free version of IDE that let you manage ‘data’ folder easily (XML and LUA files)
  • MariaDB database, PHP 7.4 and Apache2 server – website for your OTS
  • The Forgotten Server 1.2+ running on your PC
  • Gesior2012 for TFS 1.2+ running on your PC

1. Install GIT for Windows with environment integration

Download it from site (version 64-bit Setup):Git - Downloading Package (https://git-scm.com/download/win)
‘Setup’ version will integrate Git with Windows explorer.

1-1.png

Download 64-bit Git for Windows Setup.

2.png

Unselect GUI option. It’s useless. You will have better Git GUI in IDEA.

3.png

Change line ending to ‘as is’. On GitHub most of code uses Unix-style endings.

2. Install Visual Studio 2019 Community with C++

Download it from site:Visual Studio 2019 | Download for free (https://visualstudio.microsoft.com/vs/)

4-1.png

Select “Community” version. It will start download. After download run installer.

5-1.png

Select packet “Programming classic applications in C++”.

6-1.png

Select packet “English language”. It’s required to install TFS compilation libraries.

7.png

After installation run Visual Studio for first time to make it configure itself.
You don’t need Microsoft Account to use it. Click ‘Not now, maybe later’.

3. Install vcpkg – C++ library manager for Windows

8.png

Open Git Bash (‘linux console’) in folder ‘C:\’

9.png

Type in console: git clone microsoft/vcpkg (https://github.com/Microsoft/vcpkg.git)
Code:
git clone https://github.com/Microsoft/vcpkg.git

10.png

Type in console: cd vcpkg
Code:
cd vcpkg

11.png

Open website:microsoft/vcpkg (https://github.com/Microsoft/vcpkg) and find newest tagged version

Link: microsoft/vcpkg (https://github.com/Microsoft/vcpkg)
Newest tagged version should be stable. I tried master branch and it did not work with all libraries. You can always use old version, not newest. I used for this tutorial: 2020.01

12.png

Type in console: git checkout 2020.01
Code:
git checkout 2020.01

It will switch version of vcpkg to version from 2020.01

13-1.png

Type: ./bootstrap-vcpkg.bat
Code:
./bootstrap-vcpkg.bat

To build vcpkg. You must do it after downloading from GitHub and after every version change.

14.png

Run Windows PowerShell as Administrator (another black console..)

15.png

Change path in console to vcpkg path
Type: cd C:\vcpkg
Code:
cd C:\vcpkg

16.png

In console type: .\vcpkg integrate install
Code:
.\vcpkg integrate install

This will integrate vcpkg C++ library manager with Visual Studio we installed before.
After integrating with Visual Studio close PowerShell. We don’t need administrator rights anymore.

17.png

If you closed Git Bash console we opened at start, open it again in vcpkg folder.

18.png

Copy current libraries list from official TFS wiki (for 64-bit):otland/forgottenserver (https://github.com/otland/forgottenserver/wiki/Compiling-on-Windows-%28vcpkg%29)

Libraries list at 2020-02-17:
Code:
vcpkg install boost-iostreams:x64-windows boost-asio:x64-windows boost-system:x64-windows boost-filesystem:x64-windows boost-variant:x64-windows boost-lockfree:x64-windows luajit:x64-windows libmariadb:x64-windows pugixml:x64-windows mpir:x64-windows cryptopp:x64-windows

19.png

Type in console: ./ and paste list

./ means ‘run’

20.png


We got all libraries for TFS!

4. Download TFS and compile engine

Create folder:
Code:
C:\ots

21-1.png

Open Git Bash in folder C:\ots

22-1.png

Download newest TFS. Type: git clone otland/forgottenserver (https://github.com/otland/forgottenserver.git)
Code:
git clone https://github.com/otland/forgottenserver.git

23-1.png


Code:
C:\ots\forgottenserver\vc14\theforgottenserver.sln

It will open TFS project in Visual Studio.

24-1.png

Click ‘OK’ when VS ask you about changing target platform.

25.png

Change build type to Release and build target platform to x64.
Previously we installed C++ libraries for 64-bit platform – we can compile only 64-bit version.

If you plan to do many changes in sources and compile in often, you may try to use Debug build type.
It should link faster and reduce time of building solution.

26.png

Start compilation of TFS. It can take few minutes.

27.png

Open folder: C:\ots\forgottenserver\vc14\x64\Release
Code:
C:\ots\forgottenserver\vc14\x64\Release

28.png

Copy all .dll files and .exe file to folder: C:\ots\forgottenserver\
Code:
C:\ots\forgottenserver\

29.png

TFS is ready. Now we need to install database server and import TFS database schema.
Post automatically merged:

I was not able to post this as 1 thread.
It was keep saying that I cannot post more than 30 images in 1 post. Even when I split it into 2 posts. Probably because of auto-post-merge.

Can some moderator merge my 2 threads?

From Windows 10 to OTS development machine for dummies - part 2
 
Last edited by a moderator:
Great guide! There's been a rise in tutorial submissions recently, and I love it :)
It will surely help some people.
 
@Gesior.pl

is there any "ots-files" that are able to run ots without problems?
like this one U menionted
"otland/forgottenserver (https://github.com/otland/forgottenserver/wiki/Compiling-on-Windows-%28vcpkg%29) "
or is it full of bugs? and need shitload of work to make it "proper/decent"before letting people play?

btw what kind of tibia version it is?
TFS probably does not have any big bugs, but datapacks from forum that contain hundreds of scripts (RL map etc.) are full of bugs.
It's your job to make good scripts or fix other people scripts. This tutorial shows where to start and how to do it properly (use IntelliJ IDEA).
In case of kasteria.pl 8.0 RL map server - my team spent around 4000 hours in last 4 years on scripting and mapping to make it work without big bugs/crashes.

Current TFS version on GitHub is 10.97 - 10.98, but there are many forks with protocol upgrades/downgrades and you can compile them all after finishing this tutorial.
 
Cannot merge posts that contain 30 or more images unfortunately. So the two threads remain as is. If you want to report something or request a change, use the report tool.

Good job on the tutorial!
 
Good job! Your contributions is always the best, really thanks for share this with the community! With sure will be very helpful!
 
I love you Gesior, thanks for the effort!
 
Thanks for the tutorial! It helped a lot. I only changed IntelliJ IDEA for VScode, keep the good work.
 
Hello Gesior,

During compilation of tfs1.3 for 8.60
i found this error

Code:
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\xtgmath.h(24,70): warning C4244: 'argument': conversion from 'double' to 'T', possible loss of data
1>        with
1>        [
1>            T=uint32_t
1>        ] (compiling source file ..\src\networkmessage.cpp)

What this mean?

Btw the overall process
Code:
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
 
Hello Gesior,

During compilation of tfs1.3 for 8.60
i found this error

Code:
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\xtgmath.h(24,70): warning C4244: 'argument': conversion from 'double' to 'T', possible loss of data
1>        with
1>        [
1>            T=uint32_t
1>        ] (compiling source file ..\src\networkmessage.cpp)

What this mean?

Btw the overall process
Code:
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
It looks like some library used by TFS has some error. It's not part of TFS. It's not part of that tutorial.
It's probably part of 'Microsoft Visual C++ math implementation' (basic math library?).
You are running newest version of MSVC (14.24.28314) and for some reason it's marked as 'unstable' on Wikipedia. They marked version from 7 months ago as 'stable'.
You/we can't do anything about it. Just wait for Microsoft to fix it.

This 'error' is here just to warn you, that some other programmer could make mistake (he could do it intentionally!) and on line 24 of file:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\xtgmath.h
Code tells compiler to change double number into T (Template, you can read in google about C++ templates) which in this part of code is expected to by uint32_t. This kind of type casting is not safe (=loss of data, double number can be higher than highest uint32_t number).
If you are good enough to find if this is a real bug, you can try to fix it and report it to author.
 
It looks like some library used by TFS has some error. It's not part of TFS. It's not part of that tutorial.
It's probably part of 'Microsoft Visual C++ math implementation' (basic math library?).
You are running newest version of MSVC (14.24.28314) and for some reason it's marked as 'unstable' on Wikipedia. They marked version from 7 months ago as 'stable'.
You/we can't do anything about it. Just wait for Microsoft to fix it.

This 'error' is here just to warn you, that some other programmer could make mistake (he could do it intentionally!) and on line 24 of file:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\xtgmath.h
Code tells compiler to change double number into T (Template, you can read in google about C++ templates) which in this part of code is expected to by uint32_t. This kind of type casting is not safe (=loss of data, double number can be higher than highest uint32_t number).
If you are good enough to find if this is a real bug, you can try to fix it and report it to author.
Thanks for reply.
I don’t know much rly about this.
But this warning can do anything to the tfs? Or just ignore it till the fix?
 
Thanks for reply.
I don’t know much rly about this.
But this warning can do anything to the tfs? Or just ignore it till the fix?
In some random/unexpected situation, it could result in crash or error in math calculations (used everywhere.. all computers do are math calculations).
I'm not good enough to trace where TFS uses this code or if it uses it at all (TFS during compilation load all functions from that library, but it does not mean it will use bugged one at all).
I would not worry about it.
Often when I run super-stable open source software, it shows 50-1000 warnings at start, but it's 2020... we write applications that have milions of lines, not 50 (like in 1970) - we don't write them all on our own, we can't even check them all, we must believe that author of modules/libraries we use gave us good code.
 
In some random/unexpected situation, it could result in crash or error in math calculations (used everywhere.. all computers do are math calculations).
I'm not good enough to trace where TFS uses this code or if it uses it at all (TFS during compilation load all functions from that library, but it does not mean it will use bugged one at all).
I would not worry about it.
Often when I run super-stable open source software, it shows 50-1000 warnings at start, but it's 2020... we write applications that have milions of lines, not 50 (like in 1970) - we don't write them all on our own, we can't even check them all, we must believe that author of modules/libraries we use gave us good code.
Well, thanks for clarification :) great tutorial btw :)
 
Hello Gesior,

During compilation i've got this error "
Ważność Kod Opis Projekt Plik Wiersz Stan pominięcia
Błąd C1083 Nie można otworzyć pliku dołącz: 'boost/asio.hpp': No such file or directory theforgottenserver C:\ots\forgottenserver\src\otpch.h 42 ". I've tried many itmes, but nothing helps. Do you know what can i do? :)
 
So, I have followed your guide as to how to get TFS to work, Everything has been going okay but I am trying to use Nekiro's TFS 7.72-Downgrade and your Gesior 2012 isn't working.


Code:
Fatal error: Uncaught Error: Call to a member function fetch() on bool in C:\xampp\htdocs\classes\account.php:33 Stack trace: #0 C:\xampp\htdocs\classes\account.php(21): Account->load(1, 'name') #1 C:\xampp\htdocs\install.php(334): Account->__construct(1, 'name') #2 {main} thrown in C:\xampp\htdocs\classes\account.php on line 33
As well as


Code:
STEP 5
Set Admin Account

Fatal error: Uncaught Error: Call to a member function fetch() on bool in C:\xampp\htdocs\classes\account.php:33 Stack trace: #0 C:\xampp\htdocs\classes\account.php(21): Account->load(1, 'name') #1 C:\xampp\htdocs\install.php(434): Account->__construct(1, 'name') #2 {main} thrown in C:\xampp\htdocs\classes\account.php on line 33

Anyway I can fix this or do I have to use a certain website for this?
 
okay i do everything and work fine but how to downgrade this to 8.6 ??
 
Last edited:
chciałbym to zrobić tylko z tfs 0.4 r3884 bo nie chcę najnowszej tibii, zalezy mi na 8.6
pomógłbyś stworzyć vc10 folder zamiast devcpp w 3884?
 
@Gesior.pl
I have problem when i use " .\vcpkg integrate install"
integrate install problem.png
Is it because I have "Previous IPDB not found, fall back to full compilation." in console?
git.png
Please help
 
Back
Top