• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TFS A* Algorithm :D

We reviewed this with @johnsamir via discord. He's now running his server with all the changes, was very easy to apply them all so I think he's not going to have more issues related to this system.

About the creature corner thing, we reproduced it on both engines, and it is indeed, delaying a little bit when the creature is on corners. But I also logged in to Tibia cipsoft (tibia rl) and noticed that the creature behaviour is the same (it stays on the corner). This only make me think that requesting this "feature" of getting out too fast from corners, is not cipsoft behaviour and I can say than is a custom feature (probably from 0.4/other engines).

There's cases, such as Deers, where they prioritize the scape, so they're really intended to walk out from corners. So I still need to test more the behaviour on this cases. But at the moment everything seems right at least for me.

Also, something important to say, is that the "corner trap" from real tibia depends a lot of where the player is placed, and also, of how to scaping route is drawn. For example, when I see that an Orc Spearman has a clear path that is a straight line to bottom, it will stay stucked on the corner. Otherwise, if the scaping route has free SQM to the right, but, it is not a straight line to the right, the creature will take the right path.

This are very very very little details, so I will keep testing it and see what I can conclude on all this. But in resume, I don't think that your suggestion on changing goToFollowCreature is correct. If you wish to have those creatures behaving like that, it's ok, but I advice that all the "elses" that are delaying the monster response are there for a reason.

Regards! ^^
Oo interesting , but which commit is this that changes the behavior of cornered monsters?

I am almost at a point where i can start testing with monsters as i am changing everything xD
 
There's no way that someone can fix a thing that isn't properly checked. And with this I mean, you should at least record or provide a screenshot, of why you think it has and error, and how it should behave. Don't post the code, post the proof that the system is not working how it should. As I see there's no issue at all.



Sorry for the delay, this one needs to be merged too in order to make everything work well ^^
Good catch @iNux

While you're testing all this I suggest that you merge kondras statistics system Feature - [TFS 1.4] OTS statistics (C++/Lua/SQL) by kondra (https://otland.net/threads/tfs-1-4-ots-statistics-c-lua-sql-by-kondra.283717/), allowing you to perhaps adjust some codes related to path finding and other things that might perhaps take a lot of CPU / Memory.

I'm trying to implement it myself but have some struggles, I'll keep trying and if I succeed I'll post the changes here.
 
While you're testing all this I suggest that you merge kondras statistics system
A bit off topic, but maybe someone needs it to add stats to his server:

Yesterday I reset my Docker cache (alpine:3.15.0 with all libraries installed) and I could not compile TFS 1.4 with OTS Stats using Docker anymore.

So I've made TFS 1.4 with OTS Stats and some 1.5 changes to make it compile on Linux (alpine:3.19.0) and Windows (vcpkg) [include stats.h/tasks.h in different files and move definitions of OTS Stats createTask (and other functions) to tasks.h, to make it compile without error with 1.5 compiler configuration]:
How to make OTS Stats work with lambda functions (TFS 1.5):

On topic:
I'm planning to add custom 'monsters AI' to my version of 1.4. It will make monsters run a bit dumber (like on real Tibia) and it should use less CPU.
First I must prepare some tool to benchmark how it works with XXX players and XXXX monsters. It may take a while, last Python 'stresser' tool I have is for 8.60 protocol.
 
Thanks gesior and iNux! I'll try to merge the statistics system to see what I can find. Not now but I'll so it in some moment ^^
Codina also send me this little tutorial to something similar on visual studio. It is how to attach visual studio profiler to running tfs process
1715747790982.png
So there's more options if someone wishes to try that. I haven't done yet, sorry guys.
I also wanted to bring something to your attention. While browsing the forgotten server repository, I stumbled upon this link Fix summon walk behavior by NRH-AA · Pull Request #4643 · otland/forgottenserver (https://github.com/otland/forgottenserver/pull/4643). I believe it could be useful for your server too. However, I haven't tried implementing it yet as I haven't had the opportunity to test anything yet.

I was able to implement it into Nekiros TFS-1.5-Downgrades 8.0 without any issues. It also works fine.
Forgot to merge that one! Now is merged ^^ thanks

