BlueSpud / ClientPredictionExample

MIT License
0 stars 0 forks source link

Very broken #3

Closed Travistyse closed 3 months ago

Travistyse commented 11 months ago

Downloaded the example, inserted the client prediction plugin, compiled for 5.3 just fine but I'm seeing the following issues:

  1. No replication is occurring for the ball between any clients or the server - if not for adding a print string and having the messages be replicated, I'm not sure that there's any amount of replication occurring. Spawning a particle effect didn't do anything, either - what is happening is that the ball pawns spawn in, can be seen on the server, and then the server no longer sees them and they never see each other.

  2. The plugin's component is a crash-a-holic. If you add it to anything it crashes. Honestly this project crashed after doing basically anything, but would work after a few crashes usually - I can nonetheless not create an actor blueprint with the component on it - at compile time it crashes.

I'd like to try using this plugin because I'd like to have deterministic physics for replays and relatively network stable physics based gameplay but I'm on 5.3 and don't know if the problem is that this project just didn't upgrade properly and using the plugin would work but the example is the only documentation I have for this plugin so I'm not sure what to do to enable what I'm trying to achieve, nor do I even know which systems are affected by the plugin and how to use it exactly?

I very very much appreciate what you've made but am struggling to use it at the moment - this is intended to work with forces, launching, and physics simulation, right? Does this do anything for launching Characters or adding force to them? Sorry for all of the questions - I'm very excited and hopeful given that a deterministic physics engine could enable entire elements of gameplay that weren't previously possible for me afaik.

BlueSpud commented 10 months ago

I've pushed a few fixes to the project and a fix to the plugin to hopefully resolve the first issue. I was able to reproduce it locally with 5.3 and the latest commit fixed it. I tend not to really update the example project unless I know I've made breaking changes, so apologies for that.

The crash you're getting when compiling the blueprint is likely because you're hitting the assert in UClientPredictionComponent::InitializeComponent() that checks that a physics model has been created. You need to use the plugin from C++ at the moment, and I don't really have plans to change that. You definitely could implement the model in blueprints, but you would need a bit of C++ to forward the physics model calls and then also wrap FPhysicsContext.

This plugin is meant to do what you're describing. I'm personally using it make a multiplayer tank game. It's heavily inspired by the NetworkPrediction plugin that comes with the engine which is a lot more comprehensive, but never really worked right in my experience. The example project is a ball can be rolled around / jump by applying forces with wasd and space.

Basically you need 5 things:

Hopefully that's reasonably comprehensive, and the example of course contains everything you need to get started, but feel free to ask any other questions.

BlueSpud commented 3 months ago

Going to close this since the 5.4 update changed basically everything.