OTCi - OTClient improvement project

4drik

Advanced OT User
Joined
Jun 30, 2014
Messages
195
Reaction score
145
Hello OTLand.
OTClient changed the game on OTS.
We have many servers, that thanks to OTClient are unique, interesting, but recently we neglected OTClient.
@MagicWall reminded that OTClient needs us right now, changes are needed. Check the topic.
Everyone agreed. OTClient must be developed. Developed on a larger scale.
However, most of us do not have the time or skills to work on this great project.
Then, in the subject to which the link was given above, @Dual Core proposed to purchase development services for the purpose of developing OTClient.
Since then I have become interested in freelancers and companies.

I come with the initiative.

OTCi will be a client with fixed bugs, optimized, meeting the highest expectations.

In my opinion, I made the best choice. Here I would like to point out that the continuation will be focused on me for a moment.
I'm creating Naruto Story OTS and I use OTClient for a long time. I have modified OTClient and improved it in several aspects.
My changes can be found in Edubart's github pulls but I will quote it for you.
- Battle Fix (fixes attacking monsters after pressing button "Hide monsters")
- We also have to clean up the code, eg: here
- Fix crashes, eg when running a client on MacOS, (for now we can dodge it):
modules/client/client.lua
Lua:
  -- If not MacOS, play startup music
  if g_app.getOs() ~= "mac" and g_app.getOs() ~= "macos" then
    musicChannel:enqueue(musicFilename, 3)
    connect(g_game, { onGameStart = function() musicChannel:stop(3) end })
    connect(g_game, { onGameEnd = function()
      g_sounds.stopAll()
      musicChannel:enqueue(musicFilename, 3)
    end })
  end
We know that the client has performance problems, that the FPS are not stable and they can quickly jump down.
The main creator of the project, Edubart, pointed out what should be improved so that the game's performance will increase.
1. Drawing Less Tiles
The current game map rendering architecture of otclient draws 18*14 = 252 tiles into a framebuffer, however only 15*11 = 165 tiles are visible on screen, so there is a great room for improvement here, 87 extra tiles are being drawn that are not visible, meaning that we could draw ~35% less. But there is a reason for it, 1 row at the top, 2 row at the bottom, 1 column at the left, 2 columns at the right of tiles first are drawn because when you walk you need to see where are you going at, but only when walking you need to see those extra tiles, they are discardable when you are not moving, even more depending on the direction of the walk you need to drawn only a row or a column, nevertheless otclient drawn all these extra rows and columns simple because nobody optimized that yet. Moreover we can't simple discard the bottom/right rows/columns without thinking the 64x64 sprites (trees, creatures 2x2). Therefore an algorithm that could discard those rows/columns of tiles and drawn them only when needed would greatly improve performance.

2. Drawing Even Less Tiles
There is more room for performance improvement, there a function in the map called isCompletelyCovered(), it's basically a function to check if a tile is being completely covered by another tile (meaning that we won't need to draw this covered tile). This function is working in average, however it's not smart enough, there are cases that is simple misses, and it doesn't even take the tiles dimensions into account.

3. Drawing creatures are not the problem
Many here saw that there is a great performance drop when drawing many creatures into the screen, indeed it really happens, however the main cause are not really creatures. The first problem is text drawing for creatures, it needs an algorithm with better caching, everytime a creature moves its name moves too and the engine needs to recalculate all the text glyphs positions, this could be improved by caching the text coords into a vertex array and just translating the vertex array instead of recalculating all again, in fact any moving text in otclient will consume more CPU, the greater the text the more you generally don't notice this because the UI text are static. The second cause is the battle list, which have some algorithms that work poorly when dealing with huge number of creatures. If you hide the creatures name and disable the battle module you will see that the FPS doesn't drop that much with many creatures.

4. Lights doesn't have the best implementation
As some noted the lights are drawn as big bubbles, meaning more lights more bubbles to draw, the bigger the light the bigger the bubble. When you have many lights the FPS will decrease a lot. This was not how I originally intended do implement lights, this algorithm was first introduced by @tarjei who sent me his idea and patch by email, in conjunction with him I adapted the algorithm to otclient, because how cool? We had lights working. However years passed and the algorithm still the same, it works. In a better world the lightning system would use vertex lightning, this would split the final drawn game map framebuffer into squares and each corner of the squares would have a color value associated with the intensity/color of light at the corner, then we would draw the framebuffer in a batch of squares with lightning colors associated with each square. This method would not decrease FPS even with huge amount of lights. Other idea would be to make per pixel lightning, for that using shaders, however would need a recent graphics card.

5. Reduce Texture Binding
As many of you was discussing, this would improved FPS. All sprites are loaded into textures, each time the client draws a sprite on the map it needs to bind the associated texture to that sprite, each binding downgrades the performance. In a perfect world if the whole game map could be drawn without texture bindings switches, even better, in a single batch, there would be a great increase in the FPS. But how to do that? This can be done with a technique called texture atlas, where all current visible and recent sprites are maintained in a few huge textures, thus much less texture switching would be needed, this would need a great refactor in how sprites are handled in otclient.

I have provided this information to a company that deals with the optimization of games - Bit Hit Studio.
In response, I received information that they would take care of the project for 1000$ and the project would be ready in two months.
The price seems as affordable as the work you need, but we also anticipate additional, unexpected expenses in the amount of $500.
In total 1500$ is needed of which 300$ has already been paid by us.
I decided that we should not require a deadline but I would like to get an access to the repository on which the company will work.
The company wants to cooperate with me, everything went without a problem. We have paid the money that has started the project.
(If you are interested in who is "we", it will be explained later.)

We are also looking for solutions that are already tested on servers. Solutions, which will improve the quality of the game.
We have contacted a some major OTS project that has significantly improved OTC in order to buy improvments and publish it, however, those who answered criticized the current situation in the world of Open Tibia.
In short term: everyone wants to only get, but not give
We want to change it and we hope that, more developers will join soon.

This project will be expensive. It will cost us time and money.
Therefore, I am doing a money collection.

I will write all those who donate the project there, users:
- @4drik (100$)
- @margoh (100$)
- @Nilan (100$)


To be on a list, you can send donations by Skrill on E-mail adress: [email protected]
When you do this, please send me a private message.
If you want to donate and don't have Skrill account, you can create it here.

If you can not help, it's a pity, but you can count on us.
Remember that in the end all changes and improvments will be available to the entire community.

The project will be under supervision by @4drik (me, Naruto Story OTS author), @Nilan (Dragon Ball Legend OTS author), @margoh and Bit Hit gaming company.
We will do our best to make OTClient even more amazing.

Thank you for so many support in messages.
In this topic I will keep you informed about progress.

Optimization progress:
1. Drawing Less Tiles - FINISHED (written by Adrik, tested by Nilan):
> FPS before: 450
> FPS after: 468
2. Drawing Even Less Tiles
3. Drawing creatures are not the problem
4. Lights doesn't have the best implementation
5. Reduce Texture Binding
 

Ahilphino

Veteran OT User
Joined
Jun 5, 2013
Messages
1,382
Reaction score
403
NAH!

dont fix performance wtf. everyone can run otclient
the issue IS The garbage animations in newer protocols.
 
Last edited by a moderator:
OP
4drik

4drik

Advanced OT User
Joined
Jun 30, 2014
Messages
195
Reaction score
145
the issue IS The garbage animations in newer protocols.
We'll take care of that too. Optimization is not the only thing that we focus on.
We plan to improve and implement many solutions, e.g. an updater.
 

Peonso

Godly Member
Joined
Jan 14, 2008
Messages
1,515
Reaction score
1,003
We have contacted a some major OTS project that has significantly improved OTC in order to buy improvments and publish it, however, those who answered criticized the current situation in the world of Open Tibia.
In short term: everyone wants to only get, but not give
Someone really came with that lame excuse? They should remember that most of the shit they use are open source and from community effort. They don't what to share because they don't want competition. As if any feature could be compared with the whole otclient or tfs/otserv that they got for free.
 

Amiroslo

Support Team
Support Team
Joined
Jul 28, 2009
Messages
6,677
Reaction score
683
Good luck, if you guys want a channel on our discord. HMU
 

BahamutxD

Jack of all trades, master of none
Joined
Jun 8, 2009
Messages
568
Reaction score
180
Location
Spain
I must agree with @Ahilphino Never seen/had a performance issue with OTC but animations being clunky and movement not being smooth thats a real issue and most likely one of the reasons that makes server owners use real Tibia client instead.

I'm running an extended view test with unlocked underground Z view aswell (720 tiles at most) and my test machine ranges from 400 to 500fps while CPU/GPU being half used. (2500k/560gtx) The only time I can see big performance drops is when theres massive amounts of spell effects but thats never a real case scenario unless its some crazy fast server. I'm not saying performance shouln't be better/is perfect but I don't see it as a real problem right now.

Sadly I can't help with coding neither with big amount of money but in my free time I like to make maps, so if anyone wants a map done I would gladly donate the money to the project.
 

Taishou Zetto

New Member
Joined
Jan 6, 2018
Messages
8
Reaction score
1
Otclient needs to be improved, as has been said before, we have alot of drop fps on many occasions , congratulations guys, make otclient great :p.
 