@onTopic: here's a video explaining how to install and older version of vcpkg, to compile Greed-TFS-1.5-Downgrades. If you guys wish to do some tests with the engine too you're welcome, it has everything installed on it as you guys can see in commit logs. Did this recording while I was helping @abdala ragab and @3alola1 to compile their engines.


Regards!
 
Last edited:
Thanks gesior and iNux! I'll try to merge the statistics system to see what I can find. Not now but I'll so it in some moment ^^
Codina also send me this little tutorial to something similar on visual studio. It is how to attach visual studio profiler to running tfs process
View attachment 84674
So there's more options if someone wishes to try that. I haven't done yet, sorry guys.

Forgot to merge that one! Now is merged ^^ thanks

@onTopic: here's a video explaining how to install and older version of vcpkg, to compile Greed-TFS-1.5-Downgrades. If you guys wish to do some tests with the engine too you're welcome, it has everything installed on it as you guys can see in commit logs. Did this recording while I was helping @abdala ragab and @3alola1 to compile their engines.


Regards!
Great that you're making an effort. I tried but got stuck while attempting to merge the Stats system. If someone has time to explain what might be the issue, I have posted a support thread at:

 
Just did this post, im going to copy paste that here. Guys can't be more clean than this.

I'll try to do it the easier as possible. Do the following to merge (some commits will tell you to do this... and then revert that... just don't delete & go, sometimes use // to comment code in case you probably have to add it later):

