npruehs/ue4-rts

Character only moving a small amount before getting stuck

Closed this issue · 14 comments

Hey, I don't know if this is the right place for this but I'm having issues making characters move properly. I have one moving but it only moves a few centimeters and the stops and doesn't move again. It seems to always be in the same direction as well. I followed the documentation word for word but since I'm a bit new to Unreal, I suspect that I did something wrong.

Thanks for any help.

Hi @DomDom3333,

With your map, have you added a NavMeshBoundsVolume and if so, have you adjusted the Brush settings (it defaults to 200, 200, 200 on the X, Y and Z-axes)?

Yup. Just testing things on a flat test map and everything is green when i press P, with small cutouts around each thing place, like its meant to be.

When setting up gameplay tags, did you import the file DT_RTSGameplayTags? (you shouldn't create a new tag called "DT_RTSGameplayTags", but should import the actual file)

No i believe i just created them in the project settings. Where is the file i need to import? How do add the file? It only has a name field.
image

In the content browser, there's a tiny button called "View Options". Click that and hit "Show Plugin Content".
Then you'll see the file is in "RealTimeStrategy Content"->"Data" folder.

For adding the file, should be an option under "Gameplay Tag Table List". Might need to add a new list item by clicking the + button.

Alright, I've done that. It added successfully.
image

However the problem is still present. the unit moves a small amount and then gets stuck there. The Fog of war and everything updates but the unit just stops there. Always in the same pattern as well, regardless of where I send it to.

Hi @DomDom3333,

With the blackboard or behaviour tree, have you made any modifications?

None whatsoever. I just followed the Step by step guide up to the Units. Basically everything to make a Unit move afaik.

When orders are issued, it actually issues an order on the first actor hit. I suspect maybe it's hitting either the minimap or vision volume? To fix it you can update the code to ignore those volumes by doing the following:

In RTSPlayerController add the following lines near the top:
#include "UI/RTSMinimapVolume.h"
#include "Vision/RTSVisionVolume.h"

Then find this line: "DefaultOrderIgnoreTargetClasses.Add(ARTSCameraBoundsVolume::StaticClass());".
Underneath that line add the following lines:
DefaultOrderIgnoreTargetClasses.Add(ARTSVisionVolume::StaticClass());
DefaultOrderIgnoreTargetClasses.Add(ARTSMinimapVolume::StaticClass());

@coolyoshi As im still pretty new in Unreal, im using blueprint mode. Is there a way to do it using Blueprints too or does that only work in the C++ projects?

Update:
So I just booted the project file and it works. Didn't change a thing. No idea why it didn't work before. Its now moving normal but only ~90% of the distance. There's always a little left to go. Any reason why it would do that?

Edit: And the model seems to glitch out for a single frame at the start of the movement. Have no image to verify but it looks like the model distorts wildly. Since I'm using a basic cone as a placeholder and nothing else, I don't think it's the model causing it.

Edit 2: And the vision cone doesn't stick to the unit being moved. It kinda moves along but if the unit moves far enough waya, it will actually leave the field of view all together and move into the fog of war where it is no longer visible. Should i raise a separate issue for this?

image

Hi @DomDom3333,

On the update (Point 1): This looks to me like your settings on your NavMeshVolume - can you increase the box settings on this and see what it does?

On Edit 1 (Point 2): Not sure about that - may be linked to an earlier open case about moving the unit.

On Edit 2 (Point 3): This looks like the settings in the RTSMinimapVolume and RTSVisionVolume. I have mine set to be slightly larger than the rest of my settings (FogofWarPostProcessing, RTSCameraBounds and NavMeshBounds)and that keeps everything in line with what you would expect to see in an RTS with units vision and reaching the end of a map.

Hey @Zimbo1786
Thanks a lot for the suggestions.

The Unit not moving the entire distance is still present after increasing the NavMeshBoundsVolume

The moving of the unit to the edge of the fog of war is resuced a lot by increasing the size of the Minimap volume and the Vision Volume. It doesnt't remove the issue though.

Units not moving the entire distance could happen due to the "Acceptance Radius" that's specified for the MoveTo nodes in the behavior tree. This is required for preventing units from trying to reach their destination indefinitely, especially when ordering multiple units (with collision) to move the same location. Unfortunately, that's a pretty hard problem to solve, as we learned the hard way with A Year Of Rain. The problem becomes more important to you in case you've got melee units. You might want to take a look around for solving "path following" (in contrast to path finding). Until now, that has been out-of-scope for this plugin.