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

[Tutorial] Adding more tiles to game window - Updated 7/6/2018

OMG DUDE!
Read the reply chupaescadatri gave you, damn. There's what you're asking.

Sorry, but, I think you don't understand what I said, with this paste my client looks like that:
yupVC961TF6g7axr-cFlDA.png


And what I said, it's to zoom out, like it, but automatically, without I click (ctrl -) 2 times, every time that I login on my character, like this:
km7kzq1UTDil80hLtjEcJA.png
 
Last edited:
Sorry, but, I think you don't understand what I said, with this paste my client looks like that:
yupVC961TF6g7axr-cFlDA.png


And what I said, it's to zoom out, like it, but automatically, without I click (ctrl -) 2 times, every time that I login on my character, like this:
km7kzq1UTDil80hLtjEcJA.png


You need to look for gameMapPanel:setZoom inside gameinterface.lua and change the value (There's many but i guess u can hit the right one, i can't check myself right now).

About the white name on you character, is there a chance you share something about it?
 
You need to look for gameMapPanel:setZoom inside gameinterface.lua and change the value (There's many but i guess u can hit the right one, i can't check myself right now).

About the white name on you character, is there a chance you share something about it?

I'm trying to put this view, but it's a little complicated.

The white name, you need just delete this in Creature.cpp (Otclient)
C++:
    else if(healthPercent >= 100)
        m_informationColor = Color(0xDC, 0xC8, 0x46);
    else if(healthPercent > 60)
        m_informationColor = Color(0xDC, 0xB6, 0x3F);
    else if(healthPercent > 30)
        m_informationColor = Color(0xDC, 0x94, 0x33);
    else if(healthPercent > 8)
        m_informationColor = Color(0xDC, 0x5A, 0x1F);
    else if(healthPercent > 3)
        m_informationColor = Color(0xDC, 0x4C, 0x1A);
    else
        m_informationColor = Color(0xDC, 0x2E, 0x10);

Will be like this:
C++:
void Creature::setHealthPercent(uint8 healthPercent)
{
    m_healthPercent = healthPercent;
    callLuaField("onHealthPercentChange", healthPercent);

    if(healthPercent <= 0)
        onDeath();
}
 
When I climb on a ladder, this appears, and the account hangs forever.
Sorry for my English, I'm Brazilian. Help-me


Code:
    [C++]: Protocol::xteaDecrypt
ERROR: failed to decrypt message
at:
    [C++]: Protocol::internalRecvData
ERROR: invalid encrypted network message
at:
    [C++]: Protocol::xteaDecrypt
ERROR: failed to decrypt message
at:
Help-me
 
I'm using latest otclient version from github and none of those functions are in my protocolgame.cpp, not even the NETWORKMESSAGE_MAXSIZE in const.h
Any idea?
 
I'm using latest otclient version from github and none of those functions are in my protocolgame.cpp, not even the NETWORKMESSAGE_MAXSIZE in const.h
Any idea?

make changes in tfs sources all codes are there
 
Last edited:
Does this work for 0.4, 8.70? I saw it here in the sources, but it's kind of complex because I did not find it the way it is there
 
I can not find these codes in my
igcvj0

