Hello everyone!
I’ve recently started playing with the topdown sample after a year or so to see if things have improved.
While there seems to be a bit more polish now, I still found two rather odd problems, one I would simply like to warn about if someone else was to run into it, and one problem I’m still looking for a good solution for.
(1) The first problem was getting ClipCursor (confining the mouse to the screen / region of the screen) to work. Calling any combination of SetInputMode / LockCursorToView / LockMouseToWidget was unexpectedly uncooperative. I ran into several problems, sometimes the cursor would not be confined at all, sometimes it would confine the cursor until you pressed a mouse button, sometimes it would work intermittently. The most common symptom was the second one by far however. I debugged this quite a bit, first using profiling / breakpoints, but after no luck I started binary search debugging it using the strategy game sample and finally found that setting bShowCursor in my playercontroller was causing the strange behavior! Really quite bizarre. I followed the usage of this variable through all lines I could find, but I couldn’t really find a root cause. It has to be some OS interaction going on here is what I figure at the moment. In any case,
**simply not setting bShowCursor to true, calling setinputmode on LMB up (to make sure we reget the capture focus after an alt-tab) and drawing my own cursor fixed the problem. **
(2) The second problem I had, that I have not solved yet, was getting multiple pawn pathfinding to work.
The problem here is that as soon as you add more than one pawn, and order them to run to some point, if they happen to collide on the way, they either fly away hand in hand (yes, they literally fly away into the sky) if you have CanCharStepUp enabled, and if disabled, they seem to throw each other away, I assume to prevent their colliders from clipping into each other or some interaction like that.
I played around with this quite a bit the last time I fiddled with this sample, and there didn’t seem to be any solution to the problem back then. It still also does seem to be a problem unfortunately. I don’t seem to be alone anymore with the problem either, I found a couple of people describing the same problems… here is one for example:
I’ve also tried RVO and detour (PathFollowingComponent) to see if I could get them to not run into each other. Much like this other poster mentions, this does decrease the collision frequency, but it still happens, and as such is not very usable.
I’m going to play around a bit more with this problem, but I’m very interested to hear if someone else already knows what causes this problem, and has an idea for a solution.
Best regards,
Temaran