Support draw debug colors on multiplayer #311
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR does two things:
Explanation
Changes for #240 would result in "weird sphere while play as client if show debug shapes on":
![image](https://user-images.githubusercontent.com/20263103/143734006-5c2656ff-0d19-4fb6-8d29-c065edc257aa.png)
This is because
AALSPlayerCameraManager::CustomCameraBehavior
is not run on dedicated server, so the debug draw from server draw the initial location forever.(Initialized inAALSPlayerCameraManager::OnPossess)
This picture is showing the difference between server and client draw debug.(with some test code modification)
![image](https://user-images.githubusercontent.com/20263103/143734566-11cfee5f-d489-4717-b660-d2859f90dc1d.png)
(I was play from current camera location, so the server location is in the air)
server sphere(left) vs client sphere (right)
Yes debug draw on server will show up in client now
see this commit of unreal b6000dafc0b07743ea859274641c551fbf03b333
![image](https://user-images.githubusercontent.com/20263103/143734535-0afb98ec-89c3-48e8-b215-91b320c2ce29.png)
you can use "show ServerDrawDebug" to toggle server debug draw.
Changes in blueprint
instead of forcing everyone to use "show ServerDrawDebug" to turn off the maybe unwanted drawing, I choose to modify the blueprint:
![image](https://user-images.githubusercontent.com/20263103/143734308-e987f7b0-9321-4429-9bec-11554c84b838.png)
with detailed explanation.
Fix errors if AnimMan is not the default character mesh
the error:
![image](https://user-images.githubusercontent.com/20263103/143734539-1076d618-ab48-451f-bc65-74d6c0319770.png)
Fix:
![image](https://user-images.githubusercontent.com/20263103/143734340-f5ffc226-564c-49b0-9338-689a5f0cbf04.png)
![image](https://user-images.githubusercontent.com/20263103/143734347-0b881960-2f5a-42dd-9358-99eb95cf17a8.png)
add two validate funtion:
Check before do things. to prevent error emits:
![image](https://user-images.githubusercontent.com/20263103/143734356-59284391-e382-4701-b662-1fdf0d043aff.png)
![image](https://user-images.githubusercontent.com/20263103/143734388-962d3e0e-5b33-4c4e-99b4-94e5358d403c.png)
Misc
Cache variables to reduce pure function overhead and straighten the lines.