UE5 Quest System
This page is part of the documentaiton for my UE5 Quest System

Multiplayer

UE5 Quest System Version: 2.0

    Note 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:

    Quest Sharing Option - This is a quest-specific feature that you can enable or disable in the Quest Options. When enabled, players can share the quest with others.
    Quest Log Button - A button for sharing quests appears in the player's quest log. However, it's only visible when multiple players are connected to the game, facilitating the sharing process.
    Quest State - Sharing is only possible when the quest is in the 'In Progress' state. This restriction ensures that only active quests can be shared among players.
    Sharing Process - When a player initiates a quest share, the system provides feedback through Small Alerts, indicating the response from each player. For example, if a player has the quest window open and is busy with another quest, they'll send a busy notice back, but only if the shared quest is one they could potentially accept. If a player has already completed a quest, or is not eligible, the sender will also be notified.
    Prerequisite Check - Upon sharing, the system checks if the receiving player meets the prerequisites for the quest. If the prerequisites are not met, the quest won't be shared with that player, ensuring that only eligible players can receive and participate in the shared quest.

    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:

    Objective-Specific Sharing - The ability to share objective progress is determined on an objective-by-objective basis. This setting is found in the Objective Options section, where you can enable or disable sharing for each particular objective.
    Eligibility for Sharing - When a player makes progress on an objective, that progress is shared only with party members who are also undertaking the same quest.
    Defining Party Members - The system determines who qualifies as a party member through the Connected Systems BPI. By default, all connected players are considered party members. This BPI allows you to customize this to fit the specific mechanics or requirements of your game.

    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.

    This documentation and asset version are new. If you encounter any bugs or if anything doesn't make sense, please let me know.