Steve's Unreal Quest System: data-driven quest system for UE4

Related tags

SUQS
Overview

Steve's Unreal Quest System (SUQS)

What Is It?

SUQS is a simple, data-driven quest system for UE4. It helps you define quest structures for your game, and track progress against those quests for a player in a simple way.

All quests are defined in static asset datatables, which can either be edited directly in UE4, or written as JSON - a schema is provided to provide handy autocomplete and validation in most editors (see Editor Setup).

At runtime, you use a simple API to record progress against these quests: accept quests, complete tasks, increment progress etc. As tasks are completed they trigger progression based on simple rules, and callbacks and a query API let you reflect those changes in your world.

Support This Work!!

I've decided to open source this work because I think it's likely to be genuinely useful to people. I like sharing my work with others, and that also generally makes it better. But, it all takes extra effort over keeping it private!

If you appreciate me doing this, please consider ❤️ ❤️ Supporting my work on Patreon! ❤️ ❤️ Thanks!

Installing

Cloning

The best way is to clone this repository as a submodule; that way you can contribute pull requests if you want. The project should be placed in your project's Plugins folder.

> cd YourProject
> git submodule add https://github.com/sinbad/SUQS Plugins/SUQS
> git add ../.gitmodules
> git commit

Alternatively you can download the ZIP of this repo and place it in YourProject/Plugins/SUQS.

Referencing in C++

Edit YourProject.Build.cs and do something similar to this:

using System.IO;
using UnrealBuildTool;

public class YourProject : ModuleRules
{
	private string PluginsPath
	{
		get { return Path.GetFullPath( Path.Combine( ModuleDirectory, "../../Plugins/" ) ); }
	}
	
	protected void AddSUQS() {
		// Linker
		PrivateDependencyModuleNames.AddRange(new string[] { "SUQS" });
		// Headers
		PublicIncludePaths.Add(Path.Combine( PluginsPath, "SUQS", "Source", "SUQS", "Public"));
	}

	public SUQSExamples(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
		
		AddSUQS();
	}
}

After adding this you should right-click your .uproject file and "Generate Visual Studio Project Files".

Usage Overview

Defining Quests

Quests are static data tables stored in assets. They can't be altered dynamically, and this is deliberate; not only does it keep the implementation simpler, it means you always have a single source of truth for your quest structure.

That doesn't mean you can't have branching quests. Branching within a quest is supported (the branches are predefined in the data), and also quests can be dependent on each other's success or failure.

While you can edit quest data tables in the UE4 editor, let's see a JSON example because it's the easiest to see easily. You can configure your editor to provide auto-complete and documentation, see Editor Setup. There are lots of optional features, so here is the simplest possible quest:

[
  {
    "Identifier": "Q_Smol",
    "Title": "NSLOCTEXT(\"TestQuests\", \"SmolQuestTitle\", \"Smol Quest\")",
    "DescriptionWhenActive": "NSLOCTEXT(\"TestQuests\", \"SmolQuestDesc\", \"The smallest possible quest\")",
    "Objectives": [
      {
        "Tasks": [
          {
            "Identifier": "T_Smol",
            "Title": "NSLOCTEXT(\"TestQuests\", \"SmolQuestTaskTitle\", \"Easiest possible thing\")"
          }
        ]
      }
    ]
  }
]

