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

TFS 1.X+ Tfs 1.3 pathfinding + changed client viewport

Decodde

New Member
Joined
Oct 8, 2018
Messages
31
Reaction score
0
I expanded my screen using @Flatlander tutorial, but i think its missing edit the pathfind viewport for summons too.

If i leave their default range they get lost trying find me, i know i could make they teleport to me if get lost but thats not what im looking for.


Do someone have any idea what part is missing to also expand summon path find view port?
 
Solution
@Decodde

On both videos the Monk now behaves another way. On the first one Monks went dance mode since they lost the follow target (master). Now it freezes like, he sees you, but can't calculate the path.

Check if 'player follow' behaves the same way.

Also please check those code parts:

otland/forgottenserver
It should creates data from part you've already modified, but anyway heres the place you need to play on.

otland/forgottenserver
expriment with that method
C++:
void Creature::getPathSearchParams(const Creature*, FindPathParams& fpp) const
{
    fpp.fullPathSearch = !hasFollowPath;
    fpp.clearSight = true;
    fpp.maxSearchDist = 12; // <- especially this
    fpp.minTargetDist = 1...
Code:
static constexpr int32_t MAX_NODES = 512;
To increase i must change 512 to whatever i want?

-Edit- Increased that value but changed nothing
 
Last edited:
youre messing in wrong place

can't build it right now, but please check this
otland/forgottenserver

C++:
bool Monster::canSee(const Position& pos) const
{
    return Creature::canSee(getPosition(), pos, 9, 9);
}

9,9 range should work for all monsters view range. Just try to increase it
From video I can predict you will need it for all monsters, so that change should be good
 
@pasiak12 hey bro changing those values increased the max distance my summons can follow me.

this is my viewport in map.h:
Code:
class Map
{
    public:
        static constexpr int32_t maxViewportX = 18; //min value: maxClientViewportX + 1
        static constexpr int32_t maxViewportY = 10; //min value: maxClientViewportY + 1
        static constexpr int32_t maxClientViewportX = 17;
        static constexpr int32_t maxClientViewportY = 9;

        uint32_t clean() const;

i changed the value to 30,30 to test:
Code:
bool Monster::canSee(const Position& pos) const
{
    return Creature::canSee(getPosition(), pos, 30, 30);
}

now it can follow me for 14 tiles away
it could cause any issue, lag or something setting highers value than the default?

-Edit- i changed the value to 200,200 just to test but it seen to continue limited to 14 tiles

-Edit2- compiled tfs and otclient with higher viewport x,y just to to test, and it continued limiting to 14 tiles
any idea why being limited to 14 tiles now?
 
Last edited:
@Decodde

On both videos the Monk now behaves another way. On the first one Monks went dance mode since they lost the follow target (master). Now it freezes like, he sees you, but can't calculate the path.

Check if 'player follow' behaves the same way.

Also please check those code parts:

otland/forgottenserver
It should creates data from part you've already modified, but anyway heres the place you need to play on.

otland/forgottenserver
expriment with that method
C++:
void Creature::getPathSearchParams(const Creature*, FindPathParams& fpp) const
{
    fpp.fullPathSearch = !hasFollowPath;
    fpp.clearSight = true;
    fpp.maxSearchDist = 12; // <- especially this
    fpp.minTargetDist = 1;
    fpp.maxTargetDist = 1;
}

otland/forgottenserver

fpp.maxTargetDist = mType->info.targetDistance; // check what would happen if you put there some higher value
 
Solution
thank you it worked! do you know if increasing those values could cause any issue, like lag or something?
another doubt @pasiak12 do you know how make summons be able to walk through others summons and players?

example:
otclient_2018-11-25_16-45-33.png
my monk be able to come to me passing trought the player and her summon
 
Last edited:
thank you it worked! do you know if increasing those values could cause any issue, like lag or something?
another doubt @pasiak12 do you know how make summons be able to walk through others summons and players?

example:
View attachment 33436
my monk be able to come to me passing trought the player and her summon


With this change all the monsters will(should) scan map further. If you want to use this feature only on summons, I can suggest add some condition like
if (isSummon()) ...


Also revert all the changes that does not impact that follow system (especially map.h)

Body block.. you shoud look in that func:
otland/forgottenserver
ReturnValue Tile::queryAdd(int32_t, const Thing& thing, uint32_t, uint32_t flags, Creature*) const

Check ur code there. The summon should be extracted from thing and condition should be added to not let him step on that Tile if theres already some creature on it.
 
Back
Top