-
Notifications
You must be signed in to change notification settings - Fork 26
Ai pathfinding fixes #1107
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
base: develop
Are you sure you want to change the base?
Ai pathfinding fixes #1107
Conversation
| // ========================================================================================= | ||
| // BOX FLAGS | ||
| // ========================================================================================= | ||
| public bool Splitter; // Box is a "splitter" (1x1 box at TT_SPLITTER trigger) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is TT_SPLITTER? This terminology does not exist in TRLE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SPLITTER is the gray box. Its true nature is to force the generation of 1x1 box that can be blocked or not by doors above them
| // ========================================================================================= | ||
| public bool Splitter; // Box is a "splitter" (1x1 box at TT_SPLITTER trigger) | ||
| public bool NotWalkableBox;// Box is marked as not walkable | ||
| public bool Monkey; // Box has monkey swing ceiling (TT_MONKEY trigger) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SPLITTER is the gray box. Its true nature is to force the generation of 1x1 box that can be blocked or not by doors above them
| /// Used to detect slopes and calculate average floor height. | ||
| /// Naming: dec_tilt[1-4] corresponds to XnZp, XpZp, XpZn, XnZn corners. | ||
| /// </summary> | ||
| private int dec_tilt1 = Clicks.ToWorld(-1); // Floor.XnZp (X-, Z+) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion, this should be called not tilt but cornerHeight then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have used original names but i have correct it.
| private List<TombEngineOverlap> dec_overlaps; | ||
| private bool dec_boxExtendsInAnotherRoom; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was it a mistake or dec_boxExtendsInAnotherRoom was renamed to dec_doorCheck unintentionally here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the original name, and it's the same thing: check door = box expansion continues in the room beyond the door,
| /// <param name="z">World Z coordinate (in sectors)</param> | ||
| /// <returns>True if position is reachable, false if blocked</returns> | ||
| [MethodImpl(MethodImplOptions.AggressiveOptimization)] | ||
| private bool Dec_ClampRoom(int x, int z) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the reason for the rename? Old name (Dec_CanSectorBeReachedAndIsSolid) sounds more intuitive to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the original name
| { | ||
| // Boxes must have the same height for jump | ||
| if (a.TrueFloor != b.TrueFloor) return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please describe all changes done in this function further.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
| /// Tests all sectors along the shared edge to ensure they connect properly. | ||
| /// </summary> | ||
| [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] | ||
| public bool Dec_TestOverlapXmax(dec_TombEngine_box_aux test, dec_TombEngine_box_aux box) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please describe all changes done in this function further.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
| /// Corresponds to TestLeftOverlap() in original box.c. | ||
| /// </summary> | ||
| [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] | ||
| public bool Dec_TestOverlapXmin(dec_TombEngine_box_aux test, dec_TombEngine_box_aux box) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please describe all changes done in this function further.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
| /// Corresponds to TestBottomOverlap() in original box.c (inverted axis). | ||
| /// </summary> | ||
| [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] | ||
| public bool Dec_TestOverlapZmax(dec_TombEngine_box_aux test, dec_TombEngine_box_aux box) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please describe all changes done in this function further.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
| } | ||
|
|
||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| public bool Dec_OverlapZmin(dec_TombEngine_box_aux a, dec_TombEngine_box_aux b) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please describe all changes done in this function further.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
155425f to
6957349
Compare
This Pull request fixes many bugs with pathfinding of water creatures.
Additionally, I have cleaned a bit the code and added more comments;