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

OTClient 1.0

Last edited:
Hi, can anyone check on vanilla OTClient 1.0 and vanila TFS if this drawning bug happens to you aswell?

1) It doesn't animate "big" magic effects every 2nd sqm.


I'm using !z 51 command and as you can see on video, it makes light effects but does not draw magic effect or it is supposed to work like that?

2) Sometimes it can't render properly things if they are on the bottom edge of the screen.

Screenshots:
683dd22af267f2dc478c39a18234c052.png
e8de06f60272f5c267ea0852b433b30b.png
 
Last edited:
Hi, can anyone check on vanilla OTClient 1.0 and vanila TFS if this drawning bug happens to you aswell?

1) It doesn't animate "big" magic effects every 2nd sqm.


I'm using !z 51 command and as you can see on video, it makes light effects but does not draw magic effect or it is supposed to work like that?

2) Sometimes it can't render properly things if they are on the bottom edge of the screen.

Screenshots:
683dd22af267f2dc478c39a18234c052.png
e8de06f60272f5c267ea0852b433b30b.png

1)
this effect has a pattern, so you should use the effect with id 46, which is without a pattern

2)
Fixed, plz, next error use the git. thx


[Topic]
we are reaching the final stretch, soon ot1.0 will be officially launched.
 
Last edited:
As part of OTC 1.0, we knew that battleList had issues for a while know (first issue raised about it on nov 2017, ironically by me):

I've felt tempted to compare some implementations of this module and understand (really understand) what was causing this.

Vanila OTC:
  • Pick all creatures of screen with getSpectators
  • Iterate all creatures adding them to array in a sorted way (depending on current sortType)
  • Each change on Health we remove the creature and add it again in a sorted way (!!)
  • Each change on Distance (local player) we sort everything from scratch (!!!!!)
  • Each change on Distance (creature) we remove it and add it again in a sorted way (!!)
Comments: We are spending too much calculations, especially on distance case and the way we "insert in a sorted way" is basically iterating and trying to find the correct position, which has a cost around N/2 being N the size of array. Also everytime we need to recalculate the sort, we do M * N * log2(N) * C, where N is the number of creatures in the array, M being the number of movements and C being the number of corrections we need to perform in the array. It's easy to understand why this explodes so quickly;

OTC V8:
  • Kondra started by throwing away all the events, except the onPositionChange
  • 1) Pick all creatures (currently visible) of screen with getSpectatorsInRangeEx
  • 2) Sort all creatures using quicksort [complexity of N * log2(N)]
  • 3) Repeat 1 and 2 each 100 ms. (!!!)
  • Each change on Distance (local player) we sort everything from scratch (!!!!!)
Comments: The idea started wrong, the biggest advantage in this case is information, aka called "entropy".
Throwing away all this information leave us with no choice than sort it from scratch every single time, but I believe this was intended as this is exacly the approach he chose (in 1, 2 and 3). We continue to spend the EXACT amount of calculations every single time the local player moves but we did had a significant improvement in the checkCreatures function by only asking for the getSpectators to give us the creatures that are currently visible in my zoom mode (which means if you zoom in, it will return you less creatures than vanila version). While this small improvement is good, by deleting the events, Kondra made the list worst than it was initially, since now NO MATTER WHAT we will recalculate 10 times per second, so our complexity would be something like this:

