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

[OTC Mehah] Fix problems in increasing the map view

Brunds

Member
Joined
Sep 2, 2014
Messages
33
Reaction score
7
My source used: 0.3.6 TFS
OTClient - Redemption 1.0 rev 0.000 (desenv) built on Jul 3 2023 for arch x64


Guys, the idea of this topic is to clarify information that I found in several places to compose the content that already exists and not leave room for common mistakes like what happened to me. Based on everything I've researched and found I'm going to clear up some information about installing the increase map view change on OTC Mehah and the Server
First thing is this tutorial is super valid and functional, as long as if you have something different from your source you need to adapt it and not just copy and paste the code
Now I'm going to talk about the list of things you should pay attention to when installing this modification
In the server part (source or src)
XML:
#define NETWORKMESSAGE_MAXSIZE 24590

The value 24590 can be changed however it cannot be too high and also not below this suggested value so it is recommended to find a value that corrects the problem of errors in the OTC but do not be exaggerated I recommend something between 24590 - 40000 still judging that 40000 is too much in my case 24590 is working smoothly
Now in the part of configuring the new view size where the default is 8x6 in the topic it presents the code this way
C++:
void Map::resetAwareRange()
{
   AwareRange range;
   range.left = 8;
   range.top = 6;
   range.bottom = 7;
   range.right = 9;
   setAwareRange(range);
}

But the code in Mehah's OTC is like this

C++:
void Map::resetAwareRange() {
    setAwareRange({
        static_cast<uint8_t>(g_gameConfig.getMapViewPort().width()) ,
        static_cast<uint8_t>(g_gameConfig.getMapViewPort().height()),
        static_cast<uint8_t>(g_gameConfig.getMapViewPort().width() + 1),
        static_cast<uint8_t>(g_gameConfig.getMapViewPort().height() + 1)
    });
}

But it seems that even changing the values in gameconfig.h doesn't work or the values are not sent correctly so I just changed them to unique values like this leaving 16x9

C++:
void Map::resetAwareRange() {
    setAwareRange({16, 9, 17, 10});
}

Remember that the values must be the same in the source of the server in my case it was like this
C++:
        static const int32_t maxViewportX = 17; //min value: maxClientViewportX + 1
        static const int32_t maxViewportY = 10; //min value: maxClientViewportY + 1
        static const int32_t maxClientViewportX = 16;
        static const int32_t maxClientViewportY = 9;

The problem I was having specifically was that on my server the distanceEffect is also changed to u16 and the feature was not enabled on the otclient so here are the features that I have enabled on mine
Lua:
        if version >= 860 then
            g_game.enableFeature(GameSpritesU32) -- To extended the sprites
            g_game.enableFeature(GameMagicEffectU16) -- effects aumentados.
            g_game.enableFeature(GameDistanceEffectU16)
            g_game.enableFeature(GameExtendedOpcode)
            g_game.enableFeature(GameChangeMapAwareRange)
            g_game.enableFeature(GameAttackSeq);
        end

Of course this is not a default setting but I didn't remember that I needed to enable the distanceEffect feature in u16 so I'm leaving on record the importance of remembering to activate the features correctly in OTC
Warning: finally, I would like to highlight the importance of configuring the view limit value in the source and in the OTC equally
 
Best Value:
static constexpr int32_t NETWORKMESSAGE_MAXSIZE = 65500;

Use setup.otml to config viewport
 
Best Value:


Use setup.otml to config viewport
in my version of source 0.3.6 comes in unt16 the network so it is not a good option to use this value however it may be valid for other src that is in uint32
 
in my version of source 0.3.6 comes in unt16 the network so it is not a good option to use this value however it may be valid for other src that is in uint32
"doesn't matter", you just can't go beyond 65535, which is the maximum value of uint16_t.
 
Anybody know whats version is the client of TibiaScape? Im using 800OtClient but I have the feeling that its so slowly, isnt fluid like TibiaScape Client. If anybody can help me please, I apreciate!
 
TFS 0.3.6 ERROR: ProtocolGame parse message exception
OTClient ERROR: ProtocolGame parse message exception
Helping future ninjas with the SEO

This fixed all my errors related to:
ERROR: ProtocolGame parse message exception...
ERROR: no creature found to move...
ERROR: no thing at pos...
ERROR: invalid creature...
ERROR: no thing...

adding these lines:
Lua:
g_game.enableFeature(GameSpritesU32)
g_game.enableFeature(GameMagicEffectU16)
g_game.enableFeature(GameDistanceEffectU16)
at: modules\game_features\features.lua

Lua:
if(version >= 860) then
    g_game.enableFeature(GameSpritesU32) -- Extended sprites
    g_game.enableFeature(GameMagicEffectU16) -- Increased effects
    g_game.enableFeature(GameAttackSeq)
end

to a FRESH downloaded OTCV8 and OTClient(Mehah's) with just the custom things/data/860 added from my regular Old Client
 
Last edited:
Back
Top