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

Positioning 64x64

Dercas

Active Member
Joined
Nov 15, 2008
Messages
86
Reaction score
28
Hi all,

I'm working on 64x64 graphics in OTC (Mehah). Apart from upscaling the graphics I've made the following changes:

src/client/creature.cpp
Change:
C++:
const auto& creatureOffset = Point(16 - getDisplacementX(), -getDisplacementY() - 2) + getDrawOffset();

To:
C++:
const auto& creatureOffset = Point(32 - getDisplacementX(), -getDisplacementY() - 4) + getDrawOffset();

To have the creature's name displayed in the right position & compiled. Then I've changed in

otclient/data/setup.otml

sprite-size: 32
to:
sprite-size: 64

So that the graphics is displayed correctly in 64x64 rather than 32x32.

I, however, have an issue with stacking items on the ground (parcels, boxes, whatever) & creatures walking on them seems to be a bit out of place. Example:

1711463007288.png

1711463156772.png


The table is also broken:
1711463111284.png



Items lying on a counter:

1711463381841.png

& creature (character) standing on the parcels:
1711463464329.png

So, I know that the positioning of the items lying higher is incorrect & should be upscaled as I use higher-res graphics but couldn't find the right source part nor any fix on the forum for the problem.


Any help will be appreciated!
 
You can have a look at otcv8 changes, which I've made some time ago (regarding 64x64 sprites - HD mod) - filter otcv8 repo by mrianura author
Post automatically merged:

I solved there exactly Your issues
 
You can have a look at otcv8 changes, which I've made some time ago (regarding 64x64 sprites - HD mod) - filter otcv8 repo by mrianura author
Post automatically merged:

I solved there exactly Your issues
Thank you for the response. Is this what you mean?
Merge pull request #38 from mrianura/master · OTCv8/otcv8-dev@72af7c4 (https://github.com/OTCv8/otcv8-dev/commit/72af7c465752f7c143261bc8460c12de28f20f9e)

If so, I have not found a solution over there.
 
these 4, basically everywhere You have m_displacement You should multiple this by scale factor (64x64 means scale 2)
1711529434357.png
 
the HD mod was made for an older version of otcv8, mehah release is a bit different (or simply newer) & your changes/mod doesn't really fix the problem. When it comes to m_displacement:

1711535719160.png

That's all places it appears in the source & the only thing we could actually change is:

C++:
const Rect screenRect(dest + (textureOffset - m_displacement - (m_size.toPoint() - Point(1)) * g_gameConfig.getSpriteSize()) * g_drawPool.getScaleFactor(), textureRect.size() * g_drawPool.getScaleFactor());

but it already contains "g_gameConfig.getSpriteSize())" so no amendments are needed here.

I've also looked for 'getDisplacement' part of the codes in the past but also no success in fixing the issue :(
 
const Rect screenRect(dest + (textureOffset - m_displacement *2 - (m_size.toPoint() - Point(1)) * g_gameConfig.getSpriteSize()) * g_drawPool.getScaleFactor(), textureRect.size() * g_drawPool.getScaleFactor());

m_displacement *2 should be everywhere
 
Back
Top