Micky5991.Quests 0.4.0

dotnet add package Micky5991.Quests --version 0.4.0                
NuGet\Install-Package Micky5991.Quests -Version 0.4.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Micky5991.Quests" Version="0.4.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Micky5991.Quests --version 0.4.0                
#r "nuget: Micky5991.Quests, 0.4.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Micky5991.Quests as a Cake Addin
#addin nuget:?package=Micky5991.Quests&version=0.4.0

// Install Micky5991.Quests as a Cake Tool
#tool nuget:?package=Micky5991.Quests&version=0.4.0                

Quests

Create your own RPG-like quests with this library built on .NET Standard.

Installation

This library targets .NET Standard 2.0 and .NET Standard 2.1. You can install this package over NuGet.

PM> Install-Package Micky5991.Quests

Features

  • Behavior-Tree inspired quest nesting.
  • Sleeping, Active, Success and Failure states for quest nodes.
  • Event-based Task completion
  • Observe changes to quest properties using observer pattern.
  • Full integration into Microsoft.Extensions.DependencyInjection.Abstractions 3.1+

Requirements

  • .NET Standard 2.0 / 2.1 compatible application
  • Dependency Injection Container compatible with Microsoft.Extensions.DependencyInjection.Abstractions

Node-Types

This library provides different node types out of the box. But you can inherit from already existing abstract types to create your own composite or task nodes.

  • Quest Root
    Parent node that holds context information and a blackboard, accessible by all child nodes. This node will be registered to the DI Container.
  • Quest Task
    Final tree leaf that listens to events and marks itself as a certain status to signal other parts of your application if a task has been completed. These nodes will hold actual actions the user has to do in order to progress through the tree.
  • Condition Task
    Final tree leaf that can be used as a "neutral" task that should not be failed. For example: "Stay alive during this attack." It will be marked as successful, but can be transitioned into a failed state.
  • Composite: Sequence
    Chain quest tasks or other composite nodes one after another to accomplish some kind of dependency between different tasks. It tries to finish every subtask.
  • Composite: Parallel
    Create a batch of tasks or other composite nodes which will be activated as soon as the parent activates. Here you can offer multiple quests to the target.
  • Composite: First Success Sequence
    Create a try-and-error task chain that will succeed as soon as the first child node signals a successful state. Useful if you want to give your target repeated quests and fallback to another quest, if the first was not successful.
  • Composite: Any Success
    Similar to the "Composite: Parallel". All nodes are activated as soon as this node activates. The success state will be reached as soon as a single child node succeeds. Single failures are no problem, as long as any other pending node is inside this composite.

Example quest structure

To provide you with some information about the possibilities this library offers, you can find an example Roleplay quest layout:

QUEST ROOT: Journey to save the princess
└─COMPOSITE SEQUENCE
  ├─ TASK: Find your brother
  ├─ COMPOSITE SEQUENCE
  │ ├─ TASK: Enter the Bomb Battlefield.
  │ ├─ TASK: Find the boss of this Level.
  │ ├─ COMPOSITE PARALLEL
  │ │ ├─ CONDITION TASK: Stay alive during the bossfight.
  │ │ └─ TASK: Defeat the great bomb boss
  │ └─ TASK: Leave the Bomb Battlefield.
  ├─ COMPOSITE SEQUENCE
  │ ├─ TASK: Enter the final world
  │ └─ COMPOSITE PARALLEL
  │   ├─ TASK: Defeat all enemies in this world
  │   └─ COMPOSITE SEQUENCE
  │     ├─ TASK: Find the last boss
  │     ├─ COMPOSITE PARALLEL
  │     │ ├─ CONDITION TASK: Stay alive during the bossfight.
  │     │ └─ TASK: Defeat the final boss
  │     └─ TASK: Find and free the princess
  └─ TASK: Claim your reward

This is a quest structure which can be represented with this library.

License

MIT License

Copyright (c) 2021 Francesco Paolocci

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.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.4.0 504 1/20/2022
0.3.1 470 10/23/2021
0.3.0 314 10/23/2021