x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Component Replication with Simulated Physics [bug]

Component replication bug after Set Simulated Physics to true.
Steps to reproduce:
1. Create new blueprint actor (1st image), set Replicates true. Add one scene component (I've tryed few other types, same result) as root component, add and attach 1 Static Mesh Component, choose mesh in the property (use settings - e.g. Simulate Physics false, Auto Weld false but any combination gives the same result.
2. Add blueprint nodes (1st image). Turn on Physics and Component replication.
3. Place blueprint on the level (2nd image). Look on coordinates.
4. Run the game for 2 players and see location of the static mesh component on the server and the client (3rd image). On the client side the root component will be in the right location but any of the attached components will be on the wrong position which is the world coordinate applyed as the relative coordinate.

So the world coordinate offset will be added twice to the component location: first time to position it according to the actor location and then adding the world coordinates instead relative. It looks like a simple math mistake but realy makes unable to use Component replication with Physics simulation. Hope it can be fixed in 4.8 or kind of 4.8.1.

Below there are 3 steps(pictures) that can be easily reproduced. alt text alt text alt text

Product Version: Not Selected
Tags:
bp.png (466.8 kB)
level.png (1.2 MB)
result.png (2.2 MB)
more ▼

asked May 03 '15 at 11:47 AM in Bug Reports

avatar image

Trachinusdragon
6 1 3 5

avatar image Ben Halliday STAFF May 04 '15 at 10:33 PM

Hi Trachinusdragon,

I tried reproducing this in 4.7.6 but the actor location remained the same for both server and client. Are you able to reproduce this in a new project, or only your current project? If you see the same thing in a new project, could you upload it somewhere like Dropbox or Google Drive and give me a link so I can take a look? Thanks!

avatar image Trachinusdragon May 05 '15 at 09:24 AM

Hello, Ben. Actor location and the root component location is the same on both - client and server(so actor replication works fine) but not the any of other components. I found this in my big project and then made new clean project and did screenshots you see above. Full project available here or the only blueprint you need to copy to clean first person shooter Blueprint'/Game/FirstPersonBP/Blueprints/BP_test.BP_Test'.

Picture - how this project looks on my side picture

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Hi Trachinusdragon,

Thanks for the project! I spoke with the developers about this and learned that only the root component's physics state is replicated. As such, the physics results are not being replicated properly because your root is not simulating physics. To make this work in your test project, I bypassed the Set Is Replicated for the static mesh components and just used Set Simulate Physics for them on Begin Play. Then I took the root mesh component and enabled Simulate Physics.

Now I'm not sure what you're attempting to create here, but it seems like you want the root static mesh to remain in place with no physics simulation, and the components to react to physics. In that situation, it would be better to use two different Actor Blueprints, one for the base that doesn't react to physics, and the other that does. You can then attach the other to the non-physics Actor, and they'll each respond to physics as you expect.

To properly replicate the change in position as a result of physics on both the Server and Client, you'll also need to make sure you're doing all the physics movement on the Server. If the Client is the one changing the behavior, you'll need to use an RPC call to the Server to have the Server do it instead, because replication in UE4 runs from Server to Client, and not in reverse.

Hope that helps! Let me know if any of that wasn't clear or you need any further assistance.

more ▼

answered May 07 '15 at 06:47 PM

avatar image Trachinusdragon May 07 '15 at 11:35 PM

Hi Ben, thank you for your answer.

What I'm trying to do is to create a tree constructed from static meshes which are branches, trunk and other tree parts. So I would like to get my static mesh components replicate physics separetely when I turn it on. If you have succeded with the replication of physics in the test project, could you please post it somewhere like Dropbox or Google Drive, because I could not make it work.

The child components movement replication seems to be working properly except the world location coordinates. All of them are moving the same way on the server and clients, but the coordinates of child components are doubled. Pls look on the last picture I've posted.

From my point there is bug with replication: right after you turn on "set is replicated" on child componets desregarding set simulate physic is turn off or on root component - child component is shifted on + world coordinate from root component. The only problem I have.

Please open attached project and run for 2 players, then shoot on the server to both BP actors and see the shift in coordinates I'm talking about. The only problem this coordinate shift, everything else works fine!

link

avatar image Ben Halliday STAFF May 11 '15 at 07:18 PM

Thanks for the more detailed test project! With it I was able to confirm the problem: at the moment, replicating multiple physics bodies/components within one actor is not supported. The developers have talked it over and will try to move the bReplicateMovement flag onto component rather than actor, which would make your setup work correctly. For tracking, we've entered this task as UE-15343, and it sounds like we have someone ready to check something in soon.

I wouldn't expect this to be fixed in time for 4.8, but I will see if it's possible. In the meantime, you'd have a better shot attaching actors to actors, rather than using components inside a single BP. Thanks for your report!

avatar image Trachinusdragon May 12 '15 at 11:26 AM

Ben, thank you for your reply and task creation, this is what I need. I'm ready to do extensive testing when I have a chance to do it.

The idea why I draw your attention to it - because multiple physics bodies/components within one actor almost working already and I hope UE team need not much efforts to make it 100% working. It is very cool and obvious to have feature of the engine for open world and multiplayer games (lot of different objects and different behavior, but it does not mean lot of them replicate same time - so engine supported component physics replication make life much easier). I guess you can easily imagine hundreds of examples how game developers can use it.

I'm looking forward to test whenever I have chance.

avatar image Ben Halliday STAFF May 12 '15 at 03:07 PM

I agree, and it sounds like the developers want to make this work as well. I'll let you know as soon as I have any information on the update. Thanks for sticking with it!

avatar image Trachinusdragon Jun 18 '15 at 01:06 PM

Hello Ben, just a kind question if this task(UE-15343) has a chance to be implemented in 4.9?

avatar image Ben Halliday STAFF Jun 18 '15 at 01:27 PM

There's a chance, but I haven't seen any update on the feature request yet. I've emailed the developer who entered the report for an update, and I'll let you know what I find out.

avatar image Trachinusdragon Jun 24 '15 at 05:20 PM

Sorry for disturbing, have you received any feedback from the developer yet?

avatar image Ben Halliday STAFF Jun 24 '15 at 06:15 PM

Yes: it looks like this has been fixed, and the fix should be in 4.8.1. I'm still testing, but it appears this is correct.

avatar image Trachinusdragon Jun 24 '15 at 09:57 PM

Still not working for me in UE 4.8.1. :( I used the same test project I attached above.

avatar image Ben Halliday STAFF Jul 02 '15 at 05:17 PM

I apologize, I was mistaken, looks like this is a 4.9 fix at earliest. I'm still confirming, but it looks like it won't be in any 4.8 hotfixes.

avatar image Trachinusdragon Jul 02 '15 at 06:11 PM

Ben, thank you for update. Hope it will be done in 4.9.

avatar image Ben Halliday STAFF Jul 14 '15 at 09:57 PM

Okay, spoke with the developers and it sounds like only the first part of the situation (PreReplication) was fixed, but Replicate Movement is still not implemented. I've reopened the task and I will follow up when I have more information. Thanks for the update!

avatar image Trachinusdragon Jul 14 '15 at 09:59 PM

Thank you!!!

avatar image Trachinusdragon Aug 12 '15 at 09:24 AM

Still not loosing hope to get this feature in 4.9 Preview 4-5. In Preview 3 I see only 2 issues was fixed that before this one - UE-15343 in number. Maybe it is good time to look on it. :)

avatar image Ben Halliday STAFF Aug 12 '15 at 06:46 PM

It looks like it's been pushed to 4.10, as the fix requires a number of risky changes, and they missed the window for 4.9. I'll let you know if I see any change.

avatar image Trachinusdragon Aug 12 '15 at 10:52 PM

Thank you!

avatar image Trachinusdragon Sep 29 '15 at 11:47 AM

Is any chance to be implemented in 4.1 for this awesome feature(Replicate Movement for coponents)?

avatar image Ben Halliday STAFF Sep 29 '15 at 01:28 PM

The feature request has been backlogged, so I don't know for certain if they're attempting to implement anything for 4.10. I'll let you know if I see any change, but for now you may need to find an alternative method for your goals.

avatar image Trachinusdragon Sep 30 '15 at 10:16 AM

Ok, thank you for help.

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question