• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

TFS A* Algorithm :D

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
1,211
Solutions
27
Reaction score
677
Location
Santiago - Chile
GitHub
ralke23
Twitch
ralke23
Creature::eek:nThink() @ralke

replace
C++:
forceUpdateFollowPath = true

with
C++:
if (followCreature) {
        goToFollowCreature();
    }

    forceUpdateFollowPath = true;

Fixes are pushed to github (only need the path call one ralke)

Done ^^

But still says that There is no way.
1662860964352.png

Tried clicking sewers and thoose stuff too :p
What is wrong? Thanks in advance!!
Post automatically merged:

Edit: I saw some other commits, going to apply and see how it goes

What else must be added?? If you could link me to it i'll apreciate it !!

Here's my change history
 
OP
OP
Itutorial

Itutorial

Excellent OT User
Joined
Dec 23, 2014
Messages
2,285
Solutions
68
Reaction score
933
Done ^^

But still says that There is no way.
View attachment 70479

Tried clicking sewers and thoose stuff too :p
What is wrong? Thanks in advance!!
Post automatically merged:

Edit: I saw some other commits, going to apply and see how it goes

What else must be added?? If you could link me to it i'll apreciate it !!

Here's my change history
Check the github changes. You need to change in game.cpp

Change all
C++:
player->getPathTo