Apollos

Dude who does stuff
Joined
Apr 22, 2009
Messages
737
Reaction score
450
Location
United States
This is so great to hear guys, thanks so much for taking the initiative. I think this is a really good idea, take the load off the maintainers and get the bugs fixed and then everyone can move on to adding new features for OTC.

I'm hoping that now that this is in the works, more developers who have fixed the major bugs with OTC will be more willing to contribute again.
 
Last edited:

Sir Knighter

ArchlightOnline.com
Premium User
Joined
Jun 29, 2009
Messages
4,073
Reaction score
1,167
Location
Canada
If you guys can publicly prove several significant performance improvements, I'll donate a good amount. I just wanna make sure you guys and this group you're working with know what they're doing. $1000 seems suspiciously cheap.
 

Ochman

Premium User
Premium User
Joined
Feb 27, 2016
Messages
212
Reaction score
135
Have few questions regarding:
a) Is it going to be open sourced or donators-only?
b) Is there any way to contribute with PRs? My only problem with OTC was that I couldn't feel any kind of "progress". And I'm good enough to provide a few fixes, but on the other hand, I'm not good enough to make it complex and ensure that I don't destroy any other thing. (I'm not talking about optimization, rather about some behavior bugs).
 
Last edited:
OP
4drik

4drik

Advanced OT User
Joined
Jun 30, 2014
Messages
195
Reaction score
145
Hello.
Thank you for so much interest. This indicates how much demand was for the development of OTC.
a) Is it going to be open sourced or donators-only?
b) Is there any way to contribute with PRs? My only problem with OTC was that I couldn't feel any kind of "progress". And I'm good enough to provide a few fixes, but on the other hand, I'm not good enough to make it complex and ensure that I don't destroy any other thing. (I'm not talking about optimization, rather about some behavior bugs).
a) When the donate pool is filled - the project will be public.
b) Of course you can share solutions with us. We will check it and then we decide whether it should be implemented or not.

This is just the beginning of the road, and the effect is already visible.
 

StreamSide

Joseluis Gonzalez
Support Team
Joined
Aug 31, 2007
Messages
3,283
Reaction score
796
Location
Arica - Chile
Heyy, congratulations for this motivation, I'm glad you guys are doing something for the best thing ever created for otservers, the famous OTC.
I will donate for sure.
 

totolol123

Intermediate OT User
Joined
Oct 19, 2010
Messages
305
Reaction score
62
You need to make things clear, what is the background of this company? I did a basic search and only found outdated information, also sent them a EMAIL and got no response yet. Maybe company is different but its the only one i did found.
If you want people to be engaged in it, start a public repository where everyone can see changes being made, not a private shady one.
Things can be done also by patreon by steps. Hit 500$ then X improvement is done, company can break things up for us and also we will need deadlines, you know we are paying, nothing here is for free.
Im willing to donate but not in current way, sorry.
 

iNux

New Member
Joined
Jan 19, 2019
Messages
18
Reaction score
16
This does not look professional at all, it should contain information of what issues OTClient has and what fixes there will be. This thread is not serious at all. @4drik You can do better then this, give us more information, a list, anything that people can see otherwise donations will never happen.

You can't write this way, I think a more serious and experienced person should take this, showing a before and after pictures of FPS does not make it worth paying the money. What has changed, what changes were made?
 

BahamutxD

Jack of all trades, master of none
Joined
Jun 8, 2009
Messages
568
Reaction score
180
Location
Spain
Hello.
Thank you for so much interest. This indicates how much demand was for the development of OTC.

a) When the donate pool is filled - the project will be public.
b) Of course you can share solutions with us. We will check it and then we decide whether it should be implemented or not.

This is just the beginning of the road, and the effect is already visible.
Whats the CPU/GPU on that machine?
 

Kvn007

Well-Known Member
Joined
Aug 20, 2009
Messages
20
Reaction score
9
I will donate soon D: if you guys give us more information
 
Last edited:

Apollos

Dude who does stuff
Joined
Apr 22, 2009
Messages
737
Reaction score
450
Location
United States
I can't even find information on this Bit Hit Studio company anywhere online, it seems sketchy. I'm ready to donate but I would love to get more information on how legit this company is before I do. Please give some links to show who they are, or like Sir Knighter prove the significant changes made by this company.
 

Dual Core

New Member
Joined
Oct 25, 2018
Messages
11
Reaction score
8
I think what some of the guys say is fine. I think the changes should be visible in a Gith repository. Donate without knowing if something is really being done is not safe I think.

I would donate
 
Top