(R * (2N + N * log2(N)) + (M * (2N + N * log2(N))

The first part is related to the automatic refreshes, being R the Ratio of refresh. The second is related to movements of local player.
The good thing is that despite the mess, kondra actually had a lot of good ideas that he tried to put into practice in his code such as:
  • Not considering creatures when zooming in (implemented successfully)
  • Initiate the widgets in advance (implemented successfully)
  • Instead of recalculating the array when you change from asc to sort we just iterate it backwards (implemented successfully)
  • Use a simple counter instead of os.time() for Age. (implemented successfully)
  • Overall code refactors (debatable)
  • Limiting the number of creatures to be added (not implemented though we see some checks that indicate that he was trying to do this)
... and the most important one:
  • When we have a zillion creatures in screen, we should limit the ratio of refresh.
But ok, you might be asking yourself now "why the hell I'm making those comparations?". Understanding the flaws is the only way to start making something better and while I have came up with a new implementation of my own, I want you all to understand the concepts and flaws because I hope someday someone improve my code even further as there are still some TODOs that needs to be concluded.

OTC 1.0: -- After pull #24
  • Pick all creatures of screen with getSpectators (planning to use v8 approach soon)
  • Instead of creating one array (battleButtons) we create also one called (BinaryTree)
  • 1) When adding a new creature, we do as usual but we also use binaryInsert to get the correct index in sorted order.
  • Each change we use the information from the current event and also from our cache (battleButton) to locate the current index (using binary search) and update it (swaps). This lead us to the following scenarios:
  • OnAppearing: We do as [1]
  • OnDisappearing: BinarySearch to find the current index and swap to correct positions all next positions.
  • OnHealthChange: BinarySearch to find current index and update it, also swaps to correct position all next or previous positions (depending if the health increased or decreased). Also we iterate the widgets to correct their visual localization.
  • onPositionChange: If the localPlayer moves, we simply recalculate distance to every creature and use quickSort. If it's a creature moving, we search it by using binarySearch and swaps to correct position all next or previous positions (depending if the health increased or decreased).
Comments: While I still don't have implemented most of V8 ideas, by using binarySearch and Insertion we reduce the amount of time to search from N/2 (average) to Log2(N) (worst case). While this may sound strange to understand for people who are not from computer science, for 100 monsters it would mean 50 checks vs 7.
I could reduce this even further by instead of saving data on battleButton, actually saving the index of BinatryTree, this would make access time be constant (1 check).

The bad thing is that now I'm using 3 arrays (battlePanel, battleButtons and BinaryTree) instead of two but we could do further improvements to have the binarytree be actually our battlePanel if I'm not mistaken, but in this particular case our goal is to reduce processing and not memory.

I highly encourage you to test this rework, report issues and more importantly: understand the concepts and check the TODOs to see if you can make it better. This is an issue that has been going on for years now and took me several days to actually start understanding and rewritting it.
Any help is welcome, remember that this will be used by all of us.
 
Last edited:
oh yeah I have searched but the github is so complicated.
 
Hey guys,

Well, I always wanted to help the community, but I had to choose, life and personal projects or the community, I ended up choosing my life, but things changed with the arrival of COVID and now I have time, so I will be making some corrections and improvements in customer performance, I do not guarantee exorbitant improvements, but enough to keep FPS stable on any machine, even with an I7 4770 + RX 580, I have FPS drops with many interactions.

Ahh, not forgetting, I don't intend to work on this project for a long time, at first, until the end of July, but it will be enough and feel free to report and help.

Follow the repository: mehah/otclient (https://github.com/mehah/otclient)

What has been done so far?
1- Fixed Walk System (Removed Dash, it is no longer accurate.)
2- Support Idle Animation

What will be done?
1- Bug fixes and FPS stability
2- Creation of a component to better manage the modules.
3- Possible True OTML, using HTML and CSS writing. (Maybe I won't have time for this)

OBS: I do not intend to maintain compatibility with old Tibia versions, only 10.98+

Hope u can do the 3 one
"3- Possible True OTML, using HTML and CSS writing. (Maybe I won't have time for this)"
Cant wait to make some good UIs :)
 
Hope u can do the 3 one
"3- Possible True OTML, using HTML and CSS writing. (Maybe I won't have time for this)"
Cant wait to make some good UIs :)
Well, there are already C++ frameworks for HTML5/CSS/JS based UI so it's not like he would have to write everything from scratch.
 
this project looks cools , i hope someday someone add feature to handle old protocols like 8.6 7.72 etc
 
@Mehah Yo sick work you have done so fare, i sent you a dono. Have you finished updating this (i know its fare from finished)? If i recall you said you were working on it until the end of July. Just wondering because i might try compile it and have a play around unless you have some changes planned soon.
 
there's this weird lag between monster and its name, as you can see in the gif, whenever I set framerate = max.
When I set the framerate down to 60, this does not happen.
Not sure what is going on, has anyone experienced this before?

ezgif-7-e0895971cf50.gif
Post automatically merged:

holy cow the .gif looks awful
 
Hope u can do the 3 one
"3- Possible True OTML, using HTML and CSS writing. (Maybe I won't have time for this)"
Cant wait to make some good UIs :)