Some basic notes:

  • A single JSON file can include multiple Quests, each of which must have a globally unique Identifier
  • All player-visible text can be localised using NSLOCTEXT
  • Each quest is comprised of 1 or more Objectives
    • Objectives are always sequential (but can branch)
    • Objectives contain Tasks, which are the unit of progression
    • Objectives group Tasks, determining whether they are sequential or flexibly ordered, or whether all mandatory tasks have to be completed or only 1 (or 2, or 3...) of those in the group,
    • Tasks track actual progress, can be mandatory or optional, and can have target numbers (e.g. collect 3 otter's noses, 7 ocelot spleens), and time limits

More details on the specifics can be found in Quests.

Quest Progression

Quest definitions are static, but of course your players will progress through them over time. The main object you'll interact with in SUQS is USuqsProgression, which tracks this, and holds the quest definition library as well.

It's through USuqsProgression that you'll accept quests, complete tasks, and store the current status of active quests, and permanently store the quest archive. For example:

Accept Quest Complete Task

This object can be serialized for inclusion in save games.

See Quest Progression for more details.

More Information

License

The MIT License (MIT) Copyright © 2021 Steve Streeting

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Owner
Steve Streeting
Game developer. I previously created Ogre3D and SourceTree, and had a hand in Git LFS.
Steve Streeting
Steve's Persistent Unreal Data library

SPUD: Steve's Persistent Unreal Data library What is it? SPUD is a save game and streaming level persistence solution for Unreal Engine 4. The 2 main

Steve Streeting 38 Feb 22, 2021
RakNet is a cross platform, open source, C++ networking engine for game programmers.

RakNet 4.081 Copyright (c) 2014, Oculus VR, Inc. Package notes The Help directory contains index.html, which is full help documentation in HTML format

Facebook Archive 2.9k Feb 15, 2021
RakNet is a cross platform, open source, C++ networking engine for game programmers.

RakNet 4.081 Copyright (c) 2014, Oculus VR, Inc. Package notes The Help directory contains index.html, which is full help documentation in HTML format

Facebook Archive 2.9k Feb 15, 2021
mTCP: A Highly Scalable User-level TCP Stack for Multicore Systems

README mTCP is a highly scalable user-level TCP stack for multicore systems. mTCP source code is distributed under the Modified BSD License. For more

null 1.6k Feb 17, 2021
Examples for individual ROS2 functionalities inc. Subscribers, Publishers, Timers, Services, Parameters. ...

ROS2 examples This example package is meant to explore the possibilities of ROS2 from the point of view of current ROS1 features and how the ROS1 feat

Multi-robot Systems (MRS) group at Czech Technical University in Prague 29 Feb 23, 2021
Simple, secure & standards compliant web server for the most demanding of applications

Simple, secure[1] & standards compliant[2] web server for the most demanding[3] of applications. Read more... ?? Optimized security Being meticulously

uNetworking AB 12.3k Feb 19, 2021
A modern C++ network library for developing high performance network services in TCP/UDP/HTTP protocols.

evpp Introduction 中文说明 evpp is a modern C++ network library for developing high performance network services using TCP/UDP/HTTP protocols. evpp provid

Qihoo 360 2.5k Feb 19, 2021
Mongoose Embedded Web Server Library - a multi-protocol embedded networking library with TCP/UDP, HTTP, WebSocket, MQTT built-in protocols, async DNS resolver, and non-blocking API.

Mongoose - Embedded Web Server / Embedded Networking Library Mongoose is a networking library for C/C++. It implements event-driven non-blocking APIs

Cesanta Software 6.9k Feb 19, 2021
Realtime Client/Server app for Linux allowing joystick (and other HID) data to be transferred over a local network

netstick What is it? Netstick enables HID devices to be remotely connected between a "client" and "server" over a network connection. It allows the ke

null 10 Apr 24, 2021
Event-driven network library for multi-threaded Linux server in C++11

Muduo is a multithreaded C++ network library based on the reactor pattern. http://github.com/chenshuo/muduo Copyright (c) 2010, Shuo Chen. All righ

Shuo Chen 9k Feb 19, 2021
Enabling the Windows Subsystem for Linux to include support for Wayland and X server related scenarios

Welcome to WSLg WSLg is short for Windows Subsystem for Linux GUI and the purpose of the project is to enable support for running Linux GUI applicatio

Microsoft 2.9k Apr 30, 2021
Open source file system for small embedded systems

STORfs Open Source File System Release Version 1.0.2 Created by: KrauseGLOBAL Solutions, LLC What is STORfs? STORfs is an open source flash file syste

null 10 Feb 12, 2021
C++ library for creating an embedded Rest HTTP server (and more)

The libhttpserver reference manual Tl;dr libhttpserver is a C++ library for building high performance RESTful web servers. libhttpserver is built upon

Sebastiano Merlino 454 Feb 17, 2021
canonical libwebsockets.org networking library

Libwebsockets Libwebsockets is a simple-to-use, MIT-license, pure C library providing client and server for http/1, http/2, websockets, MQTT and other

lws-team 2.9k Feb 18, 2021