Skip to content
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

Conversations and API refactor #108

Merged
merged 50 commits into from
May 15, 2024
Merged

Conversation

Matt-Carey
Copy link
Collaborator

@Matt-Carey Matt-Carey commented May 2, 2024

InworldClient

Convert from struct to UObject. Unreal structs cannot have UFUNCTION. Enables the ability to directly interface with raw API if desired in BP/CPP, or make custom implementation of wrapper that interfaces with UInworldClient.

InworldSession/InworldPlayer/InworldCharacter

There's a bit of logic that will remain consistent across various implementations of using Unreal SDK. It is encouraged to use the provided default components, but these separate objects with their interface makes it easier to pick and choose the provided classes if desired.
These uobjects will replicate out of the box as long as they have a replicated outer AActor in their ownership hierarchy. No need to maintain replicated variables on custom components, simply bind to events fired by OnReps. This uses Subobject replication, similar to Epic's Gameplay Ability System.

Owner Interfaces

Create an interface for each Session/Player/Character that promises functionality required by the UObject. The outer object that implements this interface is responsible for the lifecycle of the object.
For example, the InworldCharacterComponent is an Owner of InworldCharacter. It is responsible for creating the object, replicating the object, registering the InworldCharacter to a Session, etc.

InworldSessionComponent

Equivalent of the InworldCharacterComponent/InworldPlayerComponent, but for InworldSession. In order to be replicated, the InworldSession must have a replicated outer. This is not possible with the subsystem. Also, to use seamless travel, WorldSubsystems are shutdown between. Using a component on an actor enables the transfer of the session between worlds without needing to save/stop/load the session.
Currently, the Actor populates the InworldApiSubsystem with its InworldSession for backwards compatibility.
By default, if the InworldApiSubsystem finds itself without a session at beginplay, one will be created for backwards compatibility with using InworldApi directly.
We will also need the ability to enable client-side sessions in multi-player. Although this is not yet supported, it will be feasible with these changes by simply creating a session on the client, and registering characters to this client-side session.

@Matt-Carey Matt-Carey requested a review from Ancient23 May 3, 2024 19:44
@Matt-Carey Matt-Carey marked this pull request as ready for review May 3, 2024 19:44
@Matt-Carey Matt-Carey removed the request for review from Ancient23 May 8, 2024 12:08
@Matt-Carey Matt-Carey merged commit e2287b3 into main May 15, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants