-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pathfinding Crash #391
Comments
Reported by |
Reported by |
Reported by
|
Reported by - _Attachment: [map300 pocket edition.rar](https://storage.googleapis.com/google-code-attachments/keeperfx/issue-391/comment-4/map300 pocket edition.rar)_ |
Reported by |
Reported by |
Reported by |
Reported by |
Reported by - _Attachment: [map300dk-edit.7z](https://storage.googleapis.com/google-code-attachments/keeperfx/issue-391/comment-10/map300dk-edit.7z)_ |
@mefistotelis Is it possible the last few months there's an extra bug in the code that causes more pathfinding problems? Many maps seem to suffer. Attached a log and packet file from Burdened Imp map 222 that freezes the game. |
It is more likely that it's not a new bug, but old one which become more apparent. Pathfinding consists of two major routines:
Now, every function which is either related to creature state or map state, affects the pathfinding component. Every time we rewrite such a function - more of rewritten pathfinding is used. This means if there's a bug in rewritten code - it is being used more often as development progresses. I believe there is some kind of error in rewritten pathfinding, and I spent quite lot of time trying to debug it - but unfortunately I don't have enough time to make one long debug session, and debugging such complex issue with interrupts is almost impossible. |
Is there something I can provide (apart from more time) that can help you out? |
The only way to solve that is to debug the cause. If we won't be able to do it with what we have, due to complexity of the issue, then we'll have to prepare tools which would decrease the complexity. For example:
Now to answer your question, Loobinex - I don't think you can help in any other way than updating issues each time you see the problem. What would help is a test map where the problem happens always, and happens relatively fast after starting the map, but I realise it's not easy to get this. When I tried to debug pathfinding, I used a map you listed as faulty in one of your issues. On this map, (can't remember which, sorry) at some point, a computer player imp was getting stuck on dungeon heart pedestal. But this was happening after about 1 hour of gameplay, and that was taking quite some time even in frameskip mode. To debug this back to the cause, I had to make a packet file and run it over and over, many times. This also meant that any other update to the code was leading to desychronization of packet file and starting the process from the beginning. |
Providing such a map is the easiest thing in the world. I assumed with this being such a well known problem you would have had your own test-map for this already. To reproduce load the attached map (called pathfinding crash), build some imps, mark a path towards the portal and drop and imp to dig and the game will freeze. |
Ok then; I'm now focused on refactoring the keeperfx-stable repository, but when I'm done I will take a look at this (unless someone will do it earlier). |
This is a new record for me. This map from the database hangs the game before you're even out of the floating spirit: 00425_hero_invasion04.zip This is an interesting comparison, as when I tried it in an old version (0.4.4.976) i could play a good 5 seconds before the game hung. EDIT: I updated the map in the database, it hung because the map was corrupted. Version 6 is fine, version 5 hung. |
Apparently also happens in the main campaign as well. See this topic. |
@Trotim found out that what really helps in preventing the pathfinding bug is to make sure maps have 'filled corners'. So for ADiKtEd open the map.ini and set these settings 'FRAIL_COLUMNS=0, UNAFFECTED_GEMS=1, UNAFFECTED_ROCK=1' and make/update the map with these settings in place. This strongly reduced the amount of triangles, and the pathfinding bug occurs when there are over 9000 triangles. |
Fixed in Loobinex/keeperfx-unofficial@7d60638 |
- Game will no longer hang or crash when reaching the maximum number of triangles - It's now possible to raise the number of triangles in the code to allow for more complex maps without pathfinding problems occurring. Accomplished by redirect original DK functions accessing the triangles data to their rewritten counterparts as they are still called indirectly by other non-translated functions. Switched over the triangles, treeitems and tree_val. Fixes dkfans/keeperfx#391
Originally reported on Google Code with ID 391
Reported by
Woudo@hotmail.com.au
on 2014-10-11 08:05:36- _Attachment: [map300.rar](https://storage.googleapis.com/google-code-attachments/keeperfx/issue-391/comment-0/map300.rar)_
The text was updated successfully, but these errors were encountered: