Timeline for How can I "smoothen" my path-finding on a map with big tiles?
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 30, 2017 at 16:35 | comment | added | John Hamilton | Let us continue this discussion in chat. | |
| Jan 30, 2017 at 16:33 | comment | added | Tudvari | I use path-finding, because when a player wants to go from A to C, but there is a B midway, the player expect that its character avoid B instead of being stuck at B. In click-to-move games, pathfinding is really necessary. | |
| Jan 30, 2017 at 16:24 | comment | added | John Hamilton | Then why are you using A* pathfinding? You could just move the character towards the point where it needs to move. You don't really need to calculate whether it can move there or not, just try moving it towards there and if there are walls, then the player will collide with the walls (assuming you're using the colliders right). | |
| Jan 30, 2017 at 16:21 | comment | added | Tudvari | Oh, you misunderstood me. Yes, this would make the path smoother, but I didn't mean this by "smoothen". What I meant: In this example, the character could just straightly go to its target position (in a straight line) but he can't because the grid only lets K * 45 degree directions. (8 directions) | |
| Jan 30, 2017 at 16:14 | comment | added | John Hamilton | With tiles that big, the player character won't be so off-base. I've added another picture to show the most likely curve that path will take. You could also just make a bezier curve every 3 tiles so that it never goes so off base that it'll be misleading. | |
| Jan 30, 2017 at 16:14 | history | edited | John Hamilton | CC BY-SA 3.0 | added 146 characters in body |
| Jan 30, 2017 at 16:09 | comment | added | Tudvari | Yes, but visually approximating the path could be misleading. I could set the weights to lower the chance of highly misinformating graphical position, but that wouldn't be enough. It would be really frustrating for the player for example if he wants to dodge a trap, and visually he indeed dodges it, but its real position triggers the trap. | |
| Jan 30, 2017 at 15:40 | comment | added | John Hamilton | You could just interrupt movement if a new order is given, so if you're using mouse to direct the character and you have a pathfinding algorithm, you can re-calculate every frame (or every few frames for performance reasons if necessary). It would just mean interrupting the characters path, then making a new path. Of course, you'd need to handle continuous animation (something like, start animation on mousedown, stop animation when the character stops moving). Also, the positioning is really down to how much weight you're giving each dot on the curve, see the bottom part of the second link. | |
| Jan 30, 2017 at 15:29 | comment | added | Tudvari | I thought about this too but the problem is that the character's visual representation could be annoyingly far away from its actual position. (Which is bad for example when the player wants to dodge projectiles) | |
| Jan 30, 2017 at 15:18 | history | answered | John Hamilton | CC BY-SA 3.0 |