it will look something like this
C++:
if (player->getPathTo(movingCreatureOrigPos, listDir, 0, 1, true, true)) {

add , PLAYER_SEARCHDIST to end of all to look like this
C++:
if (player->getPathTo(movingCreatureOrigPos, listDir, 0, 1, true, true, PLAYER_SEARCHDIST)) {

Make sure to only add to end. Don't change any values in it other than that.

Then in player.h
under
C++:
static constexpr int32_t PLAYER_MIN_SPEED = 10;

add
C++:
static constexpr int32_t PLAYER_SEARCHDIST = 9;
 

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
1,211
Solutions
27
Reaction score
677
Location
Santiago - Chile
GitHub
ralke23
Twitch
ralke23
Check the github changes. You need to change in game.cpp

Change all
C++:
player->getPathTo

it will look something like this
C++:
if (player->getPathTo(movingCreatureOrigPos, listDir, 0, 1, true, true)) {

add , PLAYER_SEARCHDIST to end of all to look like this
C++:
if (player->getPathTo(movingCreatureOrigPos, listDir, 0, 1, true, true, PLAYER_SEARCHDIST)) {

Make sure to only add to end. Don't change any values in it other than that.

Then in player.h
under
C++:
static constexpr int32_t PLAYER_MIN_SPEED = 10;

add
C++:
static constexpr int32_t PLAYER_SEARCHDIST = 9;

Think I missed something, I got this error log
1662861886036.png

It shows me this potential fix
1662861993389.png
 

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
1,211
Solutions
27
Reaction score
677
Location
Santiago - Chile
GitHub
ralke23
Twitch
ralke23
OP
OP
Itutorial

Itutorial

Excellent OT User
Joined
Dec 23, 2014
Messages
2,285
Solutions
68
Reaction score
933
Be sure to implement the newest commits from this morning. Fixed summons keepDistance. They will walk away if you are too close now. Also fixed an issue which made them stop following after x distance because of the keepDistance fix and lastly fixed the path updating for following. It was constantly updating very fast. Now it will only update if it needs to.

@ralke
 

Extrodus

|| Blazera.net ||
Premium User
Joined
Dec 22, 2008
Messages
2,648
Solutions
7
Reaction score
446
Location
Canada
Be sure to implement the newest commits from this morning. Fixed summons keepDistance. They will walk away if you are too close now. Also fixed an issue which made them stop following after x distance because of the keepDistance fix and lastly fixed the path updating for following. It was constantly updating very fast. Now it will only update if it needs to.

@ralke
Could you create a new github with one specific commit that addresses the changes for the system?
 
OP
OP
Itutorial

Itutorial

Excellent OT User
Joined
Dec 23, 2014
Messages
2,285
Solutions
68
Reaction score
933
Could you create a new github with one specific commit that addresses the changes for the system?
Once it is ready to merge I will. There isn't much too it really. Both the pull requests do one thing each.

1) Call path update whenever it is needed (so we don't get walking delays)
2) Make the pathfinding faster so it takes less performance to use.

All other changes have just been things that broke because of the difference in the pathfinding system.

If summons didn't walk away in default TFS then one of the commits made it so they do. It was kind of related so I added it in.
 
Last edited:

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
1,211
Solutions
27
Reaction score
677
Location
Santiago - Chile
GitHub
ralke23
Twitch
ralke23
Be sure to implement the newest commits from this morning. Fixed summons keepDistance. They will walk away if you are too close now. Also fixed an issue which made them stop following after x distance because of the keepDistance fix and lastly fixed the path updating for following. It was constantly updating very fast. Now it will only update if it needs to.

@ralke

Perfect! Worked! In case someone else looks at this, be sure to merge "Add min distance check" this way distX and distY won't show as undefined.
 

Pox

Advanced OT User
Joined
Apr 28, 2020
Messages
162
Solutions
10
Reaction score
164
Not sure if its only me?
The commits are abit messy to follow, some overwrites others etc... but I should have gotten them all

path.gif
 
Last edited:
OP
OP
Itutorial

Itutorial

Excellent OT User
Joined
Dec 23, 2014
Messages
2,285
Solutions
68
Reaction score
933
Not sure if its only me?
The commits are abit messy to follow, some overwrites others etc... but I should have gotten them all

View attachment 70847
Yeah, I found this same problem while doing some testing. I haven't posted the fix for it yet because I am still testing. You should be able to change this to fix it:

map.cpp
C++:
// We are at the target and don't need to walk away. No need to update path.
    if (!fpp.keepDistance && fpp.minTargetDist <= 1 && distX < 2 && distY < 2) {
        return false;
    }

to
C++:
// We are at the target and don't need to walk away. No need to update path.
    if (!fpp.keepDistance && fpp.minTargetDist <= 1 && distX < 2 && distY < 2) {
        return true;
    }
 

Diarreamental

Banned User
Joined
Jul 6, 2015
Messages
450
Solutions
1
Reaction score
80
Cool

up sorry for double post, could somebody point me out which are the requeried changes in order to apply the "new monster behavior" please? i can see many references from differentes autoerhs i must apply all ? which one to choose?

thanks
 

mameca123

www.TheHeroesOfTime.com
Joined
Nov 19, 2008
Messages
37
Reaction score
7
Cool

up sorry for double post, could somebody point me out which are the requeried changes in order to apply the "new monster behavior" please? i can see many references from differentes autoerhs i must apply all ? which one to choose?

thanks
I have the same question. Is it possible for someone to summarize what is needed? Because some of the git commits overlap others.
 

Nottinghster

Tibia World RPG Developer
Joined
Oct 24, 2007
Messages
1,548
Solutions
6
Reaction score
406
Location
Brazil - Rio de Janeiro
GitHub
Nottinghster
In that order:

 

Diarreamental

Banned User
Joined
Jul 6, 2015
Messages
450
Solutions
1
Reaction score
80
is there a way to add or replace all this commits without doing it manually code by code 1 by one? pleas enlighten me
if im using tfs 1.4?
 

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
1,211
Solutions
27
Reaction score
677
Location
Santiago - Chile
GitHub
ralke23
Twitch
ralke23
is there a way to add or replace all this commits without doing it manually code by code 1 by one? pleas enlighten me
if im using tfs 1.4?
I don't know exactly how but I think that you can compare the Greed repository with a clean TFS-1.5 Nekiro downgrade and just start importing the changes from compare. Otherwise, if you don't have source changes that you must keep, just use that sources are clean TFS-downgrades with some little addings (see logs).
 

Diarreamental

Banned User
Joined
Jul 6, 2015
Messages
450
Solutions
1
Reaction score
80
i added all the commits menthiones by @Nottinghster and i having the same compiling errors as in the clean repository
Lua:
1>database.cpp
1>C:\Users\diap\Documents\GitHub\Greed-TFS-1.5-Downgrades\src\creature.cpp(225,2): error C2065: 'isUpdatingPath': undeclared identifier
1>C:\Users\diap\Documents\GitHub\Greed-TFS-1.5-Downgrades\src\creature.cpp(245,21): warning C4390: ';': empty controlled statement found; is this the intent?
1>databasemanager.cpp

How to solve this? To fix the second error, I just deleted the semicolon, but don't know how to declare isupdating path

edited: there was an error with cherry-picking, I just changed the whole code and now have compiled it
Post automatically merged:

This is incredible work, very smooth in comparison with tfs normal behavior thanks

and i think there are many more commits involved, at least I have used the ones displayed in GitHub desktop
In that order:

 

Attachments

Last edited:

Diarreamental

Banned User
Joined
Jul 6, 2015
Messages
450
Solutions
1
Reaction score
80
since you are trying to fix monster behavior can you guys point me out how to fix this pls ? C++ - mosnter ranged attack tfs 1.5 are very off is there a way to fix this? (https://otland.net/threads/mosnter-ranged-attack-tfs-1-5-are-very-off-is-there-a-way-to-fix-this.282764/#post-2708191) @ralke @Itutorial

also when monster are being chased ( monster that run away like hunter, amazon, orc spearman ) when they get reached by a player they stand still and start attacking but they dont run away could be this fixable?
edit:: monster can be easily cornered too
 
Last edited:
Top