-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiplayer not supported #27
Comments
Hello, I will have a look. The reason I don't get this error on my side is because I do not use the unreal option "Run Under One Process". If you uncheck this, Unreal spawn a process for the server and the client. This is more reliable since it is closer to what the players will experience. |
I'm aware of the option but for rapid iteration and testing, it takes a lot longer to spin up so not a good option all of the time. |
Sure, that's why I'll have a look to fix it. |
I've got a fork that supports this now, if that's of interest |
I added Cog to the gamestate as per the example project and setup readme.
This means that
BeginPlay
,Tick
,EndPlay
are called for the server and every client. Of course, if I move it to GameMode, then it will only run on server and clients won't get any UI, so that won't help.There seems to be a lack of consideration for the static properties that ImGui uses.
Soon as there is a server and a client (vs. standalone), it will crash on EndPlay because calling
CogWindowManager->Shutdown();
shuts down the Context, causingImGuiIO& IO = ImGui::GetIO();
to return nullptr, but it is not null checked (rather, it has an assert, which it fails, and then promptly crashes).Furthermore, BeginPlay spams warnings because it is repeating logic:
Even if I test if ImGui has already initialized, to ensure it only runs once, then it'll run on the server and not the clients so they don't get windows.
For cog to support multiplayer (literally at all) it needs to respect that ImGui uses statics and separate out of the behaviour between Cog and ImGui so that you can initialize or clean up without making repeated calls to statics (especially when they are getting nulled).
This isn't sufficient on it's own, because we need to know when all clients have finished cleaning up, and then shutdown ImGui.
The text was updated successfully, but these errors were encountered: