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

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.

You might also like...
WDT Warp speed Data Transfer
WDT Warp speed Data Transfer

Warp speed Data Transfer (WDT) is an embeddedable library (and command line tool) aiming to transfer data between 2 systems as fast as possible over multiple TCP paths.

Data-oriented networking playground for the reliable UDP transports
Data-oriented networking playground for the reliable UDP transports

NetDynamics is a data-oriented networking playground for the reliable UDP transports. The application was created for stress testing and debugging a p

A small data-oriented and SIMD-optimized 3D rigid body physics library.

nudge Nudge is a small data-oriented and SIMD-optimized 3D rigid body physics library. For more information, see: http://rasmusbarr.github.io/blog/dod

A software C library designed to extract data attributes from network packets, server logs, and from structured events in general, in order to make them available for analysis

MMT-DPI A software C library desinged to extract data attributes from network packets, server logs, and from structured events in general, in odrder t

Open Source IoT Operating System

IoTaaP OS Open Source IoT Operating System Usage Include IoTaaP_OS.h to your project and define IoTaaP OS object Usage example #include IoTaaP_OS.h

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

A webserver hosting a bank system for Minecraft, able to be used from web browser or from CC/OC if you're playing modded.

CCash A webserver hosting a bank system for Minecraft, able to be used from web browser or from CC/OC if you're playing modded. Description the curren

A linux based file-transfer system in terminal. Share Files Over A Network

Introduction A linux based file-transfer system in terminal. Share Files Over A Network Note This Project Is Not Fully Completed Yet But You Are Free

Linux Terminal Service Manager (LTSM) is a set of service programs that allows remote computers to connect to a Linux operating system computer using a remote terminal session (over VNC or RDP)
Linux Terminal Service Manager (LTSM) is a set of service programs that allows remote computers to connect to a Linux operating system computer using a remote terminal session (over VNC or RDP)

Linux Terminal Service Manager (LTSM) is a set of service programs that allows remote computers to connect to a Linux operating system computer using a remote terminal session (over VNC)

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 160 Nov 21, 2022
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 12.3k Nov 27, 2022
bpflock - eBPF driven security for locking and auditing Linux machines

bpflock - Lock Linux machines bpflock - eBPF driven security for locking and auditing Linux machines. This is a Work In Progress: bpflock is currently

The Linux lock machine projects 111 Nov 24, 2022
Warp speed Data Transfer (WDT) is an embeddedable library (and command line tool) aiming to transfer data between 2 systems as fast as possible over multiple TCP paths.

WDT Warp speed Data Transfer Design philosophy/Overview Goal: Lowest possible total transfer time - to be only hardware limited (disc or network bandw

Facebook 2.7k Nov 14, 2022
The InitWare Suite of Middleware allows you to manage services and system resources as logical entities called units. Its main component is a service management ("init") system.

InitWare isn't ready to use yet!! Unless you are doing so for fun, to experiment, or to contribute, you most likely do not want to try to install Init

null 161 Nov 20, 2022
Data Plane Development Kit

DPDK is a set of libraries and drivers for fast packet processing. It supports many processor architectures and both FreeBSD and Linux. The DPDK uses

DPDK 2.2k Nov 25, 2022
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 33 Nov 6, 2022
Upload arbitrary data via Apple's Find My network.

Send My allows you to to upload abritrary data from devices without an internet connection by (ab)using Apple's Find My network. The data is broadcasted via Bluetooth Low Energy and forwarded by nearby Apple devices.

Positive Security 1.5k Nov 20, 2022
Wifi MQTT Data Logging via an esp8266 for the Ikea VINDRIKTNING PM2.5 air quality sensor

MQTT connectivity for the Ikea VINDRIKTNING This repository contains an ESP8266 firmware, which adds MQTT to the Ikea VINDRIKTNING PM2.5 air quality s

Sören Beye 928 Nov 29, 2022
Tool for Preventing Data Exfiltration with eBPF

bouheki: Tool for Preventing Data Exfiltration with eBPF bouheki is a KSRI implementation using LSM Hook by eBPF. Flexibility to apply restricted netw

mrtc0 49 Nov 24, 2022