honestly, i don't know if i'll have time for this, i'm not even having for simpler things.

this project looks cools , i hope someday someone add feature to handle old protocols like 8.6 7.72 etc

if otclient already supported these protocols, there is no reason why it doesn’t work, the point is that everything I did on this client, I didn’t test on protocols below 10.98

@Mehah Yo sick work you have done so fare, i sent you a dono. Have you finished updating this (i know its fare from finished)? If i recall you said you were working on it until the end of July. Just wondering because i might try compile it and have a play around unless you have some changes planned soon.

thxxx, I should only modify some modules to use the new component manager and add object highlight and a crosshair, but that doesn't stop you from playing and the only thing I shouldn't do is to optimize the interface.

there's this weird lag between monster and its name, as you can see in the gif, whenever I set framerate = max.
When I set the framerate down to 60, this does not happen.
Not sure what is going on, has anyone experienced this before?

View attachment 48459
Post automatically merged:

holy cow the .gif looks awful

I am aware of this, the solution is simple and you already did, enable vertical sync. I don't advise anyone to leave the FPS at maximum, it will only make your CPU / GPU fry.
 
I am aware of this, the solution is simple and you already did, enable vertical sync. I don't advise anyone to leave the FPS at maximum, it will only make your CPU / GPU fry.

I see, thanks!
I bought you a coffee in PayPal :)
What you're doing is very laudable.
 
posted new issue on git also putting that here also
objects are blinking/disappearing at the bottom of the screen



I know what is causing this if the crop is setted up this way its happening but after resizing the crop to match the sprite its getting fixed, its not happening in edubard otclient so im staying with my report that this is a bug
Gyazo (https://gyazo.com/959edb2f9e730928fa22d80efaabc0bb) (wrong crop size, bug happends)
Gyazo (https://gyazo.com/a5149c62dc6dade1be9ad50030ec4579) (correct crop, bug getting fixed)
 
Last edited:
posted new issue on git also putting that here also
objects are blinking/disappearing at the bottom of the screen



I know what is causing this if the crop is setted up this way its happening but after resizing the crop to match the sprite its getting fixed, its not happening in edubard otclient so im staying with my report that this is a bug
Gyazo (https://gyazo.com/959edb2f9e730928fa22d80efaabc0bb) (wrong crop size, bug happends)
Gyazo (https://gyazo.com/a5149c62dc6dade1be9ad50030ec4579) (correct crop, bug getting fixed)

this is not a bug, just an algorithm to inhibit tiles that are not visible on your screen, based on cropping the image.

if this is bothering you, just remove this line, but I do not advise:
 
this is not a bug, just an algorithm to inhibit tiles that are not visible on your screen, based on cropping the image.

if this is bothering you, just remove this line, but I do not advise:
I just adjust the crops not a big deal

Also found new crash posted on git if more info need to be provided hit me up on discord we can share screen and figure out what is going on

Discord: BulawOw#4809
 
Last edited:
I have this problem with the client, sprites don't load correctly, only have this problem with OTC 1.0, with old OTC version and OTCV8 don't have this problem, ¿it's something about the extension of the spr?
P.S.: I'm using TFS 1.3 10.98 version sprs
Sin título.png
 
opened new issue on git with fps dropping on opening modal windows where the biggest fps drop is while opening outfit modal window (set outfit)

Edit:
My bad everything is fine i got my client compiled in debug
 
Last edited:
Back
Top