• 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 Sprite render problem

Kobuz

New Member
Joined
Apr 15, 2022
Messages
5
Reaction score
2
Hello. I have a problem with sprite render distance.
Idk why, but as far i remember sprites 2x1 / 2x2 rendered properly.
The problem is that sprites higher than 2 (in this example w:1 h:3 w:2 h:3) rendering like this (down right corner):
wrong.PNG
and how it should be:
correct.PNG

I haven't seen thread with my problem.
I added more tiles to screen, this is my default view:
entire view.PNG
and this is max render size:
render size.PNG


Can someone guide me how to fix this?
I'm using OTC by Mehah 2.0.1 and TFS 1.4
Many thanks
 
Solution
To understand what I want to say, let's take a look at this "object" which is an item that consists of 3x3 tiles in one "object".
qlk9ZnE.png

I will use the following definitions as an example to better understanding:
  • Cyan Anchor = actual item that should be sent from server to client in mapDescription FIRST (otherwise you won't be able to see rest of sprites)
  • Entire Object = entire item which consists of 9 "tiles" (3x3)
  • Try to use imagination :p
So... Let's start from beginning...

Based on the default draw method:
Every "object" you see on gameMap (gamescreen) in client are creature, effect, distance effect, item no matter what but they are drawn...
To understand what I want to say, let's take a look at this "object" which is an item that consists of 3x3 tiles in one "object".
qlk9ZnE.png

I will use the following definitions as an example to better understanding:
  • Cyan Anchor = actual item that should be sent from server to client in mapDescription FIRST (otherwise you won't be able to see rest of sprites)
  • Entire Object = entire item which consists of 9 "tiles" (3x3)
  • Try to use imagination :p
So... Let's start from beginning...

Based on the default draw method:
Every "object" you see on gameMap (gamescreen) in client are creature, effect, distance effect, item no matter what but they are drawn directly from cyan anchor (right down corner)
If you want to draw the entire object which will be for example 30x30 in one item which is extremely terrible idea to handle like that, the server still needs to send cyan anchor and client needs to parse it FIRST which will be "30 tiles below sprites that you want to be displayed" which should be visible outside the screen, but obviously, the sprites above cyan anchor won't be visible, due to that you need to see cyan anchor with localPlayer first (right down corner).. but.. the cyan anchor (begin of item) will be "30 tiles" below the sprites which you want to display (so you physically don't have access to it through the player's camera until you walk to cyan anchor or send more tiles in width and height, which is terrible as I said before).

There isn't any magic trick to acquire that, other than:
1) Send even more tiles from each side of screen everytime at once (more tiles = more overload by server (need to sent more data in mapDescription packet that needs to be processed by client) not recommended due to that X tiles with all informations needs to be sent to each player everytime which will be overload af.
or
2) Split the objects that consist of more than 3x3 tile sprites in one object - into - smaller ones, even like 1 item = 1 piece of wall. recommended
or
3) Create an crazy hack that will handle something like : if certain item have flag to be force drawn then send its tile with it in mapDescription without sending other tiles in single row recommended only if you have time and understanding logic and want tryhard this option, so far I only know one person @Oskar1121 who sent light resources like that to have light outside the screen. 📸preview

PS. Also, it's worth mentioning, that mapDescription is sending tiles in a row (not entire screen) but just one line vertical or horizontal, depends how you set it in engine.
You can quick check it by zooming out camera and walk slowly to up/down or left/right, the "new" tiles will appear(be loaded by server) in line [ ! ]
You can also try to add distance effect which will be for example 5x5 and launch it somewhere outside screen where you want to be displayed, it won't be displayed until right down corner of object will be received by client from server.

I honestly suggest using the 2) option.
 
Last edited:
Solution
Back
Top