• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!
  • 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

probably relogs near monsters should be enaught(fast multiple times) as far as i know
Hmmmm definitely I would notice if so, been using this implementation for quite long and never experienced a crash. Probably op is running a third-party system that is crashing his server. Anyways if anything comes up, I can test if you can provide step-by-step. Regards!
 
- reproduction on master
You did all that and didn't even dig into what was causing the exception? Your locals show both player and creature to be valid, so it's not them, and it also doesn't appear to even be the specific function you are saying is the issue... sure that's the one that is calling the method which is crashing, but it appears the invalid memory is being read inside either "isInGhostMode" or "canSeeGhostMode"... plus, that callstack you have there, it doesn't show any calls at all from the specific code you are blaming for the crash either... the entire thing appears to be completely unrelated..

You should actually use that debugger and follow through to find the invalid memory, then once we know what's not valid, we can start to figure out where and why it got invalidated
 
I'm just showing how to reproduce the crash. I haven't digging into it. It's 100% due to incorrect reference counting. This system is a disaster. It needs to be changed to smart pointers asap. Unfortunately, that probably won't happen. The effort is wasted on some idiotic squabbles over a check on a pointer, a stupid 5 lines of code...
 
This all changes breaks many thing :(
not confirmed yet but from quite good source (guy who report this issue to me almost always reports issue that exist in tfs source)

I know there may still be things to be fixed, but the optimization is very good, so it's worth investing in carrying out more tests and reporting what can be adjusted in the code to make it perfect

I added this to my 10.98 repository for more people to test, in my country 80% of people or more use only old protocol (version 10.98 or lower) so it is useful if this is added in several repositories for more people to test

So far I haven't found anything wrong...
 
how to reproduce? I can't see how the op did it

I will add this implementation is not finished. There is a little problem with the logic for references however, it will at some point remove all references correctly. When I get more time I will fix the logic in it.


To explain the issue with the logic: It is adding references wrong. I made it add references to creatures that are following something and the creature being followed. The reason for this is I am not exactly sure which creature needs to have reference increased. The creature following something? or the creature that is being followed? If these questions get answered I can implement a solution faster.

All that I said previously could be incorrect too. Maybe it is the correct solution. The only reason I believe there is an issue is because when I tested the numbers I counted for references never seemed to be correct. I added the ability to log how many references are on each creature whenever it was adding or removing references. Then I spawned a few rats to follow my character. After killing them or logging out, ect. The reference gets updated. The numbers never seemed to be correct for what was expected. Also, there was something going on with logging out and in on player characters. Sometimes the references didn't get deleted until the second deletion (log out) of the player.
 
Last edited:
Back
Top