Multiplayer
UE5 Quest System Version: 2.0Note about Single Player
Before we dive into the multiplayer stuff I just wanted to mention that everything will still work great in single player games. There are some features that are exclusive to multiplayer like sharing quests and objective progress. If you are making a single player game you can simply ignore these options. The system will know if your game is single player and even hide the Share button on the quest log for you. Remember, in single player you are essentially both the server and client.
New to Multiplayer Development?
If you are going to be working with the quest system from blueprint you should have at least a basic understanding of how multiplayer works in Unreal.
The system will yell at you (print string) if you try to do something important (like changing a quest state) from the client that should only be handled from the server. It is your responsibility to understand the importance of running something on the server vs the client, and specifically how to resolve the issue at your end.
In the event that you actually need to initiate an important quest related action from the client (mostly for UI purpose) there are a number of included events you can use for the most common actions. Review the Working in Blueprint chapter to learn all about them. Using these events will ensure the proper flow from client to server, and some will provide the option to validate the state before continuing (remember you should never trust the client!).
If you are new to multiplayer development or struggling with this concept I recommend reading through the Multiplayer Network Compendium before you get started.
Multiplayer Player Identification
In the demo world, we identify players by their index in the game state's players array (when the player controller component loads). However, this method works well only for games where progress doesn't need to be saved between player and server restarts because it relies on the order in which players connect.
Many users of this system typically switch to using a unique identifier from a subsystem, such as your Steam ID, for more reliable player identification. The Connected Systems BPI allows you to supply your unique player ID to the quest system. If you are going the Steam (or similar) route you should use this method.
If you're setting up the system manually (by setting the Auto Setup Quest System? option to false on our AC_QuestSystem_PlayerControllercomponent), you'll have the chance to input the player and game identifiers when you call the SetupQuestSystem events (in both AC_QuestSystem_PlayerController and AC_QuestSystem_PlayerState manually).
The system will give priority to the ID when entered as an input through the SetupQuestSystem event on the player state component. If the system is handling setup for you, or no ID is provided on input, the system will then look for an ID on your player controller using the Connected Systems BPI. If the Connected Systems BPI isn't set up or it returns an empty string, the system will then default to using the session-driven driver method, which is the method demonstrated in the demo world.
Share a Quest in Multiplayer
Quest sharing is a feature that allows players to share quests with each other, enhancing the cooperative aspect of gameplay. Here's how it works:
Sharing will only occur with party members. Defining our party members is part of the Connected Systems BPI, by default it will use all connected players.
Share Objective Progress in Multiplayer
In your game, players can also share the progress of specific objectives, fostering a collaborative gameplay experience. Here's how objective progress sharing works:
For instance, if one player collects a required item or defeats a specific enemy, and the objective progress sharing is enabled, other party members on the same quest will also receive credit for that objective. This feature enhances team play and can significantly impact how players strategize and collaborate within your game.
By incorporating shared objective progress, you provide players with an additional layer of interaction and teamwork, encouraging them to work together more closely and making the questing experience more dynamic and interconnected.
By default there are no distance related estricitons in place on sharing.