The following commit logs must be applied from achieved nekiro downgrade repository (8.6, 8.0, whatever).

  1. Gigastar A* pathfinding Gigastar A* Pathfinding · ralke23/Greed-TFS-1.5-Downgrades@45f9793 (https://github.com/ralke23/Greed-TFS-1.5-Downgrades/commit/45f9793faa63201db903bc79d724bae80c9b6f46)
  2. Gigastar pathfinding call Gigastar Pathfinding Call · ralke23/Greed-TFS-1.5-Downgrades@eb642bf (https://github.com/ralke23/Greed-TFS-1.5-Downgrades/commit/eb642bf87f76c600479abdc16201af816183dead)
  3. Method set master position Method setMasterPosition · ralke23/Greed-TFS-1.5-Downgrades@8f2d82a (https://github.com/ralke23/Greed-TFS-1.5-Downgrades/commit/8f2d82ad839cde1612cc8ac6dc9c8f0ecbc855d6)
  4. Update follow path Update Follow Path · ralke23/Greed-TFS-1.5-Downgrades@3077e8f (https://github.com/ralke23/Greed-TFS-1.5-Downgrades/commit/3077e8f539a216cbbbaa2d056c35427057aea482)
  5. PLAYER_SEARCHDIST PLAYER_SEARCHDIST · ralke23/Greed-TFS-1.5-Downgrades@b73d122 (https://github.com/ralke23/Greed-TFS-1.5-Downgrades/commit/b73d122ab47035e0cc7e6c126a6db463f42c7555)
  6. getPathTo (position to pos) getPathTo (position to pos) · ralke23/Greed-TFS-1.5-Downgrades@9a440f3 (https://github.com/ralke23/Greed-TFS-1.5-Downgrades/commit/9a440f39610b684fefc1ca8c1b1f16ab410093e1)
  7. Add follow position to follow creature Add followPosition to followCreature · ralke23/Greed-TFS-1.5-Downgrades@044299d (https://github.com/ralke23/Greed-TFS-1.5-Downgrades/commit/044299d305d2e744d294c8799c2a86630903b24d)
  8. Summon keepDistance, isInRange, distance check Summon keepDistance, isInRange, distance check. · ralke23/Greed-TFS-1.5-Downgrades@50d9f7b (https://github.com/ralke23/Greed-TFS-1.5-Downgrades/commit/50d9f7bc8c311c487cf840123808e7f7dc7aaeaa)
  9. Corrections Corrections · ralke23/Greed-TFS-1.5-Downgrades@d105eb0 (https://github.com/ralke23/Greed-TFS-1.5-Downgrades/commit/d105eb0d917f2814ec9408f3c8bbe2710d7b9eba)
  10. 9 players stackpos bug 9 players stackpos bug · ralke23/Greed-TFS-1.5-Downgrades@4473d68 (https://github.com/ralke23/Greed-TFS-1.5-Downgrades/commit/4473d6806ea7420bc78cf58b1fea28e991acf67d)
  11. Fir3lement 0.4 goToFollowCreature Fir3lement 0.4 goToFollowCreature · ralke23/Greed-TFS-1.5-Downgrades@404c478 (https://github.com/ralke23/Greed-TFS-1.5-Downgrades/commit/404c478dd10811a9a2275bce9e0b94c18df0923c)
  12. NRH-AA Pathfinding NRH-AA Pathfinding · ralke23/Greed-TFS-1.5-Downgrades@570c4d7 (https://github.com/ralke23/Greed-TFS-1.5-Downgrades/commit/570c4d7b3aef10166ae8ab52f87ffa167ab70415)
  13. First adjustments on NRH-A Pathfinding First adjustments on NRH-A Pathfinding · ralke23/Greed-TFS-1.5-Downgrades@d5670ec (https://github.com/ralke23/Greed-TFS-1.5-Downgrades/commit/d5670ec78becd3ec9fa6eb60b4304628381ad78c)
  14. Optimize pathfinding by NRH-AA Optimize pathfinding by NRH-AA · ralke23/Greed-TFS-1.5-Downgrades@efdd636 (https://github.com/ralke23/Greed-TFS-1.5-Downgrades/commit/efdd636193d4a50df88733811631cf0afa161c92)
  15. Path viewport check, fix to blocked sight of monsters (needs review, it causes lag and memory increase) Path viewport check, fix to blocked sight of monsters (needs review, … · ralke23/Greed-TFS-1.5-Downgrades@d001657 (https://github.com/ralke23/Greed-TFS-1.5-Downgrades/commit/d0016579d68c06570487444e62e29137bf3c5eed)
  16. NRA-AA fixing memory leaks NRA-AA fixing memory leaks · ralke23/Greed-TFS-1.5-Downgrades@4fc0dfa (https://github.com/ralke23/Greed-TFS-1.5-Downgrades/commit/4fc0dfa394249ca212690d0e62d456fa6433adb6)
  17. NRH-AA latest changes NRH-AA latest changes · ralke23/Greed-TFS-1.5-Downgrades@81f7784 (https://github.com/ralke23/Greed-TFS-1.5-Downgrades/commit/81f7784fccd6ebd074e4b22b6f72488c5eda6123)

Can't be more easy to follow than this. Remember. You need to use achieved Nekiro distribution.
Regards!

I followed and applied every single one of the steps on TFS 1.5 Downgrade Nekiro 8.0 except step 10, 9 Player Stackpos Bug as it affects the protocol which results in issues with the items.otbm and the tibia.dat for version 8.0. This is the result TFS 1.X+ - Client Crash After Login | TFS 1.5 Downgrade Nekiro (https://otland.net/threads/client-crash-after-login-tfs-1-5-downgrade-nekiro.289448/#post-2756335)

I had to revert that commit to make it work. I have no idea which part of the code results in issues with the client like that.

I applied all the commits, 1 - 17, except step 10. This is the result with the creatures on TFS 1.5 Downgrade Nekiro 8.0. I even went back and redid everything thinking that I missed something, but I never did. Anyway, this is the behavior of the creatures. @ralke @Itutorial Do you have any idea why this occurs?

 
I'm planning to add custom 'monsters AI' to my version of 1.4.
I would like to understand how this AI monster/creature operates. Are you currently working on it, planning to work on it in the future, or have you already completed it? Furthermore, do you have any intentions of sharing it?
 
Updated on github.
Amazing! Been using the system for quite long and the performance is so good. Can you send me a message on discord to correctly implement this latest changes? I will really appreciate it a lot! I also saw that the map click pathfinding (previous to this latest change) behaves weird when it has to find diagonal paths. Seeing you're active again, please let's have a talk about it ^^

Regards!
 
Back
Top