• 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
Premium User
Joined
Sep 18, 2007
Messages
2,147
Solutions
25
Reaction score
1,422
Location
PLand
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.


Download 64-bit Git for Windows Setup.


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


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/)


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


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


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


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


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


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


Type in console: cd vcpkg
Code:
cd vcpkg


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


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

It will switch version of vcpkg to version from 2020.01


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

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


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


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


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.


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


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


Type in console: ./ and paste list

./ means ‘run’



We got all libraries for TFS!

4. Download TFS and compile engine

Create folder:
Code:
C:\ots


Open Git Bash in folder C:\ots


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



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

It will open TFS project in Visual Studio.


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


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.


Start compilation of TFS. It can take few minutes.


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


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


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:

Boy67

Active Member
Joined
Jul 4, 2007
Messages
174
Solutions
3
Reaction score
39
Location
England
good job dude. Very clear and understandable instructions for any beginner.
 

Damon

Check my status to contact me :)
Joined
Mar 26, 2011
Messages
6,168
Solutions
1
Reaction score
1,932
Location
Germany
Great guide! There's been a rise in tutorial submissions recently, and I love it :)
It will surely help some people.
 
OP
Gesior.pl

Gesior.pl

Mega Noob&LOL 2012
Senator
Premium User
Joined
Sep 18, 2007
Messages
2,147
Solutions
25
Reaction score
1,422
Location
PLand
@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.
 

Kaspar

Unprejudiced
Staff member
Global Moderator
Joined
Jun 2, 2016
Messages
731
Solutions
2
Reaction score
669
Location
Stockholm
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!
 

zxmatzx

Intermediate OT User
Joined
Dec 1, 2010
Messages
304
Solutions
26
Reaction score
141
Location
Brazil
GitHub
Mateuso8
Good job! Your contributions is always the best, really thanks for share this with the community! With sure will be very helpful!
 

MV564

New Member
Joined
Feb 11, 2020
Messages
2
Reaction score
0
Thanks for the tutorial! It helped a lot. I only changed IntelliJ IDEA for VScode, keep the good work.
 

mRefaat

💉 Pharmacist 💊
Joined
Jan 18, 2014
Messages
651
Solutions
2
Reaction score
75
Location
Egypt
GitHub
MohamedRefaat
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 ==========
 
OP
Gesior.pl

Gesior.pl

Mega Noob&LOL 2012
Senator
Premium User
Joined
Sep 18, 2007
Messages
2,147
Solutions
25
Reaction score
1,422
Location
PLand
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.
 

mRefaat

💉 Pharmacist 💊
Joined
Jan 18, 2014
Messages
651
Solutions
2
Reaction score
75
Location
Egypt
GitHub
MohamedRefaat
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?
 
OP
Gesior.pl

Gesior.pl

Mega Noob&LOL 2012
Senator
Premium User
Joined
Sep 18, 2007
Messages
2,147
Solutions
25
Reaction score
1,422
Location
PLand
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.
 

mRefaat

💉 Pharmacist 💊
Joined
Jan 18, 2014
Messages
651
Solutions
2
Reaction score
75
Location
Egypt
GitHub
MohamedRefaat
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 :)
 

Labalbal

New Member
Joined
Mar 11, 2020
Messages
1
Reaction score
0
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? :)
 

Malthael

Member
Joined
Feb 1, 2020
Messages
21
Reaction score
6
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?
 

alfredx15

New Member
Joined
Nov 23, 2014
Messages
2
Reaction score
0
okay i do everything and work fine but how to downgrade this to 8.6 ??
 
Last edited:

forumek

Member
Joined
Jan 14, 2019
Messages
61
Reaction score
21
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?
 

Koon

New Member
Joined
May 7, 2016
Messages
14
Reaction score
1
@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
 
Top