IMG-> Screenshot
/*
* Copyright (c) 2010-2017 OTClient <GitHub - edubart/otclient: An alternative tibia client for otserv written in C++11 and Lua, made with a modular system that uses lua scripts for ingame interface and functionality, making otclient flexible and easy to customize>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

#include "protocolgame.h"
#include "game.h"
#include "player.h"
#include "item.h"
#include "localplayer.h"

void ProtocolGame::login(const std::string& accountName, const std::string& accountPassword, const std::string& host, uint16 port, const std::string& characterName, const std::string& authenticatorToken, const std::string& sessionKey)
{
m_accountName = accountName;
m_accountPassword = accountPassword;
m_authenticatorToken = authenticatorToken;
m_sessionKey = sessionKey;
m_characterName = characterName;

connect(host, port);
}

void ProtocolGame::eek:nConnect()
{
m_firstRecv = true;
Protocol::eek:nConnect();

m_localPlayer = g_game.getLocalPlayer();

if(g_game.getFeature(Otc::GameProtocolChecksum))
enableChecksum();

if(!g_game.getFeature(Otc::GameChallengeOnLogin))
sendLoginPacket(0, 0);

recv();
}

void ProtocolGame::eek:nRecv(const InputMessagePtr& inputMessage)
{
if(m_firstRecv) {
m_firstRecv = false;

if(g_game.getFeature(Otc::GameMessageSizeCheck)) {
int size = inputMessage->getU16();
if(size != inputMessage->getUnreadSize()) {
g_logger.traceError("invalid message size");
return;
}
}
}

parseMessage(inputMessage);
recv();
}

void ProtocolGame::eek:nError(const boost::system::error_code& error)
{
g_game.processConnectionError(error);
disconnect();
}
 
Code:
 protocolgame.cpp In member function `void ProtocolGame::sendMoveCreature(const Creature*, const Tile*, const Position&, uint32_t, const Tile*, const Position&, uint32_t, bool)':

Code:
2306;protocolgame.cpp 'class NetworkMessage_ptr' has no member named 'AddByte'


When I change AddByte to addByte, the error persists

Code:
protocolgame.cpp In member function `void ProtocolGame::sendMoveCreature(const Creature*, const Tile*, const Position&, uint32_t, const Tile*, const Position&, uint32_t, bool)':

Code:
protocolgame.cpp 'class NetworkMessage_ptr' has no member named 'addByte'

Doubt healed, with my instructions, I realized there was something wrong with this line "msg.AddByte" the right one would be "msg-> AddByte".
 
Last edited by a moderator:
I increased the screen and am having this problem whenever I see a npc on the screen, when it moves I get this error in the terminal


ERROR: no thing at pos:917 1027 7, stackpos:1 C++ stack traceback: [C++]: ProtocolGame::getMappedThing ./otclient(ProtocolGame::getMappedThing(stdext::shared_object_ptr const&)+0x421) [0x5620996b2ec5] ./otclient(ProtocolGame::parseCreatureMove(stdext::shared_object_ptr const&)+0x2f) [0x5620996b33c9] ./otclient(ProtocolGame::parseMessage(stdext::shared_object_ptr const&)+0x375) [0x5620996b509d] ./otclient(ProtocolGame::eek:nRecv(stdext::shared_object_ptr const&)+0x6b) [0x5620996a4693] ./otclient(Protocol::internalRecvData(unsigned char*, unsigned short)+0x7e) [0x5620995c0262] ./otclient(std::_Function_handler, std::_Placeholder<1>, std::_Placeholder<2>))(unsigned char*, unsigned short)> >::_M_invoke(std::_Any_data const&, unsigned char*&&, unsigned short&&)+0x2b) [0x5620995c0cc0] ./otclient(Connection::eek:nRecv(boost::system::error_code const&, unsigned long)+0x83) [0x5620995af2b9] ./otclient(boost::asio::detail::read_op, boost::asio::mutable_buffers_1, boost::asio::mutable_buffer const*, boost::asio::detail::transfer_all_t, std::_Bind, std::_Placeholder<1>, std::_Placeholder<2>))(boost::system::error_code const&, unsigned long)> >::eek:perator()(boost::system::error_code const&, unsigned long, int)+0x2c0) [0x5620995bb4e2]


ERROR: no creature found to move C++ stack traceback: [C++]: ProtocolGame::parseCreatureMove ./otclient(ProtocolGame::parseCreatureMove(stdext::shared_object_ptr const&)+0x10d) [0x5620996b34a7] ./otclient(ProtocolGame::parseMessage(stdext::shared_object_ptr const&)+0x375) [0x5620996b509d] ./otclient(ProtocolGame::eek:nRecv(stdext::shared_object_ptr const&)+0x6b) [0x5620996a4693] ./otclient(Protocol::internalRecvData(unsigned char*, unsigned short)+0x7e) [0x5620995c0262] ./otclient(std::_Function_handler, std::_Placeholder<1>, std::_Placeholder<2>))(unsigned char*, unsigned short)> >::_M_invoke(std::_Any_data const&, unsigned char*&&, unsigned short&&)+0x2b) [0x5620995c0cc0] ./otclient(Connection::eek:nRecv(boost::system::error_code const&, unsigned long)+0x83) [0x5620995af2b9] ./otclient(boost::asio::detail::read_op, boost::asio::mutable_buffers_1, boost::asio::mutable_buffer const*, boost::asio::detail::transfer_all_t, std::_Bind, std::_Placeholder<1>, std::_Placeholder<2>))(boost::system::error_code const&, unsigned long)> >::eek:perator()(boost::system::error_code const&, unsigned long, int)+0x2c0) [0x5620995bb4e2] ./otclient(boost::asio::detail::reactive_socket_recv_op, boost::asio::mutable_buffers_1, boost::asio::mutable_buffer const*, boost::asio::detail::transfer_all_t, std::_Bind, std::_Placeholder<1>, std::_Placeholder<2>))(boost::system::error_code const&, unsigned long)> > >::do_complete(void*, boost::asio::detail::scheduler_operation*, boost::system::error_code const&, unsigned long)+0xc5) [0x5620995bb5d0]

Captura de tela_2018-02-20_23-30-44.png
 
Last edited by a moderator:
@Flatlander I'm just curious - do you happen to have any information related to how the expansion of the game window impacts the performance of creature pathfinding?
I'd imagine that increasing the window by 4sqm on the x-axis and 2sqm on the y-axis would create a lot of extra overhead in the pathfinding code, especially with a large mob of creatures calculating their path.

Red
 
@Flatlander I'm just curious - do you happen to have any information related to how the expansion of the game window impacts the performance of creature pathfinding?
I'd imagine that increasing the window by 4sqm on the x-axis and 2sqm on the y-axis would create a lot of extra overhead in the pathfinding code, especially with a large mob of creatures calculating their path.

Red

Definitely have data on it somewhere.

I even have had an argument here on OTLand about how I had to update that pathfinding system.
Should We Start Learn TFS Coding ?

Basically you'll want to take into account "distance" when selecting a "bestnode" in the pathing system for TFS to resolve most issues.

There are probably other optimizations you can do, but my server can currently have creatures track you up/down stairs, and from very long distances without causing too much lag. (Also, you can set a max-limit, if a monster can't find you in 100 nodes, it gives up, etc)
 
@Flatlander
I am using OTX 0.3.8(i guess?)

I've followed the tutorial over 10 times, compiled otx over 40 times, comiled otc in 4 different sizes(because of the size in map.cpp).

I've followed your tutorial a lot of times now.

Result:

vRBA5t0.png


Skills everything == -1. (Yes i've already increased the number in const.h). I've also tried this:
[Solved] Sending more tiles to client

No results.


But in one of my earlier compilations (there were some numbers that were wrong (giving value of viewportX instead of (viewportX+1) or forgotten or something. I do not know which one was wrong(or good). So i couldn't reproduce the sources(especially after many compilations further).

But the earlier compilation worked pretty okay'ish~~~

EdMgsRr.png


Minimap is ok, Floorchange is ok, walking north or south ok. But walking east or west...

ibJN9Ev.png


AgqXudi.png

Optical illusion ?

I've thought it was somewhere in the sendcreature or the moveupcreature function?
Tried to manipulate it no difference at all!

Untill i tried your tutorial again from 0, which results in the first picture again(as with the other failed compilations).

Notes:
- Cansee isn't in protocolgame, it's in protocolgamebase(atleast in otx?).
- I can find spectators at some places in sources, but it has no numeric value..
- Yes i am aware that it might not work, as it ain't the real TFS.
vRBA5t0
 
I have never used OTX.

How similar is it to TFS 1.X?
Does it still have a protocolgame.cpp?
If yes can you post it here so I can take a look at it?
 
I have never used OTX.

How similar is it to TFS 1.X?
Does it still have a protocolgame.cpp?
If yes can you post it here so I can take a look at it?

Well to be honest, OTX is mostly just modified TFS.
That's why i decided to private message you, according to TFS developers they call it stealing(if i am right).

yes i do have protocolgame.cpp

 
Back
Top