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

Programmer Tfs 1.3 work with multi-cores

Engradiel

Member
Joined
May 3, 2009
Messages
120
Reaction score
7
Location
Brazil
Hello everyone, I'm looking for someone able to optimize TFS 1.3 and make it run on multi cores.

I think it really is a good solution in the medium and long term, as it will not required such an expensive dedicated.

core.png
 
Hello everyone, I'm looking for someone able to optimize TFS 1.3 and make it run on multi cores.

I think it really is a good solution in the medium and long term, as it will not required such an expensive dedicated.

View attachment 79254
There is a serious error in the source or datapack that is consuming a lot of CPU

I believe it should be the tfs 1.3 engine + scripts + systems + spells and others
 
you will certainly have to pay a lot more to anyone willing to make tfs multi-threaded (if anyone is crazy enough to accept this job), than the amount of money will would waste paying for a better dedicated server

in short words: it's not easy and that is why it wasn't done in decades
 
you will certainly have to pay a lot more to anyone willing to make tfs multi-threaded (if anyone is crazy enough to accept this job), than the amount of money will would waste paying for a better dedicated server

in short words: it's not easy and that is why it wasn't done in decades

I know it is not a discussion post, and we know that the work of Multi Threading is quite complicated and impractical in many cases.


- What about using OpenMP?:


Or:

 
I think TFS can be optimized a little for certain specific tasks, but converting the entire engine cycle into multithreading is impossible due to the logic of how things work in Tibia, When I say impossible I mean that there will be no benefit in it, even if it is multithreaded it would behave as a single thread literally.
 
I know it is not a discussion post, and we know that the work of Multi Threading is quite complicated and impractical in many cases.


- What about using OpenMP?:


Or:

If you want to use parallelism you'll be good to go with just the C++17 algorithms library.

you will certainly have to pay a lot more to anyone willing to make tfs multi-threaded (if anyone is crazy enough to accept this job), than the amount of money will would waste paying for a better dedicated server

in short words: it's not easy and that is why it wasn't done in decades
First of all, tfs is not single-threaded and there are no other bottlenecks (except db maybe?) that could be solved with mt.
The game is synchronous, you want stuff to happen synchronously in most cases, or else you might end up wasting performance on, for example, building paths that are no longer valid.
 
I am using kondra's ot log to see the functions more used:

Lua:
      3876       296       23.32684%       12.92029% std::bind(&Game::checkCreatures, this, (index + 1) % EVENT_CREATURECOUNT)
      2747     47142       16.53197%        9.15674% std::bind(&Game::checkCreatureWalk, &g_game, getID())
      2623     26006       15.79142%        8.74657% std::bind(&Game::checkCreatureAttack, &g_game, getID())

Maybe someone know how to optimize specific that one.

I am using a Ryzen 5 3600, 16GB, 250GB NVME
The server is baiak (fast attack and a lot of monsters together)
With 130 players the cpu is already 70%

I guess with 150 180 max the freeze will start...

1697463045173.png

This is not normal right? (I know there is no magic to process the entire game simultaneously, but I believe it is bad and can be optimized)
 
Last edited:
Back
Top