• Sign up for September Mapping Competition! The prize includes Otland Premium time.
  • 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!

Creating a Tibia Client from Scratch

Evil Mark

Active Member
Joined
Nov 23, 2008
Messages
1,693
Best answers
0
Reaction score
32
I basically have no experience in C++ to read the sources I'm assuming the way to go about this would be through the client where one would reverse engineer it?

Could someone experienced comment on this?
 

StreamSide

Joseluis Gonzalez
Support Team
Joined
Aug 31, 2007
Messages
3,432
Best answers
42
Reaction score
943
Location
Arica - Chile

Alpha

Relentless
Premium User
Joined
Apr 3, 2011
Messages
400
Best answers
18
Reaction score
161
Location
South Korea
bots like elfbot, ibot would work in this client?
a big part of otservers players are full of botters
They won't. All of those bots are made for the specific official Tibia clients, they're not going to work on any new client.
 

StreamSide

Joseluis Gonzalez
Support Team
Joined
Aug 31, 2007
Messages
3,432
Best answers
42
Reaction score
943
Location
Arica - Chile
bots like elfbot, ibot would work in this client?
a big part of otservers players are full of botters
anyways with this stuff you can easily create a new bot for your own client, that would be cool af
 
OP
Evil Mark

Evil Mark

Active Member
Joined
Nov 23, 2008
Messages
1,693
Best answers
0
Reaction score
32
I didn't really receive the feedback I was hoping for so I'm going to rephrase my question.

If I don't know the source code behind the server, then in order to create a client. I would have to reverse engineer a client in order to understand it better right?

But if I do have a server, how would I know what to place inside the client?

The dream is to have a server and client written in C#. Higher level programming language which would run the game without any unforeseen troubles as it doesn't accept any half measures where C++ will just let you compile if the solution works "kind of"
 

Yamaken

Pro OpenTibia Developer
Premium User
Joined
Jul 27, 2013
Messages
504
Best answers
3
Reaction score
374
I didn't really receive the feedback I was hoping for so I'm going to rephrase my question.

If I don't know the source code behind the server, then in order to create a client. I would have to reverse engineer a client in order to understand it better right?

But if I do have a server, how would I know what to place inside the client?

The dream is to have a server and client written in C#. Higher level programming language which would run the game without any unforeseen troubles as it doesn't accept any half measures where C++ will just let you compile if the solution works "kind of"
Simply explained, you only need to know about the protocol. The protocol is the abstraction of the messages between client and server, ideally you only need to know that, only in specific cases you need to look at how tfs/the server works(it will help you to know why/how the messages are build).
Luckly for you there is atleast two opensource projects that implements a otserver in C#.
 

fabian766

Advanced OT User
Joined
Apr 22, 2008
Messages
96
Best answers
17
Reaction score
186
Location
Poland
bots like elfbot, ibot would work in this client?
a big part of otservers players are full of botters
No, they wouldn't be working(at least official ones), also I don't care about botters.

I didn't really receive the feedback I was hoping for so I'm going to rephrase my question.

If I don't know the source code behind the server, then in order to create a client. I would have to reverse engineer a client in order to understand it better right?

But if I do have a server, how would I know what to place inside the client?

The dream is to have a server and client written in C#. Higher level programming language which would run the game without any unforeseen troubles as it doesn't accept any half measures where C++ will just let you compile if the solution works "kind of"
If you want to create Tibia Client/Server then you need to understand few things:
  • Tibia sends data by using TCP/IP protocol for it's reliability
  • Protocol that cipsoft wrote for Tibia(you can get these by looking at protocolgame.cpp/protocollogin.cpp, flash client sources or by reverse engineering doesn't matter how you get information about these packets, what matters is that it needs to be exactly the same)
  • Tibia.dat and Tibia.spr structures for pre-11 clients or appearances[...].dat and sprite[...].bmp.lzma structures for post-11 clients(Tibia.dat is binary format, Tibia.spr is RLE-encoded sprites, appearances[...].dat is google protobuf compiled file, sprite[...].bmp.lzma is simple bmp file compressed by lzma)
How you write code depends on you the only thing you need to manage the same is network protocol.
Also if you're asking about how to know about these things without any source behind then yes reverse engineering is the only way(like how the first OTS engines were writed) or you can hack into game company machines and stole their work(xD).
 

MagicWall

Veteran OT User
Joined
Oct 12, 2008
Messages
105
Best answers
5
Reaction score
278
You may learn tibia protocol/sprite system from working projects like OTClient/TFS. I think it's easiest way to learn how to make own client from scratch.
Code rewrite from C++ to C# may give you beginning knowledge who may help you in future use reverse engineering in Tibia client.

For example (OTC):
Protocol: protocolgameparse.cpp
Sprite: spritemanager.cpp
 

Cjaker

[0xDEADBEEF] EXCEPTION_ACCESS_VIOLATION
Joined
Oct 17, 2016
Messages
46
Best answers
0
Reaction score
83
Location
0xDEADBEEF
Reversing Tibia Client network stuff isn't a big challenge. What i suggest to you is read the tfs protocol sources and understand from protocollogin to protocolgame.

Choose a simple version (like 8.6) and start from him, is better for developing socket stuff.
If you want i can send you a good stuff about connection of cipsoft client 8.6 xD
In C# you can do all you need, just need some libraries for encrypting RSA, encrypting XTEA and TCP Socket (like TCPClient).

When you are done with all the connection, you can start understanding the .spr and .dat structure, with that you can get the sprites 32x32 and build them correctly.
And the last step is rendering, you can speed up reading the OTClient algorithm about rendering, moving creatures, adding/removing things, everything. (or in the hard way => reverse the Tibia Client, use your own logic at games development, etc.)

That's all i have done in my game using Monogame Framework (C#)
(just a demo video showing the game running, the sprites are not mine, using for test purposes)
 

Source

Active Member
Joined
May 31, 2020
Messages
37
Best answers
0
Reaction score
29
Location
The multiverse
As a matter of simple practical advice, everything else having already been answered, you should probably actually learn a language like C++/C# first if you're trying to make anything remotely close to a serious Tibia client.
Writing a client seems much harder than writing a server as far as I can tell, having written a semi-functional server from scratch myself.
That said, you could always start out with something simpler like making a simple graphical application, scripting a small game using anything from GameMaker to Python, Java, or any modern game engine.
On the plus side, if you start out learning Unity there's always the Open Tibia Unity project out there for study and to help you get started.
 
Top