From acd45ec783e5d7e08c7a51d365cec7c5b0ff8b8f Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 4 Aug 2024 00:09:16 +0200 Subject: [PATCH] update --- animation/Animation.h | 339 ++++++ animation/AnimationEaseType.h | 47 + gpuapi/opengl/UIOpengl.h | 63 + gpuapi/opengl/UtilsOpengl.h | 11 + image/default_colors.h | 36 + image/default_colors.htm | 68 ++ math/Animation.h | 19 - models/Location.h | 19 + models/Map/map_chunks.h | 0 models/event/Event.h | 146 +++ models/event/EventTaskType.h | 937 +++++++++++++++ models/event/event_file_format.txt | 42 + models/event/tmp | 937 +++++++++++++++ models/guild/GuildBanner.h | 23 + models/item/Equipment.h | 34 +- models/item/EquipmentType.h | 1 + models/map.h | 1 + models/mob/ActivityStats.h | 24 + models/mob/Mob.cpp | 14 +- models/mob/Mob.h | 22 + models/mob/MobState.h | 16 +- models/mob/MobStats.cpp | 48 + models/mob/MobStats.h | 1056 +++++++++-------- models/mob/monster/LootTable.h | 5 + models/mob/player/Player.h | 3 + models/mob/skill/Skill.h | 136 ++- models/mob/skill/definitions/beam | 0 .../skill/definitions/health_inverse_dmg.cfg | 4 + .../mob/skill/definitions/health_to_dmg.cfg | 1 + models/mob/skill/definitions/sacrafice.cfg | 2 + models/mob/skill/definitions/teleport.cfg | 0 pathfinding/AStar.h | 0 pathfinding/Jps.h | 0 pathfinding/JpsBounded.h | 0 pathfinding/Jpsp.h | 0 platform/linux/UtilsLinux.h | 48 + platform/win32/UtilsWin32.h | 17 + stdlib/Intrinsics.h | 18 +- stdlib/simd/SIMD_F32.h | 330 +++++- stdlib/simd/SIMD_Helper.h | 163 ++- stdlib/simd/SIMD_I16.h | 976 +++++++++++++++ stdlib/simd/SIMD_I32.h | 743 +++++++++++- stdlib/simd/SIMD_I8.h | 983 +++++++++++++++ thread/ThreadOSWrapper.h | 2 + ui/Dropdown.h | 0 ui/Image.h | 0 ui/Link.h | 0 ui/Panel.h | 0 ui/Select.h | 0 ui/Table.h | 0 ui/Text.h | 0 ui/Textarea.h | 0 ui/Textfield.h | 0 ui/UIButton.h | 35 + ui/UIElement.h | 20 + ui/UIElementType.h | 20 + ui/UILayout.h | 51 + ui/UILocation.h | 13 + ui/UIPosition.h | 9 + ui/UIWindow.h | 39 + utils/Compiler.h | 7 +- utils/FastPipes.h | 50 + utils/StringUtils.h | 22 + utils/SystemInfo.h | 523 ++++++++ utils/SystemUtils.h | 15 + 65 files changed, 7460 insertions(+), 678 deletions(-) create mode 100644 animation/Animation.h create mode 100644 animation/AnimationEaseType.h create mode 100644 gpuapi/opengl/UIOpengl.h create mode 100644 image/default_colors.h create mode 100644 image/default_colors.htm delete mode 100644 math/Animation.h create mode 100644 models/Location.h create mode 100644 models/Map/map_chunks.h create mode 100644 models/event/Event.h create mode 100644 models/event/EventTaskType.h create mode 100644 models/event/event_file_format.txt create mode 100644 models/event/tmp create mode 100644 models/guild/GuildBanner.h create mode 100644 models/mob/ActivityStats.h create mode 100644 models/mob/MobStats.cpp create mode 100644 models/mob/skill/definitions/beam create mode 100644 models/mob/skill/definitions/health_inverse_dmg.cfg create mode 100644 models/mob/skill/definitions/health_to_dmg.cfg create mode 100644 models/mob/skill/definitions/sacrafice.cfg create mode 100644 models/mob/skill/definitions/teleport.cfg create mode 100644 pathfinding/AStar.h create mode 100644 pathfinding/Jps.h create mode 100644 pathfinding/JpsBounded.h create mode 100644 pathfinding/Jpsp.h create mode 100644 stdlib/simd/SIMD_I16.h create mode 100644 stdlib/simd/SIMD_I8.h create mode 100644 ui/Dropdown.h create mode 100644 ui/Image.h create mode 100644 ui/Link.h create mode 100644 ui/Panel.h create mode 100644 ui/Select.h create mode 100644 ui/Table.h create mode 100644 ui/Text.h create mode 100644 ui/Textarea.h create mode 100644 ui/Textfield.h create mode 100644 ui/UIButton.h create mode 100644 ui/UIElement.h create mode 100644 ui/UIElementType.h create mode 100644 ui/UILayout.h create mode 100644 ui/UILocation.h create mode 100644 ui/UIPosition.h create mode 100644 ui/UIWindow.h create mode 100644 utils/FastPipes.h create mode 100644 utils/SystemInfo.h create mode 100644 utils/SystemUtils.h diff --git a/animation/Animation.h b/animation/Animation.h new file mode 100644 index 0000000..9d87e93 --- /dev/null +++ b/animation/Animation.h @@ -0,0 +1,339 @@ +/** + * Jingga + * + * @package Utils + * @copyright Jingga + * @license OMS License 2.0 + * @version 1.0.0 + * @link https://jingga.app + */ +#ifndef TOS_ANIMATION_H +#define TOS_ANIMATION_H + +#include +#include "../utils/MathUtils.h" + +#include "AnimationEaseType.h" + +inline +float lerp_approx(float a, float b, float t) +{ + return a + t * (b - a); +} + +float anim_ease(float t, AnimationEaseType type) { + switch(type) { + case ANIMATION_EASE_IN_SINE: { + return anim_ease_in_sine(t); + }; + case ANIMATION_EASE_OUT_SINE: { + return anim_ease_out_sine(t); + }; + case ANIMATION_EASE_IN_OUT_SINE: { + return anim_ease_in_out_sine(t); + }; + case ANIMATION_EASE_IN_QUAD: { + return anim_ease_in_quad(t); + }; + case ANIMATION_EASE_OUT_QUAD: { + return anim_ease_out_quad(t); + }; + case ANIMATION_EASE_IN_OUT_QUAD: { + return anim_ease_in_out_quad(t); + }; + case ANIMATION_EASE_IN_CUBIC: { + return anim_ease_in_cubic(t); + }; + case ANIMATION_EASE_OUT_CUBIC: { + return anim_ease_out_cubic(t); + }; + case ANIMATION_EASE_IN_OUT_CUBIC: { + return anim_ease_in_out_cubic(t); + }; + case ANIMATION_EASE_IN_QUART: { + return anim_ease_in_quart(t); + }; + case ANIMATION_EASE_OUT_QUART: { + return anim_ease_out_quart(t); + }; + case ANIMATION_EASE_IN_OUT_QUART: { + return anim_ease_in_out_quart(t); + }; + case ANIMATION_EASE_IN_QUINT: { + return anim_ease_in_quint(t); + }; + case ANIMATION_EASE_OUT_QUINT: { + return anim_ease_out_quint(t); + }; + case ANIMATION_EASE_IN_OUT_QUINT: { + return anim_ease_in_out_quint(t); + }; + case ANIMATION_EASE_IN_EXPO: { + return anim_ease_in_expo(t); + }; + case ANIMATION_EASE_OUT_EXPO: { + return anim_ease_out_expo(t); + }; + case ANIMATION_EASE_IN_OUT_EXPO: { + return anim_ease_in_out_expo(t); + }; + case ANIMATION_EASE_IN_CIRC: { + return anim_ease_in_circ(t); + }; + case ANIMATION_EASE_OUT_CIRC: { + return anim_ease_out_circ(t); + }; + case ANIMATION_EASE_IN_OUT_CIRC: { + return anim_ease_in_out_circ(t); + }; + case ANIMATION_EASE_IN_BACK: { + return anim_ease_in_back(t); + }; + case ANIMATION_EASE_OUT_BACK: { + return anim_ease_out_back(t); + }; + case ANIMATION_EASE_IN_OUT_BACK: { + return anim_ease_in_out_back(t); + }; + case ANIMATION_EASE_IN_ELASTIC: { + return anim_ease_in_elastic(t); + }; + case ANIMATION_EASE_OUT_ELASTIC: { + return anim_ease_out_elastic(t); + }; + case ANIMATION_EASE_IN_OUT_ELASTIC: { + return anim_ease_in_out_elastic(t); + }; + case ANIMATION_EASE_IN_BOUNCE: { + return anim_ease_in_bounce(t); + }; + case ANIMATION_EASE_OUT_BOUNCE: { + return anim_ease_out_bounce(t); + }; + case ANIMATION_EASE_IN_OUT_BOUNCE: { + return anim_ease_in_out_bounce(t); + }; + default: + return t; + } +} + +inline +float anim_ease_linear(float t) { + return t; +} + +inline +float anim_ease_in_sine(float t) { + return 1 - cosf_approx((t * OMS_PI) / 2); +} + +inline +float anim_ease_out_sine(float t) { + return sinf_approx((t * OMS_PI) / 2); +} + +inline +float anim_ease_in_out_sine(float t) { + return -(cosf_approx(OMS_PI * t) - 1) / 2; +} + +inline +float anim_ease_in_quad(float t) { + return t * t; +} + +inline +float anim_ease_out_quad(float t) { + return 1 - (1 - t) * (1 - t); +} + +inline +float anim_ease_in_out_quad(float t) { + return t < 0.5 + ? 2 * t * t + : 1 - pow(-2 * t + 2, 2) / 2; +} + +inline +float anim_ease_in_cubic(float t) { + return t * t * t; +} + +inline +float anim_ease_out_cubic(float t) { + return 1 - pow(1 - t, 3); +} + +inline +float anim_ease_in_out_cubic(float t) { + return t < 0.5 + ? 4 * t * t * t + : 1 - pow(-2 * t + 2, 3) / 2; +} + +inline +float anim_ease_in_quart(float t) { + return t * t * t * t; +} + +inline +float anim_ease_out_quart(float t) { + return 1 - pow(1 - t, 4); +} + +inline +float anim_ease_in_out_quart(float t) { + return t < 0.5 + ? 8 * t * t * t * t + : 1 - pow(-2 * t + 2, 4) / 2; +} + +inline +float anim_ease_in_quint(float t) { + return t * t * t * t * t; +} + +inline +float anim_ease_out_quint(float t) { + return 1 - pow(1 - t, 5); +} + +inline +float anim_ease_in_out_quint(float t) { + return t < 0.5 + ? 16 * t * t * t * t * t + : 1 - pow(-2 * t + 2, 5) / 2; +} + +inline +float anim_ease_in_expo(float t) { + return t == 0 + ? 0 : pow(2, 10 * t - 10); +} + +inline +float anim_ease_out_expo(float t) { + return t == 1 + ? 1 + : 1 - pow(2, -10 * t); +} + +inline +float anim_ease_in_out_expo(float t) { + if (t == 0 || t == 1) { + return t; + } + + return t < 0.5 + ? pow(2, 20 * t - 10) / 2 + : (2 - pow(2, -20 * t + 10)) / 2; +} + +inline +float anim_ease_in_circ(float t) { + return 1 - sqrt(1 - pow(t, 2)); +} + +inline +float anim_ease_out_circ(float t) { + return sqrt(1 - pow(t - 1, 2)); +} + +inline +float anim_ease_in_out_circ(float t) { + return t < 0.5 + ? (1 - sqrt(1 - pow(2 * t, 2))) / 2 + : (sqrt(1 - pow(-2 * t + 2, 2)) + 1) / 2; +} + +inline +float anim_ease_in_back(float t) { + const float c1 = 1.70158; + const float c3 = c1 + 1; + + return c3 * t * t * t - c1 * t * t; +} + +inline +float anim_ease_out_back(float t) { + const float c1 = 1.70158; + const float c3 = c1 + 1; + + return 1 + c3 * pow(t - 1, 3) + c1 * pow(t - 1, 2); +} + +inline +float anim_ease_in_out_back(float t) { + const float c1 = 1.70158; + const float c2 = c1 * 1.525; + + return t < 0.5 + ? (pow(2 * t, 2) * ((c2 + 1) * 2 * t - c2)) / 2 + : (pow(2 * t - 2, 2) * ((c2 + 1) * (t * 2 - 2) + c2) + 2) / 2; +} + +inline +float anim_ease_in_elastic(float t) { + const float c4 = (2 * OMS_PI) / 3; + + if (t == 0 || t == 1) { + return t; + } + + return -pow(2, 10 * t - 10) * sinf_approx((t * 10 - 10.75) * c4); +} + +inline +float anim_ease_out_elastic(float t) { + const float c4 = (2 * OMS_PI) / 3; + + if (t == 0.0 || t == 1.0) { + return t; + } + + return pow(2, -10 * t) * sinf_approx((t * 10 - 0.75) * c4) + 1; +} + +inline +float anim_ease_in_out_elastic(float t) { + const float c5 = (2 * OMS_PI) / 4.5; + + if (t == 0.0 || t == 1.0) { + return t; + } else if (t < 0.5) { + return -(pow(2, 20 * t - 10) * sinf_approx((20 * t - 11.125) * c5)) / 2; + } + + return (pow(2, -20 * t + 10) * sinf_approx((20 * t - 11.125) * c5)) / 2 + 1; +} + +inline +float anim_ease_in_bounce(float t) { + return 1 - anim_ease_out_bounce(1 - t); +} + +inline +float anim_ease_out_bounce(float t) { + const float n1 = 7.5625; + const float d1 = 2.75; + + if (t < 1 / d1) { + return n1 * t * t; + } else if (t < 2 / d1) { + return n1 * (t -= 1.5 / d1) * t + 0.75; + } else if (t < 2.5 / d1) { + return n1 * (t -= 2.25 / d1) * t + 0.9375; + } + + return n1 * (t -= 2.625 / d1) * t + 0.984375; +} + +inline +float anim_ease_in_out_bounce(float t) { + return t < 0.5 + ? (1 - anim_ease_out_bounce(1 - 2 * t)) / 2 + : (1 + anim_ease_out_bounce(2 * t - 1)) / 2; +} + +#endif \ No newline at end of file diff --git a/animation/AnimationEaseType.h b/animation/AnimationEaseType.h new file mode 100644 index 0000000..7ed2086 --- /dev/null +++ b/animation/AnimationEaseType.h @@ -0,0 +1,47 @@ +/** + * Jingga + * + * @package Utils + * @copyright Jingga + * @license OMS License 2.0 + * @version 1.0.0 + * @link https://jingga.app + */ +#ifndef TOS_ANIMATION_EASE_TYPE_H +#define TOS_ANIMATION_EASE_TYPE_H + +enum AnimationEaseType { + ANIMATION_LINEAR, + ANIMATION_EASE_IN_SINE, + ANIMATION_EASE_OUT_SINE, + ANIMATION_EASE_IN_OUT_SINE, + ANIMATION_EASE_IN_QUAD, + ANIMATION_EASE_OUT_QUAD, + ANIMATION_EASE_IN_OUT_QUAD, + ANIMATION_EASE_IN_CUBIC, + ANIMATION_EASE_OUT_CUBIC, + ANIMATION_EASE_IN_OUT_CUBIC, + ANIMATION_EASE_IN_QUART, + ANIMATION_EASE_OUT_QUART, + ANIMATION_EASE_IN_OUT_QUART, + ANIMATION_EASE_IN_QUINT, + ANIMATION_EASE_OUT_QUINT, + ANIMATION_EASE_IN_OUT_QUINT, + ANIMATION_EASE_IN_EXPO, + ANIMATION_EASE_OUT_EXPO, + ANIMATION_EASE_IN_OUT_EXPO, + ANIMATION_EASE_IN_CIRC, + ANIMATION_EASE_OUT_CIRC, + ANIMATION_EASE_IN_OUT_CIRC, + ANIMATION_EASE_IN_BACK, + ANIMATION_EASE_OUT_BACK, + ANIMATION_EASE_IN_OUT_BACK, + ANIMATION_EASE_IN_ELASTIC, + ANIMATION_EASE_OUT_ELASTIC, + ANIMATION_EASE_IN_OUT_ELASTIC, + ANIMATION_EASE_IN_BOUNCE, + ANIMATION_EASE_OUT_BOUNCE, + ANIMATION_EASE_IN_OUT_BOUNCE +}; + +#endif \ No newline at end of file diff --git a/gpuapi/opengl/UIOpengl.h b/gpuapi/opengl/UIOpengl.h new file mode 100644 index 0000000..acbb001 --- /dev/null +++ b/gpuapi/opengl/UIOpengl.h @@ -0,0 +1,63 @@ +/** + * Jingga + * + * @copyright Jingga + * @license OMS License 2.0 + * @version 1.0.0 + * @link https://jingga.app + */ +#ifndef TOS_GPUAPI_OPENGL_UI_H +#define TOS_GPUAPI_OPENGL_UI_H + +#include "../../stdlib/Types.h" +#include "../../stdlib/Mathtypes.h" + +#include "../../ui/UIButton.h" +#include "../../ui/UIWindow.h" + +#include "../../../EngineDependencies/opengl/glew/include/GL/glew.h" +#include "../../../EngineDependencies/opengl/glfw/include/glfw3.h" + +void render_button(UIButton* btn) +{ + // Draw the background rectangle (button) + glColor3f(btn->layout_default->color_background.r, btn->layout_default->color_background.g, btn->layout_default->color_background.b); + glBegin(GL_QUADS); + glVertex2f(btn->layout_default->x, btn->layout_default->y); + glVertex2f(btn->layout_default->x + btn->layout_default->width, btn->layout_default->y); + glVertex2f(btn->layout_default->x + btn->layout_default->width, btn->layout_default->y + btn->layout_default->height); + glVertex2f(btn->layout_default->x, btn->layout_default->y + btn->layout_default->height); + glEnd(); + + // Draw the border + glColor3f(btn->layout_default->border_color.r, btn->layout_default->border_color.g, btn->layout_default->border_color.b); + // Bottom border + glLineWidth(btn->layout_default->border_width[0]); + glBegin(GL_LINES); + glVertex2f(btn->layout_default->x, btn->layout_default->y); + glVertex2f(btn->layout_default->x + btn->layout_default->width, btn->layout_default->y); + glEnd(); + + // Right border + glLineWidth(btn->layout_default->border_width[1]); + glBegin(GL_LINES); + glVertex2f(btn->layout_default->x + btn->layout_default->width, btn->layout_default->y); + glVertex2f(btn->layout_default->x + btn->layout_default->width, btn->layout_default->y + btn->layout_default->height); + glEnd(); + + // Top border + glLineWidth(btn->layout_default->border_width[2]); + glBegin(GL_LINES); + glVertex2f(btn->layout_default->x + btn->layout_default->width, btn->layout_default->y + btn->layout_default->height); + glVertex2f(btn->layout_default->x, btn->layout_default->y + btn->layout_default->height); + glEnd(); + + // Left border + glLineWidth(btn->layout_default->border_width[3]); + glBegin(GL_LINES); + glVertex2f(btn->layout_default->x, btn->layout_default->y + btn->layout_default->height); + glVertex2f(btn->layout_default->x, btn->layout_default->y); + glEnd(); +} + +#endif \ No newline at end of file diff --git a/gpuapi/opengl/UtilsOpengl.h b/gpuapi/opengl/UtilsOpengl.h index aafd855..991ace7 100644 --- a/gpuapi/opengl/UtilsOpengl.h +++ b/gpuapi/opengl/UtilsOpengl.h @@ -357,4 +357,15 @@ void gpuapi_buffer_delete(GLuint buffer) glDeleteBuffers(1, &buffer); } +void render_9_patch(GLuint texture, + int imgWidth, int imgHeight, + int img_x1, int img_x2, + int img_y1, int img_y2, + int renderWidth, int renderHeight, + int repeat +) +{ + +} + #endif \ No newline at end of file diff --git a/image/default_colors.h b/image/default_colors.h new file mode 100644 index 0000000..2b72213 --- /dev/null +++ b/image/default_colors.h @@ -0,0 +1,36 @@ +/** + * Jingga + * + * @copyright Jingga + * @license OMS License 2.0 + * @version 1.0.0 + * @link https://jingga.app + */ +#ifndef TOS_IMAGE_DEFAULT_COLORS_H +#define TOS_IMAGE_DEFAULT_COLORS_H + +#include "../stdlib/Types.h" + +// @todo some of the cullors are bad +// @todo basically all the dark colors could be made darker -> space out some of the very bright colors a little bit more (see 3rd - 5th column) + +const int default_colors_256[256] = { + 0x123456, 0xFFFFFF, 0xF1EEED, 0xDCDEDE, 0xBFC1BF, 0xAEB0AD, 0x9E9D9E, 0x8E8F94, 0x717373, 0x5E5F61, 0x4D4D4C, 0x3F403A, 0x332C2A, 0x241E22, 0x0C1210, 0x000000, + 0xF6D3CF, 0xFABABC, 0xFBA699, 0xF19580, 0xFB837A, 0xFC615A, 0xFF4E4B, 0xFF4040, 0xF72128, 0xF60303, 0xE40000, 0xC70002, 0x900009, 0x630604, 0x4f0107, 0x2d0205, + 0xFDDDCE, 0xFCC5AC, 0xFFB9A4, 0xF6A378, 0xF49A80, 0xFF7D4F, 0xF8742C, 0xFE5A22, 0xF44A0B, 0xDA3A06, 0xC03500, 0x853004, 0x912600, 0x672300, 0x471608, 0x2b0d05, + 0xFCEBCF, 0xFCD8AA, 0xFFCD98, 0xFCC27F, 0xF3B267, 0xFDA660, 0xFD942D, 0xFF8001, 0xDF6E00, 0xCC6B00, 0xA85D00, 0xA55300, 0x734700, 0x612D08, 0x562600, 0x351700, + 0xFFF6C9, 0xFFECA8, 0xFDE884, 0xFADC6D, 0xF8DE6F, 0xFFCF43, 0xFFBD00, 0xEBB800, 0xC1A800, 0xBC8F09, 0x9B7A00, 0x8E6C08, 0x795F01, 0x5C4A00, 0x523B00, 0x392900, + 0xFFFFCD, 0xFDFEAF, 0xFCFBA1, 0xFDFF69, 0xF9FF2A, 0xFFFE04, 0xEFEE00, 0xE0DE00, 0xBDBF13, 0xB4AF00, 0x9F9900, 0x909002, 0x717300, 0x505400, 0x4A4F00, 0x343700, + 0xE4FFBD, 0xDFFEB9, 0xD1FF8F, 0xCAFC84, 0xC0F96B, 0xBAF353, 0x98FB00, 0x9AEE0F, 0x78CE00, 0x74C100, 0x61A401, 0x578A03, 0x4F7E02, 0x3C6200, 0x2E4F00, 0x203700, + 0xE1F8D8, 0xBBFEAD, 0xA2F592, 0xA1F79A, 0x81FF7A, 0x5DFF59, 0x48FF58, 0x00F600, 0x12D31F, 0x0ACB04, 0x10A40A, 0x089811, 0x06780E, 0x05640F, 0x005200, 0x003100, + 0xD5FFF8, 0xBCFFEA, 0xA7FED3, 0x99F2C4, 0x6CFFB5, 0x53F29E, 0x4CFEA1, 0x0AF779, 0x0CD56A, 0x0BC868, 0x01AA50, 0x07A557, 0x008642, 0x075A30, 0x00562C, 0x00331a, + 0xD9FDFE, 0xB3FCFF, 0xACFFFF, 0x90FFFF, 0x76FEFF, 0x5FFAFD, 0x08FEFE, 0x22F3F2, 0x06C9C2, 0x08B2C4, 0x049FA4, 0x078C97, 0x008286, 0x025D5D, 0x005056, 0x003135, + 0xE2F5FF, 0xB4EBFF, 0xA3DAFF, 0x89CCF8, 0x79D1FF, 0x61C3F7, 0x59C5F3, 0x3FB9F6, 0x05A4FA, 0x0592F0, 0x0677B8, 0x00649A, 0x065A77, 0x004974, 0x003154, 0x00243e, + 0xD1DDFF, 0xB5D0EF, 0xA7BFF6, 0x90B6F4, 0x85AAF7, 0x67AAFF, 0x5386FF, 0x437AFF, 0x3A6AFF, 0x044EFC, 0x034EF7, 0x0A37BF, 0x09268B, 0x062871, 0x001D4C, 0x001435, + 0xC7C3FF, 0xC7C6FE, 0x9D9CFF, 0x9194F6, 0x7E81FE, 0x776FF7, 0x595AFF, 0x4852FF, 0x2D2EFF, 0x2020F8, 0x0400E1, 0x0000DD, 0x010097, 0x000086, 0x03005D, 0x020035, + 0xE1D4FF, 0xD8ACFF, 0xCD9BFF, 0xC88DFA, 0xBD8AF9, 0xB160FF, 0xAA52FE, 0x9841FD, 0x8726FF, 0x8700F5, 0x7200F4, 0x5C00B7, 0x460489, 0x350077, 0x28004F, 0x1c0037, + 0xFFC7FF, 0xFFB2FF, 0xFF9AFF, 0xF181F1, 0xFB6FFD, 0xF850FB, 0xFB46FF, 0xF91FFF, 0xF900FF, 0xDD00E6, 0xBF00C7, 0x9B0199, 0xB70090, 0x670362, 0x4F0153, 0x330035, + 0xFDD2E6, 0xF9B5DA, 0xF7A4D4, 0xF198CB, 0xF682BD, 0xFF5FAE, 0xFF4CA9, 0xFF3CA4, 0xFF1A94, 0xF90979, 0xE80071, 0xC40061, 0x96004A, 0x670132, 0x4F0024, 0x310016 +} + +#endif \ No newline at end of file diff --git a/image/default_colors.htm b/image/default_colors.htm new file mode 100644 index 0000000..7d032f1 --- /dev/null +++ b/image/default_colors.htm @@ -0,0 +1,68 @@ + + + + + + 16x16 Color Picker Table + + + +
+ + + \ No newline at end of file diff --git a/math/Animation.h b/math/Animation.h deleted file mode 100644 index 6c04f25..0000000 --- a/math/Animation.h +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Jingga - * - * @package Utils - * @copyright Jingga - * @license OMS License 2.0 - * @version 1.0.0 - * @link https://jingga.app - */ -#ifndef TOS_MATH_ANIMATION -#define TOS_MATH_ANIMATION - -inline -float lerp_approx(float a, float b, float t) -{ - return a + t * (b - a); -} - -#endif \ No newline at end of file diff --git a/models/Location.h b/models/Location.h new file mode 100644 index 0000000..041abdc --- /dev/null +++ b/models/Location.h @@ -0,0 +1,19 @@ +/** + * Jingga + * + * @copyright Jingga + * @license OMS License 2.0 + * @version 1.0.0 + * @link https://jingga.app + */ +#ifndef TOS_MODELS_LOCATION_H +#define TOS_MODELS_LOCATION_H + +#include "../stdlib/Mathtypes.h" + +struct Location { + v3_f32 position; + v4_f32 orientation; +}; + +#endif \ No newline at end of file diff --git a/models/Map/map_chunks.h b/models/Map/map_chunks.h new file mode 100644 index 0000000..e69de29 diff --git a/models/event/Event.h b/models/event/Event.h new file mode 100644 index 0000000..1442584 --- /dev/null +++ b/models/event/Event.h @@ -0,0 +1,146 @@ +#ifndef TOS_EVENT_H +#define TOS_EVENT_H + +#include "../../stdlib/Types.h" +#include "../mob/monster/LootTable.h" +#include "EventTaskType.h" + +enum QuestState { + QUEST_STATE_NOT_STARTED, + QUEST_STATE_IN_PROGRESS, + QUEST_STATE_COMPLETED, + QUEST_STATE_FAILED +}; + +// also used for conditions in event tasks +struct EventRequirement { + int* events_finished; // These events need to be completed + int events_finished_count; + + int* events_not_finished; + int events_not_finished_count; + + int* events_started; // These events need to be started + int events_started_count; + + int* events_not_started; + int events_not_started_count; + + int char_level_above; + int char_level_below; + + int group_size; // some quests require a certain group size + + int* proficiencies_above; + int* proficiencies_above_level; + int proficiencies_above_count; + + int* proficiencies_below; + int* proficiencies_below_level; + int proficiencies_below_count; + + int char_trait_type; // npc, region, global, ... + int* char_trait_above; + int* char_trait_above_level; + int char_trait_above_count; + + int* char_trait_below; + int* char_trait_below_level; + int char_trait_below_count; + + int char_recognition_type; // npc, region, global, ... + int* char_recognition_above; + int* char_recognition_above_level; + int char_recognition_above_count; + + int* char_recognition_below; + int* char_recognition_below_level; + int char_recognition_below_count; +}; + +struct EventReward { + int score; // score required for this reward + + LootTable loot; + bool reward_given; +}; + +struct EventTaskCollect { + int64* items; + int* required_amount; + int* collected_amount; + + // @todo some data should be visual, some only internal + // sometimes we want to show radi, sometimes not + // some of the radi are also mob/obj spawn areas for internal purposes + v3_f32* positions; + f32* radi; +}; + +struct EventTaskKill { + int64 mob; + int required_kills; + int kills_done; + + v3_f32* positions; + f32* radi; +}; + +struct EventTaskAccompany { + int64 npc; + + v3_f32* positions; + f32* radi; + + bool reached_destination; +}; + +struct EventTaskDiscover { + v3_f32* positions; + f32* radi; + + bool* discovered; +}; + +struct EventTaskDeliver { + // @todo first pickup items from location/npc? + + int64* items; + int* required_amount; + int* delivered_amount; + + // pickup location + v3_f32* positions; + f32* radi; + + // @todo destination + + bool* delivered; +}; + +struct EventTask { + EventTaskType type; + bool completed; + union { + EventTaskCollect collect; + EventTaskKill kill; + EventTaskAccompany accompany; + EventTaskDiscover discover; + }; +}; + +struct Event { + int64 id; + QuestState state; + int64 giver; + + char* title; + char* description; + + EventTask* tasks; + + EventRequirement* requirements; + EventReward* rewards; +}; + +#endif \ No newline at end of file diff --git a/models/event/EventTaskType.h b/models/event/EventTaskType.h new file mode 100644 index 0000000..1dbe5b3 --- /dev/null +++ b/models/event/EventTaskType.h @@ -0,0 +1,937 @@ +#ifndef TOS_QUEST_EVENT_TASK_TYPE_H +#define TOS_QUEST_EVENT_TASK_TYPE_H + +enum EventTaskType { + TASK_COLLECT, // Collect a specific item or set of items + TASK_KILL, // Kill a certain number of enemies + TASK_ACCOMPANY, // Escort an NPC to a location + TASK_DISCOVER, // Discover a specific location + TASK_DELIVER, // Deliver an item to an NPC or location + TASK_RESCUE, // Rescue an NPC or group of NPCs + TASK_RETRIEVE, // Retrieve a stolen or lost item + TASK_GATHER_INFORMATION, // Gather information or clues + TASK_TALK, // Speak to a specific NPC or group of NPCs + TASK_DEFEND, // Defend a location or NPC for a certain period of time + TASK_SURVIVE, // Survive waves of enemies or a hazardous environment + TASK_INVESTIGATE, // Investigate a mystery or event + TASK_CONSTRUCT, // Build or repair a structure or object + TASK_CRAFT, // Craft a specific item or set of items + TASK_TRAIN, // Train a skill or teach an NPC + TASK_FOLLOW, // Follow an NPC or creature without being detected + TASK_SABOTAGE, // Sabotage an enemy structure or plan + TASK_CAPTURE, // Capture or trap an enemy or creature + TASK_ESCAPE, // Escape from a location or situation + TASK_EXPLORE, // Explore a new area or region + TASK_NEGOTIATE, // Negotiate peace or a trade agreement + TASK_BARGAIN, // Bargain for a better price or outcome + TASK_SPY, // Gather intelligence on enemies or allies + TASK_INFILTRATE, // Infiltrate an enemy base or organization + TASK_ASSASSINATE, // Assassinate a key target + TASK_RECON, // Perform reconnaissance on a location + TASK_HACK, // Hack a computer system or device + TASK_REPAIR, // Repair a damaged object or system + TASK_ENCHANT, // Enchant a weapon, armor, or item + TASK_BREW, // Brew a potion or drink + TASK_FISH, // Catch a certain type or number of fish + TASK_HUNT, // Hunt a specific animal or creature + TASK_COLLECT_TAX, // Collect taxes or tribute from NPCs + TASK_RECRUIT, // Recruit allies or troops for a cause + TASK_ESCAPE_PRISON, // Escape from captivity or imprisonment + TASK_EXTRACT, // Extract resources or an NPC from a location + TASK_SHADOW, // Shadow an NPC or enemy without being seen + TASK_FIND_LOST, // Find a lost or missing NPC or item + TASK_PLANT, // Plant seeds or objects in specific locations + TASK_SELL, // Sell specific items to merchants or NPCs + TASK_BUY, // Purchase specific items or goods + TASK_PROTECT, // Protect a caravan or convoy + TASK_RELOCATE, // Relocate an NPC or item to a new location + TASK_RESTORE, // Restore a broken artifact or relationship + TASK_SURVEY, // Survey land or resources + TASK_SMUGGLE, // Smuggle contraband past guards or checkpoints + TASK_INTERROGATE, // Interrogate an NPC for information + TASK_INTERCEPT, // Intercept a message or courier + TASK_ESCORT, // Escort an important NPC through dangerous territory + TASK_MINE, // Mine specific ores or minerals + TASK_BOUNTY, // Collect a bounty on a specific target + TASK_TRAP, // Set traps for enemies or animals + TASK_CONQUER, // Conquer a specific area or territory + TASK_SURRENDER, // Surrender to an enemy or superior + TASK_NEGLECT, // Avoid or neglect a responsibility (e.g., a moral choice) + TASK_SUPPORT, // Provide support or aid to allies in a conflict + TASK_DELIVER_MESSAGE, // Deliver a message or letter to an NPC + TASK_LAY_SIEGE, // Lay siege to a fortress or city + TASK_BREAK_SIEGE, // Break a siege and liberate a location + TASK_FORAGE, // Forage for food, herbs, or supplies + TASK_SEARCH, // Search for clues or specific items in an area + TASK_TAME, // Tame a wild animal or creature + TASK_CHARM, // Charm or persuade an NPC or creature + TASK_CONVINCE, // Convince an NPC to take a certain action + TASK_DEFECT, // Defect from one faction to another + TASK_BETRAY, // Betray an ally or group for personal gain + TASK_DECRYPT, // Decrypt a coded message or puzzle + TASK_PUZZLE, // Solve a puzzle or riddle + TASK_RACE, // Participate in a race or timed event + TASK_TOURNAMENT, // Compete in a tournament or competition + TASK_SCARE, // Scare off or intimidate an NPC or creature + TASK_SHOOT, // Shoot targets or enemies with a ranged weapon + TASK_USE_ITEM, // Use a specific item at a location or on an NPC + TASK_PERSUADE, // Persuade an NPC to do something or believe something + TASK_MEDITATE, // Meditate to gain insights or abilities + TASK_DUEL, // Duel an NPC in combat + TASK_TRIAL, // Complete a trial or test of skill + TASK_PREACH, // Preach to NPCs to gain followers or influence + TASK_CONVERT, // Convert NPCs to a religion or cause + TASK_COLLECT_DEBT, // Collect a debt from an NPC + TASK_LIGHT, // Light torches or beacons + TASK_EXTINGUISH, // Extinguish fires or light sources + TASK_RECONCILE, // Reconcile a conflict between NPCs or groups + TASK_DISARM, // Disarm traps or enemies + TASK_RELOCATE_VILLAGERS, // Relocate villagers to a safe area + TASK_CALM, // Calm a panicked NPC or creature + TASK_INVOKE_RITUAL, // Invoke or complete a ritual + TASK_PERFORM, // Perform music, dance, or a play for an audience + TASK_OBTAIN_PERMISSION, // Obtain permission to enter a location or take an action + TASK_HIDE, // Hide from enemies or during a stealth mission + TASK_CLIMB, // Climb a mountain, tree, or other structure + TASK_SWIM, // Swim across a body of water or retrieve an item from underwater + TASK_DIVE, // Dive into deep water or a cave + TASK_RESIST, // Resist temptation or a magical effect + TASK_SNEAK, // Sneak into a location without being detected + TASK_SURVEY_TERRITORY, // Survey territory for strategic purposes + TASK_COMMUNE, // Commune with spirits, gods, or nature + TASK_EXORCISE, // Exorcise a spirit or demon from a location or person + TASK_SUMMON, // Summon a creature, spirit, or other entity + TASK_DECEIVE, // Deceive an NPC or group + TASK_GATHER_ARMY, // Gather an army or group of followers + TASK_REPEL_INVASION, // Repel an invasion or attack + TASK_HARVEST, // Harvest crops or resources + TASK_OPERATE_MACHINE, // Operate a complex machine or vehicle + TASK_NEGOTIATE_RANSOM, // Negotiate the ransom of a captured NPC + TASK_CONVICT, // Convict or acquit an NPC in a trial + TASK_TRACK, // Track a person, creature, or object + TASK_CONCEAL, // Conceal evidence or an object from others + TASK_APPREHEND, // Apprehend a criminal or fugitive + TASK_TEACH, // Teach an NPC a skill or knowledge + TASK_CURE, // Cure a disease or ailment affecting an NPC + TASK_RECLAIM, // Reclaim lost or stolen property + TASK_HUNT_TREASURE, // Hunt for hidden or buried treasure + TASK_PROPHESY, // Deliver a prophecy or prediction + TASK_ENACT_REVENGE, // Enact revenge on an enemy or traitor + TASK_UPHOLD_OATH, // Uphold an oath or pledge + TASK_FIND_PATH, // Find a path through difficult terrain + TASK_ESCORT_CONVOY, // Escort a convoy through dangerous territory + TASK_INTERFERE, // Interfere with an enemy's plans or operations + TASK_ENFORCE_LAW, // Enforce the law in a chaotic or lawless area + TASK_RESTORE_HONOR, // Restore the honor of a disgraced NPC or family + TASK_PEACE_TREATY, // Negotiate or enforce a peace treaty + TASK_GATHER_HERBS, // Gather specific herbs or plants + TASK_CAMP, // Set up or break down a camp + TASK_SET_TRAPS, // Set traps for animals or enemies + TASK_CREATE_POTION, // Create a potion using specific ingredients + TASK_RECONSTITUTE, // Reconstitute a broken or damaged artifact + TASK_RENOVATE, // Renovate or repair a building or structure + TASK_EXTRACT_ORE, // Extract ore from a mine or vein + TASK_DOUSE_FLAMES, // Douse flames in a burning building or area + TASK_BLESS, // Bless an object, location, or person + TASK_PLUNDER, // Plunder a village, ship, or enemy camp + TASK_CONSECRATE, // Consecrate a temple, altar, or sacred ground + TASK_EVACUATE, // Evacuate civilians or troops from a dangerous area + TASK_DISGUISE, // Disguise yourself or an NPC to infiltrate or avoid detection + TASK_CONFRONT, // Confront an NPC or creature about their actions + TASK_WAGER, // Wager on a game, race, or duel + TASK_SAIL, // Sail a ship to a specific destination + TASK_MAINTAIN, // Maintain equipment, a building, or machinery + TASK_CLEANSE, // Cleanse a cursed or polluted area + TASK_HOLD_POSITION, // Hold a position against enemies for a certain time + TASK_MAP_TERRITORY, // Map uncharted territory or a region + TASK_INTERPRET, // Interpret a prophecy, dream, or message + TASK_TRANSLATE, // Translate an ancient or foreign language + TASK_ENFORCE_ORDER, // Enforce order in a chaotic environment + TASK_REPENT, // Repent for a past mistake or sin + TASK_INITIATE, // Initiate a new member into a guild, order, or faction + TASK_TEST_LOYALTY, // Test the loyalty of an NPC or group + TASK_SACRIFICE, // Sacrifice an item, creature, or person for a greater cause + TASK_COLLECT_TITHE, // Collect a tithe or offering from NPCs + TASK_PERFORM_RITUAL, // Perform a ritual to summon, banish, or bless + TASK_RESCUE_HOSTAGE, // Rescue a hostage from enemy forces + TASK_PROVOKE, // Provoke an enemy or rival into action + TASK_NEUTRALIZE, // Neutralize a threat without killing + TASK_SCOUR, // Scour an area for resources, clues, or enemies + TASK_MARK_LOCATION, // Mark a location for future use or for others to find + TASK_NAVIGATE, // Navigate through dangerous or unknown territory + TASK_MANAGE_RESOURCES, // Manage resources such as food, water, or materials + TASK_APPEASE, // Appease an angry deity, spirit, or powerful NPC + TASK_MOURN, // Mourn the loss of a person, place, or thing + TASK_ORGANIZE_EVENT, // Organize an event such as a festival, gathering, or meeting + TASK_ESCORT_PRISONER, // Escort a prisoner to a specific location + TASK_ENDURE, // Endure a hardship or trial for a certain time + TASK_BOND_WITH_CREATURE, // Bond with a creature or animal to gain its loyalty + TASK_RECONCILE_FACTIONS, // Reconcile two or more factions that are at odds + TASK_CONDUCT_RITUAL, // Conduct a complex ritual with multiple steps + TASK_OFFER_TRIBUTE, // Offer tribute to a ruler, deity, or spirit + TASK_EXILE, // Exile an NPC or group from a community or region + TASK_SUMMON_ALLY, // Summon an ally or familiar to aid in a quest + TASK_DEFUSE, // Defuse a bomb or dangerous situation + TASK_RELAY_MESSAGE, // Relay a message between two parties + TASK_FIND_RELIC, // Find a lost or ancient relic + TASK_DECIPHER_CODE, // Decipher a code, puzzle, or riddle + TASK_JUDGE_CONTEST, // Judge a contest, competition, or duel + TASK_ESTABLISH_BASE, // Establish a base of operations in a new location + TASK_DEFEAT_CHAMPION, // Defeat a champion in battle or competition + TASK_EMBARK_JOURNEY, // Embark on a long and dangerous journey + TASK_OVERTHROW, // Overthrow a ruler or government + TASK_PERFORM_CEREMONY, // Perform a ceremonial duty or rite + TASK_DEPLOY_TROOPS, // Deploy troops to a strategic location + TASK_CONDUCT_RESEARCH, // Conduct research on a subject, item, or creature + TASK_COUNTERFEIT, // Create a counterfeit item, document, or currency + TASK_OBTAIN_FAVOR, // Obtain the favor of a powerful NPC or faction + TASK_CHALLENGE_RIVAL, // Challenge a rival to a duel, contest, or battle + TASK_RECLAIM_LAND, // Reclaim land from enemies or the wilderness + TASK_PROTECT_ARTIFACT, // Protect an artifact from theft or damage + TASK_CREATE_ALLIANCE, // Create an alliance between factions or NPCs + TASK_TRAVERSE_DUNGEON, // Traverse a dungeon or dangerous area + TASK_DEFEND_STRONGHOLD, // Defend a stronghold from an attack or siege + TASK_UNDERGO_TRIAL, // Undergo a trial of strength, wisdom, or courage + TASK_REDEEM, // Redeem an NPC or yourself from a past wrong + TASK_RESTORE_BALANCE, // Restore balance to a chaotic situation or ecosystem + TASK_CONQUER_FORTRESS, // Conquer a fortress or enemy stronghold + TASK_DEPLOY_TRAP, // Deploy a trap in a strategic location + TASK_HARNESS_POWER, // Harness a source of power or magic + TASK_PLANT_EVIDENCE, // Plant evidence to frame an NPC or mislead others + TASK_RECON_VILLAGE, // Recon a village or settlement for information + TASK_ESCORT_VIP, // Escort a VIP to a safe or strategic location + TASK_CREATE_ART, // Create a piece of art, music, or literature + TASK_REPAIR_REPUTATION, // Repair the reputation of an NPC, faction, or yourself + TASK_FIND_HEIR, // Find a missing heir to a throne or legacy + TASK_REPAIR_BRIDGE, // Repair a bridge to allow safe passage + TASK_CONSTRUCT_BARRICADE,// Construct a barricade to defend against enemies + TASK_INVOKE_DIVINE_HELP, // Invoke divine help or blessings in a dire situation + TASK_PREPARE_FEAST, // Prepare a feast or banquet for a special occasion + TASK_OBSERVE, // Observe an event or person without intervening + TASK_MANAGE_SUPPLY_LINES,// Manage supply lines during a campaign or mission + TASK_ARRANGE_MARRIAGE, // Arrange a marriage for political or personal reasons + TASK_FIND_CURE, // Find a cure for a disease or curse + TASK_RESCUE_ANIMAL, // Rescue an endangered or trapped animal + TASK_CONSTRUCT_MONUMENT, // Construct a monument to commemorate an event or person + TASK_INVEST_FORTUNE, // Invest a fortune in business, property, or trade + TASK_HOST_GATHERING, // Host a gathering or meeting of importance + TASK_RESCUE_CHILD, // Rescue a lost or kidnapped child + TASK_SUBDUE_CREATURE, // Subdue a rampaging creature without killing it + TASK_MEDIATE, // Mediate a dispute between NPCs or factions + TASK_DESTROY_EVIDENCE, // Destroy evidence of a crime or secret + TASK_DEVELOP_TECH, // Develop new technology, magic, or strategy + TASK_NAVIGATE_POLITICS, // Navigate complex political situations + TASK_REVIVE, // Revive an NPC from death or unconsciousness + TASK_ESCORT_MERCHANT, // Escort a merchant and their goods to a market or town + TASK_INTERFERE_CEREMONY, // Interfere with a rival's ceremony or ritual + TASK_DISMISS_ALLY, // Dismiss an ally or companion from your service + TASK_PERFORM_EXORCISM, // Perform an exorcism to banish a spirit or demon + TASK_SECURE_BORDER, // Secure a border against invasion or smuggling + TASK_RETRIEVE_TREASURE, // Retrieve a treasure from a dangerous location + TASK_HOST_CONTEST, // Host a contest or tournament + TASK_REUNITE_FAMILY, // Reunite a family separated by conflict or tragedy + TASK_SMELT_ORE, // Smelt ore into usable metal + TASK_ENCHANT_WEAPON, // Enchant a weapon with special powers + TASK_CREATE_GOLEM, // Create or animate a golem or other construct + TASK_REPLANT_FOREST, // Replant a forest that has been destroyed + TASK_REPLANT_FOREST, // Replant a forest that has been destroyed + TASK_RESURRECT, // Resurrect an NPC or creature from the dead + TASK_SILENCE, // Silence an NPC or group to prevent them from speaking out + TASK_SUBVERT, // Subvert a rival or enemy's plans from within + TASK_INVESTIGATE_CRIME, // Investigate a crime scene or mystery + TASK_DEFEND_CIVILIANS, // Defend civilians from an attack or disaster + TASK_TRAVEL_UNDERCOVER, // Travel undercover to avoid detection + TASK_EXTRACT_INFO, // Extract information from a captured enemy or informant + TASK_AWAKEN_ANCIENT, // Awaken an ancient being or power + TASK_CLEAR_DUNGEON, // Clear a dungeon of enemies or traps + TASK_CONDUCT_RAID, // Conduct a raid on an enemy stronghold or village + TASK_INTERCEPT_CARGO, // Intercept a shipment of goods or weapons + TASK_BUILD_FORTRESS, // Build a fortress or stronghold + TASK_ENFORCE_QUARANTINE, // Enforce a quarantine in a plague-ridden area + TASK_MAINTAIN_MORALITY, // Maintain the morality or faith of a group + TASK_RECOVER_BODY, // Recover a fallen ally's body from a dangerous location + TASK_BRIBE_OFFICIAL, // Bribe an official to gain favor or bypass a law + TASK_PREVENT_WAR, // Prevent a war between factions or nations + TASK_INTERROGATE_PRISONER,// Interrogate a prisoner for vital information + TASK_FORGE_ALLIANCE, // Forge an alliance between warring factions + TASK_OPERATE_VEHICLE, // Operate a vehicle, such as a ship or airship + TASK_HARNESS_ELEMENT, // Harness the power of an elemental force + TASK_BREED_ANIMALS, // Breed animals for a specific purpose or trait + TASK_QUELL_REBELLION, // Quell a rebellion or uprising + TASK_RECRUIT_SOLDIERS, // Recruit soldiers for a military campaign + TASK_SEEK_REDEMPTION, // Seek redemption for past sins or failures + TASK_ESCAPE_DUNGEON, // Escape from a dungeon or prison + TASK_TRACK_ENEMY, // Track an enemy's movements and plans + TASK_REPAIR_SHIP, // Repair a damaged ship or vehicle + TASK_MANAGE_ECONOMY, // Manage the economy of a town or region + TASK_CONSTRUCT_TEMPLE, // Construct a temple or place of worship + TASK_DEVELOP_CURE, // Develop a cure for a deadly disease or poison + TASK_EXCAVATE_RUINS, // Excavate ruins to uncover lost artifacts or knowledge + TASK_BARTER, // Barter goods or services with NPCs or factions + TASK_COMPOSE_LETTER, // Compose an important letter or message + TASK_NAVIGATE_SEAS, // Navigate treacherous seas or waterways + TASK_PROTECT_SECRET, // Protect a secret from being discovered or revealed + TASK_DISRUPT_RITUAL, // Disrupt an enemy's ritual or ceremony + TASK_NEGOTIATE_PEACE, // Negotiate peace between warring factions + TASK_REPAIR_RELIC, // Repair a damaged or broken relic + TASK_DISCOVER_ARTIFACT, // Discover a lost or hidden artifact + TASK_LEAD_EXPEDITION, // Lead an expedition into unknown or dangerous territory + TASK_TRAIN_COMPANION, // Train a companion or pet in new skills + TASK_CONVERT_ENEMY, // Convert an enemy to your side or cause + TASK_GATHER_REINFORCEMENTS, // Gather reinforcements to aid in a battle + TASK_FREE_SLAVES, // Free slaves or captives from bondage + TASK_STOP_ASSASSINATION, // Stop an assassination attempt on an important NPC + TASK_DISCOVER_LORE, // Discover ancient lore or knowledge + TASK_HARVEST_CROPS, // Harvest crops from a field or farm + TASK_EXTEND_TERRITORY, // Extend the territory of a kingdom or faction + TASK_REPEL_ATTACK, // Repel an attack on a settlement or fortress + TASK_PERFORM_SABOTAGE, // Perform sabotage on enemy equipment or plans + TASK_HIDE_EVIDENCE, // Hide evidence of a crime or conspiracy + TASK_CAPTURE_ANIMAL, // Capture a wild or dangerous animal + TASK_DEFUSE_CONFLICT, // Defuse a conflict between NPCs or factions + TASK_CONFRONT_FEARS, // Confront and overcome personal fears or nightmares + TASK_PROTECT_TRADER, // Protect a trader on their journey through dangerous lands + TASK_EXPAND_INFLUENCE, // Expand the influence of your faction or cause + TASK_RESTORE_ANCIENT_ORDER, // Restore an ancient order or organization + TASK_INVESTIGATE_RUINS, // Investigate ancient ruins for clues or treasure + TASK_REINFORCE_WALLS, // Reinforce the walls of a castle or city + TASK_NAVIGATE_MOUNTAINS, // Navigate treacherous mountain paths + TASK_PURIFY_SOURCE, // Purify a corrupted or polluted source of water or power + TASK_HEAL_WOUNDED, // Heal the wounded after a battle or disaster + TASK_ENCHANT_ARMOR, // Enchant armor with magical properties + TASK_AVENGE_DEATH, // Avenge the death of a loved one or comrade + TASK_LEARN_SPELL, // Learn a new spell or magical ability + TASK_FORM_COVENANT, // Form a covenant with a powerful entity or faction + TASK_TRAVERSE_DESERT, // Traverse a dangerous desert region + TASK_OVERCOME_CURSE, // Overcome or lift a powerful curse + TASK_BATTLE_ARENA, // Battle in an arena for glory or rewards + TASK_LOCATE_PORTAL, // Locate a portal to another realm or dimension + TASK_MANAGE_VILLAGE, // Manage the affairs of a village or small town + TASK_NEGOTIATE_TRADE, // Negotiate trade agreements between factions + TASK_REPEL_MONSTER, // Repel a monster that threatens a town or settlement + TASK_CONDUCT_RITUAL, // Conduct a ritual to summon or banish a being + TASK_EXPLORE_CAVES, // Explore caves or underground tunnels + TASK_CRAFT_WEAPON, // Craft a weapon using special materials + TASK_CLEAR_FOREST, // Clear a forest of dangerous creatures or obstacles + TASK_REPAIR_MACHINERY, // Repair complex machinery or constructs + TASK_RETRIEVE_SCROLL, // Retrieve a lost or stolen scroll + TASK_DEFEND_CARGO, // Defend cargo during transport + TASK_RECOVER_LOST_ITEM, // Recover a lost or stolen item of importance + TASK_NAVIGATE_SWAMP, // Navigate through a treacherous swamp + TASK_EXORCISE_HAUNTING, // Exorcise a haunting from a location + TASK_INVOKE_ANCIENT_RITES, // Invoke ancient rites or rituals for protection or power + TASK_CONSTRUCT_BRIDGE, // Construct a bridge to cross a river or chasm + TASK_UNCOVER_HIDDEN_PATH,// Uncover a hidden path or secret passage + TASK_FIND_LOST_CITY, // Find a lost city or civilization + TASK_BIND_DEMON, // Bind a demon or spirit to prevent harm + TASK_CREATE_ARMOR, // Create armor for protection or battle + TASK_MAP_CAVERNS, // Map unexplored caverns or tunnels + TASK_LIFT_SIEGE, // Lift a siege on a city or fortress + TASK_NAVIGATE_JUNGLE, // Navigate through a dense jungle + TASK_PURGE_CORRUPTION, // Purge corruption from a person, place, or thing + TASK_RETRIEVE_REMAINS, // Retrieve the remains of a fallen ally or enemy + TASK_CREATE_AMULET, // Create a protective amulet or charm + TASK_RESOLVE_DISPUTE, // Resolve a dispute between NPCs or factions + TASK_STOP_REBELLION, // Stop a rebellion before it gains momentum + TASK_REPEL_HORDE, // Repel a horde of enemies attacking a settlement + TASK_EXAMINE_ARTIFACT, // Examine an artifact for clues or knowledge + TASK_ARRANGE_TREATY, // Arrange a treaty between warring factions + TASK_PROTECT_REFUGEES, // Protect refugees fleeing from war or disaster + TASK_INTERCEPT_SPY, // Intercept a spy before they deliver critical information + TASK_DISCOVER_NEW_LAND, // Discover new land for exploration or colonization + TASK_RESCUE_SURVIVORS, // Rescue survivors from a disaster or battle + TASK_CULTIVATE_CROPS, // Cultivate crops to ensure a harvest + TASK_REPAIR_WEAPON, // Repair a broken or damaged weapon + TASK_REPAIR_WEAPON, // Repair a broken or damaged weapon + TASK_CONDUCT_INVESTIGATION, // Conduct an investigation into a mystery or crime + TASK_DEFEND_VILLAGE, // Defend a village from invaders or monsters + TASK_INTERCEPT_COURIER, // Intercept a courier carrying important messages or items + TASK_PREPARE_DEFENSES, // Prepare defenses for an impending attack + TASK_SEEK_OUTLAW, // Seek and capture or eliminate an outlaw + TASK_CONVERT_FOLLOWERS, // Convert followers to a new faith or cause + TASK_SMUGGLE_GOODS, // Smuggle goods past enemy lines or authorities + TASK_PREPARE_RITUAL, // Prepare a complex ritual requiring multiple steps + TASK_REPAIR_ARMOR, // Repair damaged armor + TASK_CONDUCT_SURVEILLANCE, // Conduct surveillance on a target or location + TASK_ACQUIRE_BLUEPRINTS, // Acquire blueprints for a device or building + TASK_ESCORT_DIGNITARY, // Escort a dignitary through dangerous territory + TASK_RECRUIT_ALLIES, // Recruit allies to support your cause + TASK_CONSTRUCT_BARRACKS, // Construct barracks for housing soldiers + TASK_REPAIR_FORTIFICATIONS, // Repair damaged fortifications or walls + TASK_DEFUSE_AMBUSH, // Defuse an ambush set by enemies + TASK_GATHER_INTEL, // Gather intelligence on enemy positions or plans + TASK_CONDUCT_DIPLOMACY, // Conduct diplomatic negotiations with a foreign power + TASK_RETRIEVE_BLUEPRINTS,// Retrieve stolen or lost blueprints + TASK_INTERCEPT_SMUGGLERS,// Intercept smugglers transporting illegal goods + TASK_ESCAPE_PURSUIT, // Escape from pursuers tracking you or your group + TASK_REPAIR_GATE, // Repair a damaged or broken gate + TASK_CONSTRUCT_TOWER, // Construct a tower for defense or observation + TASK_RESUPPLY, // Resupply a forward base or outpost with necessary goods + TASK_CONDUCT_HEIST, // Conduct a heist to steal valuable items or information + TASK_NAVIGATE_MARSH, // Navigate through a dangerous marsh or bog + TASK_REPAIR_BRIDGE, // Repair a bridge to restore a critical route + TASK_DISRUPT_SMUGGLING, // Disrupt smuggling operations in a region + TASK_ENFORCE_LAW, // Enforce the law in a lawless area or situation + TASK_ESCORT_CONVOY, // Escort a convoy through dangerous territory + TASK_EXTINGUISH_FIRE, // Extinguish a fire threatening a village or forest + TASK_INVESTIGATE_MURDER, // Investigate a murder and find the culprit + TASK_GATHER_MEDICINE, // Gather medicine or herbs to treat the sick + TASK_REPEL_RAIDERS, // Repel raiders attacking a settlement + TASK_DEFEND_CITADEL, // Defend a citadel from an attacking force + TASK_RECRUIT_MERCENARIES,// Recruit mercenaries for a specific mission or battle + TASK_DISMANTLE_BOMB, // Dismantle a bomb or explosive device + TASK_RECONSTRUCT_EVENT, // Reconstruct events of a crime or mystery + TASK_CONDUCT_INTERVIEW, // Conduct an interview to gather information or clues + TASK_CLEAR_RUBBLE, // Clear rubble from a road, building, or path + TASK_DEFEND_TEMPLE, // Defend a temple from desecration or attack + TASK_CONSTRUCT_PALISADE, // Construct a palisade for temporary defense + TASK_OBTAIN_PERMIT, // Obtain a permit or authorization from authorities + TASK_EXAMINE_CORPSE, // Examine a corpse to determine cause of death + TASK_PROTECT_MERCHANT, // Protect a merchant from bandits or pirates + TASK_FIND_LOST_MAP, // Find a lost map leading to treasure or important locations + TASK_RECLAIM_POSSESSION, // Reclaim a possession taken by enemies or thieves + TASK_DISMANTLE_TRAP, // Dismantle a trap set by enemies + TASK_ACQUIRE_SEAL, // Acquire a seal of authority or authenticity + TASK_DEFEND_CARAVAN, // Defend a caravan traveling through dangerous territory + TASK_ESTABLISH_OUTPOST, // Establish an outpost in a remote or strategic location + TASK_RESOLVE_HOSTAGE_SITUATION, // Resolve a hostage situation peacefully or by force + TASK_REPAIR_WELL, // Repair a well to restore access to water + TASK_SALVAGE_SHIPWRECK, // Salvage a shipwreck for valuable goods or information + TASK_AVERT_DISASTER, // Avert a natural or magical disaster threatening a region + TASK_EXORCISE_SPIRIT, // Exorcise a malevolent spirit from a location or person + TASK_SMUGGLE_PERSON, // Smuggle a person out of a dangerous area + TASK_NAVIGATE_WILDERNESS, // Navigate through a dense and perilous wilderness + TASK_PROTECT_ARTISAN, // Protect an artisan while they complete a crucial task + TASK_REPAIR_ROAD, // Repair a road to ensure safe travel + TASK_COUNTER_INFILTRATION, // Counter enemy infiltration efforts within your ranks + TASK_RESCUE_SAILORS, // Rescue sailors stranded at sea or on a deserted island + TASK_RECLAIM_TERRITORY, // Reclaim territory lost to enemies or natural forces + TASK_DISPEL_ILLUSION, // Dispel an illusion hiding a truth or danger + TASK_RESOLVE_FEUD, // Resolve a feud between families, factions, or individuals + TASK_RETRIEVE_KEY, // Retrieve a key to unlock a door, chest, or magical barrier + TASK_DEFEND_FARMSTEAD, // Defend a farmstead from bandits or wild animals + TASK_CONSTRUCT_AQUEDUCT, // Construct an aqueduct to bring water to a settlement + TASK_FIND_LOST_CREW, // Find and rescue a lost or missing crew from a ship or expedition + TASK_EXCAVATE_TUNNEL, // Excavate a tunnel for mining or escape purposes + TASK_BOLSTER_MORALE, // Bolster the morale of troops or a community facing hardship + TASK_GUARD_PRISONER, // Guard a high-profile prisoner until their trial or transport + TASK_SECURE_RELIC, // Secure a relic of great power or significance from enemies + TASK_DEFEND_MARKET, // Defend a marketplace from thieves or invaders + TASK_GATHER_SUPPLIES, // Gather supplies for an upcoming expedition or siege + TASK_RECLAIM_WEAPONS, // Reclaim weapons stolen by enemies or lost in battle + TASK_CONDUCT_FORAGING, // Conduct foraging in the wilderness for food and resources + TASK_INVESTIGATE_OMEN, // Investigate an ominous sign or prophecy + TASK_RESCUE_DIPLOMAT, // Rescue a diplomat captured by hostile forces + TASK_PREPARE_SIEGE, // Prepare for a siege by gathering resources and fortifying defenses + TASK_CONSTRUCT_TREBUCHET, // Construct a trebuchet or other siege weapon + TASK_CONTAIN_PLAGUE, // Contain an outbreak of plague or disease in a community + TASK_SUBDUE_REVOLT, // Subdue a revolt among soldiers or civilians + TASK_EXAMINE_DOCUMENTS, // Examine documents for clues, forgery, or hidden information + TASK_RESCUE_VILLAGERS, // Rescue villagers taken captive by raiders or monsters + TASK_INTERCEPT_REINFORCEMENTS, // Intercept enemy reinforcements before they can reach the battlefield + TASK_DEFEND_LIBRARY, // Defend a library or archive from destruction or theft + TASK_REPAIR_WALL, // Repair a breach in a wall or fortification + TASK_GATHER_RESEARCH_MATERIALS, // Gather materials needed for important research + TASK_CONSTRUCT_BATTERING_RAM, // Construct a battering ram to breach enemy gates + TASK_NAVIGATE_CANYON, // Navigate through a dangerous canyon or ravine + TASK_DEFEND_TREASURY, // Defend a treasury from robbers or enemy forces + TASK_RESCUE_HOSTAGES, // Rescue multiple hostages from a heavily guarded location + TASK_RESTORE_HOPE, // Restore hope to a demoralized community or group + TASK_NEGOTIATE_RANSOM, // Negotiate the ransom for a captured ally or valuable item + TASK_REINFORCE_OUTPOST, // Reinforce a vulnerable outpost with troops and supplies + TASK_EXAMINE_ARTEFACT, // Examine an artifact for magical properties or historical significance + TASK_ESCAPE_TRAP, // Escape from a trap set by enemies or natural forces + TASK_CLEAR_INFESTATION, // Clear an infestation of dangerous creatures from a location + TASK_REPAIR_BRIDGE, // Repair a damaged bridge to restore travel routes + TASK_FORM_DEFENSIVE_PACT, // Form a defensive pact with another faction to deter aggression + TASK_CONTAIN_MAGIC, // Contain a runaway magical effect or creature + TASK_CONSTRUCT_WATCHTOWER, // Construct a watchtower to oversee strategic areas + TASK_SECURE_BORDERS, // Secure the borders of a territory against incursions + TASK_RECOVER_RELIC, // Recover a stolen or lost relic of great importance + TASK_CREATE_DIVERSION, // Create a diversion to distract enemies or draw them away + TASK_RESCUE_TRAPPED_MINERS, // Rescue miners trapped underground by a cave-in or collapse + TASK_CONFRONT_WARLORD, // Confront a warlord threatening regional stability + TASK_NEGOTIATE_ALLIANCE, // Negotiate an alliance with a powerful faction or group + TASK_DEFEND_WAYPOINT, // Defend a strategic waypoint from enemy control + TASK_RESCUE_SPY, // Rescue a spy who has been captured behind enemy lines + TASK_REPEL_SEIGE, // Repel a siege on a fortress or city + TASK_INTERCEPT_CARGO, // Intercept valuable cargo being transported by enemies + TASK_DEFEND_OUTPOST, // Defend an outpost from being overrun by enemies + TASK_ESCORT_PRISONERS, // Escort prisoners safely to their destination + TASK_SECURE_INTEL, // Secure vital intelligence from enemy hands + TASK_DEFEND_STRATEGIC_POINT, // Defend a strategic point critical to the overall battle plan + TASK_RETRIEVE_ENCHANTED_ITEM, // Retrieve an enchanted item from a guarded location + TASK_CONSTRUCT_TRENCH, // Construct a trench for defensive purposes in battle + TASK_PREPARE_AMBUSH, // Prepare an ambush against approaching enemies + TASK_DISCOVER_HIDDEN_TREASURE, // Discover hidden treasure in an unexplored area + TASK_RESCUE_ROYALTY, // Rescue a member of royalty from enemy capture + TASK_DEFEND_CAPITAL, // Defend the capital city from an invading force + TASK_RECOVER_ANCIENT_TEXTS, // Recover ancient texts containing lost knowledge + TASK_CONSTRUCT_CATAPULT, // Construct a catapult for siege warfare + TASK_DEFEND_BRIDGE, // Defend a bridge from enemy forces attempting to cross + TASK_CLEAR_RIVER_BLOCKAGE, // Clear a blockage in a river to restore water flow + TASK_REINFORCE_FORTRESS, // Reinforce a fortress under threat of attack + TASK_CONDUCT_ESPIONAGE, // Conduct espionage to gather enemy secrets or plans + TASK_EXAMINE_RUINS, // Examine ancient ruins for clues or artifacts + TASK_CONSTRUCT_FORT, // Construct a fort to secure a strategic location + TASK_RECOVER_STOLEN_GOODS, // Recover stolen goods from bandits or pirates + TASK_PREVENT_ASSASSINATION, // Prevent an assassination attempt on a key figure + TASK_RESCUE_KIDNAPPED_CHILD, // Rescue a kidnapped child from their captors + TASK_ESTABLISH_TRADE_ROUTE, // Establish a new trade route between distant regions + TASK_DEFEND_SETTLEMENT, // Defend a settlement from raiders or wild animals + TASK_REPAIR_DAMAGED_DAM, // Repair a dam that is at risk of collapsing + TASK_RESCUE_STRANDED_TRAVELERS, // Rescue stranded travelers from a remote location + TASK_DEFEND_CASTLE, // Defend a castle under siege by enemy forces + TASK_RETRIEVE_MAGIC_SCROLL, // Retrieve a powerful magic scroll from a dangerous location + TASK_CONSTRUCT_GATE, // Construct a gate to protect a town or city + TASK_REINFORCE_BRIDGE, // Reinforce a bridge to withstand heavy use or attack + TASK_EXAMINE_RELIC, // Examine a relic for hidden powers or dangers + TASK_CONSTRUCT_FENCE, // Construct a fence to keep animals or enemies out + TASK_NAVIGATE_STORMY_SEAS, // Navigate through stormy seas to reach a destination + TASK_EXAMINE_MAGICAL_ARTIFACT, // Examine a magical artifact to determine its purpose or power + TASK_CONSTRUCT_OUTPOST, // Construct an outpost in a strategic or remote location + TASK_RECOVER_SACRED_ITEM, // Recover a sacred item stolen from a temple or shrine + TASK_ESCORT_WOUNDED, // Escort wounded allies to a safe location for treatment + TASK_DEFEND_FORT, // Defend a fort from a concentrated enemy attack + TASK_REPAIR_TOWN_WALL, // Repair a damaged town wall to protect against invasion + TASK_RESOLVE_POLITICAL_DISPUTE, // Resolve a political dispute before it escalates into conflict + TASK_REPEL_INVADERS, // Repel invaders from a territory or settlement + TASK_CONSTRUCT_MOAT, // Construct a moat around a fortress or castle + TASK_ESCORT_SUPPLIES, // Escort supplies to a besieged location + TASK_DEFEND_BARRICADE, // Defend a barricade from being breached by enemies + TASK_RETRIEVE_LOST_TREASURE, // Retrieve lost treasure from a dangerous or hidden location + TASK_NAVIGATE_BLIZZARD, // Navigate through a blizzard to reach a destination safely + TASK_REPEL_ENEMY_SCOUTS, // Repel enemy scouts from discovering strategic positions + TASK_CONDUCT_RESCUE_OPERATION, // Conduct a rescue operation to save captured allies or civilians + TASK_DEFEND_TOWER, // Defend a tower from enemy assault + TASK_CONSTRUCT_DEFENSIVE_POSITION, // Construct a defensive position to prepare for an imminent attack + TASK_INTERCEPT_ENEMY_COMMANDER, // Intercept an enemy commander to disrupt their plans + TASK_ESTABLISH_COMMUNICATION_LINE, // Establish a communication line between distant allies or outposts + TASK_DEFEND_RIVER_CROSSING, // Defend a river crossing from enemy control + TASK_RETRIEVE_ANCIENT_WEAPON, // Retrieve an ancient weapon of great power from a guarded location + TASK_ESCORT_CIVILIANS, // Escort civilians to safety during a crisis + TASK_REPAIR_SHIP_HULL, // Repair a ship's hull to prevent it from sinking + TASK_DEFEND_FERRY, // Defend a ferry from bandits or pirates during a crossing + TASK_RESCUE_ABDUCTED_PRIEST, // Rescue an abducted priest from a hostile cult + TASK_CONSTRUCT_RAMPARTS, // Construct ramparts to strengthen a defensive position + TASK_CLEAR_CAVE_IN, // Clear a cave-in to rescue trapped miners or adventurers + TASK_DEFEND_ARCHIVE, // Defend an archive containing valuable records or artifacts + TASK_REINFORCE_WATCHTOWER, // Reinforce a watchtower to improve surveillance and defense + TASK_REPEL_ENEMY_BOARDERS, // Repel enemy boarders attempting to seize control of a ship + TASK_ESTABLISH_DEFENSIVE_RING, // Establish a defensive ring to protect a key location + TASK_RECOVER_LOST_MANUSCRIPT, // Recover a lost manuscript of significant importance + TASK_CONSTRUCT_BULWARK, // Construct a bulwark to provide extra defense against attacks + TASK_NAVIGATE_TREACHEROUS_TERRAIN, // Navigate treacherous terrain to reach an objective + TASK_REPEL_ENEMY_PATROL, // Repel an enemy patrol from gaining information or territory + TASK_CONDUCT_DEFENSIVE_DRILL, // Conduct a defensive drill to prepare for potential attacks + TASK_REINFORCE_STRATEGIC_POSITION, // Reinforce a strategic position to prevent enemy advance + TASK_RESCUE_MISSING_SCOUTS, // Rescue scouts who have gone missing behind enemy lines + TASK_SECURE_WATER_SUPPLY, // Secure a water supply crucial for a settlement's survival + TASK_DEFEND_BORDERS, // Defend the borders of a kingdom or territory from incursions + TASK_REPAIR_DOCKS, // Repair docks to ensure ships can safely dock and unload supplies + TASK_RECLAIM_ANCIENT_CITADEL, // Reclaim an ancient citadel taken over by enemies + TASK_DEFEND_PORT, // Defend a port city from enemy naval forces + TASK_CONDUCT_SAFETY_INSPECTION, // Conduct a safety inspection of critical infrastructure + TASK_REPAIR_DAMAGED_MONUMENT, // Repair a damaged monument of cultural or historical significance + TASK_CONSTRUCT_BARRIERS, // Construct barriers to slow down or block enemy movement + TASK_DEFEND_STRONGHOLD, // Defend a stronghold from a major enemy offensive + TASK_REPEL_NAVAL_INVASION, // Repel a naval invasion threatening coastal defenses + TASK_ESTABLISH_TRADE_AGREEMENT, // Establish a trade agreement between distant kingdoms + TASK_RESCUE_ABANDONED_CHILDREN, // Rescue abandoned children left in a dangerous area + TASK_REINFORCE_CITY_WALLS, // Reinforce city walls to withstand a prolonged siege + TASK_CONDUCT_COVERT_OP, // Conduct a covert operation behind enemy lines + TASK_DEFEND_HIGHLANDS, // Defend the highlands from encroaching enemy forces + TASK_RECOVER_LOST_ARTIFACT, // Recover a lost artifact with significant power + TASK_CONSTRUCT_MOUNTAIN_PASS, // Construct a mountain pass to improve travel and trade routes + TASK_RESCUE_ENDANGERED_ANIMALS, // Rescue endangered animals from poachers or habitat destruction + TASK_DEFEND_AGAINST_RAID, // Defend a settlement against a raid from bandits or enemy troops + TASK_RECLAIM_STOLEN_PROPERTY, // Reclaim stolen property taken by criminals or rival factions + TASK_REPAIR_CITADEL_DEFENSES, // Repair the defenses of a citadel under threat + TASK_CONDUCT_STRATEGIC_RETREAT, // Conduct a strategic retreat to regroup and fortify + TASK_REPEL_FOREST_INVASION, // Repel an invasion of hostile forces in a forested area + TASK_RESCUE_TRAPPED_SOLDIERS, // Rescue soldiers trapped behind enemy lines or in a collapsed structure + TASK_DEFEND_HILLTOP, // Defend a hilltop position from enemy forces trying to gain the high ground + TASK_ESTABLISH_BORDER_OUTPOST, // Establish an outpost on the border to monitor enemy movements + TASK_RETRIEVE_ABANDONED_SUPPLIES, // Retrieve abandoned supplies left in a dangerous location + TASK_DEFEND_WINDMILL, // Defend a windmill from being sabotaged or destroyed + TASK_RESCUE_DOWNED_PILOT, // Rescue a downed pilot stranded in enemy territory + TASK_REINFORCE_FORTIFIED_POSITION, // Reinforce a fortified position to prepare for a heavy attack + TASK_CONSTRUCT_NAVAL_BASE, // Construct a naval base to strengthen maritime defenses + TASK_SECURE_FOREST_EDGE, // Secure the edge of a forest to prevent enemy infiltration + TASK_RECOVER_ROYAL_HEIRLOOM, // Recover a royal heirloom of immense value and significance + TASK_DEFEND_MOUNTAIN_PASS, // Defend a mountain pass from being overtaken by enemy forces + TASK_REPAIR_BARRACKS, // Repair barracks to house soldiers or refugees + TASK_ESTABLISH_SUPPLY_DEPOT, // Establish a supply depot to support ongoing operations + TASK_REPEL_SEA_MONSTER, // Repel a sea monster attacking ships or coastal settlements + TASK_RESCUE_ABANDONED_ANIMALS, // Rescue abandoned animals left in a dangerous area + TASK_DEFEND_OUTSKIRTS, // Defend the outskirts of a town or city from enemy raids + TASK_RECOVER_MAGIC_CRYSTAL, // Recover a magic crystal stolen by enemies + TASK_CONDUCT_NIGHT_RAID, // Conduct a night raid on an enemy camp or supply line + TASK_REPEL_BORDER_INCURSION, // Repel an enemy incursion across the border + TASK_REPAIR_RIVER_DAM, // Repair a river dam to prevent flooding + TASK_SECURE_ANCIENT_TOMB, // Secure an ancient tomb from grave robbers or enemies + TASK_RESCUE_CIVILIANS_FROM_CONFLICT_ZONE, // Rescue civilians caught in a conflict zone + TASK_DEFEND_TRADE_ROUTE, // Defend a trade route from bandits or hostile forces + TASK_RECOVER_ENEMY_PLANS, // Recover enemy plans to prevent them from executing their strategy + TASK_CONSTRUCT_OBSERVATION_POST, // Construct an observation post to monitor enemy activity + TASK_SECURE_SECRET_PASSAGE, // Secure a secret passage to ensure safe travel or escape + TASK_REPEL_INVADING_ARMY, // Repel an invading army from your homeland + TASK_REPAIR_FISHING_VILLAGE, // Repair a fishing village after a storm or raid + TASK_RESCUE_PRISONERS_OF_WAR, // Rescue prisoners of war held by the enemy + TASK_DEFEND_COASTLINE, // Defend a coastline from enemy landings or raids + TASK_CONDUCT_COUNTERINTELLIGENCE, // Conduct counterintelligence to prevent enemy espionage + TASK_REINFORCE_SEIGE_DEFENSES, // Reinforce defenses during an ongoing siege + TASK_CONSTRUCT_SUPPLY_LINE, // Construct a supply line to maintain troop morale and effectiveness + TASK_RESOLVE_DISPUTE_OVER_TERRITORY, // Resolve a dispute between factions over territorial claims + TASK_REPEL_NIGHT_ATTACK, // Repel a night attack by enemy forces + TASK_REPAIR_TEMPLE_SHRINE, // Repair a temple or shrine damaged by conflict or disaster + TASK_DEFEND_MOUNTAIN_FORTRESS, // Defend a mountain fortress from a major offensive + TASK_CONDUCT_LONG_RANGE_RECONNAISSANCE, // Conduct long-range reconnaissance to gather critical intel + TASK_RECLAIM_ABANDONED_FORT, // Reclaim an abandoned fort from enemies or wild creatures + TASK_RESCUE_SHIPWRECKED_CREW, // Rescue a crew stranded after a shipwreck + TASK_DEFEND_WAR_CAMP, // Defend a war camp from enemy sabotage or attack + TASK_CONSTRUCT_WATCHTOWER_NETWORK, // Construct a network of watchtowers for enhanced surveillance + TASK_REPEL_SKIRMISHERS, // Repel skirmishers attempting to harass your forces + TASK_REPAIR_BATTLEFIELD_DEFENSES, // Repair battlefield defenses during or after an engagement + TASK_RECOVER_LOST_SCOUTS, // Recover scouts who have been lost or captured during a mission + TASK_DEFEND_HARBOR, // Defend a harbor from a naval or amphibious assault + TASK_ESTABLISH_SAFEHOUSE, // Establish a safehouse for intelligence or resistance operations + TASK_REINFORCE_BATTALION, // Reinforce a battalion under heavy attack or low on morale + TASK_REPEL_AMBUSH, // Repel an ambush set by enemies during a march or expedition + TASK_REPAIR_TREBUCHET, // Repair a trebuchet damaged during siege warfare + TASK_DEFEND_TRADING_POST, // Defend a trading post from bandits or hostile forces + TASK_RESCUE_ARTISAN, // Rescue an artisan kidnapped to force them into making weapons or art + TASK_CONSTRUCT_BATTERY, // Construct a battery of artillery or defensive weapons + TASK_RECOVER_STOLEN_DOCUMENTS, // Recover documents stolen by enemy spies or thieves + TASK_DEFEND_BARRACKS, // Defend barracks housing soldiers or important personnel + TASK_SECURE_ESCAPE_ROUTE, // Secure an escape route for retreating forces or refugees + TASK_REPEL_DESERT_RAIDERS, // Repel raiders attacking from a desert region + TASK_REPAIR_CATAPULT, // Repair a catapult damaged in combat or through sabotage + TASK_DEFEND_DESERT_OASIS, // Defend a desert oasis from hostile forces or nomads + TASK_CONDUCT_TUNNEL_INSPECTION, // Conduct an inspection of tunnels to prevent collapses or enemy use + TASK_RECOVER_WOUNDED_ALLIES, // Recover wounded allies from the battlefield + TASK_CONSTRUCT_TRENCH_SYSTEM, // Construct a trench system for defense or assault preparation + TASK_SECURE_MOUNTAIN_PEAK, // Secure a mountain peak for observation or tactical advantage + TASK_REPEL_SWAMP_CREATURES, // Repel creatures attacking from a nearby swamp + TASK_DEFEND_FOREST_GROVE, // Defend a forest grove sacred to local inhabitants or druidic orders + TASK_RESCUE_HISTORIAN, // Rescue a historian who has been captured or lost in a dangerous area + TASK_CONSTRUCT_DEFENSIVE_FORTIFICATIONS, // Construct defensive fortifications to protect against invasions + TASK_REPEL_WILDERNESS_ATTACK, // Repel an attack by hostile forces emerging from the wilderness + TASK_REPAIR_RAMPARTS, // Repair ramparts damaged during an ongoing siege or conflict + TASK_SECURE_STRATEGIC_HILL, // Secure a hilltop offering a strategic advantage in battle + TASK_DEFEND_BORDER_FORT, // Defend a fort on the border of enemy territory + TASK_RESOLVE_CONFLICT_BETWEEN_CLANS, // Resolve a conflict between rival clans threatening regional stability + TASK_REPEL_FOREST_RAIDERS, // Repel raiders attacking from the forest or jungle + TASK_CONDUCT_DEEP_RECONNAISSANCE, // Conduct deep reconnaissance into enemy territory + TASK_RECLAIM_OCCUPIED_TERRITORY, // Reclaim territory occupied by enemy forces or hostile creatures + TASK_SECURE_RIVERBANK, // Secure a riverbank to prevent enemy crossings or incursions + TASK_DEFEND_SECRET_ENTRANCE, // Defend a secret entrance to a hidden base or stronghold + TASK_RECOVER_FORGOTTEN_KNOWLEDGE, // Recover knowledge lost to time or hidden in ancient texts + TASK_REPEL_MOUNTAIN_BANDITS, // Repel bandits attacking from the mountains + TASK_RESCUE_MYSTIC, // Rescue a mystic or seer captured by enemies or cultists + TASK_CONSTRUCT_SPY_NETWORK, // Construct a network of spies to gather intelligence across a region + TASK_DEFEND_ANCIENT_TEMPLE, // Defend an ancient temple from looters or invading forces + TASK_REPAIR_ANCIENT_MONUMENT, // Repair an ancient monument of cultural or historical significance + TASK_SECURE_FOREST_PASSAGE, // Secure a passage through a dense or enchanted forest + TASK_RECOVER_STOLEN_TREASURE, // Recover treasure stolen by thieves or rival factions + TASK_REPEL_JUNGLE_BEASTS, // Repel beasts attacking from a jungle or tropical region + TASK_DEFEND_ANCIENT_LIBRARY, // Defend an ancient library from being ransacked or destroyed + TASK_CONSTRUCT_FORTRESS_GATE, // Construct a gate to secure a fortress or walled city + TASK_RESOLVE_CIVIL_UPRISING, // Resolve a civil uprising threatening stability in a city or region + TASK_REPEL_MARAUDERS, // Repel marauders attacking villages or supply lines + TASK_CONDUCT_SEARCH_AND_DESTROY, // Conduct a search and destroy mission against a specific target + TASK_RECOVER_LIFESAVING_MEDICINE, // Recover life-saving medicine from a dangerous or remote location + TASK_DEFEND_SHIPPING_LANES, // Defend shipping lanes from pirates or enemy navies + TASK_RESCUE_CAPTURED_LEADER, // Rescue a captured leader before they are executed or turned against you + TASK_SECURE_FORTIFIED_CAMP, // Secure a camp heavily fortified but under threat of attack + TASK_REPEL_ENEMY_RAID, // Repel an enemy raid on your base or territory + TASK_REPAIR_BREACHED_WALL, // Repair a wall breached by enemy forces during an assault + TASK_DEFEND_WATER_SUPPLY, // Defend a water supply from being poisoned or cut off + TASK_RECOVER_DANGEROUS_ARTIFACT, // Recover an artifact that could cause great harm if left in the wrong hands + TASK_CONDUCT_RECON_MISSION, // Conduct a reconnaissance mission to gather vital information + TASK_RECLAIM_ABANDONED_MINE, // Reclaim an abandoned mine overrun by enemies or dangerous creatures + TASK_REPEL_WINTER_OFFENSIVE, // Repel a winter offensive launched by the enemy + TASK_DEFEND_TRADING_HUB, // Defend a trading hub crucial for economic stability + TASK_SECURE_SECRET_DOCUMENTS, // Secure documents that contain secret or sensitive information + TASK_RECOVER_STOLEN_HORSES, // Recover horses stolen by bandits or enemy forces + TASK_CONSTRUCT_WATCHTOWER_AT_BORDER, // Construct a watchtower at the border for surveillance and defense + TASK_REPEL_NAVAL_RAIDERS, // Repel raiders attacking from the sea or river + TASK_DEFEND_BORDER_WATCHTOWER, // Defend a border watchtower from being overrun by enemy forces + TASK_RESCUE_CAPTIVE_CHILDREN, // Rescue children taken captive by enemies or slavers + TASK_RECOVER_STOLEN_IDOLS, // Recover idols stolen from a temple or sacred site + TASK_DEFEND_MINING_OPERATION, // Defend a mining operation from hostile forces or sabotage + TASK_CONSTRUCT_SIEGE_ENGINE, // Construct a siege engine for an upcoming battle + TASK_REPEL_ENEMY_CHAMPION, // Repel an enemy champion challenging your forces or territory + TASK_SECURE_SMUGGLER_ROUTE, // Secure a smuggler's route to prevent illegal trade or enemy infiltration + TASK_DEFEND_TOWN_HALL, // Defend the town hall from an insurrection or attack + TASK_RESCUE_ABANDONED_WAGON, // Rescue a wagon left behind in enemy territory or dangerous conditions + TASK_RECOVER_MAGIC_AMULET, // Recover a magic amulet of significant power or importance + TASK_REPEL_BARBARIAN_RAID, // Repel a raid by barbarian tribes attacking a settlement or outpost + TASK_DEFEND_SUPPLY_CONVOY, // Defend a supply convoy transporting crucial goods + TASK_RECLAIM_HOLY_SITE, // Reclaim a holy site taken over by enemies or desecrated by invaders + TASK_SECURE_TRADE_AGREEMENT, // Secure a trade agreement to strengthen economic ties between regions + TASK_REPEL_ENEMY_VANGUARD, // Repel an enemy vanguard seeking to establish a foothold + TASK_DEFEND_FARM, // Defend a farm from being raided or destroyed + TASK_RECOVER_LAWLESS_TERRITORY, // Recover a territory overrun by outlaws or bandits + TASK_REPAIR_FORTRESS_WALL, // Repair a damaged fortress wall to prevent further breaches + TASK_CONSTRUCT_CITY_GATE, // Construct a gate to secure a city or major settlement + TASK_REPEL_ENEMY_INVADERS, // Repel enemy invaders from your territory or homeland + TASK_DEFEND_MOUNTAIN_OUTPOST, // Defend a mountain outpost from being overtaken by enemies + TASK_RECLAIM_ANCIENT_WEAPON, // Reclaim an ancient weapon lost or hidden in enemy territory + TASK_SECURE_VALLEY_PASSAGE, // Secure a valley passage critical for movement or trade + TASK_REPEL_SWAMP_RAIDERS, // Repel raiders attacking from a swampy region + TASK_CONSTRUCT_HILL_FORT, // Construct a fort on a hill for strategic defense + TASK_REPAIR_MILITARY_BASE, // Repair a military base damaged by enemy action + TASK_DEFEND_ANCIENT_FORT, // Defend an ancient fort from modern threats + TASK_RECOVER_ENCHANTED_TALISMAN, // Recover an enchanted talisman from a dangerous location + TASK_REPEL_NOMADIC_RAID, // Repel a raid by nomadic tribes + TASK_SECURE_OLD_CASTLE, // Secure an old castle to use as a stronghold + TASK_CONDUCT_EVACUATION, // Conduct an evacuation of civilians from a dangerous area + TASK_DEFEND_RURAL_VILLAGE, // Defend a rural village from raiders or invaders + TASK_RETRIEVE_HIDDEN_TREASURE, // Retrieve treasure hidden in a well-guarded location + TASK_CONSTRUCT_BUNKERS, // Construct bunkers for troops or civilians + TASK_REPAIR_BATTLEFIELD_EQUIPMENT, // Repair equipment used in recent battles + TASK_DEFEND_TEMPLE, // Defend a temple from desecration or attack + TASK_REPEL_INVADING_HORDES, // Repel hordes of enemies attacking from multiple directions + TASK_SECURE_SUPPLY_ROUTE, // Secure a route used for transporting supplies + TASK_RECOVER_ANTIQUITIES, // Recover valuable antiquities from thieves or looters + TASK_DEFEND_TREASURE_VAULT, // Defend a vault containing valuable treasure + TASK_CONSTRUCT_FIELD_DEFENSES, // Construct defenses in an open field to resist an assault + TASK_REPAIR_OLD_WATCHTOWER, // Repair an old watchtower for improved surveillance + TASK_REPEL_SIEGE_WEAPONS, // Repel enemy siege weapons targeting your defenses + TASK_SECURE_ENCHANTED_FOREST, // Secure a forest with magical properties from intruders + TASK_DEFEND_REMOTE_OUTPOST, // Defend a remote outpost from encroaching enemies + TASK_REPAIR_MAGE_TOWER, // Repair a tower used by mages for their magical operations + TASK_RECOVER_VITAL_SUPPLIES, // Recover essential supplies lost or stolen in conflict + TASK_CONSTRUCT_DEFENSIVE_GATES, // Construct gates to enhance the defense of a fortification + TASK_REPEL_CLAN_WARLORD, // Repel a warlord leading a clan assault + TASK_DEFEND_HISTORICAL_SITE, // Defend a site of historical significance from destruction + TASK_REPAIR_FORTIFIED_WALLS, // Repair walls of a fortification to restore its defensive capability + TASK_SECURE_TACTICAL_POSITION, // Secure a position of tactical importance in an ongoing conflict + TASK_RECOVER_STOLEN_EQUIPMENT, // Recover equipment stolen by enemies or thieves + TASK_DEFEND_CIVILIAN_CONVOY, // Defend a convoy of civilians traveling through dangerous areas + TASK_CONSTRUCT_REINFORCED_BARRICADES, // Construct barricades reinforced for extra protection + TASK_REPEL_WILD_CREATURES, // Repel wild creatures threatening settlements or supply lines + TASK_DEFEND_IMPORTANT_BRIDGE, // Defend a bridge critical for transportation and defense + TASK_RECOVER_ENEMY_WEAPONS, // Recover weapons lost or captured from the enemy + TASK_SECURE_HIDDEN_LAIR, // Secure a hidden lair from intruders or hostile forces + TASK_REPAIR_DAMAGED_PALACE, // Repair a palace damaged by conflict or disaster + TASK_DEFEND_CULTURAL_CENTER, // Defend a cultural center from attack or vandalism + TASK_CONSTRUCT_SHIELD_WALL, // Construct a shield wall to protect against a siege or assault + TASK_REPEL_TROLLS, // Repel trolls attacking from mountainous or rocky terrain + TASK_RECOVER_ANCIENT_SCROLLS, // Recover ancient scrolls from a protected location + TASK_DEFEND_FOREST_VILLAGE, // Defend a village situated within a dense forest from invaders + TASK_REPAIR_MYSTIC_OBELISK, // Repair a mystic obelisk of significance to local magical traditions + TASK_CONSTRUCT_FORTRESS_TOWER, // Construct a tower within a fortress for better defense and observation + TASK_SECURE_ABANDONED_OUTPOST, // Secure an outpost that was previously abandoned + TASK_DEFEND_NATIONAL_MONUMENT, // Defend a monument of national importance from damage or theft + TASK_RECOVER_HEIRLOOM_WEAPON, // Recover a weapon of significant familial or historical value + TASK_CONDUCT_STRATEGIC_SURVEY, // Conduct a survey to assess strategic locations and conditions + TASK_REPEL_DARK_MAGIC_USERS, // Repel dark magic users attempting to infiltrate or attack + TASK_SECURE_HIDDEN_TREASURE, // Secure treasure hidden in a secret location + TASK_DEFEND_RITUAL_SITE, // Defend a site used for important rituals from disruption or attack + TASK_REPAIR_MAGICAL_BARRIER, // Repair a magical barrier protecting a critical location + TASK_CONSTRUCT_ARTILLERY_EMPLACEMENTS, // Construct emplacements for artillery to enhance defensive capabilities + TASK_RECOVER_ANCESTRAL_TREASURE, // Recover treasure passed down through generations from a safe location + TASK_DEFEND_MYSTICAL_SPRING, // Defend a mystical spring with significant magical properties + TASK_REPAIR_AIRSHIP, // Repair an airship damaged during aerial conflict or travel + TASK_SECURE_AIRSPACE, // Secure airspace from aerial threats or intrusions + TASK_CONDUCT_MASS_EVACUATION, // Conduct an evacuation of a large population from a threatened area + TASK_DEFEND_VITAL_INFRASTRUCTURE, // Defend critical infrastructure from sabotage or attack + TASK_RECOVER_DAMAGED_ARTIFACTS, // Recover artifacts damaged during conflicts or raids + TASK_CONSTRUCT_REPAIR_STATIONS, // Construct stations for repairing equipment or fortifications + TASK_REPEL_CULT_INVADERS, // Repel invaders from a cult or religious faction + TASK_SECURE_ANCIENT_TREASURE_TROVE, // Secure a trove of ancient treasures from being plundered + TASK_DEFEND_ELITE_TROOPS, // Defend a unit of elite troops from enemy assault or capture + TASK_REPAIR_FORTRESS_CANNONS, // Repair cannons within a fortress to restore their effectiveness + TASK_CONSTRUCT_REINFORCED_BUNKERS, // Construct bunkers with additional reinforcement for strategic protection + TASK_RECOVER_ILLUMINATED_MANUSCRIPTS, // Recover manuscripts with illuminated texts of great value + TASK_DEFEND_SECRET_BASE, // Defend a base hidden from enemy eyes from being discovered or attacked + TASK_REPAIR_DEFENSIVE_TURRETS, // Repair turrets used for defending against enemy attacks + TASK_SECURE_HIGHLY_ENCHANTED_ITEM, // Secure an item of significant magical enchantment + TASK_CONDUCT_ELITE_STRIKE_MISSION, // Conduct a high-risk strike mission with elite operatives + TASK_DEFEND_AGAINST_MAGIC_ATTACKS, // Defend against magical attacks from enemy spellcasters + TASK_RECOVER_HISTORICAL_RELICS, // Recover relics of historical importance from a secure location + TASK_REPAIR_ANCIENT_DEFENSES, // Repair ancient defenses to restore their original protective capability + TASK_CONSTRUCT_MAGICALLY_ENCHANTED_BARRIERS, // Construct barriers with magical enchantments for enhanced defense + TASK_DEFEND_CULTURAL_HERITAGE, // Defend a site of cultural heritage from being attacked or damaged + TASK_SECURE_VITAL_MAGIC_ARTIFACT, // Secure a magic artifact crucial to your forces or plans + TASK_REPAIR_DILAPIDATED_KEEP, // Repair a keep that has fallen into disrepair and disuse + TASK_DEFEND_CRUCIAL_RESOURCE, // Defend a resource essential for survival or strategic advantage + TASK_RECOVER_FAMOUS_BATTLE_STANDARD, // Recover a battle standard of historic significance + TASK_CONSTRUCT_TACTICAL_FORTIFICATIONS, // Construct fortifications designed for tactical advantage in battle + TASK_SECURE_ENCHANTED_WEAPONS, // Secure weapons imbued with enchantments from falling into enemy hands + TASK_REPEL_ARMORED_RAIDERS, // Repel raiders equipped with heavy armor and advanced weaponry + TASK_DEFEND_RITUAL_ALTAR, // Defend an altar used for significant rituals from desecration + TASK_RECOVER_MAGICAL_ENCHANTMENTS, // Recover enchantments lost or stolen from magical artifacts + TASK_REPAIR_UNDERGROUND_BUNKERS, // Repair bunkers located underground to ensure their functionality + TASK_CONSTRUCT_MAGICAL_OBELISKS, // Construct obelisks with magical properties for enhanced defense or power + TASK_DEFEND_VITAL_WAREHOUSE, // Defend a warehouse holding essential supplies or equipment + TASK_RECOVER_ANCESTRAL_ARTIFACTS, // Recover artifacts with ancestral or cultural importance + TASK_REPAIR_ENCHANTED_FORGE, // Repair a forge used for creating enchanted items + TASK_SECURE_COVERT_OPERATION_BASE, // Secure a base used for covert operations and intelligence gathering + TASK_DEFEND_COVERT_MEETING_PLACE, // Defend a location used for secret meetings from discovery or attack + TASK_RECOVER_ANCIENT_TEXTS, // Recover ancient texts of great knowledge + TASK_CONSTRUCT_ELITE_DEFENSIVE_LINE, // Construct a defensive line designed to withstand elite enemy forces + TASK_DEFEND_VITAL_TRANSPORT_HUB, // Defend a transport hub crucial for logistics and troop movement + TASK_SECURE_MYSTICAL_ARTIFACTS, // Secure artifacts with mystical properties from being stolen or destroyed + TASK_RECOVER_COVERT_DOCUMENTS, // Recover documents related to secret operations or intelligence + TASK_REPAIR_OBSOLETE_TURRETS, // Repair outdated turrets to bring them back into operational use + TASK_DEFEND_ENCHANTED_LIBRARY, // Defend a library containing powerful or magical knowledge from attack + TASK_CONSTRUCT_RITUAL_DEFENSES, // Construct defenses specifically designed to protect sacred or ritual sites + TASK_REPEL_INVASION_FROM_THE_SEA, // Repel an invasion force approaching by sea + TASK_SECURE_ANCIENT_TEMPLE_GATES, // Secure the gates of an ancient temple to prevent unauthorized access + TASK_RECOVER_SCARCE_RESOURCES, // Recover resources that are rare or critical for your operations + TASK_DEFEND_LANDMARK_STRUCTURE, // Defend a landmark structure of great significance from damage or occupation + TASK_CONSTRUCT_FORTIFIED_PERIMETER, // Construct a fortified perimeter around a key installation or settlement + TASK_REPAIR_CRUCIAL_COMMUNICATIONS, // Repair communication systems vital for coordinating defense or operations + TASK_SECURE_ENCHANTED_BARRIERS, // Secure barriers enhanced with magical protections from being breached + TASK_DEFEND_AIRBORNE_OPERATIONS, // Defend operations involving airborne units or assets from enemy interference + TASK_RECOVER_HISTORICAL_STATUES, // Recover statues of historical importance from potential damage or theft + TASK_REPAIR_MAGICAL_CONDUITS, // Repair conduits used to channel magical energy or spells + TASK_CONSTRUCT_REINFORCED_TRENCHE, // Construct a trench with additional reinforcements for better protection + TASK_SECURE_MYSTICAL_FOREST, // Secure a forest imbued with mystical properties from intruders + TASK_DEFEND_KEY_TRADING_POST, // Defend a trading post crucial for commerce and supply routes + TASK_RECOVER_ANCIENT_SCROLLS, // Recover ancient scrolls containing important historical or magical information + TASK_CONDUCT_HIGH_STAKES_NEGOTIATIONS, // Conduct negotiations of great importance to resolve conflicts or secure alliances + TASK_DEFEND_AGAINST_NECROMANCY, // Defend against necromantic forces or magic targeting your forces or territory + TASK_REPAIR_EARTHEN_WALLS, // Repair earthen walls that have been damaged or breached + TASK_SECURE_HIDDEN_MINE, // Secure a hidden mine containing valuable resources or artifacts + TASK_RECOVER_WOUNDED_VETERANS, // Recover and provide aid to wounded veterans from recent conflicts + TASK_DEFEND_ANCIENT_SHRINE, // Defend an ancient shrine from desecration or attack + TASK_CONSTRUCT_MAGICAL_WARDS, // Construct wards to protect against magical attacks or intrusions + TASK_REPAIR_HISTORICAL_BUILDINGS, // Repair buildings of historical importance damaged in recent events + TASK_SECURE_FORTIFIED_OUTPOST, // Secure an outpost with fortifications to prevent enemy capture + TASK_DEFEND_VITAL_CROSSROADS, // Defend a crossroads critical for movement and supply routes + TASK_RECOVER_DAMAGED_RITUAL_ARTIFACTS, // Recover artifacts used in rituals that have been damaged or lost + TASK_REPAIR_ENCHANTED_GATES, // Repair gates enhanced with magical protections to restore their functionality + TASK_CONSTRUCT_STRATEGIC_OBSERVATION_POSTS, // Construct posts for strategic observation of enemy movements and positions + TASK_SECURE_VITAL_WEAPONSTOCKS, // Secure stocks of vital weapons from being seized or destroyed + TASK_DEFEND_CRUCIAL_FORTIFICATION, // Defend a fortification crucial for maintaining control over a region + TASK_RECOVER_ANCIENT_WEAPONS, // Recover weapons of ancient origin with significant power or historical value + TASK_REPAIR_CIVILIAN_INFRASTRUCTURE, // Repair infrastructure essential for civilian life and support + TASK_SECURE_CRITICAL_LANDMARKS, // Secure landmarks of great strategic or symbolic importance from threat + TASK_DEFEND_AGAINST_SPY_INTRUSION, // Defend against espionage attempts targeting sensitive areas or information + TASK_RECOVER_SENSITIVE_DATA, // Recover data critical to operations or security from compromised sources + TASK_CONSTRUCT_ENCHANTED_CAVERN_DEFENSES, // Construct defenses within a cavern with magical enchantments + TASK_REPAIR_TREASURE_VAULTS, // Repair vaults used to store valuable treasures and artifacts + TASK_SECURE_GREAT_LIBRARY, // Secure a large library holding extensive and valuable knowledge + TASK_DEFEND_INFLUENTIAL_LEADER, // Defend a leader of great influence from threats or attempts on their life + TASK_RECOVER_CRITICAL_MEDICAL_SUPPLIES, // Recover medical supplies essential for treatment and recovery + TASK_REPAIR_DAMAGED_BATTLEFIELD_STRATEGY, // Repair and adjust strategies used on the battlefield based on recent damage + TASK_CONSTRUCT_ELITE_PROTECTIVE_ARMOR, // Construct armor designed for elite troops or high-value targets + TASK_SECURE_ANCIENT_SECRET_TREASURE, // Secure treasure hidden in ancient locations of historical importance + TASK_DEFEND_HIDDEN_MILITARY_BASE, // Defend a secret military base from discovery or attack + TASK_RECOVER_DAMAGED_MAGIC_ITEMS, // Recover magic items damaged during recent conflicts or raids + TASK_REPAIR_BATTLEFIELD_ARTIFACTS, // Repair artifacts found on the battlefield essential for historical or strategic reasons + TASK_CONSTRUCT_PROTECTIVE_RUNES, // Construct runes for protection against magical or physical threats + TASK_SECURE_LEGENDARY_SITES, // Secure sites of legendary significance from threats or exploitation + TASK_DEFEND_STRATEGIC_TRADE_ROUTE, // Defend a trade route vital for commerce and resource distribution + TASK_RECOVER_MYSTICAL_ARTIFACTS, // Recover artifacts with mystical significance from dangerous locations + TASK_REPAIR_CRITICAL_INDUSTRIAL_EQUIPMENT, // Repair equipment crucial for industrial operations and production + TASK_CONSTRUCT_RITUALISTIC_DEFENSES, // Construct defenses based on ritualistic or magical designs for enhanced protection + TASK_SECURE_HIDDEN_MYSTICAL_ARTIFACTS, // Secure mystical artifacts hidden from general knowledge or access + TASK_DEFEND_CULTURAL_INSTITUTIONS, // Defend institutions dedicated to culture and the arts from attack or damage + TASK_RECOVER_DAMAGED_STATUES, // Recover and restore statues of artistic or historical significance + TASK_REPAIR_DEMOLISHED_FORTIFICATIONS, // Repair fortifications that have been demolished or heavily damaged + TASK_CONSTRUCT_UNDERGROUND_BUNKERS, // Construct bunkers underground to provide protection and concealment + TASK_SECURE_HISTORICAL_SITES, // Secure sites of historical importance from damage, theft, or unauthorized access + TASK_DEFEND_MYSTICAL_CAVES, // Defend caves with mystical properties from intrusion or desecration + TASK_RECOVER_EXPERT_CRAFTSMAN, // Recover a skilled craftsman who can create or repair valuable items + TASK_REPAIR_ANCIENT_DEFENSIVE_STRUCTURES, // Repair ancient structures designed for defensive purposes + TASK_CONSTRUCT_ENCHANTED_PROTECTIVE_BARRIERS, // Construct barriers enhanced with enchantments for superior protection + TASK_SECURE_ECONOMICALLY_VITAL_RESOURCES, // Secure resources critical for economic stability and growth + TASK_DEFEND_AGAINST_MAGICAL_BEASTS, // Defend against beasts with magical properties or abilities + TASK_RECOVER_ENCHANTED_SCROLLS, // Recover scrolls imbued with magic from secure locations + TASK_REPAIR_HIGH_PRIORITY_EQUIPMENT, // Repair equipment deemed high priority for ongoing operations + TASK_CONSTRUCT_FORTIFIED_RESEARCH_LAB, // Construct a research lab with fortified defenses for scientific or magical work + TASK_SECURE_MAGICALLY_ENHANCED_TREASURE, // Secure treasure with magical enhancements from theft or damage + TASK_DEFEND_TACTICAL_OUTPOSTS, // Defend outposts critical for tactical operations and defense + TASK_RECOVER_RARE_ALCHEMICAL_REAGENTS, // Recover reagents used in alchemy that are rare or essential + TASK_REPAIR_PROTECTIVE_MAGIC_CONDUITS, // Repair conduits used to channel protective magic or enchantments + TASK_CONSTRUCT_ADVANCED_DEFENSIVE_FORTIFICATIONS, // Construct advanced fortifications for improved defense against formidable threats + TASK_DEFEND_ENCHANTED_SPRING, // Defend a spring with magical properties from exploitation or attack + TASK_RECOVER_LOST_CIVILIZATION_ARTIFACTS, // Recover artifacts from a lost civilization of great historical or magical significance + TASK_REPAIR_ADVANCED_SEA_DEFENSES, // Repair advanced defenses designed to protect against sea-based attacks + TASK_CONSTRUCT_SECURE_RITUAL_CHAMBERS, // Construct chambers designed for performing high-security rituals + TASK_SECURE_CRITICAL_MAGE_TOWER, // Secure a mage tower vital for magical operations and research + TASK_DEFEND_HEAVILY_FORTIFIED_CITY, // Defend a city with extensive fortifications from sieges or attacks + TASK_RECOVER_ANCIENT_TECHNOLOGY, // Recover technology of ancient origin with significant power or utility + TASK_REPAIR_EXPERIMENTAL_WEAPONS, // Repair weapons of experimental design used for cutting-edge combat + TASK_CONSTRUCT_PROTECTIVE_ENCHANTMENTS, // Construct enchantments to protect key locations or items from magical harm + TASK_SECURE_ALCHEMICAL_REACTORS, // Secure reactors used in alchemy or magical experiments from threats + TASK_DEFEND_SUPPLY_DEPOT, // Defend a depot holding critical supplies from sabotage or theft + TASK_RECOVER_DAMAGED_ANTIQUITIES, // Recover and restore antiquities damaged in recent conflicts + TASK_REPAIR_TACTICAL_ENGINES, // Repair engines used in tactical operations or war machines + TASK_CONSTRUCT_RESEARCH_STATIONS, // Construct stations dedicated to research in strategic or magical fields + TASK_SECURE_MAGICAL_TRANSMISSION_TOWERS, // Secure towers used for transmitting magical energy or signals from interference + TASK_DEFEND_CONSTRUCTED_EMBASSIES, // Defend embassies constructed in dangerous regions from attack or breach + TASK_RECOVER_OBSOLETE_ARTIFACTS, // Recover artifacts that have fallen out of use but are still of historical value + TASK_REPAIR_SECURE_CHESTS, // Repair chests used to store valuable or sensitive items + TASK_CONSTRUCT_FORTIFIED_COMMAND_BUNKERS, // Construct command bunkers with advanced fortifications for strategic command + TASK_SECURE_ANCIENT_POWER_SOURCES, // Secure sources of ancient power from theft or misuse + TASK_DEFEND_INFLUENTIAL_ORGANIZATIONS, // Defend organizations of great influence or power from hostile actions + TASK_RECOVER_LOST_TREASURES, // Recover treasures that have been lost or hidden over time + TASK_REPAIR_EXOTIC_ARTIFACTS, // Repair artifacts of exotic origin that are crucial for various operations + TASK_CONSTRUCT_SUPPLY_CHAIN_DEFENSES, // Construct defenses to protect critical supply chains from disruption + TASK_SECURE_LEGENDARY_TREASURE_CACHES, // Secure caches of treasure with legendary status from plunder + TASK_DEFEND_HIGH_PRIORITY_RESEARCH_LABS, // Defend research labs with high-priority projects from attack + TASK_RECOVER_SENSITIVE_EQUIPMENT, // Recover equipment essential for operations that has been compromised or lost + TASK_REPAIR_ANCIENT_MILITARY_EQUIPMENT, // Repair equipment of ancient military origin for restoration and use + TASK_CONSTRUCT_ENCHANTED_SECURITY_SYSTEMS, // Construct security systems with enchantments for heightened protection + TASK_SECURE_HISTORICAL_RESEARCH_ARCHIVES, // Secure archives containing historical research from unauthorized access or damage + TASK_DEFEND_CRITICAL_WAR_SUPPLIES, // Defend supplies critical for ongoing war efforts from attack or theft + TASK_RECOVER_MAGICALLY_ENHANCED_GEAR, // Recover gear enhanced with magical properties that has been lost or stolen + TASK_REPAIR_FORTIFIED_MILITARY_OUTPOSTS, // Repair military outposts with fortifications to restore their effectiveness + TASK_CONSTRUCT_STRATEGIC_MAGICAL_OBSERVATORIES, // Construct observatories designed for monitoring magical events or phenomena + TASK_SECURE_ANCIENT_ENCHANTED_RELICS, // Secure relics with ancient enchantments from being disturbed or misused + TASK_DEFEND_HIGHLY_SENSITIVE_SITES, // Defend sites with highly sensitive information or assets from breaches + TASK_RECOVER_VITAL_MAGICAL_ESSENCES, // Recover essences crucial for magical operations or artifacts + TASK_REPAIR_ADVANCED_ENCHANTMENT_DEVICES, // Repair devices used for advanced enchantments or magical operations + TASK_CONSTRUCT_ENCHANTED_TACTICAL_GATES, // Construct gates with enchantments for tactical advantage in defense + TASK_SECURE_CRITICAL_ENCHANTED_RESOURCES, // Secure resources imbued with enchantments essential for various uses + TASK_DEFEND_AGAINST_MAGICAL_INTERFERENCE, // Defend against interference from magical sources or entities + TASK_RECOVER_OLD_TRADITIONAL_WEAPONS, // Recover traditional weapons with significant historical or cultural importance + TASK_REPAIR_HIGH_ECH_ARTIFACTS, // Repair artifacts with high technological advancements from damage or malfunction + TASK_CONSTRUCT_MAGICALLY_PROTECTED_BARRIERS, // Construct barriers protected with magic for superior defense + TASK_SECURE_ENCHANTED_TREASURE_VAULTS, // Secure vaults holding treasure with magical enhancements + TASK_DEFEND_KEY_SACRED_SITES, // Defend sacred sites of great importance from desecration or attack + TASK_RECOVER_HISTORIC_MILITARY_DOCUMENTS, // Recover documents of historic military importance from secure locations + TASK_REPAIR_ADVANCED_PROTECTIVE_SYSTEMS, // Repair systems designed for advanced protection against various threats + TASK_CONSTRUCT_DEFENSIVE_RITUALS, // Construct defensive measures based on rituals for enhanced protection + TASK_SECURE_HIDDEN_MAGIC_TREASURES, // Secure hidden treasures with magical properties from discovery or theft + TASK_DEFEND_CRITICAL_MAGICAL_GATES, // Defend gates with significant magical importance from breach or damage + TASK_RECOVER_ANCIENT_ENCHANTMENTS, // Recover enchantments from ancient sources that have been lost or hidden + TASK_REPAIR_SECURE_RESEARCH_EQUIPMENT, // Repair equipment used in secure research environments + TASK_CONSTRUCT_TACTICAL_ENCHANTED_FORTIFICATIONS, // Construct fortifications with tactical enchantments for strategic defense + TASK_SECURE_VITAL_ANCIENT_GRIMOIRES, // Secure grimoires containing ancient knowledge from unauthorized access + TASK_DEFEND_INTERNATIONAL_TREATY_SITES, // Defend sites related to international treaties from violations or attacks + TASK_RECOVER_HISTORIC_CONSTRUCTION_PLANS, // Recover plans related to historic constructions of strategic importance + TASK_REPAIR_DEFENSIVE_ENCHANTMENTS, // Repair enchantments used to protect key defensive structures or assets + TASK_CONSTRUCT_ADVANCED_MAGE_BARRIERS, // Construct barriers with advanced magical properties for high-level protection + TASK_SECURE_ENCHANTED_WEAPON_STORAGE, // Secure storage areas for weapons with magical enhancements + TASK_DEFEND_AGAINST_RITUALISTIC_ATTACKS, // Defend against attacks based on ritualistic or magical practices + TASK_RECOVER_HISTORICAL_ARTIFACTS, // Recover artifacts with significant historical value from secure locations + TASK_REPAIR_TACTICAL_MAGIC_BARRIERS, // Repair barriers designed for tactical use in magical defenses + TASK_CONSTRUCT_SUPPLY_CHAIN_SECURITY, // Construct security measures for protecting critical supply chains + TASK_SECURE_ENCHANTED_MILITARY_INSTALLATIONS, // Secure military installations with magical enhancements + TASK_DEFEND_HIGH_VALUE_RESEARCH_FACILITIES, // Defend research facilities of high value from threats and breaches + TASK_RECOVER_DAMAGED_MYSTICAL_ARTIFACTS, // Recover and restore artifacts of mystical importance that have been damaged + TASK_REPAIR_ADVANCED_DEFENSIVE_CONDUITS, // Repair conduits used for advanced defensive measures + TASK_CONSTRUCT_MAGICAL_HARVESTING_STATIONS, // Construct stations for harvesting magical resources or energy + TASK_SECURE_CRUCIAL_MAGICAL_TRANSPORTS, // Secure transport routes or vessels used for moving magical resources + TASK_DEFEND_RESEARCH_AND_DEVELOPMENT_SITES, // Defend sites dedicated to research and development from attacks or sabotage + TASK_RECOVER_EXOTIC_RITUAL_ARTIFACTS, // Recover artifacts used in exotic rituals from danger or theft + TASK_REPAIR_ADVANCED_STRATEGIC_ARTIFACTS, // Repair strategic artifacts with advanced features or technology + TASK_CONSTRUCT_FORTIFIED_MAGIC_WARDS, // Construct wards with fortifications to enhance magical protection + TASK_SECURE_LEGENDARY_ENCHANTED_ITEMS, // Secure items of legendary enchantment from theft or destruction + TASK_DEFEND_ANTIQUITY_STORAGE_FACILITIES, // Defend facilities storing valuable antiquities from breach or damage + TASK_RECOVER_HISTORICAL_RESEARCH_EQUIPMENT, // Recover equipment used in historical research from loss or damage + TASK_REPAIR_TACTICAL_ENCHANTED_ARTIFACTS, // Repair artifacts with tactical enchantments for improved functionality + TASK_CONSTRUCT_ENCHANTED_PROTECTIVE_SHELTERS, // Construct shelters with magical protection for safety and security + TASK_SECURE_ANCIENT_MAGIC_SECRETS, // Secure secrets related to ancient magic from being exposed or misused + TASK_DEFEND_CRITICAL_MAGIC_RESEARCH, // Defend research focused on magic from disruption or attack + TASK_RECOVER_DAMAGED_HISTORICAL_RELICS, // Recover and restore relics of historical significance that have been damaged +}; + +#endif \ No newline at end of file diff --git a/models/event/event_file_format.txt b/models/event/event_file_format.txt new file mode 100644 index 0000000..afe1277 --- /dev/null +++ b/models/event/event_file_format.txt @@ -0,0 +1,42 @@ +#COND0 +This is some text. +This is another text. + +TEXT_OPTIONS{3} = can select up to 3 options +// @todo how to add/hide options based on other info +1. My text ->COND1 +2. My text ->COND2,->COND2=12 +3. My text ->COND3 + +REWARDS{1,2} = pick one and then 2 +// @todo how to add/hide options based on other info +CONDA: 1. 213 564 55 ->COND2 +CONDA: 2. 12 32 ->COND2 +CONDA&CODB:3. 87 3325 11 ->COND2 +CODB: 3. 87 3325 11 ->COND2 + +#COND1 + +#COND2 + +#COND3 + +#COND1+#COND2 + +#COND1+#COND3 + +#COND2+#COND3 + +#COND1+#COND2+#COND3 + +#COND + is_true // defined through ->COND + int_value // defined through ->COND=12 + float_value + char_level + proficiencies_above[] + proficiencies_above_level[] + char_trait_above[] + char_trait_above_level[] + char_trait_below[] + char_trait_below_level[] \ No newline at end of file diff --git a/models/event/tmp b/models/event/tmp new file mode 100644 index 0000000..1dbe5b3 --- /dev/null +++ b/models/event/tmp @@ -0,0 +1,937 @@ +#ifndef TOS_QUEST_EVENT_TASK_TYPE_H +#define TOS_QUEST_EVENT_TASK_TYPE_H + +enum EventTaskType { + TASK_COLLECT, // Collect a specific item or set of items + TASK_KILL, // Kill a certain number of enemies + TASK_ACCOMPANY, // Escort an NPC to a location + TASK_DISCOVER, // Discover a specific location + TASK_DELIVER, // Deliver an item to an NPC or location + TASK_RESCUE, // Rescue an NPC or group of NPCs + TASK_RETRIEVE, // Retrieve a stolen or lost item + TASK_GATHER_INFORMATION, // Gather information or clues + TASK_TALK, // Speak to a specific NPC or group of NPCs + TASK_DEFEND, // Defend a location or NPC for a certain period of time + TASK_SURVIVE, // Survive waves of enemies or a hazardous environment + TASK_INVESTIGATE, // Investigate a mystery or event + TASK_CONSTRUCT, // Build or repair a structure or object + TASK_CRAFT, // Craft a specific item or set of items + TASK_TRAIN, // Train a skill or teach an NPC + TASK_FOLLOW, // Follow an NPC or creature without being detected + TASK_SABOTAGE, // Sabotage an enemy structure or plan + TASK_CAPTURE, // Capture or trap an enemy or creature + TASK_ESCAPE, // Escape from a location or situation + TASK_EXPLORE, // Explore a new area or region + TASK_NEGOTIATE, // Negotiate peace or a trade agreement + TASK_BARGAIN, // Bargain for a better price or outcome + TASK_SPY, // Gather intelligence on enemies or allies + TASK_INFILTRATE, // Infiltrate an enemy base or organization + TASK_ASSASSINATE, // Assassinate a key target + TASK_RECON, // Perform reconnaissance on a location + TASK_HACK, // Hack a computer system or device + TASK_REPAIR, // Repair a damaged object or system + TASK_ENCHANT, // Enchant a weapon, armor, or item + TASK_BREW, // Brew a potion or drink + TASK_FISH, // Catch a certain type or number of fish + TASK_HUNT, // Hunt a specific animal or creature + TASK_COLLECT_TAX, // Collect taxes or tribute from NPCs + TASK_RECRUIT, // Recruit allies or troops for a cause + TASK_ESCAPE_PRISON, // Escape from captivity or imprisonment + TASK_EXTRACT, // Extract resources or an NPC from a location + TASK_SHADOW, // Shadow an NPC or enemy without being seen + TASK_FIND_LOST, // Find a lost or missing NPC or item + TASK_PLANT, // Plant seeds or objects in specific locations + TASK_SELL, // Sell specific items to merchants or NPCs + TASK_BUY, // Purchase specific items or goods + TASK_PROTECT, // Protect a caravan or convoy + TASK_RELOCATE, // Relocate an NPC or item to a new location + TASK_RESTORE, // Restore a broken artifact or relationship + TASK_SURVEY, // Survey land or resources + TASK_SMUGGLE, // Smuggle contraband past guards or checkpoints + TASK_INTERROGATE, // Interrogate an NPC for information + TASK_INTERCEPT, // Intercept a message or courier + TASK_ESCORT, // Escort an important NPC through dangerous territory + TASK_MINE, // Mine specific ores or minerals + TASK_BOUNTY, // Collect a bounty on a specific target + TASK_TRAP, // Set traps for enemies or animals + TASK_CONQUER, // Conquer a specific area or territory + TASK_SURRENDER, // Surrender to an enemy or superior + TASK_NEGLECT, // Avoid or neglect a responsibility (e.g., a moral choice) + TASK_SUPPORT, // Provide support or aid to allies in a conflict + TASK_DELIVER_MESSAGE, // Deliver a message or letter to an NPC + TASK_LAY_SIEGE, // Lay siege to a fortress or city + TASK_BREAK_SIEGE, // Break a siege and liberate a location + TASK_FORAGE, // Forage for food, herbs, or supplies + TASK_SEARCH, // Search for clues or specific items in an area + TASK_TAME, // Tame a wild animal or creature + TASK_CHARM, // Charm or persuade an NPC or creature + TASK_CONVINCE, // Convince an NPC to take a certain action + TASK_DEFECT, // Defect from one faction to another + TASK_BETRAY, // Betray an ally or group for personal gain + TASK_DECRYPT, // Decrypt a coded message or puzzle + TASK_PUZZLE, // Solve a puzzle or riddle + TASK_RACE, // Participate in a race or timed event + TASK_TOURNAMENT, // Compete in a tournament or competition + TASK_SCARE, // Scare off or intimidate an NPC or creature + TASK_SHOOT, // Shoot targets or enemies with a ranged weapon + TASK_USE_ITEM, // Use a specific item at a location or on an NPC + TASK_PERSUADE, // Persuade an NPC to do something or believe something + TASK_MEDITATE, // Meditate to gain insights or abilities + TASK_DUEL, // Duel an NPC in combat + TASK_TRIAL, // Complete a trial or test of skill + TASK_PREACH, // Preach to NPCs to gain followers or influence + TASK_CONVERT, // Convert NPCs to a religion or cause + TASK_COLLECT_DEBT, // Collect a debt from an NPC + TASK_LIGHT, // Light torches or beacons + TASK_EXTINGUISH, // Extinguish fires or light sources + TASK_RECONCILE, // Reconcile a conflict between NPCs or groups + TASK_DISARM, // Disarm traps or enemies + TASK_RELOCATE_VILLAGERS, // Relocate villagers to a safe area + TASK_CALM, // Calm a panicked NPC or creature + TASK_INVOKE_RITUAL, // Invoke or complete a ritual + TASK_PERFORM, // Perform music, dance, or a play for an audience + TASK_OBTAIN_PERMISSION, // Obtain permission to enter a location or take an action + TASK_HIDE, // Hide from enemies or during a stealth mission + TASK_CLIMB, // Climb a mountain, tree, or other structure + TASK_SWIM, // Swim across a body of water or retrieve an item from underwater + TASK_DIVE, // Dive into deep water or a cave + TASK_RESIST, // Resist temptation or a magical effect + TASK_SNEAK, // Sneak into a location without being detected + TASK_SURVEY_TERRITORY, // Survey territory for strategic purposes + TASK_COMMUNE, // Commune with spirits, gods, or nature + TASK_EXORCISE, // Exorcise a spirit or demon from a location or person + TASK_SUMMON, // Summon a creature, spirit, or other entity + TASK_DECEIVE, // Deceive an NPC or group + TASK_GATHER_ARMY, // Gather an army or group of followers + TASK_REPEL_INVASION, // Repel an invasion or attack + TASK_HARVEST, // Harvest crops or resources + TASK_OPERATE_MACHINE, // Operate a complex machine or vehicle + TASK_NEGOTIATE_RANSOM, // Negotiate the ransom of a captured NPC + TASK_CONVICT, // Convict or acquit an NPC in a trial + TASK_TRACK, // Track a person, creature, or object + TASK_CONCEAL, // Conceal evidence or an object from others + TASK_APPREHEND, // Apprehend a criminal or fugitive + TASK_TEACH, // Teach an NPC a skill or knowledge + TASK_CURE, // Cure a disease or ailment affecting an NPC + TASK_RECLAIM, // Reclaim lost or stolen property + TASK_HUNT_TREASURE, // Hunt for hidden or buried treasure + TASK_PROPHESY, // Deliver a prophecy or prediction + TASK_ENACT_REVENGE, // Enact revenge on an enemy or traitor + TASK_UPHOLD_OATH, // Uphold an oath or pledge + TASK_FIND_PATH, // Find a path through difficult terrain + TASK_ESCORT_CONVOY, // Escort a convoy through dangerous territory + TASK_INTERFERE, // Interfere with an enemy's plans or operations + TASK_ENFORCE_LAW, // Enforce the law in a chaotic or lawless area + TASK_RESTORE_HONOR, // Restore the honor of a disgraced NPC or family + TASK_PEACE_TREATY, // Negotiate or enforce a peace treaty + TASK_GATHER_HERBS, // Gather specific herbs or plants + TASK_CAMP, // Set up or break down a camp + TASK_SET_TRAPS, // Set traps for animals or enemies + TASK_CREATE_POTION, // Create a potion using specific ingredients + TASK_RECONSTITUTE, // Reconstitute a broken or damaged artifact + TASK_RENOVATE, // Renovate or repair a building or structure + TASK_EXTRACT_ORE, // Extract ore from a mine or vein + TASK_DOUSE_FLAMES, // Douse flames in a burning building or area + TASK_BLESS, // Bless an object, location, or person + TASK_PLUNDER, // Plunder a village, ship, or enemy camp + TASK_CONSECRATE, // Consecrate a temple, altar, or sacred ground + TASK_EVACUATE, // Evacuate civilians or troops from a dangerous area + TASK_DISGUISE, // Disguise yourself or an NPC to infiltrate or avoid detection + TASK_CONFRONT, // Confront an NPC or creature about their actions + TASK_WAGER, // Wager on a game, race, or duel + TASK_SAIL, // Sail a ship to a specific destination + TASK_MAINTAIN, // Maintain equipment, a building, or machinery + TASK_CLEANSE, // Cleanse a cursed or polluted area + TASK_HOLD_POSITION, // Hold a position against enemies for a certain time + TASK_MAP_TERRITORY, // Map uncharted territory or a region + TASK_INTERPRET, // Interpret a prophecy, dream, or message + TASK_TRANSLATE, // Translate an ancient or foreign language + TASK_ENFORCE_ORDER, // Enforce order in a chaotic environment + TASK_REPENT, // Repent for a past mistake or sin + TASK_INITIATE, // Initiate a new member into a guild, order, or faction + TASK_TEST_LOYALTY, // Test the loyalty of an NPC or group + TASK_SACRIFICE, // Sacrifice an item, creature, or person for a greater cause + TASK_COLLECT_TITHE, // Collect a tithe or offering from NPCs + TASK_PERFORM_RITUAL, // Perform a ritual to summon, banish, or bless + TASK_RESCUE_HOSTAGE, // Rescue a hostage from enemy forces + TASK_PROVOKE, // Provoke an enemy or rival into action + TASK_NEUTRALIZE, // Neutralize a threat without killing + TASK_SCOUR, // Scour an area for resources, clues, or enemies + TASK_MARK_LOCATION, // Mark a location for future use or for others to find + TASK_NAVIGATE, // Navigate through dangerous or unknown territory + TASK_MANAGE_RESOURCES, // Manage resources such as food, water, or materials + TASK_APPEASE, // Appease an angry deity, spirit, or powerful NPC + TASK_MOURN, // Mourn the loss of a person, place, or thing + TASK_ORGANIZE_EVENT, // Organize an event such as a festival, gathering, or meeting + TASK_ESCORT_PRISONER, // Escort a prisoner to a specific location + TASK_ENDURE, // Endure a hardship or trial for a certain time + TASK_BOND_WITH_CREATURE, // Bond with a creature or animal to gain its loyalty + TASK_RECONCILE_FACTIONS, // Reconcile two or more factions that are at odds + TASK_CONDUCT_RITUAL, // Conduct a complex ritual with multiple steps + TASK_OFFER_TRIBUTE, // Offer tribute to a ruler, deity, or spirit + TASK_EXILE, // Exile an NPC or group from a community or region + TASK_SUMMON_ALLY, // Summon an ally or familiar to aid in a quest + TASK_DEFUSE, // Defuse a bomb or dangerous situation + TASK_RELAY_MESSAGE, // Relay a message between two parties + TASK_FIND_RELIC, // Find a lost or ancient relic + TASK_DECIPHER_CODE, // Decipher a code, puzzle, or riddle + TASK_JUDGE_CONTEST, // Judge a contest, competition, or duel + TASK_ESTABLISH_BASE, // Establish a base of operations in a new location + TASK_DEFEAT_CHAMPION, // Defeat a champion in battle or competition + TASK_EMBARK_JOURNEY, // Embark on a long and dangerous journey + TASK_OVERTHROW, // Overthrow a ruler or government + TASK_PERFORM_CEREMONY, // Perform a ceremonial duty or rite + TASK_DEPLOY_TROOPS, // Deploy troops to a strategic location + TASK_CONDUCT_RESEARCH, // Conduct research on a subject, item, or creature + TASK_COUNTERFEIT, // Create a counterfeit item, document, or currency + TASK_OBTAIN_FAVOR, // Obtain the favor of a powerful NPC or faction + TASK_CHALLENGE_RIVAL, // Challenge a rival to a duel, contest, or battle + TASK_RECLAIM_LAND, // Reclaim land from enemies or the wilderness + TASK_PROTECT_ARTIFACT, // Protect an artifact from theft or damage + TASK_CREATE_ALLIANCE, // Create an alliance between factions or NPCs + TASK_TRAVERSE_DUNGEON, // Traverse a dungeon or dangerous area + TASK_DEFEND_STRONGHOLD, // Defend a stronghold from an attack or siege + TASK_UNDERGO_TRIAL, // Undergo a trial of strength, wisdom, or courage + TASK_REDEEM, // Redeem an NPC or yourself from a past wrong + TASK_RESTORE_BALANCE, // Restore balance to a chaotic situation or ecosystem + TASK_CONQUER_FORTRESS, // Conquer a fortress or enemy stronghold + TASK_DEPLOY_TRAP, // Deploy a trap in a strategic location + TASK_HARNESS_POWER, // Harness a source of power or magic + TASK_PLANT_EVIDENCE, // Plant evidence to frame an NPC or mislead others + TASK_RECON_VILLAGE, // Recon a village or settlement for information + TASK_ESCORT_VIP, // Escort a VIP to a safe or strategic location + TASK_CREATE_ART, // Create a piece of art, music, or literature + TASK_REPAIR_REPUTATION, // Repair the reputation of an NPC, faction, or yourself + TASK_FIND_HEIR, // Find a missing heir to a throne or legacy + TASK_REPAIR_BRIDGE, // Repair a bridge to allow safe passage + TASK_CONSTRUCT_BARRICADE,// Construct a barricade to defend against enemies + TASK_INVOKE_DIVINE_HELP, // Invoke divine help or blessings in a dire situation + TASK_PREPARE_FEAST, // Prepare a feast or banquet for a special occasion + TASK_OBSERVE, // Observe an event or person without intervening + TASK_MANAGE_SUPPLY_LINES,// Manage supply lines during a campaign or mission + TASK_ARRANGE_MARRIAGE, // Arrange a marriage for political or personal reasons + TASK_FIND_CURE, // Find a cure for a disease or curse + TASK_RESCUE_ANIMAL, // Rescue an endangered or trapped animal + TASK_CONSTRUCT_MONUMENT, // Construct a monument to commemorate an event or person + TASK_INVEST_FORTUNE, // Invest a fortune in business, property, or trade + TASK_HOST_GATHERING, // Host a gathering or meeting of importance + TASK_RESCUE_CHILD, // Rescue a lost or kidnapped child + TASK_SUBDUE_CREATURE, // Subdue a rampaging creature without killing it + TASK_MEDIATE, // Mediate a dispute between NPCs or factions + TASK_DESTROY_EVIDENCE, // Destroy evidence of a crime or secret + TASK_DEVELOP_TECH, // Develop new technology, magic, or strategy + TASK_NAVIGATE_POLITICS, // Navigate complex political situations + TASK_REVIVE, // Revive an NPC from death or unconsciousness + TASK_ESCORT_MERCHANT, // Escort a merchant and their goods to a market or town + TASK_INTERFERE_CEREMONY, // Interfere with a rival's ceremony or ritual + TASK_DISMISS_ALLY, // Dismiss an ally or companion from your service + TASK_PERFORM_EXORCISM, // Perform an exorcism to banish a spirit or demon + TASK_SECURE_BORDER, // Secure a border against invasion or smuggling + TASK_RETRIEVE_TREASURE, // Retrieve a treasure from a dangerous location + TASK_HOST_CONTEST, // Host a contest or tournament + TASK_REUNITE_FAMILY, // Reunite a family separated by conflict or tragedy + TASK_SMELT_ORE, // Smelt ore into usable metal + TASK_ENCHANT_WEAPON, // Enchant a weapon with special powers + TASK_CREATE_GOLEM, // Create or animate a golem or other construct + TASK_REPLANT_FOREST, // Replant a forest that has been destroyed + TASK_REPLANT_FOREST, // Replant a forest that has been destroyed + TASK_RESURRECT, // Resurrect an NPC or creature from the dead + TASK_SILENCE, // Silence an NPC or group to prevent them from speaking out + TASK_SUBVERT, // Subvert a rival or enemy's plans from within + TASK_INVESTIGATE_CRIME, // Investigate a crime scene or mystery + TASK_DEFEND_CIVILIANS, // Defend civilians from an attack or disaster + TASK_TRAVEL_UNDERCOVER, // Travel undercover to avoid detection + TASK_EXTRACT_INFO, // Extract information from a captured enemy or informant + TASK_AWAKEN_ANCIENT, // Awaken an ancient being or power + TASK_CLEAR_DUNGEON, // Clear a dungeon of enemies or traps + TASK_CONDUCT_RAID, // Conduct a raid on an enemy stronghold or village + TASK_INTERCEPT_CARGO, // Intercept a shipment of goods or weapons + TASK_BUILD_FORTRESS, // Build a fortress or stronghold + TASK_ENFORCE_QUARANTINE, // Enforce a quarantine in a plague-ridden area + TASK_MAINTAIN_MORALITY, // Maintain the morality or faith of a group + TASK_RECOVER_BODY, // Recover a fallen ally's body from a dangerous location + TASK_BRIBE_OFFICIAL, // Bribe an official to gain favor or bypass a law + TASK_PREVENT_WAR, // Prevent a war between factions or nations + TASK_INTERROGATE_PRISONER,// Interrogate a prisoner for vital information + TASK_FORGE_ALLIANCE, // Forge an alliance between warring factions + TASK_OPERATE_VEHICLE, // Operate a vehicle, such as a ship or airship + TASK_HARNESS_ELEMENT, // Harness the power of an elemental force + TASK_BREED_ANIMALS, // Breed animals for a specific purpose or trait + TASK_QUELL_REBELLION, // Quell a rebellion or uprising + TASK_RECRUIT_SOLDIERS, // Recruit soldiers for a military campaign + TASK_SEEK_REDEMPTION, // Seek redemption for past sins or failures + TASK_ESCAPE_DUNGEON, // Escape from a dungeon or prison + TASK_TRACK_ENEMY, // Track an enemy's movements and plans + TASK_REPAIR_SHIP, // Repair a damaged ship or vehicle + TASK_MANAGE_ECONOMY, // Manage the economy of a town or region + TASK_CONSTRUCT_TEMPLE, // Construct a temple or place of worship + TASK_DEVELOP_CURE, // Develop a cure for a deadly disease or poison + TASK_EXCAVATE_RUINS, // Excavate ruins to uncover lost artifacts or knowledge + TASK_BARTER, // Barter goods or services with NPCs or factions + TASK_COMPOSE_LETTER, // Compose an important letter or message + TASK_NAVIGATE_SEAS, // Navigate treacherous seas or waterways + TASK_PROTECT_SECRET, // Protect a secret from being discovered or revealed + TASK_DISRUPT_RITUAL, // Disrupt an enemy's ritual or ceremony + TASK_NEGOTIATE_PEACE, // Negotiate peace between warring factions + TASK_REPAIR_RELIC, // Repair a damaged or broken relic + TASK_DISCOVER_ARTIFACT, // Discover a lost or hidden artifact + TASK_LEAD_EXPEDITION, // Lead an expedition into unknown or dangerous territory + TASK_TRAIN_COMPANION, // Train a companion or pet in new skills + TASK_CONVERT_ENEMY, // Convert an enemy to your side or cause + TASK_GATHER_REINFORCEMENTS, // Gather reinforcements to aid in a battle + TASK_FREE_SLAVES, // Free slaves or captives from bondage + TASK_STOP_ASSASSINATION, // Stop an assassination attempt on an important NPC + TASK_DISCOVER_LORE, // Discover ancient lore or knowledge + TASK_HARVEST_CROPS, // Harvest crops from a field or farm + TASK_EXTEND_TERRITORY, // Extend the territory of a kingdom or faction + TASK_REPEL_ATTACK, // Repel an attack on a settlement or fortress + TASK_PERFORM_SABOTAGE, // Perform sabotage on enemy equipment or plans + TASK_HIDE_EVIDENCE, // Hide evidence of a crime or conspiracy + TASK_CAPTURE_ANIMAL, // Capture a wild or dangerous animal + TASK_DEFUSE_CONFLICT, // Defuse a conflict between NPCs or factions + TASK_CONFRONT_FEARS, // Confront and overcome personal fears or nightmares + TASK_PROTECT_TRADER, // Protect a trader on their journey through dangerous lands + TASK_EXPAND_INFLUENCE, // Expand the influence of your faction or cause + TASK_RESTORE_ANCIENT_ORDER, // Restore an ancient order or organization + TASK_INVESTIGATE_RUINS, // Investigate ancient ruins for clues or treasure + TASK_REINFORCE_WALLS, // Reinforce the walls of a castle or city + TASK_NAVIGATE_MOUNTAINS, // Navigate treacherous mountain paths + TASK_PURIFY_SOURCE, // Purify a corrupted or polluted source of water or power + TASK_HEAL_WOUNDED, // Heal the wounded after a battle or disaster + TASK_ENCHANT_ARMOR, // Enchant armor with magical properties + TASK_AVENGE_DEATH, // Avenge the death of a loved one or comrade + TASK_LEARN_SPELL, // Learn a new spell or magical ability + TASK_FORM_COVENANT, // Form a covenant with a powerful entity or faction + TASK_TRAVERSE_DESERT, // Traverse a dangerous desert region + TASK_OVERCOME_CURSE, // Overcome or lift a powerful curse + TASK_BATTLE_ARENA, // Battle in an arena for glory or rewards + TASK_LOCATE_PORTAL, // Locate a portal to another realm or dimension + TASK_MANAGE_VILLAGE, // Manage the affairs of a village or small town + TASK_NEGOTIATE_TRADE, // Negotiate trade agreements between factions + TASK_REPEL_MONSTER, // Repel a monster that threatens a town or settlement + TASK_CONDUCT_RITUAL, // Conduct a ritual to summon or banish a being + TASK_EXPLORE_CAVES, // Explore caves or underground tunnels + TASK_CRAFT_WEAPON, // Craft a weapon using special materials + TASK_CLEAR_FOREST, // Clear a forest of dangerous creatures or obstacles + TASK_REPAIR_MACHINERY, // Repair complex machinery or constructs + TASK_RETRIEVE_SCROLL, // Retrieve a lost or stolen scroll + TASK_DEFEND_CARGO, // Defend cargo during transport + TASK_RECOVER_LOST_ITEM, // Recover a lost or stolen item of importance + TASK_NAVIGATE_SWAMP, // Navigate through a treacherous swamp + TASK_EXORCISE_HAUNTING, // Exorcise a haunting from a location + TASK_INVOKE_ANCIENT_RITES, // Invoke ancient rites or rituals for protection or power + TASK_CONSTRUCT_BRIDGE, // Construct a bridge to cross a river or chasm + TASK_UNCOVER_HIDDEN_PATH,// Uncover a hidden path or secret passage + TASK_FIND_LOST_CITY, // Find a lost city or civilization + TASK_BIND_DEMON, // Bind a demon or spirit to prevent harm + TASK_CREATE_ARMOR, // Create armor for protection or battle + TASK_MAP_CAVERNS, // Map unexplored caverns or tunnels + TASK_LIFT_SIEGE, // Lift a siege on a city or fortress + TASK_NAVIGATE_JUNGLE, // Navigate through a dense jungle + TASK_PURGE_CORRUPTION, // Purge corruption from a person, place, or thing + TASK_RETRIEVE_REMAINS, // Retrieve the remains of a fallen ally or enemy + TASK_CREATE_AMULET, // Create a protective amulet or charm + TASK_RESOLVE_DISPUTE, // Resolve a dispute between NPCs or factions + TASK_STOP_REBELLION, // Stop a rebellion before it gains momentum + TASK_REPEL_HORDE, // Repel a horde of enemies attacking a settlement + TASK_EXAMINE_ARTIFACT, // Examine an artifact for clues or knowledge + TASK_ARRANGE_TREATY, // Arrange a treaty between warring factions + TASK_PROTECT_REFUGEES, // Protect refugees fleeing from war or disaster + TASK_INTERCEPT_SPY, // Intercept a spy before they deliver critical information + TASK_DISCOVER_NEW_LAND, // Discover new land for exploration or colonization + TASK_RESCUE_SURVIVORS, // Rescue survivors from a disaster or battle + TASK_CULTIVATE_CROPS, // Cultivate crops to ensure a harvest + TASK_REPAIR_WEAPON, // Repair a broken or damaged weapon + TASK_REPAIR_WEAPON, // Repair a broken or damaged weapon + TASK_CONDUCT_INVESTIGATION, // Conduct an investigation into a mystery or crime + TASK_DEFEND_VILLAGE, // Defend a village from invaders or monsters + TASK_INTERCEPT_COURIER, // Intercept a courier carrying important messages or items + TASK_PREPARE_DEFENSES, // Prepare defenses for an impending attack + TASK_SEEK_OUTLAW, // Seek and capture or eliminate an outlaw + TASK_CONVERT_FOLLOWERS, // Convert followers to a new faith or cause + TASK_SMUGGLE_GOODS, // Smuggle goods past enemy lines or authorities + TASK_PREPARE_RITUAL, // Prepare a complex ritual requiring multiple steps + TASK_REPAIR_ARMOR, // Repair damaged armor + TASK_CONDUCT_SURVEILLANCE, // Conduct surveillance on a target or location + TASK_ACQUIRE_BLUEPRINTS, // Acquire blueprints for a device or building + TASK_ESCORT_DIGNITARY, // Escort a dignitary through dangerous territory + TASK_RECRUIT_ALLIES, // Recruit allies to support your cause + TASK_CONSTRUCT_BARRACKS, // Construct barracks for housing soldiers + TASK_REPAIR_FORTIFICATIONS, // Repair damaged fortifications or walls + TASK_DEFUSE_AMBUSH, // Defuse an ambush set by enemies + TASK_GATHER_INTEL, // Gather intelligence on enemy positions or plans + TASK_CONDUCT_DIPLOMACY, // Conduct diplomatic negotiations with a foreign power + TASK_RETRIEVE_BLUEPRINTS,// Retrieve stolen or lost blueprints + TASK_INTERCEPT_SMUGGLERS,// Intercept smugglers transporting illegal goods + TASK_ESCAPE_PURSUIT, // Escape from pursuers tracking you or your group + TASK_REPAIR_GATE, // Repair a damaged or broken gate + TASK_CONSTRUCT_TOWER, // Construct a tower for defense or observation + TASK_RESUPPLY, // Resupply a forward base or outpost with necessary goods + TASK_CONDUCT_HEIST, // Conduct a heist to steal valuable items or information + TASK_NAVIGATE_MARSH, // Navigate through a dangerous marsh or bog + TASK_REPAIR_BRIDGE, // Repair a bridge to restore a critical route + TASK_DISRUPT_SMUGGLING, // Disrupt smuggling operations in a region + TASK_ENFORCE_LAW, // Enforce the law in a lawless area or situation + TASK_ESCORT_CONVOY, // Escort a convoy through dangerous territory + TASK_EXTINGUISH_FIRE, // Extinguish a fire threatening a village or forest + TASK_INVESTIGATE_MURDER, // Investigate a murder and find the culprit + TASK_GATHER_MEDICINE, // Gather medicine or herbs to treat the sick + TASK_REPEL_RAIDERS, // Repel raiders attacking a settlement + TASK_DEFEND_CITADEL, // Defend a citadel from an attacking force + TASK_RECRUIT_MERCENARIES,// Recruit mercenaries for a specific mission or battle + TASK_DISMANTLE_BOMB, // Dismantle a bomb or explosive device + TASK_RECONSTRUCT_EVENT, // Reconstruct events of a crime or mystery + TASK_CONDUCT_INTERVIEW, // Conduct an interview to gather information or clues + TASK_CLEAR_RUBBLE, // Clear rubble from a road, building, or path + TASK_DEFEND_TEMPLE, // Defend a temple from desecration or attack + TASK_CONSTRUCT_PALISADE, // Construct a palisade for temporary defense + TASK_OBTAIN_PERMIT, // Obtain a permit or authorization from authorities + TASK_EXAMINE_CORPSE, // Examine a corpse to determine cause of death + TASK_PROTECT_MERCHANT, // Protect a merchant from bandits or pirates + TASK_FIND_LOST_MAP, // Find a lost map leading to treasure or important locations + TASK_RECLAIM_POSSESSION, // Reclaim a possession taken by enemies or thieves + TASK_DISMANTLE_TRAP, // Dismantle a trap set by enemies + TASK_ACQUIRE_SEAL, // Acquire a seal of authority or authenticity + TASK_DEFEND_CARAVAN, // Defend a caravan traveling through dangerous territory + TASK_ESTABLISH_OUTPOST, // Establish an outpost in a remote or strategic location + TASK_RESOLVE_HOSTAGE_SITUATION, // Resolve a hostage situation peacefully or by force + TASK_REPAIR_WELL, // Repair a well to restore access to water + TASK_SALVAGE_SHIPWRECK, // Salvage a shipwreck for valuable goods or information + TASK_AVERT_DISASTER, // Avert a natural or magical disaster threatening a region + TASK_EXORCISE_SPIRIT, // Exorcise a malevolent spirit from a location or person + TASK_SMUGGLE_PERSON, // Smuggle a person out of a dangerous area + TASK_NAVIGATE_WILDERNESS, // Navigate through a dense and perilous wilderness + TASK_PROTECT_ARTISAN, // Protect an artisan while they complete a crucial task + TASK_REPAIR_ROAD, // Repair a road to ensure safe travel + TASK_COUNTER_INFILTRATION, // Counter enemy infiltration efforts within your ranks + TASK_RESCUE_SAILORS, // Rescue sailors stranded at sea or on a deserted island + TASK_RECLAIM_TERRITORY, // Reclaim territory lost to enemies or natural forces + TASK_DISPEL_ILLUSION, // Dispel an illusion hiding a truth or danger + TASK_RESOLVE_FEUD, // Resolve a feud between families, factions, or individuals + TASK_RETRIEVE_KEY, // Retrieve a key to unlock a door, chest, or magical barrier + TASK_DEFEND_FARMSTEAD, // Defend a farmstead from bandits or wild animals + TASK_CONSTRUCT_AQUEDUCT, // Construct an aqueduct to bring water to a settlement + TASK_FIND_LOST_CREW, // Find and rescue a lost or missing crew from a ship or expedition + TASK_EXCAVATE_TUNNEL, // Excavate a tunnel for mining or escape purposes + TASK_BOLSTER_MORALE, // Bolster the morale of troops or a community facing hardship + TASK_GUARD_PRISONER, // Guard a high-profile prisoner until their trial or transport + TASK_SECURE_RELIC, // Secure a relic of great power or significance from enemies + TASK_DEFEND_MARKET, // Defend a marketplace from thieves or invaders + TASK_GATHER_SUPPLIES, // Gather supplies for an upcoming expedition or siege + TASK_RECLAIM_WEAPONS, // Reclaim weapons stolen by enemies or lost in battle + TASK_CONDUCT_FORAGING, // Conduct foraging in the wilderness for food and resources + TASK_INVESTIGATE_OMEN, // Investigate an ominous sign or prophecy + TASK_RESCUE_DIPLOMAT, // Rescue a diplomat captured by hostile forces + TASK_PREPARE_SIEGE, // Prepare for a siege by gathering resources and fortifying defenses + TASK_CONSTRUCT_TREBUCHET, // Construct a trebuchet or other siege weapon + TASK_CONTAIN_PLAGUE, // Contain an outbreak of plague or disease in a community + TASK_SUBDUE_REVOLT, // Subdue a revolt among soldiers or civilians + TASK_EXAMINE_DOCUMENTS, // Examine documents for clues, forgery, or hidden information + TASK_RESCUE_VILLAGERS, // Rescue villagers taken captive by raiders or monsters + TASK_INTERCEPT_REINFORCEMENTS, // Intercept enemy reinforcements before they can reach the battlefield + TASK_DEFEND_LIBRARY, // Defend a library or archive from destruction or theft + TASK_REPAIR_WALL, // Repair a breach in a wall or fortification + TASK_GATHER_RESEARCH_MATERIALS, // Gather materials needed for important research + TASK_CONSTRUCT_BATTERING_RAM, // Construct a battering ram to breach enemy gates + TASK_NAVIGATE_CANYON, // Navigate through a dangerous canyon or ravine + TASK_DEFEND_TREASURY, // Defend a treasury from robbers or enemy forces + TASK_RESCUE_HOSTAGES, // Rescue multiple hostages from a heavily guarded location + TASK_RESTORE_HOPE, // Restore hope to a demoralized community or group + TASK_NEGOTIATE_RANSOM, // Negotiate the ransom for a captured ally or valuable item + TASK_REINFORCE_OUTPOST, // Reinforce a vulnerable outpost with troops and supplies + TASK_EXAMINE_ARTEFACT, // Examine an artifact for magical properties or historical significance + TASK_ESCAPE_TRAP, // Escape from a trap set by enemies or natural forces + TASK_CLEAR_INFESTATION, // Clear an infestation of dangerous creatures from a location + TASK_REPAIR_BRIDGE, // Repair a damaged bridge to restore travel routes + TASK_FORM_DEFENSIVE_PACT, // Form a defensive pact with another faction to deter aggression + TASK_CONTAIN_MAGIC, // Contain a runaway magical effect or creature + TASK_CONSTRUCT_WATCHTOWER, // Construct a watchtower to oversee strategic areas + TASK_SECURE_BORDERS, // Secure the borders of a territory against incursions + TASK_RECOVER_RELIC, // Recover a stolen or lost relic of great importance + TASK_CREATE_DIVERSION, // Create a diversion to distract enemies or draw them away + TASK_RESCUE_TRAPPED_MINERS, // Rescue miners trapped underground by a cave-in or collapse + TASK_CONFRONT_WARLORD, // Confront a warlord threatening regional stability + TASK_NEGOTIATE_ALLIANCE, // Negotiate an alliance with a powerful faction or group + TASK_DEFEND_WAYPOINT, // Defend a strategic waypoint from enemy control + TASK_RESCUE_SPY, // Rescue a spy who has been captured behind enemy lines + TASK_REPEL_SEIGE, // Repel a siege on a fortress or city + TASK_INTERCEPT_CARGO, // Intercept valuable cargo being transported by enemies + TASK_DEFEND_OUTPOST, // Defend an outpost from being overrun by enemies + TASK_ESCORT_PRISONERS, // Escort prisoners safely to their destination + TASK_SECURE_INTEL, // Secure vital intelligence from enemy hands + TASK_DEFEND_STRATEGIC_POINT, // Defend a strategic point critical to the overall battle plan + TASK_RETRIEVE_ENCHANTED_ITEM, // Retrieve an enchanted item from a guarded location + TASK_CONSTRUCT_TRENCH, // Construct a trench for defensive purposes in battle + TASK_PREPARE_AMBUSH, // Prepare an ambush against approaching enemies + TASK_DISCOVER_HIDDEN_TREASURE, // Discover hidden treasure in an unexplored area + TASK_RESCUE_ROYALTY, // Rescue a member of royalty from enemy capture + TASK_DEFEND_CAPITAL, // Defend the capital city from an invading force + TASK_RECOVER_ANCIENT_TEXTS, // Recover ancient texts containing lost knowledge + TASK_CONSTRUCT_CATAPULT, // Construct a catapult for siege warfare + TASK_DEFEND_BRIDGE, // Defend a bridge from enemy forces attempting to cross + TASK_CLEAR_RIVER_BLOCKAGE, // Clear a blockage in a river to restore water flow + TASK_REINFORCE_FORTRESS, // Reinforce a fortress under threat of attack + TASK_CONDUCT_ESPIONAGE, // Conduct espionage to gather enemy secrets or plans + TASK_EXAMINE_RUINS, // Examine ancient ruins for clues or artifacts + TASK_CONSTRUCT_FORT, // Construct a fort to secure a strategic location + TASK_RECOVER_STOLEN_GOODS, // Recover stolen goods from bandits or pirates + TASK_PREVENT_ASSASSINATION, // Prevent an assassination attempt on a key figure + TASK_RESCUE_KIDNAPPED_CHILD, // Rescue a kidnapped child from their captors + TASK_ESTABLISH_TRADE_ROUTE, // Establish a new trade route between distant regions + TASK_DEFEND_SETTLEMENT, // Defend a settlement from raiders or wild animals + TASK_REPAIR_DAMAGED_DAM, // Repair a dam that is at risk of collapsing + TASK_RESCUE_STRANDED_TRAVELERS, // Rescue stranded travelers from a remote location + TASK_DEFEND_CASTLE, // Defend a castle under siege by enemy forces + TASK_RETRIEVE_MAGIC_SCROLL, // Retrieve a powerful magic scroll from a dangerous location + TASK_CONSTRUCT_GATE, // Construct a gate to protect a town or city + TASK_REINFORCE_BRIDGE, // Reinforce a bridge to withstand heavy use or attack + TASK_EXAMINE_RELIC, // Examine a relic for hidden powers or dangers + TASK_CONSTRUCT_FENCE, // Construct a fence to keep animals or enemies out + TASK_NAVIGATE_STORMY_SEAS, // Navigate through stormy seas to reach a destination + TASK_EXAMINE_MAGICAL_ARTIFACT, // Examine a magical artifact to determine its purpose or power + TASK_CONSTRUCT_OUTPOST, // Construct an outpost in a strategic or remote location + TASK_RECOVER_SACRED_ITEM, // Recover a sacred item stolen from a temple or shrine + TASK_ESCORT_WOUNDED, // Escort wounded allies to a safe location for treatment + TASK_DEFEND_FORT, // Defend a fort from a concentrated enemy attack + TASK_REPAIR_TOWN_WALL, // Repair a damaged town wall to protect against invasion + TASK_RESOLVE_POLITICAL_DISPUTE, // Resolve a political dispute before it escalates into conflict + TASK_REPEL_INVADERS, // Repel invaders from a territory or settlement + TASK_CONSTRUCT_MOAT, // Construct a moat around a fortress or castle + TASK_ESCORT_SUPPLIES, // Escort supplies to a besieged location + TASK_DEFEND_BARRICADE, // Defend a barricade from being breached by enemies + TASK_RETRIEVE_LOST_TREASURE, // Retrieve lost treasure from a dangerous or hidden location + TASK_NAVIGATE_BLIZZARD, // Navigate through a blizzard to reach a destination safely + TASK_REPEL_ENEMY_SCOUTS, // Repel enemy scouts from discovering strategic positions + TASK_CONDUCT_RESCUE_OPERATION, // Conduct a rescue operation to save captured allies or civilians + TASK_DEFEND_TOWER, // Defend a tower from enemy assault + TASK_CONSTRUCT_DEFENSIVE_POSITION, // Construct a defensive position to prepare for an imminent attack + TASK_INTERCEPT_ENEMY_COMMANDER, // Intercept an enemy commander to disrupt their plans + TASK_ESTABLISH_COMMUNICATION_LINE, // Establish a communication line between distant allies or outposts + TASK_DEFEND_RIVER_CROSSING, // Defend a river crossing from enemy control + TASK_RETRIEVE_ANCIENT_WEAPON, // Retrieve an ancient weapon of great power from a guarded location + TASK_ESCORT_CIVILIANS, // Escort civilians to safety during a crisis + TASK_REPAIR_SHIP_HULL, // Repair a ship's hull to prevent it from sinking + TASK_DEFEND_FERRY, // Defend a ferry from bandits or pirates during a crossing + TASK_RESCUE_ABDUCTED_PRIEST, // Rescue an abducted priest from a hostile cult + TASK_CONSTRUCT_RAMPARTS, // Construct ramparts to strengthen a defensive position + TASK_CLEAR_CAVE_IN, // Clear a cave-in to rescue trapped miners or adventurers + TASK_DEFEND_ARCHIVE, // Defend an archive containing valuable records or artifacts + TASK_REINFORCE_WATCHTOWER, // Reinforce a watchtower to improve surveillance and defense + TASK_REPEL_ENEMY_BOARDERS, // Repel enemy boarders attempting to seize control of a ship + TASK_ESTABLISH_DEFENSIVE_RING, // Establish a defensive ring to protect a key location + TASK_RECOVER_LOST_MANUSCRIPT, // Recover a lost manuscript of significant importance + TASK_CONSTRUCT_BULWARK, // Construct a bulwark to provide extra defense against attacks + TASK_NAVIGATE_TREACHEROUS_TERRAIN, // Navigate treacherous terrain to reach an objective + TASK_REPEL_ENEMY_PATROL, // Repel an enemy patrol from gaining information or territory + TASK_CONDUCT_DEFENSIVE_DRILL, // Conduct a defensive drill to prepare for potential attacks + TASK_REINFORCE_STRATEGIC_POSITION, // Reinforce a strategic position to prevent enemy advance + TASK_RESCUE_MISSING_SCOUTS, // Rescue scouts who have gone missing behind enemy lines + TASK_SECURE_WATER_SUPPLY, // Secure a water supply crucial for a settlement's survival + TASK_DEFEND_BORDERS, // Defend the borders of a kingdom or territory from incursions + TASK_REPAIR_DOCKS, // Repair docks to ensure ships can safely dock and unload supplies + TASK_RECLAIM_ANCIENT_CITADEL, // Reclaim an ancient citadel taken over by enemies + TASK_DEFEND_PORT, // Defend a port city from enemy naval forces + TASK_CONDUCT_SAFETY_INSPECTION, // Conduct a safety inspection of critical infrastructure + TASK_REPAIR_DAMAGED_MONUMENT, // Repair a damaged monument of cultural or historical significance + TASK_CONSTRUCT_BARRIERS, // Construct barriers to slow down or block enemy movement + TASK_DEFEND_STRONGHOLD, // Defend a stronghold from a major enemy offensive + TASK_REPEL_NAVAL_INVASION, // Repel a naval invasion threatening coastal defenses + TASK_ESTABLISH_TRADE_AGREEMENT, // Establish a trade agreement between distant kingdoms + TASK_RESCUE_ABANDONED_CHILDREN, // Rescue abandoned children left in a dangerous area + TASK_REINFORCE_CITY_WALLS, // Reinforce city walls to withstand a prolonged siege + TASK_CONDUCT_COVERT_OP, // Conduct a covert operation behind enemy lines + TASK_DEFEND_HIGHLANDS, // Defend the highlands from encroaching enemy forces + TASK_RECOVER_LOST_ARTIFACT, // Recover a lost artifact with significant power + TASK_CONSTRUCT_MOUNTAIN_PASS, // Construct a mountain pass to improve travel and trade routes + TASK_RESCUE_ENDANGERED_ANIMALS, // Rescue endangered animals from poachers or habitat destruction + TASK_DEFEND_AGAINST_RAID, // Defend a settlement against a raid from bandits or enemy troops + TASK_RECLAIM_STOLEN_PROPERTY, // Reclaim stolen property taken by criminals or rival factions + TASK_REPAIR_CITADEL_DEFENSES, // Repair the defenses of a citadel under threat + TASK_CONDUCT_STRATEGIC_RETREAT, // Conduct a strategic retreat to regroup and fortify + TASK_REPEL_FOREST_INVASION, // Repel an invasion of hostile forces in a forested area + TASK_RESCUE_TRAPPED_SOLDIERS, // Rescue soldiers trapped behind enemy lines or in a collapsed structure + TASK_DEFEND_HILLTOP, // Defend a hilltop position from enemy forces trying to gain the high ground + TASK_ESTABLISH_BORDER_OUTPOST, // Establish an outpost on the border to monitor enemy movements + TASK_RETRIEVE_ABANDONED_SUPPLIES, // Retrieve abandoned supplies left in a dangerous location + TASK_DEFEND_WINDMILL, // Defend a windmill from being sabotaged or destroyed + TASK_RESCUE_DOWNED_PILOT, // Rescue a downed pilot stranded in enemy territory + TASK_REINFORCE_FORTIFIED_POSITION, // Reinforce a fortified position to prepare for a heavy attack + TASK_CONSTRUCT_NAVAL_BASE, // Construct a naval base to strengthen maritime defenses + TASK_SECURE_FOREST_EDGE, // Secure the edge of a forest to prevent enemy infiltration + TASK_RECOVER_ROYAL_HEIRLOOM, // Recover a royal heirloom of immense value and significance + TASK_DEFEND_MOUNTAIN_PASS, // Defend a mountain pass from being overtaken by enemy forces + TASK_REPAIR_BARRACKS, // Repair barracks to house soldiers or refugees + TASK_ESTABLISH_SUPPLY_DEPOT, // Establish a supply depot to support ongoing operations + TASK_REPEL_SEA_MONSTER, // Repel a sea monster attacking ships or coastal settlements + TASK_RESCUE_ABANDONED_ANIMALS, // Rescue abandoned animals left in a dangerous area + TASK_DEFEND_OUTSKIRTS, // Defend the outskirts of a town or city from enemy raids + TASK_RECOVER_MAGIC_CRYSTAL, // Recover a magic crystal stolen by enemies + TASK_CONDUCT_NIGHT_RAID, // Conduct a night raid on an enemy camp or supply line + TASK_REPEL_BORDER_INCURSION, // Repel an enemy incursion across the border + TASK_REPAIR_RIVER_DAM, // Repair a river dam to prevent flooding + TASK_SECURE_ANCIENT_TOMB, // Secure an ancient tomb from grave robbers or enemies + TASK_RESCUE_CIVILIANS_FROM_CONFLICT_ZONE, // Rescue civilians caught in a conflict zone + TASK_DEFEND_TRADE_ROUTE, // Defend a trade route from bandits or hostile forces + TASK_RECOVER_ENEMY_PLANS, // Recover enemy plans to prevent them from executing their strategy + TASK_CONSTRUCT_OBSERVATION_POST, // Construct an observation post to monitor enemy activity + TASK_SECURE_SECRET_PASSAGE, // Secure a secret passage to ensure safe travel or escape + TASK_REPEL_INVADING_ARMY, // Repel an invading army from your homeland + TASK_REPAIR_FISHING_VILLAGE, // Repair a fishing village after a storm or raid + TASK_RESCUE_PRISONERS_OF_WAR, // Rescue prisoners of war held by the enemy + TASK_DEFEND_COASTLINE, // Defend a coastline from enemy landings or raids + TASK_CONDUCT_COUNTERINTELLIGENCE, // Conduct counterintelligence to prevent enemy espionage + TASK_REINFORCE_SEIGE_DEFENSES, // Reinforce defenses during an ongoing siege + TASK_CONSTRUCT_SUPPLY_LINE, // Construct a supply line to maintain troop morale and effectiveness + TASK_RESOLVE_DISPUTE_OVER_TERRITORY, // Resolve a dispute between factions over territorial claims + TASK_REPEL_NIGHT_ATTACK, // Repel a night attack by enemy forces + TASK_REPAIR_TEMPLE_SHRINE, // Repair a temple or shrine damaged by conflict or disaster + TASK_DEFEND_MOUNTAIN_FORTRESS, // Defend a mountain fortress from a major offensive + TASK_CONDUCT_LONG_RANGE_RECONNAISSANCE, // Conduct long-range reconnaissance to gather critical intel + TASK_RECLAIM_ABANDONED_FORT, // Reclaim an abandoned fort from enemies or wild creatures + TASK_RESCUE_SHIPWRECKED_CREW, // Rescue a crew stranded after a shipwreck + TASK_DEFEND_WAR_CAMP, // Defend a war camp from enemy sabotage or attack + TASK_CONSTRUCT_WATCHTOWER_NETWORK, // Construct a network of watchtowers for enhanced surveillance + TASK_REPEL_SKIRMISHERS, // Repel skirmishers attempting to harass your forces + TASK_REPAIR_BATTLEFIELD_DEFENSES, // Repair battlefield defenses during or after an engagement + TASK_RECOVER_LOST_SCOUTS, // Recover scouts who have been lost or captured during a mission + TASK_DEFEND_HARBOR, // Defend a harbor from a naval or amphibious assault + TASK_ESTABLISH_SAFEHOUSE, // Establish a safehouse for intelligence or resistance operations + TASK_REINFORCE_BATTALION, // Reinforce a battalion under heavy attack or low on morale + TASK_REPEL_AMBUSH, // Repel an ambush set by enemies during a march or expedition + TASK_REPAIR_TREBUCHET, // Repair a trebuchet damaged during siege warfare + TASK_DEFEND_TRADING_POST, // Defend a trading post from bandits or hostile forces + TASK_RESCUE_ARTISAN, // Rescue an artisan kidnapped to force them into making weapons or art + TASK_CONSTRUCT_BATTERY, // Construct a battery of artillery or defensive weapons + TASK_RECOVER_STOLEN_DOCUMENTS, // Recover documents stolen by enemy spies or thieves + TASK_DEFEND_BARRACKS, // Defend barracks housing soldiers or important personnel + TASK_SECURE_ESCAPE_ROUTE, // Secure an escape route for retreating forces or refugees + TASK_REPEL_DESERT_RAIDERS, // Repel raiders attacking from a desert region + TASK_REPAIR_CATAPULT, // Repair a catapult damaged in combat or through sabotage + TASK_DEFEND_DESERT_OASIS, // Defend a desert oasis from hostile forces or nomads + TASK_CONDUCT_TUNNEL_INSPECTION, // Conduct an inspection of tunnels to prevent collapses or enemy use + TASK_RECOVER_WOUNDED_ALLIES, // Recover wounded allies from the battlefield + TASK_CONSTRUCT_TRENCH_SYSTEM, // Construct a trench system for defense or assault preparation + TASK_SECURE_MOUNTAIN_PEAK, // Secure a mountain peak for observation or tactical advantage + TASK_REPEL_SWAMP_CREATURES, // Repel creatures attacking from a nearby swamp + TASK_DEFEND_FOREST_GROVE, // Defend a forest grove sacred to local inhabitants or druidic orders + TASK_RESCUE_HISTORIAN, // Rescue a historian who has been captured or lost in a dangerous area + TASK_CONSTRUCT_DEFENSIVE_FORTIFICATIONS, // Construct defensive fortifications to protect against invasions + TASK_REPEL_WILDERNESS_ATTACK, // Repel an attack by hostile forces emerging from the wilderness + TASK_REPAIR_RAMPARTS, // Repair ramparts damaged during an ongoing siege or conflict + TASK_SECURE_STRATEGIC_HILL, // Secure a hilltop offering a strategic advantage in battle + TASK_DEFEND_BORDER_FORT, // Defend a fort on the border of enemy territory + TASK_RESOLVE_CONFLICT_BETWEEN_CLANS, // Resolve a conflict between rival clans threatening regional stability + TASK_REPEL_FOREST_RAIDERS, // Repel raiders attacking from the forest or jungle + TASK_CONDUCT_DEEP_RECONNAISSANCE, // Conduct deep reconnaissance into enemy territory + TASK_RECLAIM_OCCUPIED_TERRITORY, // Reclaim territory occupied by enemy forces or hostile creatures + TASK_SECURE_RIVERBANK, // Secure a riverbank to prevent enemy crossings or incursions + TASK_DEFEND_SECRET_ENTRANCE, // Defend a secret entrance to a hidden base or stronghold + TASK_RECOVER_FORGOTTEN_KNOWLEDGE, // Recover knowledge lost to time or hidden in ancient texts + TASK_REPEL_MOUNTAIN_BANDITS, // Repel bandits attacking from the mountains + TASK_RESCUE_MYSTIC, // Rescue a mystic or seer captured by enemies or cultists + TASK_CONSTRUCT_SPY_NETWORK, // Construct a network of spies to gather intelligence across a region + TASK_DEFEND_ANCIENT_TEMPLE, // Defend an ancient temple from looters or invading forces + TASK_REPAIR_ANCIENT_MONUMENT, // Repair an ancient monument of cultural or historical significance + TASK_SECURE_FOREST_PASSAGE, // Secure a passage through a dense or enchanted forest + TASK_RECOVER_STOLEN_TREASURE, // Recover treasure stolen by thieves or rival factions + TASK_REPEL_JUNGLE_BEASTS, // Repel beasts attacking from a jungle or tropical region + TASK_DEFEND_ANCIENT_LIBRARY, // Defend an ancient library from being ransacked or destroyed + TASK_CONSTRUCT_FORTRESS_GATE, // Construct a gate to secure a fortress or walled city + TASK_RESOLVE_CIVIL_UPRISING, // Resolve a civil uprising threatening stability in a city or region + TASK_REPEL_MARAUDERS, // Repel marauders attacking villages or supply lines + TASK_CONDUCT_SEARCH_AND_DESTROY, // Conduct a search and destroy mission against a specific target + TASK_RECOVER_LIFESAVING_MEDICINE, // Recover life-saving medicine from a dangerous or remote location + TASK_DEFEND_SHIPPING_LANES, // Defend shipping lanes from pirates or enemy navies + TASK_RESCUE_CAPTURED_LEADER, // Rescue a captured leader before they are executed or turned against you + TASK_SECURE_FORTIFIED_CAMP, // Secure a camp heavily fortified but under threat of attack + TASK_REPEL_ENEMY_RAID, // Repel an enemy raid on your base or territory + TASK_REPAIR_BREACHED_WALL, // Repair a wall breached by enemy forces during an assault + TASK_DEFEND_WATER_SUPPLY, // Defend a water supply from being poisoned or cut off + TASK_RECOVER_DANGEROUS_ARTIFACT, // Recover an artifact that could cause great harm if left in the wrong hands + TASK_CONDUCT_RECON_MISSION, // Conduct a reconnaissance mission to gather vital information + TASK_RECLAIM_ABANDONED_MINE, // Reclaim an abandoned mine overrun by enemies or dangerous creatures + TASK_REPEL_WINTER_OFFENSIVE, // Repel a winter offensive launched by the enemy + TASK_DEFEND_TRADING_HUB, // Defend a trading hub crucial for economic stability + TASK_SECURE_SECRET_DOCUMENTS, // Secure documents that contain secret or sensitive information + TASK_RECOVER_STOLEN_HORSES, // Recover horses stolen by bandits or enemy forces + TASK_CONSTRUCT_WATCHTOWER_AT_BORDER, // Construct a watchtower at the border for surveillance and defense + TASK_REPEL_NAVAL_RAIDERS, // Repel raiders attacking from the sea or river + TASK_DEFEND_BORDER_WATCHTOWER, // Defend a border watchtower from being overrun by enemy forces + TASK_RESCUE_CAPTIVE_CHILDREN, // Rescue children taken captive by enemies or slavers + TASK_RECOVER_STOLEN_IDOLS, // Recover idols stolen from a temple or sacred site + TASK_DEFEND_MINING_OPERATION, // Defend a mining operation from hostile forces or sabotage + TASK_CONSTRUCT_SIEGE_ENGINE, // Construct a siege engine for an upcoming battle + TASK_REPEL_ENEMY_CHAMPION, // Repel an enemy champion challenging your forces or territory + TASK_SECURE_SMUGGLER_ROUTE, // Secure a smuggler's route to prevent illegal trade or enemy infiltration + TASK_DEFEND_TOWN_HALL, // Defend the town hall from an insurrection or attack + TASK_RESCUE_ABANDONED_WAGON, // Rescue a wagon left behind in enemy territory or dangerous conditions + TASK_RECOVER_MAGIC_AMULET, // Recover a magic amulet of significant power or importance + TASK_REPEL_BARBARIAN_RAID, // Repel a raid by barbarian tribes attacking a settlement or outpost + TASK_DEFEND_SUPPLY_CONVOY, // Defend a supply convoy transporting crucial goods + TASK_RECLAIM_HOLY_SITE, // Reclaim a holy site taken over by enemies or desecrated by invaders + TASK_SECURE_TRADE_AGREEMENT, // Secure a trade agreement to strengthen economic ties between regions + TASK_REPEL_ENEMY_VANGUARD, // Repel an enemy vanguard seeking to establish a foothold + TASK_DEFEND_FARM, // Defend a farm from being raided or destroyed + TASK_RECOVER_LAWLESS_TERRITORY, // Recover a territory overrun by outlaws or bandits + TASK_REPAIR_FORTRESS_WALL, // Repair a damaged fortress wall to prevent further breaches + TASK_CONSTRUCT_CITY_GATE, // Construct a gate to secure a city or major settlement + TASK_REPEL_ENEMY_INVADERS, // Repel enemy invaders from your territory or homeland + TASK_DEFEND_MOUNTAIN_OUTPOST, // Defend a mountain outpost from being overtaken by enemies + TASK_RECLAIM_ANCIENT_WEAPON, // Reclaim an ancient weapon lost or hidden in enemy territory + TASK_SECURE_VALLEY_PASSAGE, // Secure a valley passage critical for movement or trade + TASK_REPEL_SWAMP_RAIDERS, // Repel raiders attacking from a swampy region + TASK_CONSTRUCT_HILL_FORT, // Construct a fort on a hill for strategic defense + TASK_REPAIR_MILITARY_BASE, // Repair a military base damaged by enemy action + TASK_DEFEND_ANCIENT_FORT, // Defend an ancient fort from modern threats + TASK_RECOVER_ENCHANTED_TALISMAN, // Recover an enchanted talisman from a dangerous location + TASK_REPEL_NOMADIC_RAID, // Repel a raid by nomadic tribes + TASK_SECURE_OLD_CASTLE, // Secure an old castle to use as a stronghold + TASK_CONDUCT_EVACUATION, // Conduct an evacuation of civilians from a dangerous area + TASK_DEFEND_RURAL_VILLAGE, // Defend a rural village from raiders or invaders + TASK_RETRIEVE_HIDDEN_TREASURE, // Retrieve treasure hidden in a well-guarded location + TASK_CONSTRUCT_BUNKERS, // Construct bunkers for troops or civilians + TASK_REPAIR_BATTLEFIELD_EQUIPMENT, // Repair equipment used in recent battles + TASK_DEFEND_TEMPLE, // Defend a temple from desecration or attack + TASK_REPEL_INVADING_HORDES, // Repel hordes of enemies attacking from multiple directions + TASK_SECURE_SUPPLY_ROUTE, // Secure a route used for transporting supplies + TASK_RECOVER_ANTIQUITIES, // Recover valuable antiquities from thieves or looters + TASK_DEFEND_TREASURE_VAULT, // Defend a vault containing valuable treasure + TASK_CONSTRUCT_FIELD_DEFENSES, // Construct defenses in an open field to resist an assault + TASK_REPAIR_OLD_WATCHTOWER, // Repair an old watchtower for improved surveillance + TASK_REPEL_SIEGE_WEAPONS, // Repel enemy siege weapons targeting your defenses + TASK_SECURE_ENCHANTED_FOREST, // Secure a forest with magical properties from intruders + TASK_DEFEND_REMOTE_OUTPOST, // Defend a remote outpost from encroaching enemies + TASK_REPAIR_MAGE_TOWER, // Repair a tower used by mages for their magical operations + TASK_RECOVER_VITAL_SUPPLIES, // Recover essential supplies lost or stolen in conflict + TASK_CONSTRUCT_DEFENSIVE_GATES, // Construct gates to enhance the defense of a fortification + TASK_REPEL_CLAN_WARLORD, // Repel a warlord leading a clan assault + TASK_DEFEND_HISTORICAL_SITE, // Defend a site of historical significance from destruction + TASK_REPAIR_FORTIFIED_WALLS, // Repair walls of a fortification to restore its defensive capability + TASK_SECURE_TACTICAL_POSITION, // Secure a position of tactical importance in an ongoing conflict + TASK_RECOVER_STOLEN_EQUIPMENT, // Recover equipment stolen by enemies or thieves + TASK_DEFEND_CIVILIAN_CONVOY, // Defend a convoy of civilians traveling through dangerous areas + TASK_CONSTRUCT_REINFORCED_BARRICADES, // Construct barricades reinforced for extra protection + TASK_REPEL_WILD_CREATURES, // Repel wild creatures threatening settlements or supply lines + TASK_DEFEND_IMPORTANT_BRIDGE, // Defend a bridge critical for transportation and defense + TASK_RECOVER_ENEMY_WEAPONS, // Recover weapons lost or captured from the enemy + TASK_SECURE_HIDDEN_LAIR, // Secure a hidden lair from intruders or hostile forces + TASK_REPAIR_DAMAGED_PALACE, // Repair a palace damaged by conflict or disaster + TASK_DEFEND_CULTURAL_CENTER, // Defend a cultural center from attack or vandalism + TASK_CONSTRUCT_SHIELD_WALL, // Construct a shield wall to protect against a siege or assault + TASK_REPEL_TROLLS, // Repel trolls attacking from mountainous or rocky terrain + TASK_RECOVER_ANCIENT_SCROLLS, // Recover ancient scrolls from a protected location + TASK_DEFEND_FOREST_VILLAGE, // Defend a village situated within a dense forest from invaders + TASK_REPAIR_MYSTIC_OBELISK, // Repair a mystic obelisk of significance to local magical traditions + TASK_CONSTRUCT_FORTRESS_TOWER, // Construct a tower within a fortress for better defense and observation + TASK_SECURE_ABANDONED_OUTPOST, // Secure an outpost that was previously abandoned + TASK_DEFEND_NATIONAL_MONUMENT, // Defend a monument of national importance from damage or theft + TASK_RECOVER_HEIRLOOM_WEAPON, // Recover a weapon of significant familial or historical value + TASK_CONDUCT_STRATEGIC_SURVEY, // Conduct a survey to assess strategic locations and conditions + TASK_REPEL_DARK_MAGIC_USERS, // Repel dark magic users attempting to infiltrate or attack + TASK_SECURE_HIDDEN_TREASURE, // Secure treasure hidden in a secret location + TASK_DEFEND_RITUAL_SITE, // Defend a site used for important rituals from disruption or attack + TASK_REPAIR_MAGICAL_BARRIER, // Repair a magical barrier protecting a critical location + TASK_CONSTRUCT_ARTILLERY_EMPLACEMENTS, // Construct emplacements for artillery to enhance defensive capabilities + TASK_RECOVER_ANCESTRAL_TREASURE, // Recover treasure passed down through generations from a safe location + TASK_DEFEND_MYSTICAL_SPRING, // Defend a mystical spring with significant magical properties + TASK_REPAIR_AIRSHIP, // Repair an airship damaged during aerial conflict or travel + TASK_SECURE_AIRSPACE, // Secure airspace from aerial threats or intrusions + TASK_CONDUCT_MASS_EVACUATION, // Conduct an evacuation of a large population from a threatened area + TASK_DEFEND_VITAL_INFRASTRUCTURE, // Defend critical infrastructure from sabotage or attack + TASK_RECOVER_DAMAGED_ARTIFACTS, // Recover artifacts damaged during conflicts or raids + TASK_CONSTRUCT_REPAIR_STATIONS, // Construct stations for repairing equipment or fortifications + TASK_REPEL_CULT_INVADERS, // Repel invaders from a cult or religious faction + TASK_SECURE_ANCIENT_TREASURE_TROVE, // Secure a trove of ancient treasures from being plundered + TASK_DEFEND_ELITE_TROOPS, // Defend a unit of elite troops from enemy assault or capture + TASK_REPAIR_FORTRESS_CANNONS, // Repair cannons within a fortress to restore their effectiveness + TASK_CONSTRUCT_REINFORCED_BUNKERS, // Construct bunkers with additional reinforcement for strategic protection + TASK_RECOVER_ILLUMINATED_MANUSCRIPTS, // Recover manuscripts with illuminated texts of great value + TASK_DEFEND_SECRET_BASE, // Defend a base hidden from enemy eyes from being discovered or attacked + TASK_REPAIR_DEFENSIVE_TURRETS, // Repair turrets used for defending against enemy attacks + TASK_SECURE_HIGHLY_ENCHANTED_ITEM, // Secure an item of significant magical enchantment + TASK_CONDUCT_ELITE_STRIKE_MISSION, // Conduct a high-risk strike mission with elite operatives + TASK_DEFEND_AGAINST_MAGIC_ATTACKS, // Defend against magical attacks from enemy spellcasters + TASK_RECOVER_HISTORICAL_RELICS, // Recover relics of historical importance from a secure location + TASK_REPAIR_ANCIENT_DEFENSES, // Repair ancient defenses to restore their original protective capability + TASK_CONSTRUCT_MAGICALLY_ENCHANTED_BARRIERS, // Construct barriers with magical enchantments for enhanced defense + TASK_DEFEND_CULTURAL_HERITAGE, // Defend a site of cultural heritage from being attacked or damaged + TASK_SECURE_VITAL_MAGIC_ARTIFACT, // Secure a magic artifact crucial to your forces or plans + TASK_REPAIR_DILAPIDATED_KEEP, // Repair a keep that has fallen into disrepair and disuse + TASK_DEFEND_CRUCIAL_RESOURCE, // Defend a resource essential for survival or strategic advantage + TASK_RECOVER_FAMOUS_BATTLE_STANDARD, // Recover a battle standard of historic significance + TASK_CONSTRUCT_TACTICAL_FORTIFICATIONS, // Construct fortifications designed for tactical advantage in battle + TASK_SECURE_ENCHANTED_WEAPONS, // Secure weapons imbued with enchantments from falling into enemy hands + TASK_REPEL_ARMORED_RAIDERS, // Repel raiders equipped with heavy armor and advanced weaponry + TASK_DEFEND_RITUAL_ALTAR, // Defend an altar used for significant rituals from desecration + TASK_RECOVER_MAGICAL_ENCHANTMENTS, // Recover enchantments lost or stolen from magical artifacts + TASK_REPAIR_UNDERGROUND_BUNKERS, // Repair bunkers located underground to ensure their functionality + TASK_CONSTRUCT_MAGICAL_OBELISKS, // Construct obelisks with magical properties for enhanced defense or power + TASK_DEFEND_VITAL_WAREHOUSE, // Defend a warehouse holding essential supplies or equipment + TASK_RECOVER_ANCESTRAL_ARTIFACTS, // Recover artifacts with ancestral or cultural importance + TASK_REPAIR_ENCHANTED_FORGE, // Repair a forge used for creating enchanted items + TASK_SECURE_COVERT_OPERATION_BASE, // Secure a base used for covert operations and intelligence gathering + TASK_DEFEND_COVERT_MEETING_PLACE, // Defend a location used for secret meetings from discovery or attack + TASK_RECOVER_ANCIENT_TEXTS, // Recover ancient texts of great knowledge + TASK_CONSTRUCT_ELITE_DEFENSIVE_LINE, // Construct a defensive line designed to withstand elite enemy forces + TASK_DEFEND_VITAL_TRANSPORT_HUB, // Defend a transport hub crucial for logistics and troop movement + TASK_SECURE_MYSTICAL_ARTIFACTS, // Secure artifacts with mystical properties from being stolen or destroyed + TASK_RECOVER_COVERT_DOCUMENTS, // Recover documents related to secret operations or intelligence + TASK_REPAIR_OBSOLETE_TURRETS, // Repair outdated turrets to bring them back into operational use + TASK_DEFEND_ENCHANTED_LIBRARY, // Defend a library containing powerful or magical knowledge from attack + TASK_CONSTRUCT_RITUAL_DEFENSES, // Construct defenses specifically designed to protect sacred or ritual sites + TASK_REPEL_INVASION_FROM_THE_SEA, // Repel an invasion force approaching by sea + TASK_SECURE_ANCIENT_TEMPLE_GATES, // Secure the gates of an ancient temple to prevent unauthorized access + TASK_RECOVER_SCARCE_RESOURCES, // Recover resources that are rare or critical for your operations + TASK_DEFEND_LANDMARK_STRUCTURE, // Defend a landmark structure of great significance from damage or occupation + TASK_CONSTRUCT_FORTIFIED_PERIMETER, // Construct a fortified perimeter around a key installation or settlement + TASK_REPAIR_CRUCIAL_COMMUNICATIONS, // Repair communication systems vital for coordinating defense or operations + TASK_SECURE_ENCHANTED_BARRIERS, // Secure barriers enhanced with magical protections from being breached + TASK_DEFEND_AIRBORNE_OPERATIONS, // Defend operations involving airborne units or assets from enemy interference + TASK_RECOVER_HISTORICAL_STATUES, // Recover statues of historical importance from potential damage or theft + TASK_REPAIR_MAGICAL_CONDUITS, // Repair conduits used to channel magical energy or spells + TASK_CONSTRUCT_REINFORCED_TRENCHE, // Construct a trench with additional reinforcements for better protection + TASK_SECURE_MYSTICAL_FOREST, // Secure a forest imbued with mystical properties from intruders + TASK_DEFEND_KEY_TRADING_POST, // Defend a trading post crucial for commerce and supply routes + TASK_RECOVER_ANCIENT_SCROLLS, // Recover ancient scrolls containing important historical or magical information + TASK_CONDUCT_HIGH_STAKES_NEGOTIATIONS, // Conduct negotiations of great importance to resolve conflicts or secure alliances + TASK_DEFEND_AGAINST_NECROMANCY, // Defend against necromantic forces or magic targeting your forces or territory + TASK_REPAIR_EARTHEN_WALLS, // Repair earthen walls that have been damaged or breached + TASK_SECURE_HIDDEN_MINE, // Secure a hidden mine containing valuable resources or artifacts + TASK_RECOVER_WOUNDED_VETERANS, // Recover and provide aid to wounded veterans from recent conflicts + TASK_DEFEND_ANCIENT_SHRINE, // Defend an ancient shrine from desecration or attack + TASK_CONSTRUCT_MAGICAL_WARDS, // Construct wards to protect against magical attacks or intrusions + TASK_REPAIR_HISTORICAL_BUILDINGS, // Repair buildings of historical importance damaged in recent events + TASK_SECURE_FORTIFIED_OUTPOST, // Secure an outpost with fortifications to prevent enemy capture + TASK_DEFEND_VITAL_CROSSROADS, // Defend a crossroads critical for movement and supply routes + TASK_RECOVER_DAMAGED_RITUAL_ARTIFACTS, // Recover artifacts used in rituals that have been damaged or lost + TASK_REPAIR_ENCHANTED_GATES, // Repair gates enhanced with magical protections to restore their functionality + TASK_CONSTRUCT_STRATEGIC_OBSERVATION_POSTS, // Construct posts for strategic observation of enemy movements and positions + TASK_SECURE_VITAL_WEAPONSTOCKS, // Secure stocks of vital weapons from being seized or destroyed + TASK_DEFEND_CRUCIAL_FORTIFICATION, // Defend a fortification crucial for maintaining control over a region + TASK_RECOVER_ANCIENT_WEAPONS, // Recover weapons of ancient origin with significant power or historical value + TASK_REPAIR_CIVILIAN_INFRASTRUCTURE, // Repair infrastructure essential for civilian life and support + TASK_SECURE_CRITICAL_LANDMARKS, // Secure landmarks of great strategic or symbolic importance from threat + TASK_DEFEND_AGAINST_SPY_INTRUSION, // Defend against espionage attempts targeting sensitive areas or information + TASK_RECOVER_SENSITIVE_DATA, // Recover data critical to operations or security from compromised sources + TASK_CONSTRUCT_ENCHANTED_CAVERN_DEFENSES, // Construct defenses within a cavern with magical enchantments + TASK_REPAIR_TREASURE_VAULTS, // Repair vaults used to store valuable treasures and artifacts + TASK_SECURE_GREAT_LIBRARY, // Secure a large library holding extensive and valuable knowledge + TASK_DEFEND_INFLUENTIAL_LEADER, // Defend a leader of great influence from threats or attempts on their life + TASK_RECOVER_CRITICAL_MEDICAL_SUPPLIES, // Recover medical supplies essential for treatment and recovery + TASK_REPAIR_DAMAGED_BATTLEFIELD_STRATEGY, // Repair and adjust strategies used on the battlefield based on recent damage + TASK_CONSTRUCT_ELITE_PROTECTIVE_ARMOR, // Construct armor designed for elite troops or high-value targets + TASK_SECURE_ANCIENT_SECRET_TREASURE, // Secure treasure hidden in ancient locations of historical importance + TASK_DEFEND_HIDDEN_MILITARY_BASE, // Defend a secret military base from discovery or attack + TASK_RECOVER_DAMAGED_MAGIC_ITEMS, // Recover magic items damaged during recent conflicts or raids + TASK_REPAIR_BATTLEFIELD_ARTIFACTS, // Repair artifacts found on the battlefield essential for historical or strategic reasons + TASK_CONSTRUCT_PROTECTIVE_RUNES, // Construct runes for protection against magical or physical threats + TASK_SECURE_LEGENDARY_SITES, // Secure sites of legendary significance from threats or exploitation + TASK_DEFEND_STRATEGIC_TRADE_ROUTE, // Defend a trade route vital for commerce and resource distribution + TASK_RECOVER_MYSTICAL_ARTIFACTS, // Recover artifacts with mystical significance from dangerous locations + TASK_REPAIR_CRITICAL_INDUSTRIAL_EQUIPMENT, // Repair equipment crucial for industrial operations and production + TASK_CONSTRUCT_RITUALISTIC_DEFENSES, // Construct defenses based on ritualistic or magical designs for enhanced protection + TASK_SECURE_HIDDEN_MYSTICAL_ARTIFACTS, // Secure mystical artifacts hidden from general knowledge or access + TASK_DEFEND_CULTURAL_INSTITUTIONS, // Defend institutions dedicated to culture and the arts from attack or damage + TASK_RECOVER_DAMAGED_STATUES, // Recover and restore statues of artistic or historical significance + TASK_REPAIR_DEMOLISHED_FORTIFICATIONS, // Repair fortifications that have been demolished or heavily damaged + TASK_CONSTRUCT_UNDERGROUND_BUNKERS, // Construct bunkers underground to provide protection and concealment + TASK_SECURE_HISTORICAL_SITES, // Secure sites of historical importance from damage, theft, or unauthorized access + TASK_DEFEND_MYSTICAL_CAVES, // Defend caves with mystical properties from intrusion or desecration + TASK_RECOVER_EXPERT_CRAFTSMAN, // Recover a skilled craftsman who can create or repair valuable items + TASK_REPAIR_ANCIENT_DEFENSIVE_STRUCTURES, // Repair ancient structures designed for defensive purposes + TASK_CONSTRUCT_ENCHANTED_PROTECTIVE_BARRIERS, // Construct barriers enhanced with enchantments for superior protection + TASK_SECURE_ECONOMICALLY_VITAL_RESOURCES, // Secure resources critical for economic stability and growth + TASK_DEFEND_AGAINST_MAGICAL_BEASTS, // Defend against beasts with magical properties or abilities + TASK_RECOVER_ENCHANTED_SCROLLS, // Recover scrolls imbued with magic from secure locations + TASK_REPAIR_HIGH_PRIORITY_EQUIPMENT, // Repair equipment deemed high priority for ongoing operations + TASK_CONSTRUCT_FORTIFIED_RESEARCH_LAB, // Construct a research lab with fortified defenses for scientific or magical work + TASK_SECURE_MAGICALLY_ENHANCED_TREASURE, // Secure treasure with magical enhancements from theft or damage + TASK_DEFEND_TACTICAL_OUTPOSTS, // Defend outposts critical for tactical operations and defense + TASK_RECOVER_RARE_ALCHEMICAL_REAGENTS, // Recover reagents used in alchemy that are rare or essential + TASK_REPAIR_PROTECTIVE_MAGIC_CONDUITS, // Repair conduits used to channel protective magic or enchantments + TASK_CONSTRUCT_ADVANCED_DEFENSIVE_FORTIFICATIONS, // Construct advanced fortifications for improved defense against formidable threats + TASK_DEFEND_ENCHANTED_SPRING, // Defend a spring with magical properties from exploitation or attack + TASK_RECOVER_LOST_CIVILIZATION_ARTIFACTS, // Recover artifacts from a lost civilization of great historical or magical significance + TASK_REPAIR_ADVANCED_SEA_DEFENSES, // Repair advanced defenses designed to protect against sea-based attacks + TASK_CONSTRUCT_SECURE_RITUAL_CHAMBERS, // Construct chambers designed for performing high-security rituals + TASK_SECURE_CRITICAL_MAGE_TOWER, // Secure a mage tower vital for magical operations and research + TASK_DEFEND_HEAVILY_FORTIFIED_CITY, // Defend a city with extensive fortifications from sieges or attacks + TASK_RECOVER_ANCIENT_TECHNOLOGY, // Recover technology of ancient origin with significant power or utility + TASK_REPAIR_EXPERIMENTAL_WEAPONS, // Repair weapons of experimental design used for cutting-edge combat + TASK_CONSTRUCT_PROTECTIVE_ENCHANTMENTS, // Construct enchantments to protect key locations or items from magical harm + TASK_SECURE_ALCHEMICAL_REACTORS, // Secure reactors used in alchemy or magical experiments from threats + TASK_DEFEND_SUPPLY_DEPOT, // Defend a depot holding critical supplies from sabotage or theft + TASK_RECOVER_DAMAGED_ANTIQUITIES, // Recover and restore antiquities damaged in recent conflicts + TASK_REPAIR_TACTICAL_ENGINES, // Repair engines used in tactical operations or war machines + TASK_CONSTRUCT_RESEARCH_STATIONS, // Construct stations dedicated to research in strategic or magical fields + TASK_SECURE_MAGICAL_TRANSMISSION_TOWERS, // Secure towers used for transmitting magical energy or signals from interference + TASK_DEFEND_CONSTRUCTED_EMBASSIES, // Defend embassies constructed in dangerous regions from attack or breach + TASK_RECOVER_OBSOLETE_ARTIFACTS, // Recover artifacts that have fallen out of use but are still of historical value + TASK_REPAIR_SECURE_CHESTS, // Repair chests used to store valuable or sensitive items + TASK_CONSTRUCT_FORTIFIED_COMMAND_BUNKERS, // Construct command bunkers with advanced fortifications for strategic command + TASK_SECURE_ANCIENT_POWER_SOURCES, // Secure sources of ancient power from theft or misuse + TASK_DEFEND_INFLUENTIAL_ORGANIZATIONS, // Defend organizations of great influence or power from hostile actions + TASK_RECOVER_LOST_TREASURES, // Recover treasures that have been lost or hidden over time + TASK_REPAIR_EXOTIC_ARTIFACTS, // Repair artifacts of exotic origin that are crucial for various operations + TASK_CONSTRUCT_SUPPLY_CHAIN_DEFENSES, // Construct defenses to protect critical supply chains from disruption + TASK_SECURE_LEGENDARY_TREASURE_CACHES, // Secure caches of treasure with legendary status from plunder + TASK_DEFEND_HIGH_PRIORITY_RESEARCH_LABS, // Defend research labs with high-priority projects from attack + TASK_RECOVER_SENSITIVE_EQUIPMENT, // Recover equipment essential for operations that has been compromised or lost + TASK_REPAIR_ANCIENT_MILITARY_EQUIPMENT, // Repair equipment of ancient military origin for restoration and use + TASK_CONSTRUCT_ENCHANTED_SECURITY_SYSTEMS, // Construct security systems with enchantments for heightened protection + TASK_SECURE_HISTORICAL_RESEARCH_ARCHIVES, // Secure archives containing historical research from unauthorized access or damage + TASK_DEFEND_CRITICAL_WAR_SUPPLIES, // Defend supplies critical for ongoing war efforts from attack or theft + TASK_RECOVER_MAGICALLY_ENHANCED_GEAR, // Recover gear enhanced with magical properties that has been lost or stolen + TASK_REPAIR_FORTIFIED_MILITARY_OUTPOSTS, // Repair military outposts with fortifications to restore their effectiveness + TASK_CONSTRUCT_STRATEGIC_MAGICAL_OBSERVATORIES, // Construct observatories designed for monitoring magical events or phenomena + TASK_SECURE_ANCIENT_ENCHANTED_RELICS, // Secure relics with ancient enchantments from being disturbed or misused + TASK_DEFEND_HIGHLY_SENSITIVE_SITES, // Defend sites with highly sensitive information or assets from breaches + TASK_RECOVER_VITAL_MAGICAL_ESSENCES, // Recover essences crucial for magical operations or artifacts + TASK_REPAIR_ADVANCED_ENCHANTMENT_DEVICES, // Repair devices used for advanced enchantments or magical operations + TASK_CONSTRUCT_ENCHANTED_TACTICAL_GATES, // Construct gates with enchantments for tactical advantage in defense + TASK_SECURE_CRITICAL_ENCHANTED_RESOURCES, // Secure resources imbued with enchantments essential for various uses + TASK_DEFEND_AGAINST_MAGICAL_INTERFERENCE, // Defend against interference from magical sources or entities + TASK_RECOVER_OLD_TRADITIONAL_WEAPONS, // Recover traditional weapons with significant historical or cultural importance + TASK_REPAIR_HIGH_ECH_ARTIFACTS, // Repair artifacts with high technological advancements from damage or malfunction + TASK_CONSTRUCT_MAGICALLY_PROTECTED_BARRIERS, // Construct barriers protected with magic for superior defense + TASK_SECURE_ENCHANTED_TREASURE_VAULTS, // Secure vaults holding treasure with magical enhancements + TASK_DEFEND_KEY_SACRED_SITES, // Defend sacred sites of great importance from desecration or attack + TASK_RECOVER_HISTORIC_MILITARY_DOCUMENTS, // Recover documents of historic military importance from secure locations + TASK_REPAIR_ADVANCED_PROTECTIVE_SYSTEMS, // Repair systems designed for advanced protection against various threats + TASK_CONSTRUCT_DEFENSIVE_RITUALS, // Construct defensive measures based on rituals for enhanced protection + TASK_SECURE_HIDDEN_MAGIC_TREASURES, // Secure hidden treasures with magical properties from discovery or theft + TASK_DEFEND_CRITICAL_MAGICAL_GATES, // Defend gates with significant magical importance from breach or damage + TASK_RECOVER_ANCIENT_ENCHANTMENTS, // Recover enchantments from ancient sources that have been lost or hidden + TASK_REPAIR_SECURE_RESEARCH_EQUIPMENT, // Repair equipment used in secure research environments + TASK_CONSTRUCT_TACTICAL_ENCHANTED_FORTIFICATIONS, // Construct fortifications with tactical enchantments for strategic defense + TASK_SECURE_VITAL_ANCIENT_GRIMOIRES, // Secure grimoires containing ancient knowledge from unauthorized access + TASK_DEFEND_INTERNATIONAL_TREATY_SITES, // Defend sites related to international treaties from violations or attacks + TASK_RECOVER_HISTORIC_CONSTRUCTION_PLANS, // Recover plans related to historic constructions of strategic importance + TASK_REPAIR_DEFENSIVE_ENCHANTMENTS, // Repair enchantments used to protect key defensive structures or assets + TASK_CONSTRUCT_ADVANCED_MAGE_BARRIERS, // Construct barriers with advanced magical properties for high-level protection + TASK_SECURE_ENCHANTED_WEAPON_STORAGE, // Secure storage areas for weapons with magical enhancements + TASK_DEFEND_AGAINST_RITUALISTIC_ATTACKS, // Defend against attacks based on ritualistic or magical practices + TASK_RECOVER_HISTORICAL_ARTIFACTS, // Recover artifacts with significant historical value from secure locations + TASK_REPAIR_TACTICAL_MAGIC_BARRIERS, // Repair barriers designed for tactical use in magical defenses + TASK_CONSTRUCT_SUPPLY_CHAIN_SECURITY, // Construct security measures for protecting critical supply chains + TASK_SECURE_ENCHANTED_MILITARY_INSTALLATIONS, // Secure military installations with magical enhancements + TASK_DEFEND_HIGH_VALUE_RESEARCH_FACILITIES, // Defend research facilities of high value from threats and breaches + TASK_RECOVER_DAMAGED_MYSTICAL_ARTIFACTS, // Recover and restore artifacts of mystical importance that have been damaged + TASK_REPAIR_ADVANCED_DEFENSIVE_CONDUITS, // Repair conduits used for advanced defensive measures + TASK_CONSTRUCT_MAGICAL_HARVESTING_STATIONS, // Construct stations for harvesting magical resources or energy + TASK_SECURE_CRUCIAL_MAGICAL_TRANSPORTS, // Secure transport routes or vessels used for moving magical resources + TASK_DEFEND_RESEARCH_AND_DEVELOPMENT_SITES, // Defend sites dedicated to research and development from attacks or sabotage + TASK_RECOVER_EXOTIC_RITUAL_ARTIFACTS, // Recover artifacts used in exotic rituals from danger or theft + TASK_REPAIR_ADVANCED_STRATEGIC_ARTIFACTS, // Repair strategic artifacts with advanced features or technology + TASK_CONSTRUCT_FORTIFIED_MAGIC_WARDS, // Construct wards with fortifications to enhance magical protection + TASK_SECURE_LEGENDARY_ENCHANTED_ITEMS, // Secure items of legendary enchantment from theft or destruction + TASK_DEFEND_ANTIQUITY_STORAGE_FACILITIES, // Defend facilities storing valuable antiquities from breach or damage + TASK_RECOVER_HISTORICAL_RESEARCH_EQUIPMENT, // Recover equipment used in historical research from loss or damage + TASK_REPAIR_TACTICAL_ENCHANTED_ARTIFACTS, // Repair artifacts with tactical enchantments for improved functionality + TASK_CONSTRUCT_ENCHANTED_PROTECTIVE_SHELTERS, // Construct shelters with magical protection for safety and security + TASK_SECURE_ANCIENT_MAGIC_SECRETS, // Secure secrets related to ancient magic from being exposed or misused + TASK_DEFEND_CRITICAL_MAGIC_RESEARCH, // Defend research focused on magic from disruption or attack + TASK_RECOVER_DAMAGED_HISTORICAL_RELICS, // Recover and restore relics of historical significance that have been damaged +}; + +#endif \ No newline at end of file diff --git a/models/guild/GuildBanner.h b/models/guild/GuildBanner.h new file mode 100644 index 0000000..04a64e2 --- /dev/null +++ b/models/guild/GuildBanner.h @@ -0,0 +1,23 @@ +/** + * Jingga + * + * @copyright Jingga + * @license OMS License 2.0 + * @version 1.0.0 + * @link https://jingga.app + */ +#ifndef TOS_MODELS_GUILD_BANNER_H +#define TOS_MODELS_GUILD_BANNER_H + +struct GuildBanner { + int shape; + int colors; + + int crest; + int crest_colors; + + int pole; + int pole_colors; +}; + +#endif \ No newline at end of file diff --git a/models/item/Equipment.h b/models/item/Equipment.h index 950a48f..eccb149 100644 --- a/models/item/Equipment.h +++ b/models/item/Equipment.h @@ -11,23 +11,37 @@ #include "../../stdlib/Types.h" -#include "../../mob/MobStats.h" -#include "../../mob/skill/StatsTarget.h" +#include "../mob/MobStats.h" +#include "../mob/skill/StatsTarget.h" + +// @todo when to use points and when to use values? struct Equipment { byte type; char* name; +}; - // @tood how to handle multiplicative stats? - // you can have 2 stats for 2 target types (e.g. you could create a buff and debuff in one skill) - SMobStats stats1; - StatsTarget stats1_target; +struct SEquipmentStatsPoints { + // Item requirements + PrimaryStatsPoints requirements; - SMobStats stats2; - StatsTarget stats2_target; + // Item stats + // items cannot have stats like str, they can only modify primary stats of chars (see below) + SecondaryStatsPoints secondary_item; - // @todo probably add more of the Skill attributes here - // @question what should be part of skills and what should be part of items?!?!?!? + // Modifies the char stats + // @todo A character cannot do for example fire damage (only items and skills can do that) + // This means these stats are unused and just use up memory + PrimaryStatsPoints primary_char_add; + PrimaryStatsRelPoints primary_char_mul; + + SecondaryStatsPoints secondary_char_add; + SecondaryStatsRelPoints secondary_char_mul; + + // Modifies the skills + // only modifies skills that have these stats != 0 + SecondaryStatsPoints secondary_skill_add; + SecondaryStatsRelPoints secondary_skill_mul; }; #endif \ No newline at end of file diff --git a/models/item/EquipmentType.h b/models/item/EquipmentType.h index 1635392..cb5ffaa 100644 --- a/models/item/EquipmentType.h +++ b/models/item/EquipmentType.h @@ -20,6 +20,7 @@ struct EquipmentType { bool damage; bool armor; bool supporting; + bool beam; }; #endif \ No newline at end of file diff --git a/models/map.h b/models/map.h index e69de29..6508791 100644 --- a/models/map.h +++ b/models/map.h @@ -0,0 +1 @@ +// @todo \ No newline at end of file diff --git a/models/mob/ActivityStats.h b/models/mob/ActivityStats.h new file mode 100644 index 0000000..e4eb10b --- /dev/null +++ b/models/mob/ActivityStats.h @@ -0,0 +1,24 @@ +/** + * Jingga + * + * @copyright Jingga + * @license OMS License 2.0 + * @version 1.0.0 + * @link https://jingga.app + */ +#ifndef TOS_MODELS_MOB_ACTIVITY_STATS_H +#define TOS_MODELS_MOB_ACTIVITY_STATS_H + +#include "../../stdlib/Types.h" + +/** + * @todo optimize order of struct members to ensure optimal struct size + */ + +struct SActivityStats { + int32 farming; + int32 thiefing; + int32 mining; +}; + +#endif \ No newline at end of file diff --git a/models/mob/Mob.cpp b/models/mob/Mob.cpp index 324aa73..aa3005a 100644 --- a/models/mob/Mob.cpp +++ b/models/mob/Mob.cpp @@ -26,14 +26,14 @@ void mob_interpolate(Mob* mob, f32 time) float p = OMS_MIN(t2 / t1, 1.0f); - mob->state.location.x = s1->location.x + (s2->location.x - s1->location.x) * p; - mob->state.location.y = s1->location.y + (s2->location.y - s1->location.y) * p; - mob->state.location.z = s1->location.z + (s2->location.z - s1->location.z) * p; + mob->state.location.position.x = s1->location.position.x + (s2->location.position.x - s1->location.position.x) * p; + mob->state.location.position.y = s1->location.position.y + (s2->location.position.y - s1->location.position.y) * p; + mob->state.location.position.z = s1->location.position.z + (s2->location.position.z - s1->location.position.z) * p; - mob->state.orientation.x = s1->orientation.x + (s2->orientation.x - s1->orientation.x) * p; - mob->state.orientation.y = s1->orientation.y + (s2->orientation.y - s1->orientation.y) * p; - mob->state.orientation.z = s1->orientation.z + (s2->orientation.z - s1->orientation.z) * p; - mob->state.orientation.w = s1->orientation.w + (s2->orientation.w - s1->orientation.w) * p; + mob->state.location.orientation.x = s1->location.orientation.x + (s2->location.orientation.x - s1->location.orientation.x) * p; + mob->state.location.orientation.y = s1->location.orientation.y + (s2->location.orientation.y - s1->location.orientation.y) * p; + mob->state.location.orientation.z = s1->location.orientation.z + (s2->location.orientation.z - s1->location.orientation.z) * p; + mob->state.location.orientation.w = s1->location.orientation.w + (s2->location.orientation.w - s1->location.orientation.w) * p; } #endif \ No newline at end of file diff --git a/models/mob/Mob.h b/models/mob/Mob.h index 3f9956e..c2e18c4 100644 --- a/models/mob/Mob.h +++ b/models/mob/Mob.h @@ -16,6 +16,8 @@ #include "MobState.h" +// @todo consider to create 3 mob state arrays instead and have every array ordered in the same way + struct Mob { byte category; byte mclass; @@ -29,6 +31,26 @@ struct Mob { MobState state; MobState state1; MobState state2; + + // Data layout + // 12223444 + // 1: scale sign + // 2: scale factor (8) + // 3: weight sign + // 4: weight factor (8) + byte scale; + byte weight; + + // Data layout + // 11111112222222333333344444445555 + // 1: Base color (skin color) + // 2: Second color (head hair color) + // 3: Third color (head hair color) + // 4: Fourth color (head hair color) + // 5: Fifth color (head hair color) + + SecondaryStatsValues max; + SecondaryStatsValues current; }; #endif \ No newline at end of file diff --git a/models/mob/MobState.h b/models/mob/MobState.h index 1d84acf..0bec72a 100644 --- a/models/mob/MobState.h +++ b/models/mob/MobState.h @@ -9,13 +9,20 @@ #ifndef TOS_MODELS_MOB_STATE_H #define TOS_MODELS_MOB_STATE_H +#include "../Location.h" #include "../../stdlib/Types.h" -#include "../../stdlib/Mathtypes.h" #include "MobAction.h" +/** + * @todo optimize order of struct members to ensure optimal struct size + */ + +// @todo consider to have an array of mob_location which contains position+orientation probably much better cache wise? +// but these locations are only chunk relative?! Well the absolute position comes from the chunk id. +// The whole world is split into a x b x c chunks + struct MobState { - v3_f32 location; - v4_f32 orientation; + Location location; float t; @@ -24,9 +31,10 @@ struct MobState { // last 3 bytes = animation to use uint32 action = (MOB_ACTION_INACTIVE << 24); + int chunk_id; + bool in_battle; - int chunk_id; byte environment; // dungeon/raid, pvp-openworld, pvp, pvp-tournament, open-world, instance-private, instance-invite, housing, }; diff --git a/models/mob/MobStats.cpp b/models/mob/MobStats.cpp new file mode 100644 index 0000000..56b636e --- /dev/null +++ b/models/mob/MobStats.cpp @@ -0,0 +1,48 @@ +/** + * Jingga + * + * @copyright Jingga + * @license OMS License 2.0 + * @version 1.0.0 + * @link https://jingga.app + */ +#ifndef TOS_MODELS_MOB_STATS_C +#define TOS_MODELS_MOB_STATS_C + +#include "MobStats.h" +#include "../../stdlib/simd/SIMD_I32.h" + +// Calculate whenever character points or items change +// 1. combine primary Item points with character points +// 2. combine secondary item points with character points +// 3. calculate semi static character values from points + +// Calculated for every skill and then cached whenever that skill is used +inline +void calculate_modify_values( + const Skill* skill, + const SMobStatsTotal* mob_stats, + const SEquipmentStatsTotal* item_stats, + SecondaryStatsValues* modify_values +) +{ + +} + +// @todo check what to do?? + +inline +void handle_character_fight_action( + const SecondaryStatsValues* modify_values, + const Skill* skill, + SecondaryStatsValues *mob_values, + int steps +) +{ + // @todo not correct since the modify_value needs further modification in relation to the effected mob (e.g. defense consideration) + // but this means i also need the skill as parameter + int32_4_add((int32 *) modify_values, (int32 *) mob_values, (int32 *) mob_values, 10, steps); + f32_4_add((f32 *) (modify_values + 1), (f32 *) (mob_values + 1), (f32 *) (mob_values + 1), 10, steps); +} + +#endif \ No newline at end of file diff --git a/models/mob/MobStats.h b/models/mob/MobStats.h index 5839286..775ab06 100644 --- a/models/mob/MobStats.h +++ b/models/mob/MobStats.h @@ -11,537 +11,553 @@ #include "../../stdlib/Types.h" +/** + * @todo optimize order of struct members to ensure optimal struct size + */ + +// Character stats modifiable through leveling (simple +/- buttons) +struct PrimaryStatsPoints { + byte stat_str; // strength : effects health + base damage + byte stat_int; // inteligence : effects resource + base demage + byte stat_acc; // accuracy : effects critical chance + base damage + miss chance + byte stat_agi; // agility : effects resource + base damage + dodge chance + byte stat_def; // defense : effects resource + base defense + dodge chance + byte stat_sta; // stamina : effects health regen + resource regen +}; + +struct PrimaryStatsRel { + f32 stat_str; + f32 stat_int; + f32 stat_acc; + f32 stat_agi; + f32 stat_def; + f32 stat_sta; +}; + +struct PrimaryStatsRelPoints { + byte stat_str; + byte stat_int; + byte stat_acc; + byte stat_agi; + byte stat_def; + byte stat_sta; +}; + +// Character stats modifiable thorugh skill tree? +struct SecondaryStatsPoints { + // Damage types + byte dmg_pircing; + byte dmg_slashing; + byte dmg_bludgeoning; + byte dmg_stabbing; + byte dmg_fire; + byte dmg_water; + byte dmg_wind; + byte dmg_earth; + byte dmg_poison; + byte dmg_lightning; + byte dmg_ice; + byte dmg_arcane; + byte dmg_corrupted; + byte dmg_holy; + byte dmg_reflection; + byte dmg_reflection_chance; + + byte dmg_crit; + byte dmg_crit_chance; + + // Health & Resource + byte health; + byte health_on_dmg_dealt; + byte health_on_dmg_taken; + + byte health_regen; + byte health_regen_rel; + byte health_regen_on_dmg_dealt; + byte health_regen_on_dmg_taken; + + byte resource; + byte resource_on_dmg_dealt; + byte resource_on_dmg_taken; + + byte resource_regen; + byte resource_regen_rel; + byte resource_regen_on_dmg_dealt; + byte resource_regen_on_dmg_taken; + + byte resource_loss; + byte resource_loss_on_dmg_dealt; + byte resource_loss_on_dmg_taken; + + // Defense types + // think about it as armor and/or resistence if it helps + byte defense_pircing; + byte defense_slashing; + byte defense_bludgeoning; + byte defense_stabbing; + byte defense_fire; + byte defense_water; + byte defense_ice; + byte defense_earth; + byte defense_wind; + byte defense_poison; + byte defense_lightning; + byte defense_holy; + byte defense_arcane; + byte defense_corrupted; + + // Accuracy + byte dodge_chance; + byte cc_protection; + byte miss_chance; + + // Movement + // Additional speeds may be defined for Mobs + byte speed_walk1; + byte speed_swim1; + byte speed_fly1; + + // Fighting speed + byte speed_cast; + byte speed_attack; + + byte pickup_range; + + byte shield; + + byte aoe_scale; + byte resource_cost; + byte health_cost; + byte attack_range; + byte melee_range; + byte projectile_speed; + byte projectile_count; + byte shatter_probability; + byte shatter_range; + byte shatter_dmg; + byte shatter_count; + byte passthrough_damage; + byte passthrough_count; + byte dot_duration; + byte dot_count; + byte bleeding_dot; + byte poison_dot; + byte burn_dot; + byte ice_dot; + byte resource_drain; + byte shatter_dot; + byte minon_duration; + byte minion_count; + byte effect_spreading_probability; + byte effect_spreading_radius; + byte effect_spreading_max_count; + byte effect_duration; + byte aura_range; + byte cast_duration; + + byte agro_range; +}; + + +// @todo change order for simd calculations so that all valus match up +struct SecondaryStatsValues { + // Damage types + int32 dmg_pircing; + int32 dmg_slashing; + int32 dmg_bludgeoning; + int32 dmg_stabbing; + int32 dmg_fire; + int32 dmg_water; + int32 dmg_wind; + int32 dmg_earth; + int32 dmg_poison; + int32 dmg_lightning; + int32 dmg_ice; + int32 dmg_arcane; + int32 dmg_corrupted; + int32 dmg_holy; + int32 dmg_reflection; + int32 dmg_reflection_chance; + + int32 dmg_crit; + f32 dmg_crit_chance; + + // Health & Resource + int32 health; + f32 health_on_dmg_dealt; + f32 health_on_dmg_taken; + + int32 health_regen; + f32 health_regen_rel; + f32 health_regen_on_dmg_dealt; + f32 health_regen_on_dmg_taken; + + int32 resource; + f32 resource_on_dmg_dealt; + f32 resource_on_dmg_taken; + + int32 resource_regen; + f32 resource_regen_rel; + f32 resource_regen_on_dmg_dealt; + f32 resource_regen_on_dmg_taken; + + int32 resource_loss; + f32 resource_loss_on_dmg_dealt; + f32 resource_loss_on_dmg_taken; + + // Defense types + // think about it as armor and/or resistence if it helps + int32 defense_pircing; + int32 defense_slashing; + int32 defense_bludgeoning; + int32 defense_stabbing; + int32 defense_fire; + int32 defense_water; + int32 defense_ice; + int32 defense_earth; + int32 defense_wind; + int32 defense_poison; + int32 defense_lightning; + int32 defense_holy; + int32 defense_arcane; + int32 defense_corrupted; + + // Accuracy + f32 dodge_chance; + f32 cc_protection; + f32 miss_chance; + + // Movement + // Additional speeds may be defined for Mobs + f32 speed_walk1; + f32 speed_swim1; + f32 speed_fly1; + + // Fighting speed + f32 speed_cast; + f32 speed_attack; + + f32 pickup_range; + + int32 shield; + + f32 aoe_scale; + f32 resource_cost; + f32 health_cost; + f32 attack_range; + f32 melee_range; + f32 projectile_speed; + int32 projectile_count; + f32 shatter_probability; + f32 shatter_range; + int32 shatter_dmg; + int32 shatter_count; + f32 passthrough_damage; + int32 passthrough_count; + f32 dot_duration; + int32 dot_count; + int32 bleeding_dot; + int32 poison_dot; + int32 burn_dot; + int32 ice_dot; + int32 resource_drain; + int32 shatter_dot; + f32 minon_duration; + int32 minion_count; + f32 effect_spreading_probability; + f32 effect_spreading_radius; + int32 effect_spreading_max_count; + f32 effect_duration; + f32 aura_range; + f32 cast_duration; + + f32 agro_range; +}; + +struct SecondaryStatsRel { + // Damage types + f32 dmg_pircing; + f32 dmg_slashing; + f32 dmg_bludgeoning; + f32 dmg_stabbing; + f32 dmg_fire; + f32 dmg_water; + f32 dmg_wind; + f32 dmg_earth; + f32 dmg_poison; + f32 dmg_lightning; + f32 dmg_ice; + f32 dmg_arcane; + f32 dmg_corrupted; + f32 dmg_holy; + f32 dmg_reflection; + f32 dmg_reflection_chance; + + f32 dmg_crit; + f32 dmg_crit_chance; + + // Health & Resource + f32 health; + f32 health_on_dmg_dealt; + f32 health_on_dmg_taken; + + f32 health_regen; + f32 health_regen_on_dmg_dealt; + f32 health_regen_on_dmg_taken; + + f32 resource; + f32 resource_on_dmg_dealt; + f32 resource_on_dmg_taken; + + f32 resource_regen; + f32 resource_regen_on_dmg_dealt; + f32 resource_regen_on_dmg_taken; + + f32 resource_loss; + f32 resource_loss_on_dmg_dealt; + f32 resource_loss_on_dmg_taken; + + // Defense types + // think about it as armor and/or resistence if it helps + f32 defense_pircing; + f32 defense_slashing; + f32 defense_bludgeoning; + f32 defense_stabbing; + f32 defense_fire; + f32 defense_water; + f32 defense_ice; + f32 defense_earth; + f32 defense_wind; + f32 defense_poison; + f32 defense_lightning; + f32 defense_holy; + f32 defense_arcane; + f32 defense_corrupted; + + // Accuracy + f32 dodge_chance; + f32 cc_protection; + f32 miss_chance; + + // Movement + // Additional speeds may be defined for Mobs + f32 speed_walk1; + f32 speed_swim1; + f32 speed_fly1; + + // Fighting speed + f32 speed_cast; + f32 speed_attack; + + f32 pickup_range; + + f32 shield; + + f32 aoe_scale; + f32 resource_cost; + f32 health_cost; + f32 attack_range; + f32 melee_range; + f32 projectile_speed; + f32 projectile_count; + f32 shatter_probability; + f32 shatter_range; + f32 shatter_dmg; + f32 shatter_count; + f32 passthrough_damage; + f32 passthrough_count; + f32 dot_duration; + f32 dot_count; + f32 bleeding_dot; + f32 poison_dot; + f32 burn_dot; + f32 ice_dot; + f32 resource_drain; + f32 shatter_dot; + f32 minon_duration; + f32 minion_count; + f32 effect_spreading_probability; + f32 effect_spreading_radius; + f32 effect_spreading_max_count; + f32 effect_duration; + f32 aura_range; + f32 cast_duration; + + f32 agro_range; +}; + +struct SecondaryStatsRelPoints { + // Damage types + byte dmg_pircing; + byte dmg_slashing; + byte dmg_bludgeoning; + byte dmg_stabbing; + byte dmg_fire; + byte dmg_water; + byte dmg_wind; + byte dmg_earth; + byte dmg_poison; + byte dmg_lightning; + byte dmg_ice; + byte dmg_arcane; + byte dmg_corrupted; + byte dmg_holy; + byte dmg_reflection; + byte dmg_reflection_chance; + + byte dmg_crit; + byte dmg_crit_chance; + + // Health & Resource + byte health; + byte health_on_dmg_dealt; + byte health_on_dmg_taken; + + byte health_regen; + byte health_regen_on_dmg_dealt; + byte health_regen_on_dmg_taken; + + byte resource; + byte resource_on_dmg_dealt; + byte resource_on_dmg_taken; + + byte resource_regen; + byte resource_regen_on_dmg_dealt; + byte resource_regen_on_dmg_taken; + + byte resource_loss; + byte resource_loss_on_dmg_dealt; + byte resource_loss_on_dmg_taken; + + // Defense types + // think about it as armor and/or resistence if it helps + byte defense_pircing; + byte defense_slashing; + byte defense_bludgeoning; + byte defense_stabbing; + byte defense_fire; + byte defense_water; + byte defense_ice; + byte defense_earth; + byte defense_wind; + byte defense_poison; + byte defense_lightning; + byte defense_holy; + byte defense_arcane; + byte defense_corrupted; + + // Accuracy + byte dodge_chance; + byte cc_protection; + byte miss_chance; + + // Movement + // Additional speeds may be defined for Mobs + byte speed_walk1; + byte speed_swim1; + byte speed_fly1; + + // Fighting speed + byte speed_cast; + byte speed_attack; + + byte pickup_range; + + byte shield; + + byte aoe_scale; + byte resource_cost; + byte health_cost; + byte attack_range; + byte melee_range; + byte projectile_speed; + byte projectile_count; + byte shatter_probability; + byte shatter_range; + byte shatter_dmg; + byte shatter_count; + byte passthrough_damage; + byte passthrough_count; + byte dot_duration; + byte dot_count; + byte bleeding_dot; + byte poison_dot; + byte burn_dot; + byte ice_dot; + byte resource_drain; + byte shatter_dot; + byte minon_duration; + byte minion_count; + byte effect_spreading_probability; + byte effect_spreading_radius; + byte effect_spreading_max_count; + byte effect_duration; + byte aura_range; + byte cast_duration; + + byte agro_range; +}; + +struct FixedStats { + // Movement + // Additional speeds may be defined for Mobs + float speed_walk1; + float speed_swim1; + float speed_fly1; + + f32 speed_jump; + f32 speed_dodge; + f32 speed_turn; +}; + +// @question Do we even want this? +struct PlayerStats { + f32 pickup_range; +}; + struct SMobStatsTotal { - byte stat_str; // strength : effects health + base damage - byte stat_int; // inteligence : effects resource + base demage - byte stat_acc; // accuracy : effects critical chance + base damage + miss chance - byte stat_agi; // agility : effects resource + base damage + dodge change - byte stat_def; // defense : effects resource + base defense + dodge change - byte stat_sta; // stamina : effects health regen + resource regen + PrimaryStatsPoints primary_total; + SecondaryStatsValues secondary_total; - // Naming conventions - // : total - // _base : character stats (see stat_ above) - // _equip : character equipment - // _item : other item effects (consumables, e.g. potions) - // _effect : external aoe/skill effect - // _skill : own skill - - // Damage types - uint32 dmg; - uint32 dmg_base; - uint32 dmg_equip; - uint32 dmg_item; - uint32 dmg_effect; - uint32 dmg_skill; - - uint32 dmg_pircing; - uint32 dmg_pircing_base; - uint32 dmg_pircing_equip; - uint32 dmg_pircing_item; - uint32 dmg_pircing_effect; - uint32 dmg_pircing_skill; - - uint32 dmg_slashing; - uint32 dmg_slashing_base; - uint32 dmg_slashing_equip; - uint32 dmg_slashing_item; - uint32 dmg_slashing_effect; - uint32 dmg_slashing_skill; - - uint32 dmg_bludgeoning; - uint32 dmg_bludgeoning_base; - uint32 dmg_bludgeoning_equip; - uint32 dmg_bludgeoning_item; - uint32 dmg_bludgeoning_effect; - uint32 dmg_bludgeoning_skill; - - uint32 dmg_stabbing; - uint32 dmg_stabbing_base; - uint32 dmg_stabbing_equip; - uint32 dmg_stabbing_item; - uint32 dmg_stabbing_effect; - uint32 dmg_stabbing_skill; - - uint32 dmg_fire; - uint32 dmg_fire_base; - uint32 dmg_fire_equip; - uint32 dmg_fire_item; - uint32 dmg_fire_effect; - uint32 dmg_fire_skill; - - uint32 dmg_water; - uint32 dmg_water_base; - uint32 dmg_water_equip; - uint32 dmg_water_item; - uint32 dmg_water_effect; - uint32 dmg_water_skill; - - uint32 dmg_ice; - uint32 dmg_ice_base; - uint32 dmg_ice_equip; - uint32 dmg_ice_item; - uint32 dmg_ice_effect; - uint32 dmg_ice_skill; - - uint32 dmg_earth; - uint32 dmg_earth_base; - uint32 dmg_earth_equip; - uint32 dmg_earth_item; - uint32 dmg_earth_effect; - uint32 dmg_earth_skill; - - uint32 dmg_wind; - uint32 dmg_wind_base; - uint32 dmg_wind_equip; - uint32 dmg_wind_item; - uint32 dmg_wind_effect; - uint32 dmg_wind_skill; - - uint32 dmg_poison; - uint32 dmg_poison_base; - uint32 dmg_poison_equip; - uint32 dmg_poison_item; - uint32 dmg_poison_effect; - uint32 dmg_poison_skill; - - uint32 dmg_lightning; - uint32 dmg_lightning_base; - uint32 dmg_lightning_equip; - uint32 dmg_lightning_item; - uint32 dmg_lightning_effect; - uint32 dmg_lightning_skill; - - uint32 dmg_holy; - uint32 dmg_holy_base; - uint32 dmg_holy_equip; - uint32 dmg_holy_item; - uint32 dmg_holy_effect; - uint32 dmg_holy_skill; - - uint32 dmg_arcane; - uint32 dmg_arcane_base; - uint32 dmg_arcane_equip; - uint32 dmg_arcane_item; - uint32 dmg_arcane_effect; - uint32 dmg_arcane_skill; - - uint32 dmg_corrupted; - uint32 dmg_corrupted_base; - uint32 dmg_corrupted_equip; - uint32 dmg_corrupted_item; - uint32 dmg_corrupted_effect; - uint32 dmg_corrupted_skill; - - uint32 dmg_crit; - uint32 dmg_crit_base; - uint32 dmg_crit_equip; - uint32 dmg_crit_item; - uint32 dmg_crit_effect; - uint32 dmg_crit_skill; - - f32 dmg_crit_chance; - f32 dmg_crit_chance_base; - f32 dmg_crit_chance_equip; - f32 dmg_crit_chance_item; - f32 dmg_crit_chance_effect; - f32 dmg_crit_chance_skill; - - uint32 dmg_reflection; - uint32 dmg_reflection_base; - uint32 dmg_reflection_equip; - uint32 dmg_reflection_item; - uint32 dmg_reflection_effect; - uint32 dmg_reflection_skill; - - // Health & Resource - uint32 health; - uint32 health_base; - uint32 health_equip; - uint32 health_item; - uint32 health_effect; - uint32 health_skill; - - uint32 health_on_dmg_dealt; - uint32 health_on_dmg_dealt_base; - uint32 health_on_dmg_dealt_equip; - uint32 health_on_dmg_dealt_item; - uint32 health_on_dmg_dealt_effect; - uint32 health_on_dmg_dealt_skill; - - uint32 health_on_dmg_taken; - uint32 health_on_dmg_taken_base; - uint32 health_on_dmg_taken_equip; - uint32 health_on_dmg_taken_item; - uint32 health_on_dmg_taken_effect; - uint32 health_on_dmg_taken_skill; - - uint32 health_regen; - uint32 health_regen_base; - uint32 health_regen_equip; - uint32 health_regen_item; - uint32 health_regen_effect; - uint32 health_regen_skill; - - uint32 health_regen_on_dmg_dealt; - uint32 health_regen_on_dmg_dealt_base; - uint32 health_regen_on_dmg_dealt_equip; - uint32 health_regen_on_dmg_dealt_item; - uint32 health_regen_on_dmg_dealt_effect; - uint32 health_regen_on_dmg_dealt_skill; - - uint32 health_regen_on_dmg_taken; - uint32 health_regen_on_dmg_taken_base; - uint32 health_regen_on_dmg_taken_equip; - uint32 health_regen_on_dmg_taken_item; - uint32 health_regen_on_dmg_taken_effect; - uint32 health_regen_on_dmg_taken_skill; - - uint32 resource; - uint32 resource_base; - uint32 resource_equip; - uint32 resource_item; - uint32 resource_effect; - uint32 resource_skill; - - uint32 resource_on_dmg_dealt; - uint32 resource_on_dmg_dealt_base; - uint32 resource_on_dmg_dealt_equip; - uint32 resource_on_dmg_dealt_item; - uint32 resource_on_dmg_dealt_effect; - uint32 resource_on_dmg_dealt_skill; - - uint32 resource_on_dmg_taken; - uint32 resource_on_dmg_taken_base; - uint32 resource_on_dmg_taken_equip; - uint32 resource_on_dmg_taken_item; - uint32 resource_on_dmg_taken_effect; - uint32 resource_on_dmg_taken_skill; - - uint32 resource_regen; - uint32 resource_regen_base; - uint32 resource_regen_equip; - uint32 resource_regen_item; - uint32 resource_regen_effect; - uint32 resource_regen_skill; - - uint32 resource_regen_on_dmg_dealt; - uint32 resource_regen_on_dmg_dealt_base; - uint32 resource_regen_on_dmg_dealt_equip; - uint32 resource_regen_on_dmg_dealt_item; - uint32 resource_regen_on_dmg_dealt_effect; - uint32 resource_regen_on_dmg_dealt_skill; - - uint32 resource_regen_on_dmg_taken; - uint32 resource_regen_on_dmg_taken_base; - uint32 resource_regen_on_dmg_taken_equip; - uint32 resource_regen_on_dmg_taken_item; - uint32 resource_regen_on_dmg_taken_effect; - uint32 resource_regen_on_dmg_taken_skill; - - uint32 resource_loss; - uint32 resource_loss_base; - uint32 resource_loss_equip; - uint32 resource_loss_item; - uint32 resource_loss_effect; - uint32 resource_loss_skill; - - uint32 resource_loss_on_dmg_dealt; - uint32 resource_loss_on_dmg_dealt_base; - uint32 resource_loss_on_dmg_dealt_equip; - uint32 resource_loss_on_dmg_dealt_item; - uint32 resource_loss_on_dmg_dealt_effect; - uint32 resource_loss_on_dmg_dealt_skill; - - uint32 resource_loss_on_dmg_taken; - uint32 resource_loss_on_dmg_taken_base; - uint32 resource_loss_on_dmg_taken_equip; - uint32 resource_loss_on_dmg_taken_item; - uint32 resource_loss_on_dmg_taken_effect; - uint32 resource_loss_on_dmg_taken_skill; - - // Defense types - // think about it as armor and/or resistence if it helps - uint32 defense; - uint32 defense_base; - uint32 defense_equip; - uint32 defense_item; - uint32 defense_effect; - uint32 defense_skill; - - uint32 defense_pircing; - uint32 defense_pircing_base; - uint32 defense_pircing_equip; - uint32 defense_pircing_item; - uint32 defense_pircing_effect; - uint32 defense_pircing_skill; - - uint32 defense_slashing; - uint32 defense_slashing_base; - uint32 defense_slashing_equip; - uint32 defense_slashing_item; - uint32 defense_slashing_effect; - uint32 defense_slashing_skill; - - uint32 defense_bludgeoning; - uint32 defense_bludgeoning_base; - uint32 defense_bludgeoning_equip; - uint32 defense_bludgeoning_item; - uint32 defense_bludgeoning_effect; - uint32 defense_bludgeoning_skill; - - uint32 defense_stabbing; - uint32 defense_stabbing_base; - uint32 defense_stabbing_equip; - uint32 defense_stabbing_item; - uint32 defense_stabbing_effect; - uint32 defense_stabbing_skill; - - uint32 defense_fire; - uint32 defense_fire_base; - uint32 defense_fire_equip; - uint32 defense_fire_item; - uint32 defense_fire_effect; - uint32 defense_fire_skill; - - uint32 defense_water; - uint32 defense_water_base; - uint32 defense_water_equip; - uint32 defense_water_item; - uint32 defense_water_effect; - uint32 defense_water_skill; - - uint32 defense_ice; - uint32 defense_ice_base; - uint32 defense_ice_equip; - uint32 defense_ice_item; - uint32 defense_ice_effect; - uint32 defense_ice_skill; - - uint32 defense_earth; - uint32 defense_earth_base; - uint32 defense_earth_equip; - uint32 defense_earth_item; - uint32 defense_earth_effect; - uint32 defense_earth_skill; - - uint32 defense_wind; - uint32 defense_wind_base; - uint32 defense_wind_equip; - uint32 defense_wind_item; - uint32 defense_wind_effect; - uint32 defense_wind_skill; - - uint32 defense_poison; - uint32 defense_poison_base; - uint32 defense_poison_equip; - uint32 defense_poison_item; - uint32 defense_poison_effect; - uint32 defense_poison_skill; - - uint32 defense_lightning; - uint32 defense_lightning_base; - uint32 defense_lightning_equip; - uint32 defense_lightning_item; - uint32 defense_lightning_effect; - uint32 defense_lightning_skill; - - uint32 defense_holy; - uint32 defense_holy_base; - uint32 defense_holy_equip; - uint32 defense_holy_item; - uint32 defense_holy_effect; - uint32 defense_holy_skill; - - uint32 defense_arcane; - uint32 defense_arcane_base; - uint32 defense_arcane_equip; - uint32 defense_arcane_item; - uint32 defense_arcane_effect; - uint32 defense_arcane_skill; - - uint32 defense_corrupted; - uint32 defense_corrupted_base; - uint32 defense_corrupted_equip; - uint32 defense_corrupted_item; - uint32 defense_corrupted_effect; - uint32 defense_corrupted_skill; + FixedStats fixed_total; uint32 shield_type; - bool shield_dispellable; - uint32 shield; - uint32 shield_base; - uint32 shield_equip; - uint32 shield_item; - uint32 shield_effect; - uint32 shield_skill; - - // Accuracy - f32 dodge_chance; - f32 dodge_chance_base; - f32 dodge_chance_equip; - f32 dodge_chance_item; - f32 dodge_chance_effect; - f32 dodge_chance_skill; - - f32 root_protection; - f32 root_protection_base; - f32 root_protection_equip; - f32 root_protection_item; - f32 root_protection_effect; - f32 root_protection_skill; - - f32 miss_chance; - f32 miss_chance_base; - f32 miss_chance_equip; - f32 miss_chance_item; - f32 miss_chance_effect; - f32 miss_chance_skill; - - // Movement - // Additional speeds may be defined for Mobs - f32 speed_walk1; // normal/fast - f32 speed_walk1_base; - f32 speed_walk1_equip; - f32 speed_walk1_item; - f32 speed_walk1_effect; - f32 speed_walk1_skill; - - f32 speed_walk2; // casual/slow - - f32 speed_swim1; // normal/fast - f32 speed_swim1_base; - f32 speed_swim1_equip; - f32 speed_swim1_item; - f32 speed_swim1_effect; - f32 speed_swim1_skill; - - f32 speed_swim2; // casual/slow - - f32 speed_fly1; // normal/fast - f32 speed_fly1_base; - f32 speed_fly1_equip; - f32 speed_fly1_item; - f32 speed_fly1_effect; - f32 speed_fly1_skill; - - f32 speed_fly2; // casual/slow - - f32 speed_jump; - f32 speed_dodge; - f32 speed_turn; - - // Fighting speed - f32 speed_cast; - f32 speed_cast_base; - f32 speed_cast_equip; - f32 speed_cast_item; - f32 speed_cast_effect; - f32 speed_cast_skill; - - f32 speed_attack; - f32 speed_attack_base; - f32 speed_attack_equip; - f32 speed_attack_item; - f32 speed_attack_effect; - f32 speed_attack_skill; + bool shield_dispellable; }; -struct SMobStats { - byte stat_str; // strength : effects health + base damage - byte stat_int; // inteligence : effects resource + base demage - byte stat_acc; // accuracy : effects critical chance + base damage + miss chance - byte stat_agi; // agility : effects resource + base damage + dodge change - byte stat_def; // defense : effects resource + base defense + dodge change - byte stat_sta; // stamina : effects health regen + resource regen +struct SMobStatsTotalCached { + PrimaryStatsPoints primary_total; + PrimaryStatsPoints primary_char; // Only recalculated when char stats change + PrimaryStatsPoints primary_skill; // Only recalculated when skill effect runs out + PrimaryStatsPoints primary_item; // Only recalculated when item changes + PrimaryStatsPoints primary_effect; // External e.g. from mob or ally - // Damage types - uint32 dmg; - uint32 dmg_pircing; - uint32 dmg_slashing; - uint32 dmg_bludgeoning; - uint32 dmg_stabbing; - uint32 dmg_fire; - uint32 dmg_water; - uint32 dmg_ice; - uint32 dmg_arcane; - uint32 dmg_corrupted; - uint32 dmg_reflection; - - uint32 dmg_crit; - f32 dmg_crit_chance; - - // Health & Resource - uint32 health; - uint32 health_on_dmg_dealt; - uint32 health_on_dmg_taken; - - uint32 health_regen; - uint32 health_regen_on_dmg_dealt; - uint32 health_regen_on_dmg_taken; - - uint32 resource; - uint32 resource_on_dmg_dealt; - uint32 resource_on_dmg_taken; - - uint32 resource_regen; - uint32 resource_regen_on_dmg_dealt; - uint32 resource_regen_on_dmg_taken; - - uint32 resource_loss; - uint32 resource_loss_on_dmg_dealt; - uint32 resource_loss_on_dmg_taken; - - // Defense types - // think about it as armor and/or resistence if it helps - uint32 defense; - uint32 defense_pircing; - uint32 defense_slashing; - uint32 defense_bludgeoning; - uint32 defense_stabbing; - uint32 defense_fire; - uint32 defense_water; - uint32 defense_ice; - uint32 defense_earth; - uint32 defense_wind; - uint32 defense_poison; - uint32 defense_lightning; - uint32 defense_holy; - uint32 defense_arcane; - uint32 defense_corrupted; - - uint32 shield_type; - bool shield_dispellable; - uint32 shield; - - // Accuracy - f32 dodge_chance; - f32 root_protection; - f32 miss_chance; - - // Movement - // Additional speeds may be defined for Mobs - f32 speed_walk1; // normal/fast - f32 speed_walk2; // casual/slow - - f32 speed_swim1; // normal/fast - f32 speed_swim2; // casual/slow - - f32 speed_fly1; // normal/fast - f32 speed_fly2; // casual/slow - - f32 speed_jump; - f32 speed_dodge; - f32 speed_turn; - - // Fighting speed - f32 speed_cast; - f32 speed_attack; + SecondaryStatsValues secondary_total; + SecondaryStatsValues secondary_char; // Only recalculated when char stats change + SecondaryStatsValues secondary_skill; // Only recalculated when skill effect runs out + SecondaryStatsValues secondary_item; // Only recalculated when item changes + SecondaryStatsValues secondary_effect; // External e.g. from mob or ally }; -struct CMobStats { +struct SMobStatsPoints { + // Self stats + PrimaryStatsPoints primary_stats; + SecondaryStatsPoints secondary_stats; // @todo this is bad, a char doesn't have fire dmg but might have crit chance ... needs to split? + // Item modifiers + PrimaryStatsPoints item_primary_add; + PrimaryStatsRelPoints item_primary_mul; + + SecondaryStatsPoints item_secondary_add; + SecondaryStatsRelPoints item_secondary_mul; + + // Skill modifiers + PrimaryStatsPoints skill_primary_add; + PrimaryStatsRelPoints skill_primary_mul; + + SecondaryStatsPoints skill_secondary_add; + SecondaryStatsRelPoints skill_secondary_mul; }; #endif \ No newline at end of file diff --git a/models/mob/monster/LootTable.h b/models/mob/monster/LootTable.h index 0b5f5d8..8bdf3b3 100644 --- a/models/mob/monster/LootTable.h +++ b/models/mob/monster/LootTable.h @@ -14,6 +14,7 @@ #include "../../../utils/MathUtils.h" #include "Drop.h" +// @todo how to do class specific loot table? struct LootTable { // Chance this table becomes effective at all // Useful to define multiple loot tables for a mob e.g. normal drop + 1 rare guarantueed @@ -38,6 +39,10 @@ struct LootTable { // How much gold should be dropped uint32 gold_min_count; uint32 gold_max_count; + + // How much xp should be dropped + uint32 xp_min_count; + uint32 xp_max_count; }; // 1. check if table comes into effect diff --git a/models/mob/player/Player.h b/models/mob/player/Player.h index 8fd2d4a..b1798d9 100644 --- a/models/mob/player/Player.h +++ b/models/mob/player/Player.h @@ -35,6 +35,9 @@ char title[MAX_CHAR_TITLE_LENGTH]; Equipment equipment[14]; + + PrimaryStatsPoints stat_points; + PSettings settings; Backpack* packpack; diff --git a/models/mob/skill/Skill.h b/models/mob/skill/Skill.h index 080d2f2..194a2e5 100644 --- a/models/mob/skill/Skill.h +++ b/models/mob/skill/Skill.h @@ -11,6 +11,11 @@ #define MAX_SKILL_NAME 32 #define MAX_SKILL_DESCRIPTION 128 +/** + * @todo optimize order of struct members to ensure optimal struct size + */ + +// @todo We adjusted SMobStats -> we can remove a lot of variables below struct Skill { // not required for server @@ -19,47 +24,98 @@ struct Skill int id; - // animations + // @todo animations void* animation_casting; void* animation_channeling; + // @todo e.g. attack command, movement command, etc. for totems and minions + void* commands; + + // @todo configuration e.g. which minions to pick, release minion, select new minion... + void* options; + bool projectile_animation_uses_item; // Use the equiped item for the projectile byte target; // what is targatable (self, enemies, allies, ground, none?) Has to be bitset 2^n to define multiple byte default_target; + bool has_hitbox; // some skills have hitboxes (e.g. totems, minions, some breakable prisons, ...) + + // @todo how to assign life and resource to skill (e.g. life to destroyable prison, totems or resources to minions) + f32 visual_scale; // make visual larger/smaller - // @tood how to handle multiplicative stats? - // you can have 2 stats for 2 target types (e.g. you could create a buff and debuff in one skill) - SMobStats stats1; + // Scales skill over channeling time (e.g. makes balls larger and after reaching peak makes them smaller) + byte scale_type; + + // the following scale factors can be considered key frames + f32 scale1; + f32 scale2; + f32 scale3; + + // @todo when to use points and when to use values? + // Stats of the skill itself + SecondaryStatsPoints skill_stats; + StatsTarget skill_target; + + // @todo when to use points and when to use values? + // Modifies stats + // You can have 2 stats for 2 target types (e.g. you could create a buff and debuff in one skill) + // 1 + PrimaryStatsPoints stats1_primary_add; + PrimaryStatsRelPoints stats1_primary_mul; + + SecondaryStatsPoints stats1_secondary_add; + SecondaryStatsRelPoints stats1_secondary_mul; StatsTarget stats1_target; - SMobStats stats2; + // 2 + PrimaryStatsPoints stats2_primary_add; + PrimaryStatsRelPoints stats2_primary_mul; + + SecondaryStatsPoints stats2_secondary_add; + SecondaryStatsRelPoints stats2_secondary_mul; StatsTarget stats2_target; - byte skill_movement; // none, follows target, random moevement, random movement in aoe + // Modifiers + // Char + PrimaryStatsPoints primary_char_add; + PrimaryStatsRelPoints primary_char_mul; + SecondaryStatsPoints secondary_char_add; + SecondaryStatsRelPoints secondary_char_mul; + + // Item + PrimaryStatsPoints primary_item_add; + PrimaryStatsRelPoints primary_item_mul; + + SecondaryStatsPoints secondary_item_add; + SecondaryStatsRelPoints secondary_item_mul; + + int skill_movement; // none, follows target, random moevement, random movement in aoe + // @todo how to make specific custom movement pattern for boss fights + + // Useful to cast multiple totems: byte count; // how often is the skill executed @question can this also be used as tick count for heals? or is this in the MobStats? byte count_delay; // delay between executions - byte count_manual; // you can manually perform the skill count * times - // @todo how to implement random distribution e.g. place n totems in random distribution close to selected spot + byte count_manual; // you can manually perform the skill count * times. Manual = wherever you want. + byte count_radius; // radius in which they are randomly distributed + byte count_distance; // distance between sub skills + // @todo maybe combine with aoe? we could remove radius and distance and just use them from aoe // General int resource_cost; int health_cost; bool is_range; - f32 attack_range; void* attack_anim; bool is_melee; - f32 melee_range; + + bool async_cast; // Can be casted with other skills at the same time/another skill can be cast while casting this // Projectile data bool is_projectile; - f32 projectile_speed; - int projectile_count; int projectile_shape; // 3d Model int projectile_distribution; @@ -69,9 +125,6 @@ struct Skill // shatter is basically a second hit bool shatter; int shatter_projectiles; - int shatter_count; // How often can it shatter at most - f32 shatter_probability; - f32 shatter_range; f32 shatter_duration; uint32 shatter_damage; @@ -79,7 +132,7 @@ struct Skill bool is_boomerang; // Casting happens before the skill - f32 cast_duration; + // This can also be used for telegraphs bool is_cast_cancalable; bool is_cast_disruptable; bool is_cast_movable; @@ -92,16 +145,15 @@ struct Skill bool is_channeling_disruptable; bool is_channeling_movable; - byte channeling_distribution; // beginning, on hit, end, intervals, smooth -> also effects dmg if channeling is cancled + byte channeling_distribution; // beginning, on hit, end, intervals, or use damage distribution -> also effects dmg if channeling is cancled byte channeling_ticks; // how often is dmg dealt - f32 passthrough_damage; // How much of your damage in % is passing through to the next mob. - int passtrhough_count; + byte damage_distribution_location; // const, linear-increase, linear-decrease according to the shape of the skill.. e.g. more damage in center of aoe or more damage at the end of a end of a wave like skill + byte damage_distribution_time; // similar to above but it might increase over time not based on location // AOE bool is_aoe; - f32 aoe_distance; - int aoe_shape; // circle, square, donut + int aoe_shape; // circle, square, donut, movement (e.g. fire trail on dodge) AoeDistribution aoe_fill_pattern; f32 aoe_dim1; f32 aoe_dim2; @@ -111,26 +163,14 @@ struct Skill byte aoe_apply; // Applies while in aoe, applies even after moving out of aoe // DOT - f32 dot_duration; - int dot_count; byte dot_state; // only when moving, standing still, always - byte dot_effective; // always; on move; on stand still byte dot_buff_effective; // buff modifier (e.g. increase by/decrease by) float dot_buff; // buff dot when on move or on standstill - int bleeding_dot; - int poison_dot; - int burn_dot; - int ice_dot; - int resource_drain; - int dot_shatter; - // Minion (and totems) int minion_type; - int minon_count; // Max minion count - int minion_duration; int minion_summon_count; // How many summons per summon cast @question still required with general skill count? I don't think so. // Effects @@ -140,21 +180,35 @@ struct Skill f32 effect_spreading_max_count; // How many mobs can be effected at maximum f32 effect_duration; - // Aura - f32 aura_range; - // Push/pull - byte push_pull_distance; - byte push_pull_direction; // circle, pov = fan like; > 0 = push, < 0 = pull + byte movement_type; // push, pull, dodge, jump, sprint, fly + byte movement_distance; + byte movement_direction; // e.g. target, view/orientation, opposite of view/orientation + byte movement_shape; // circle, pov = fan like; > 0 = push, < 0 = pull + // @todo maybe use location change? this way we could also implement a teleport - byte player_visibility; // = e.g. sneak skill + byte mob_visibility; // = e.g. sneak skill // @todo skill jumps over to close by enemies = chain lightning // @todo illusion skill that multiplies the targeted mob and also shuffels the position - // move_distances (e.g. launch attack propells attacker forward x distance) - byte movement_distances; + // example: limits_movement = 0 + skill_disabled 0xFFFFFFFF = all = stun + byte limits_movement; // limits_movement @question maybe use character stat and set movement to -INF + uint32 limits_skills; // skill types disabled (bit field required), 0 = none + // @todo how to implement skill limits only within certain range? + // maybe just set it to is_aoe?!?! + + byte locks_stat_type; // 0 = none, 1 for example could be health = useful to make someone invulnerable + + // @todo how to implement fear? make mobs run away a short distance. + // maybe somhow use push? because it is like a push but by making the mob walk. + + // @todo how to implement a skill that shoots multiple large ball projectiles in a radial or linar pattern + // from the caster with random distances in between each other but also in waves. + // e.g. first wave sends out x balls , then second wave sends x balls but in different locations + + // @todo how to implement a beam? e.g. arcane beam or mana drain? maybe a type of projectile? }; #endif \ No newline at end of file diff --git a/models/mob/skill/definitions/beam b/models/mob/skill/definitions/beam new file mode 100644 index 0000000..e69de29 diff --git a/models/mob/skill/definitions/health_inverse_dmg.cfg b/models/mob/skill/definitions/health_inverse_dmg.cfg new file mode 100644 index 0000000..3d1cdb2 --- /dev/null +++ b/models/mob/skill/definitions/health_inverse_dmg.cfg @@ -0,0 +1,4 @@ +# do damage based on the inverse of healt +// @todo needs skill modification that doesn't exist yet + +dmg = max_healt / health * base_dmg; \ No newline at end of file diff --git a/models/mob/skill/definitions/health_to_dmg.cfg b/models/mob/skill/definitions/health_to_dmg.cfg new file mode 100644 index 0000000..2874cc6 --- /dev/null +++ b/models/mob/skill/definitions/health_to_dmg.cfg @@ -0,0 +1 @@ +# converts health to dmg \ No newline at end of file diff --git a/models/mob/skill/definitions/sacrafice.cfg b/models/mob/skill/definitions/sacrafice.cfg new file mode 100644 index 0000000..ed10229 --- /dev/null +++ b/models/mob/skill/definitions/sacrafice.cfg @@ -0,0 +1,2 @@ +# uses health for some form of attack... @todo really needs to get mapped out +# can be achieved through the mobstat that are part of the skill \ No newline at end of file diff --git a/models/mob/skill/definitions/teleport.cfg b/models/mob/skill/definitions/teleport.cfg new file mode 100644 index 0000000..e69de29 diff --git a/pathfinding/AStar.h b/pathfinding/AStar.h new file mode 100644 index 0000000..e69de29 diff --git a/pathfinding/Jps.h b/pathfinding/Jps.h new file mode 100644 index 0000000..e69de29 diff --git a/pathfinding/JpsBounded.h b/pathfinding/JpsBounded.h new file mode 100644 index 0000000..e69de29 diff --git a/pathfinding/Jpsp.h b/pathfinding/Jpsp.h new file mode 100644 index 0000000..e69de29 diff --git a/platform/linux/UtilsLinux.h b/platform/linux/UtilsLinux.h index 04ccfad..179a10a 100644 --- a/platform/linux/UtilsLinux.h +++ b/platform/linux/UtilsLinux.h @@ -16,11 +16,42 @@ #include #include #include +#include +#include #include "../../stdlib/Types.h" #include "../../utils/Utils.h" #include "../../utils/TestUtils.h" +#ifndef MAX_PATH + #define MAX_PATH PATH_MAX +#endif + +int sprintf_s(char *buffer, size_t sizeOfBuffer, const char *format, ...) { + int result; + va_list args; + + if (buffer == NULL || format == NULL || sizeOfBuffer == 0) { + errno = EINVAL; + return -1; + } + + va_start(args, format); + + result = vsnprintf(buffer, sizeOfBuffer, format, args); + + va_end(args); + + if (result >= 0 && (size_t)result >= sizeOfBuffer) { + buffer[sizeOfBuffer - 1] = '\0'; + errno = 80; + return 80; + } + + // Return the result + return result; +} + inline uint64 file_size(const char* filename) { struct stat st; @@ -179,6 +210,23 @@ void self_path(char* path) { } } +inline void relative_to_absolute(const char* rel, char* path) +{ + char self_path[MAX_PATH]; + ssize_t count = readlink("/proc/self/exe", self_path, MAX_PATH - 1); + if (count == -1) { + return; + } + self_path[count] = '\0'; + + char* last = strrchr(self_path, '/'); + if (last != NULL) { + *(last + 1) = '\0'; + } + + snprintf(path, MAX_PATH, "%s%s", self_path, rel); +} + inline void strncpy_s(char *dest, size_t destsz, const char *src, size_t count) { size_t i; diff --git a/platform/win32/UtilsWin32.h b/platform/win32/UtilsWin32.h index 8d0f59d..71aacc0 100644 --- a/platform/win32/UtilsWin32.h +++ b/platform/win32/UtilsWin32.h @@ -9,7 +9,9 @@ #ifndef TOS_UTILS_WIN32_H #define TOS_UTILS_WIN32_H +#include #include +#include #ifdef _MSC_VER #include #endif @@ -296,6 +298,21 @@ inline void self_path(char* path) GetModuleFileNameA(NULL, (LPSTR) path, MAX_PATH); } +inline void relative_to_absolute(const char* rel, char* path) +{ + char self_path[MAX_PATH]; + if (GetModuleFileNameA(NULL, self_path, MAX_PATH) == 0) { + return; + } + + char* last = strrchr(self_path, '\\'); + if (last != NULL) { + *(last + 1) = '\0'; + } + + snprintf(path, MAX_PATH, "%s%s", self_path, rel); +} + void log_to_file(LogPool* logs, HANDLE fp) { // we don't log an empty log pool diff --git a/stdlib/Intrinsics.h b/stdlib/Intrinsics.h index 5fac405..94b8ccc 100644 --- a/stdlib/Intrinsics.h +++ b/stdlib/Intrinsics.h @@ -10,11 +10,11 @@ #define TOS_STDLIB_INTRINSICS_H #include -#include #include #if __linux__ #include + #include #endif #include "Types.h" @@ -65,4 +65,20 @@ inline uint32 hash(uint64 a, uint64 b = 0) return _mm_extract_epi32(hash, 0); } +inline void atomic_increment(int32* a, int32 b) { + _aadd_i32(a, b); +} + +inline void atomic_increment(int64* a, int64 b) { + _aadd_i64(a, b); +} + +inline void atomic_decrement(int32* a, int32 b) { + _aadd_i32(a, -b); +} + +inline void atomic_decrement(int64* a, int64 b) { + _aadd_i64(a, -b); +} + #endif \ No newline at end of file diff --git a/stdlib/simd/SIMD_F32.h b/stdlib/simd/SIMD_F32.h index 0084b17..16ccd14 100644 --- a/stdlib/simd/SIMD_F32.h +++ b/stdlib/simd/SIMD_F32.h @@ -35,7 +35,7 @@ struct f32_16 { }; }; -inline f32_4 load_f32_4(f32 *mem) +inline f32_4 load_f32_4(const f32* mem) { f32_4 simd; simd.s = _mm_loadu_ps(mem); @@ -43,7 +43,7 @@ inline f32_4 load_f32_4(f32 *mem) return simd; } -inline f32_4 init_f32_4(f32 *mem) +inline f32_4 init_f32_4(const f32* mem) { f32_4 simd; simd.s = _mm_set_ps(mem[0], mem[1], mem[2], mem[3]); @@ -53,7 +53,7 @@ inline f32_4 init_f32_4(f32 *mem) inline void unload_f32_4(f32_4 a, f32 *array) { _mm_store_ps(array, a.s); } -inline f32_8 load_f32_8(f32 *mem) +inline f32_8 load_f32_8(const f32* mem) { f32_8 simd; simd.s = _mm256_loadu_ps(mem); @@ -61,7 +61,7 @@ inline f32_8 load_f32_8(f32 *mem) return simd; } -inline f32_8 init_f32_8(f32 *mem) +inline f32_8 init_f32_8(const f32* mem) { f32_8 simd; simd.s = _mm256_set_ps(mem[0], mem[1], mem[2], mem[3], mem[4], mem[5], mem[6], mem[7]); @@ -71,7 +71,7 @@ inline f32_8 init_f32_8(f32 *mem) inline void unload_f32_8(f32_8 a, f32 *array) { _mm256_store_ps(array, a.s); } -inline f32_16 load_f32_16(f32 *mem) +inline f32_16 load_f32_16(const f32* mem) { f32_16 simd; simd.s = _mm512_loadu_ps(mem); @@ -79,7 +79,7 @@ inline f32_16 load_f32_16(f32 *mem) return simd; } -inline f32_16 init_f32_16(f32 *mem) +inline f32_16 init_f32_16(const f32* mem) { f32_16 simd; simd.s = _mm512_set_ps(mem[0], mem[1], mem[2], mem[3], mem[4], mem[5], mem[6], mem[7], mem[8], mem[9], mem[10], @@ -114,6 +114,62 @@ inline f32_16 init_zero_f32_16() return simd; } +inline f32_4 init_value_f32_4(f32 value) +{ + f32_4 simd; + simd.s = _mm_set1_ps(value); + + return simd; +} + +inline f32_8 init_value_f32_8(f32 value) +{ + f32_8 simd; + simd.s = _mm256_set1_ps(value); + + return simd; +} + +inline f32_16 init_value_f32_16(f32 value) +{ + f32_16 simd; + simd.s = _mm512_set1_ps(value); + + return simd; +} + +inline f32_4 init_values_f32_4(f32 a, f32 b, f32 c, f32 d) +{ + f32_4 simd; + simd.s = _mm_set_ps(a, b, c, d); + + return simd; +} + +inline f32_8 init_values_f32_8( + f32 a, f32 b, f32 c, f32 d, + f32 e, f32 f, f32 g, f32 h +) +{ + f32_8 simd; + simd.s = _mm256_set_ps(a, b, c, d, e, f, g, h); + + return simd; +} + +inline f32_16 init_values_f32_16( + f32 a, f32 b, f32 c, f32 d, + f32 e, f32 f, f32 g, f32 h, + f32 i, f32 j, f32 k, f32 l, + f32 m, f32 n, f32 o, f32 p +) +{ + f32_16 simd; + simd.s = _mm512_set_ps(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p); + + return simd; +} + inline f32_4 operator+(f32_4 a, f32_4 b) { f32_4 simd; @@ -603,11 +659,8 @@ inline f32_8 abs(f32_8 a) inline f32_16 abs(f32_16 a) { - unsigned int unsigned_mask = (unsigned int) (1 << 31); - __m512 mask = _mm512_set1_ps(*(float *) &unsigned_mask); - f32_16 simd; - simd.s = _mm512_and_ps(a.s, mask); + simd.s = _mm512_abs_ps(a.s); return simd; } @@ -928,4 +981,261 @@ inline bool all_false(f32_16 a) return is_false; } +// @todo from down here we can optimize some of the code by NOT using the wrappers +// the code is self contained and we could use te intrinsic functions directly + +inline +void simd_mult(const f32* a, const f32* b, f32* result, int size, int steps) +{ + int i = 0; + + if (steps == 16) { + f32_16 a_16; + f32_16 b_16; + f32_16 result_16; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_16 = load_f32_16(a); + b_16 = load_f32_16(b); + result_16 = a_16 * b_16; + unload_f32_16(result_16, result); + } + } else if (steps == 8) { + f32_8 a_8; + f32_8 b_8; + f32_8 result_8; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_8 = load_f32_8(a); + b_8 = load_f32_8(b); + result_8 = a_8 * b_8; + unload_f32_8(result_8, result); + } + } else if (steps == 4) { + f32_4 a_4; + f32_4 b_4; + f32_4 result_4; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_4 = load_f32_4(a); + b_4 = load_f32_4(b); + result_4 = a_4 * b_4; + unload_f32_4(result_4, result); + } + } + + for (; i < size; ++i) { + ++a; + ++b; + ++result; + + *result = *a * *b; + } +} + +inline +void f32_4_mult(const f32* a, const f32* b, f32* result) +{ + f32_4 a_4 = load_f32_4(a); + f32_4 b_4 = load_f32_4(b); + f32_4 result_4 = a_4 * b_4; + + unload_f32_4(result_4, result); +} + +inline +void simd_mult(const f32* a, const f32* b, f32* result, int size, int steps) +{ + int i = 0; + + if (steps == 16) { + f32_16 a_16; + f32_16 b_16; + f32_16 result_16; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_16 = load_f32_16(a); + b_16 = load_f32_16(b); + result_16 = a_16 + b_16; + unload_f32_16(result_16, result); + } + } else if (steps == 8) { + f32_8 a_8; + f32_8 b_8; + f32_8 result_8; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_8 = load_f32_8(a); + b_8 = load_f32_8(b); + result_8 = a_8 + b_8; + unload_f32_8(result_8, result); + } + } else if (steps == 4) { + f32_4 a_4; + f32_4 b_4; + f32_4 result_4; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_4 = load_f32_4(a); + b_4 = load_f32_4(b); + result_4 = a_4 + b_4; + unload_f32_4(result_4, result); + } + } + + for (; i < size; ++i) { + ++a; + ++b; + ++result; + + *result = *a + *b; + } +} + +inline +void f32_4_add(const f32* a, const f32* b, f32* result) +{ + f32_4 a_4 = load_f32_4(a); + f32_4 b_4 = load_f32_4(b); + f32_4 result_4 = a_4 + b_4; + + unload_f32_4(result_4, result); +} + +// @todo add more operations like the one above "f32_4_mult()" + +inline +f32_4 simd_sin(f32_4 a) +{ + f32_4 simd; + simd.s = _mm_sin_ps(a.s); + + return simd; +} + +inline +f32_8 simd_sin(f32_8 a) +{ + f32_8 simd; + simd.s = _mm256_sin_ps(a.s); + + return simd; +} + +inline +f32_16 simd_sin(f32_16 a) +{ + f32_16 simd; + simd.s = _mm512_sin_ps(a.s); + + return simd; +} + +inline +f32_4 simd_cos(f32_4 a) +{ + f32_4 simd; + simd.s = _mm_cos_ps(a.s); + + return simd; +} + +inline +f32_8 simd_cos(f32_8 a) +{ + f32_8 simd; + simd.s = _mm256_cos_ps(a.s); + + return simd; +} + +inline +f32_16 simd_cos(f32_16 a) +{ + f32_16 simd; + simd.s = _mm512_cos_ps(a.s); + + return simd; +} + +inline +f32_4 simd_asin(f32_4 a) +{ + f32_4 simd; + simd.s = _mm_asin_ps(a.s); + + return simd; +} + +inline +f32_8 simd_asin(f32_8 a) +{ + f32_8 simd; + simd.s = _mm256_asin_ps(a.s); + + return simd; +} + +inline +f32_16 simd_asin(f32_16 a) +{ + f32_16 simd; + simd.s = _mm512_asin_ps(a.s); + + return simd; +} + +inline +f32_4 simd_acos(f32_4 a) +{ + f32_4 simd; + simd.s = _mm_acos_ps(a.s); + + return simd; +} + +inline +f32_8 simd_acos(f32_8 a) +{ + f32_8 simd; + simd.s = _mm256_acos_ps(a.s); + + return simd; +} + +inline +f32_16 simd_acos(f32_16 a) +{ + f32_16 simd; + simd.s = _mm512_acos_ps(a.s); + + return simd; +} + +// @todo implement more trigonometry function + #endif diff --git a/stdlib/simd/SIMD_Helper.h b/stdlib/simd/SIMD_Helper.h index 2e92808..3d0974a 100644 --- a/stdlib/simd/SIMD_Helper.h +++ b/stdlib/simd/SIMD_Helper.h @@ -17,81 +17,160 @@ #include #endif -inline -bool is_sse_supported() +// @todo implement for arm? + +inline int max_sse_supported() { #ifdef _MSC_VER int cpuInfo[4] = {-1}; __cpuid(cpuInfo, 1); // CPUID function 1 - // Check the SSE feature bit in EDX - return (cpuInfo[3] >> 25) & 1; + uint32_t ecx = cpuInfo[2]; + uint32_t edx = cpuInfo[3]; #else uint32_t eax, ebx, ecx, edx; eax = 1; // CPUID function 1 - - __asm__ __volatile__("cpuid;" : "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) : "a"(eax)); - - // Check the AVX feature bit in ECX - return (ecx >> 28) & 1; + __asm__ __volatile__("cpuid;" + : "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) + : "a"(eax)); #endif + + bool sse42_supported = (ecx >> 20) & 1; + if (sse42_supported) { + return 42; + } + + bool sse41_supported = (ecx >> 19) & 1; + if (sse41_supported) { + return 41; + } + + bool sse3_supported = (ecx >> 0) & 1; + if (sse3_supported) { + return 3; + } + + bool sse2_supported = (edx >> 26) & 1; + if (sse2_supported) { + return 2; + } + + return 0; } inline -bool is_avx256_supported() +int max_avx256_supported() { + int max_version = 0; + #ifdef _MSC_VER - int cpuInfo[4] = {-1}; - __cpuid(cpuInfo, 1); // CPUID function 1 + int cpuInfo[4]; + __cpuid(cpuInfo, 1); - // Check the AVX feature bit in ECX if ((cpuInfo[2] >> 28) & 1) { - __cpuid(cpuInfo, 7); // CPUID function 7, sub-function 0 - // Check the AVX2 feature bit in EBX - return (cpuInfo[1] >> 5) & 1; + __cpuid(cpuInfo, 7); // Query extended features + + if ((cpuInfo[1] >> 5) & 1) { + max_version = 2; + } } - - return false; #else - uint32_t eax, ebx, ecx, edx; + unsigned int eax, ebx, ecx, edx; - eax = 7; // CPUID function 7 - ecx = 0; // Sub-function 0 + __asm__ __volatile__("cpuid" + : "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) + : "a"(1)); + if ((ecx >> 28) & 1) { + eax = 7; + ecx = 0; + __asm__ __volatile__("cpuid" + : "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) + : "a"(eax), "c"(ecx)); - __asm__ __volatile__("cpuid;" : "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) : "a"(eax), "c"(ecx)); - - // Check the AVX-256 (AVX2) feature bit in EBX - return (ebx >> 5) & 1; + if ((ebx >> 5) & 1) { + max_version = 2; + } + } #endif + + return max_version; } inline -bool is_avx512_supported() +int max_avx512_supported() { #ifdef _MSC_VER - int cpuInfo[4] = {-1}; - __cpuid(cpuInfo, 1); // CPUID function 1 + int cpuInfo[4]; + __cpuid(cpuInfo, 1); + int ebx = 0; - // Check the AVX feature bit in ECX if ((cpuInfo[2] >> 28) & 1) { - __cpuid(cpuInfo, 7); // CPUID function 7, sub-function 0 - // Check the AVX-512 feature bit in EBX - return (cpuInfo[1] >> 16) & 1; + __cpuid(cpuInfo, 7); + + ebx = cpuInfo[1]; } - - return false; #else - uint32_t eax, ebx, ecx, edx; + unsigned int eax, ebx, ecx, edx; - eax = 7; // CPUID function 7 - ecx = 0; // Sub-function 0 - - __asm__ __volatile__("cpuid;" : "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) : "a"(eax), "c"(ecx)); - - // Check the AVX-512 feature bit in EBX - return (ebx >> 16) & 1; + __asm__ __volatile__("cpuid" + : "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) + : "a"(1)); + if ((ecx >> 28) & 1) { + eax = 7; + ecx = 0; + __asm__ __volatile__("cpuid" + : "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) + : "a"(eax), "c"(ecx)); + } #endif + + if ((ebx >> 16) & 1) { + return 1; // AVX-512F + } + + if ((ebx >> 17) & 1) { + return 2; // AVX-512DQ + } + + if ((ebx >> 21) & 1) { + return 3; // AVX-512IFMA + } + + if ((ebx >> 26) & 1) { + return 4; // AVX-512PF + } + + if ((ebx >> 27) & 1) { + return 5; // AVX-512ER + } + + if ((ebx >> 28) & 1) { + return 6; // AVX-512CD + } + + if ((ebx >> 30) & 1) { + return 7; // AVX-512BW + } + + if ((ebx >> 31) & 1) { + return 8; // AVX-512VL + } + + return 0; } +/* +const char avx512_versions[8][12] = { + "AVX-512F", + "AVX-512DQ", + "AVX-512IFMA", + "AVX-512PF", + "AVX-512ER", + "AVX-512CD", + "AVX-512BW", + "AVX-512VL" +}; +*/ + #endif \ No newline at end of file diff --git a/stdlib/simd/SIMD_I16.h b/stdlib/simd/SIMD_I16.h new file mode 100644 index 0000000..330f176 --- /dev/null +++ b/stdlib/simd/SIMD_I16.h @@ -0,0 +1,976 @@ +/** + * Jingga + * + * @copyright Jingga + * @license OMS License 2.0 + * @version 1.0.0 + * @link https://jingga.app + */ +#ifndef TOS_TOS_STDLIB_SIMD_I16_H +#define TOS_TOS_STDLIB_SIMD_I16_H + +#include +#include + +#include "../Types.h" + +struct int16_8 { + union { + __m128i s; + int16 v[8]; + }; +}; + +struct int16_16 { + union { + __m256i s; + int16 v[16]; + }; +}; + +struct int16_32 { + union { + __m512i s; + int16 v[32]; + }; +}; + + +inline int16_8 load_int16_8(const int16* mem) +{ + int16_8 simd; + simd.s = _mm_loadu_epi16(mem); + + return simd; +} + +inline int16_8 init_int16_8(const int16* mem) +{ + int16_8 simd; + simd.s = _mm_set_epi16( + mem[0], mem[1], mem[2], mem[3], + mem[4], mem[5], mem[6], mem[7] + ); + + return simd; +} + +inline void unload_int16_8(int16_8 a, int16 *array) { _mm_store_si128((__m128i *) array, a.s); } + +inline int16_16 load_int16_16(const int16* mem) +{ + int16_16 simd; + simd.s = _mm256_loadu_epi16(mem); + + return simd; +} + +inline int16_16 init_int16_16(const int16* mem) +{ + int16_16 simd; + simd.s = _mm256_set_epi16( + mem[0], mem[1], mem[2], mem[3], mem[4], mem[5], mem[6], mem[7], + mem[8], mem[9], mem[10], mem[11], mem[12], mem[13], mem[14], mem[15] + ); + + return simd; +} + +inline void unload_int16_16(int16_16 a, int16 *array) { _mm256_store_si256((__m256i *) array, a.s); } + +inline int16_32 load_int16_32(const int16* mem) +{ + int16_32 simd; + simd.s = _mm512_loadu_epi16(mem); + + return simd; +} + +inline int16_32 init_int16_32(const int16* mem) +{ + int16_32 simd; + simd.s = _mm512_set_epi16( + mem[0], mem[1], mem[2], mem[3], mem[4], mem[5], mem[6], mem[7], + mem[8], mem[9], mem[10], mem[11], mem[12], mem[13], mem[14], mem[15], + mem[16], mem[17], mem[18], mem[19], mem[20], mem[21], mem[22], mem[23], + mem[24], mem[25], mem[26], mem[27], mem[28], mem[29], mem[30], mem[31] + ); + + return simd; +} + +inline void unload_int16_32(int16_32 a, int16 *array) { _mm512_storeu_epi16(array, a.s); } + +inline int16_8 init_zero_int16_8() +{ + int16_8 simd; + simd.s = _mm_setzero_si128(); + + return simd; +} + +inline int16_16 init_zero_int16_16() +{ + int16_16 simd; + simd.s = _mm256_setzero_si256(); + + return simd; +} + +inline int16_32 init_zero_int16_32() +{ + int16_32 simd; + simd.s = _mm512_setzero_si512(); + + return simd; +} + +inline int16_8 init_value_int16_8(int16 value) +{ + int16_8 simd; + simd.s = _mm_set1_epi16(value); + + return simd; +} + +inline int16_16 init_value_int16_16(int16 value) +{ + int16_16 simd; + simd.s = _mm256_set1_epi16(value); + + return simd; +} + +inline int16_32 init_value_int16_32(int16 value) +{ + int16_32 simd; + simd.s = _mm512_set1_epi16(value); + + return simd; +} + +inline int16_8 operator+(int16_8 a, int16_8 b) +{ + int16_8 simd; + simd.s = _mm_add_epi16(a.s, b.s); + + return simd; +} + +inline int16_16 operator+(int16_16 a, int16_16 b) +{ + int16_16 simd; + simd.s = _mm256_add_epi16(a.s, b.s); + + return simd; +} + +inline int16_32 operator+(int16_32 a, int16_32 b) +{ + int16_32 simd; + simd.s = _mm512_add_epi16(a.s, b.s); + + return simd; +} + +inline int16_8 operator-(int16_8 a, int16_8 b) +{ + int16_8 simd; + simd.s = _mm_sub_epi16(a.s, b.s); + + return simd; +} + +inline int16_8 operator-(int16_8 a) { return init_zero_int16_8() - a; } + +inline int16_16 operator-(int16_16 a, int16_16 b) +{ + int16_16 simd; + simd.s = _mm256_sub_epi16(a.s, b.s); + + return simd; +} + +inline int16_16 operator-(int16_16 a) { return init_zero_int16_16() - a; } + +inline int16_32 operator-(int16_32 a, int16_32 b) +{ + int16_32 simd; + simd.s = _mm512_sub_epi16(a.s, b.s); + + return simd; +} + +inline int16_32 operator-(int16_32 a) { return init_zero_int16_32() - a; } + +inline int16_8 operator*(int16_8 a, int16_8 b) +{ + int16_8 simd; + simd.s = _mm_mul_epi32(a.s, b.s); + + return simd; +} + +inline int16_16 operator*(int16_16 a, int16_16 b) +{ + int16_16 simd; + simd.s = _mm256_mul_epi32(a.s, b.s); + + return simd; +} + +inline int16_32 operator*(int16_32 a, int16_32 b) +{ + int16_32 simd; + simd.s = _mm512_mul_epi32(a.s, b.s); + + return simd; +} + +inline int16_8 operator/(int16_8 a, int16_8 b) +{ + int16_8 simd; + simd.s = _mm_div_epi16(a.s, b.s); + + return simd; +} + +inline int16_16 operator/(int16_16 a, int16_16 b) +{ + int16_16 simd; + simd.s = _mm256_div_epi16(a.s, b.s); + + return simd; +} + +inline int16_32 operator/(int16_32 a, int16_32 b) +{ + int16_32 simd; + simd.s = _mm512_div_epi16(a.s, b.s); + + return simd; +} + +inline int16_8 operator^(int16_8 a, int16_8 b) +{ + int16_8 simd; + simd.s = _mm_xor_si128(a.s, b.s); + + return simd; +} + +inline int16_16 operator^(int16_16 a, int16_16 b) +{ + int16_16 simd; + simd.s = _mm256_xor_si256(a.s, b.s); + + return simd; +} + +inline int16_32 operator^(int16_32 a, int16_32 b) +{ + int16_32 simd; + simd.s = _mm512_xor_si512(a.s, b.s); + + return simd; +} + +inline int16_8 &operator-=(int16_8 &a, int16_8 b) +{ + a = a - b; + + return a; +} + +inline int16_16 &operator-=(int16_16 &a, int16_16 b) +{ + a = a - b; + + return a; +} + +inline int16_32 &operator-=(int16_32 &a, int16_32 b) +{ + a = a - b; + + return a; +} + +inline int16_8 &operator+=(int16_8 &a, int16_8 b) +{ + a = a + b; + + return a; +} + +inline int16_16 &operator+=(int16_16 &a, int16_16 b) +{ + a = a + b; + + return a; +} + +inline int16_32 &operator+=(int16_32 &a, int16_32 b) +{ + a = a + b; + + return a; +} + +inline int16_8 &operator*=(int16_8 &a, int16_8 b) +{ + a = a * b; + + return a; +} + +inline int16_16 &operator*=(int16_16 &a, int16_16 b) +{ + a = a * b; + + return a; +} + +inline int16_32 &operator*=(int16_32 &a, int16_32 b) +{ + a = a * b; + + return a; +} + +inline int16_8 &operator/=(int16_8 &a, int16_8 b) +{ + a.s = (a / b).s; + + return a; +} + +inline int16_16 &operator/=(int16_16 &a, int16_16 b) +{ + a.s = (a / b).s; + + return a; +} + +inline int16_32 &operator/=(int16_32 &a, int16_32 b) +{ + a.s = (a / b).s; + + return a; +} + +inline int16_8 &operator^=(int16_8 &a, int16_8 b) +{ + a = a ^ b; + + return a; +} + +inline int16_16 &operator^=(int16_16 &a, int16_16 b) +{ + a = a ^ b; + + return a; +} + +inline int16_32 &operator^=(int16_32 &a, int16_32 b) +{ + a = a ^ b; + + return a; +} + +inline int16_8 operator<(int16_8 a, int16_8 b) +{ + int16_8 simd; + simd.s = _mm_cmplt_epi16(a.s, b.s); + + return simd; +} + +inline int16_16 operator<(int16_16 a, int16_16 b) +{ + int16_16 simd; + simd.s = _mm256_xor_si256(_mm256_cmpgt_epi16(a.s, b.s), _mm256_set1_epi16(-1)); + + return simd; +} + +inline int16_32 operator<(int16_32 a, int16_32 b) +{ + int16_32 simd; + simd.s = _mm512_mask_blend_epi16(_mm512_cmplt_epi16_mask(a.s, b.s), a.s, b.s); + + return simd; +} + +inline int16_8 operator<=(int16_8 a, int16_8 b) +{ + int16_8 simd; + simd.s = _mm_andnot_si128(_mm_cmplt_epi16(b.s, a.s), _mm_set1_epi16(-1)); + + return simd; +} + +inline int16_16 operator<=(int16_16 a, int16_16 b) +{ + int16_16 simd; + simd.s = _mm256_andnot_si256(_mm256_cmpgt_epi16(a.s, b.s), _mm256_set1_epi16(-1)); + + return simd; +} + +inline int16_32 operator<=(int16_32 a, int16_32 b) +{ + int16_32 simd; + simd.s = _mm512_mask_blend_epi16(_mm512_knot(_mm512_cmpgt_epi16_mask(b.s, a.s)), b.s, a.s); + + return simd; +} + +inline int16_8 operator>(int16_8 a, int16_8 b) +{ + int16_8 simd; + simd.s = _mm_cmpgt_epi16(a.s, b.s); + + return simd; +} + +inline int16_16 operator>(int16_16 a, int16_16 b) +{ + int16_16 simd; + simd.s = _mm256_cmpgt_epi16(a.s, b.s); + + return simd; +} + +inline int16_32 operator>(int16_32 a, int16_32 b) +{ + int16_32 simd; + simd.s = _mm512_mask_blend_epi16(_mm512_cmpgt_epi16_mask(a.s, b.s), a.s, b.s); + + return simd; +} + +inline int16_8 operator>=(int16_8 a, int16_8 b) +{ + int16_8 simd; + simd.s = _mm_andnot_si128(_mm_cmplt_epi16(a.s, b.s), _mm_set1_epi16(-1)); + + return simd; +} + +inline int16_16 operator>=(int16_16 a, int16_16 b) +{ + int16_16 simd; + simd.s = _mm256_andnot_si256(_mm256_cmpgt_epi16(b.s, a.s), _mm256_set1_epi16(-1)); + + return simd; +} + +inline int16_32 operator>=(int16_32 a, int16_32 b) +{ + int16_32 simd; + simd.s = _mm512_mask_blend_epi16(_mm512_cmpge_epi16_mask(a.s, b.s), a.s, b.s); + + return simd; +} + +inline int16_8 operator==(int16_8 a, int16_8 b) +{ + int16_8 simd; + simd.s = _mm_cmpeq_epi16(a.s, b.s); + + return simd; +} + +inline int16_16 operator==(int16_16 a, int16_16 b) +{ + int16_16 simd; + simd.s = _mm256_cmpeq_epi16(a.s, b.s); + + return simd; +} + +inline int16_32 operator==(int16_32 a, int16_32 b) +{ + int16_32 simd; + simd.s = _mm512_mask_blend_epi16(_mm512_cmpeq_epi16_mask(a.s, b.s), a.s, b.s); + + return simd; +} + +inline int16_8 operator!=(int16_8 a, int16_8 b) +{ + int16_8 simd; + simd.s = _mm_andnot_si128(_mm_cmpeq_epi16(a.s, b.s), _mm_set1_epi16(-1)); + + return simd; +} + +inline int16_16 operator!=(int16_16 a, int16_16 b) +{ + int16_16 simd; + simd.s = _mm256_mask_blend_epi16(_mm256_cmp_epi16_mask(a.s, b.s, _MM_CMPINT_NE), a.s, b.s); + + return simd; +} + +inline int16_32 operator!=(int16_32 a, int16_32 b) +{ + int16_32 simd; + simd.s = _mm512_mask_blend_epi16(_mm512_cmp_epi16_mask(a.s, b.s, _MM_CMPINT_NE), a.s, b.s); + + return simd; +} + +inline int16_8 operator&(int16_8 a, int16_8 b) +{ + int16_8 simd; + simd.s = _mm_and_si128(a.s, b.s); + + return simd; +} + +inline int16_16 operator&(int16_16 a, int16_16 b) +{ + int16_16 simd; + simd.s = _mm256_and_si256(a.s, b.s); + + return simd; +} + +inline int16_32 operator&(int16_32 a, int16_32 b) +{ + int16_32 simd; + simd.s = _mm512_and_si512(a.s, b.s); + + return simd; +} + +inline int16_8 operator|(int16_8 a, int16_8 b) +{ + int16_8 simd; + simd.s = _mm_or_si128(a.s, b.s); + + return simd; +} + +inline int16_16 operator|(int16_16 a, int16_16 b) +{ + int16_16 simd; + simd.s = _mm256_or_si256(a.s, b.s); + + return simd; +} + +inline int16_32 operator|(int16_32 a, int16_32 b) +{ + int16_32 simd; + simd.s = _mm512_or_si512(a.s, b.s); + + return simd; +} + +inline int16_8 &operator&=(int16_8 &a, int16_8 b) +{ + a = a & b; + + return a; +} + +inline int16_16 &operator&=(int16_16 &a, int16_16 b) +{ + a = a & b; + + return a; +} + +inline int16_32 &operator&=(int16_32 &a, int16_32 b) +{ + a = a & b; + + return a; +} + +inline int16_8 &operator|=(int16_8 &a, int16_8 b) +{ + a = a | b; + + return a; +} + +inline int16_16 &operator|=(int16_16 &a, int16_16 b) +{ + a = a | b; + + return a; +} + +inline int16_32 &operator|=(int16_32 &a, int16_32 b) +{ + a = a | b; + + return a; +} + +inline int16_8 abs(int16_8 a) +{ + int16_8 simd; + simd.s = _mm_abs_epi16(a.s); + + return simd; +} + +inline int16_16 abs(int16_16 a) +{ + int16_16 simd; + simd.s = _mm256_abs_epi16(a.s); + + return simd; +} + +inline int16_32 abs(int16_32 a) +{ + int16_32 simd; + simd.s = _mm512_abs_epi16(a.s); + + return simd; +} + +inline int16_8 simd_min(int16_8 a, int16_8 b) +{ + int16_8 simd; + simd.s = _mm_min_epi16(a.s, b.s); + + return simd; +} + +inline int16_16 simd_min(int16_16 a, int16_16 b) +{ + int16_16 simd; + simd.s = _mm256_min_epi16(a.s, b.s); + + return simd; +} + +inline int16_32 simd_min(int16_32 a, int16_32 b) +{ + int16_32 simd; + simd.s = _mm512_min_epi16(a.s, b.s); + + return simd; +} + +inline int16_8 simd_max(int16_8 a, int16_8 b) +{ + int16_8 simd; + simd.s = _mm_max_epi16(a.s, b.s); + + return simd; +} + +inline int16_16 simd_max(int16_16 a, int16_16 b) +{ + int16_16 simd; + simd.s = _mm256_max_epi16(a.s, b.s); + + return simd; +} + +inline int16_32 simd_max(int16_32 a, int16_32 b) +{ + int16_32 simd; + simd.s = _mm512_max_epi16(a.s, b.s); + + return simd; +} + +inline int16_8 clamp(int16_8 min_value, int16_8 a, int16_8 max_value) +{ + return simd_min(simd_max(a, min_value), max_value); +} + +inline int16_16 clamp(int16_16 min_value, int16_16 a, int16_16 max_value) +{ + return simd_min(simd_max(a, min_value), max_value); +} + +inline int16_32 clamp(int16_32 min_value, int16_32 a, int16_32 max_value) +{ + return simd_min(simd_max(a, min_value), max_value); +} + +inline int16 which_true(int16_8 a) +{ + int16 which_true = _mm_movemask_epi8(a.s); + + return which_true; +} + +inline int16 which_true(int16_16 a) +{ + int16 which_true = _mm256_movemask_epi8(a.s); + + return which_true; +} + +inline int16 which_true(int16_32 a) +{ + int16 which_true = _mm512_movepi16_mask(a.s); + + return which_true; +} + +inline bool any_true(int16_8 a) +{ + bool is_any_true = _mm_movemask_epi8(a.s) > 0; + + return is_any_true; +} + +inline bool any_true(int16_16 a) +{ + bool is_any_true = _mm256_movemask_epi8(a.s) > 0; + + return is_any_true; +} + +inline bool any_true(int16_32 a) +{ + bool is_any_true = _mm512_movepi16_mask(a.s) > 0; + + return is_any_true; +} + +inline bool all_true(int16_8 a) +{ + bool is_true = _mm_movemask_epi8(a.s) == 15; + + return is_true; +} + +inline bool all_true(int16_16 a) +{ + bool is_true = _mm256_movemask_epi8(a.s) == 255; + + return is_true; +} + +inline bool all_true(int16_32 a) +{ + bool is_true = _mm512_movepi16_mask(a.s) == 65535; + + return is_true; +} + +inline bool all_false(int16_8 a) +{ + bool is_false = _mm_movemask_epi8(a.s) == 0; + + return is_false; +} + +inline bool all_false(int16_16 a) +{ + bool is_false = _mm256_movemask_epi8(a.s) == 0; + + return is_false; +} + +inline bool all_false(int16_32 a) +{ + // @todo This can be optimized (requires also changes in the comparison functions return) + bool is_false = _mm512_movepi16_mask(a.s) == 0; + + return is_false; +} + +// @todo from down here we can optimize some of the code by NOT using the wrappers +// the code is self contained and we could use te intrinsic functions directly + +inline +void simd_mult(const int16* a, const int16* b, int16* result, int size, int steps) +{ + int i = 0; + + if (steps == 16) { + int16_32 a_16; + int16_32 b_16; + int16_32 result_16; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_16 = load_int16_32(a); + b_16 = load_int16_32(b); + result_16 = a_16 * b_16; + unload_int16_32(result_16, result); + } + } else if (steps == 8) { + int16_16 a_8; + int16_16 b_8; + int16_16 result_8; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_8 = load_int16_16(a); + b_8 = load_int16_16(b); + result_8 = a_8 * b_8; + unload_int16_16(result_8, result); + } + } else if (steps == 4) { + int16_8 a_4; + int16_8 b_4; + int16_8 result_4; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_4 = load_int16_8(a); + b_4 = load_int16_8(b); + result_4 = a_4 * b_4; + unload_int16_8(result_4, result); + } + } + + for (; i < size; ++i) { + ++a; + ++b; + ++result; + + *result = *a * *b; + } +} + +inline +void simd_mult(const int16* a, const int16* b, int16* result) +{ + int16_8 a_4 = load_int16_8(a); + int16_8 b_4 = load_int16_8(b); + int16_8 result_4 = a_4 * b_4; + + unload_int16_8(result_4, result); +} + +inline +void int16_16_mult(const int16* a, const int16* b, int16* result) +{ + int16_16 a_8 = load_int16_16(a); + int16_16 b_8 = load_int16_16(b); + int16_16 result_8 = a_8 * b_8; + + unload_int16_16(result_8, result); +} + +inline +void int16_32_mult(const int16* a, const int16* b, int16* result) +{ + int16_32 a_16 = load_int16_32(a); + int16_32 b_16 = load_int16_32(b); + int16_32 result_16 = a_16 * b_16; + + unload_int16_32(result_16, result); +} + +inline +void simd_add(const int16* a, const int16* b, int16* result, int size, int steps) +{ + int i = 0; + + if (steps == 16) { + int16_32 a_16; + int16_32 b_16; + int16_32 result_16; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_16 = load_int16_32(a); + b_16 = load_int16_32(b); + result_16 = a_16 + b_16; + unload_int16_32(result_16, result); + } + } else if (steps == 8) { + int16_16 a_8; + int16_16 b_8; + int16_16 result_8; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_8 = load_int16_16(a); + b_8 = load_int16_16(b); + result_8 = a_8 + b_8; + unload_int16_16(result_8, result); + } + } else if (steps == 4) { + int16_8 a_4; + int16_8 b_4; + int16_8 result_4; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_4 = load_int16_8(a); + b_4 = load_int16_8(b); + result_4 = a_4 + b_4; + unload_int16_8(result_4, result); + } + } + + for (; i < size; ++i) { + ++a; + ++b; + ++result; + + *result = *a + *b; + } +} + +inline +void int16_8_add(const int16* a, const int16* b, int16* result) +{ + int16_8 a_4 = load_int16_8(a); + int16_8 b_4 = load_int16_8(b); + int16_8 result_4 = a_4 + b_4; + + unload_int16_8(result_4, result); +} + +inline +void int16_16_add(const int16* a, const int16* b, int16* result) +{ + int16_16 a_8 = load_int16_16(a); + int16_16 b_8 = load_int16_16(b); + int16_16 result_8 = a_8 + b_8; + + unload_int16_16(result_8, result); +} + +inline +void int16_32_add(const int16* a, const int16* b, int16* result) +{ + int16_32 a_16 = load_int16_32(a); + int16_32 b_16 = load_int16_32(b); + int16_32 result_16 = a_16 + b_16; + + unload_int16_32(result_16, result); +} + +// @todo add more operations like the one above "int16_8_mult()" + +#endif \ No newline at end of file diff --git a/stdlib/simd/SIMD_I32.h b/stdlib/simd/SIMD_I32.h index 7c09ad4..ab45604 100644 --- a/stdlib/simd/SIMD_I32.h +++ b/stdlib/simd/SIMD_I32.h @@ -15,6 +15,9 @@ #include "../Types.h" #include "SIMD_F32.h" +// @todo a lot of sse functions require high level (e.g. sse4.1) this needs to be changed to be more general +// or better create alternative functions for the available sse version. + struct int32_4 { union { __m128i s; @@ -36,7 +39,7 @@ struct int32_16 { }; }; -inline int32_4 load_int32_4(int32 *mem) +inline int32_4 load_int32_4(const int32* mem) { int32_4 simd; simd.s = _mm_loadu_epi32(mem); @@ -44,7 +47,7 @@ inline int32_4 load_int32_4(int32 *mem) return simd; } -inline int32_4 init_int32_4(int32 *mem) +inline int32_4 init_int32_4(const int32* mem) { int32_4 simd; simd.s = _mm_set_epi32(mem[0], mem[1], mem[2], mem[3]); @@ -54,7 +57,7 @@ inline int32_4 init_int32_4(int32 *mem) inline void unload_int32_4(int32_4 a, int32 *array) { _mm_store_si128((__m128i *) array, a.s); } -inline int32_8 load_int32_8(int32 *mem) +inline int32_8 load_int32_8(const int32* mem) { int32_8 simd; simd.s = _mm256_loadu_epi32(mem); @@ -62,7 +65,7 @@ inline int32_8 load_int32_8(int32 *mem) return simd; } -inline int32_8 init_int32_8(int32 *mem) +inline int32_8 init_int32_8(const int32* mem) { int32_8 simd; simd.s = _mm256_set_epi32(mem[0], mem[1], mem[2], mem[3], mem[4], mem[5], mem[6], mem[7]); @@ -72,7 +75,7 @@ inline int32_8 init_int32_8(int32 *mem) inline void unload_int32_8(int32_8 a, int32 *array) { _mm256_store_si256((__m256i *) array, a.s); } -inline int32_16 load_int32_16(int32 *mem) +inline int32_16 load_int32_16(const int32* mem) { int32_16 simd; simd.s = _mm512_loadu_epi32(mem); @@ -80,7 +83,7 @@ inline int32_16 load_int32_16(int32 *mem) return simd; } -inline int32_16 init_int32_16(int32 *mem) +inline int32_16 init_int32_16(const int32* mem) { int32_16 simd; simd.s = _mm512_set_epi32(mem[0], mem[1], mem[2], mem[3], mem[4], mem[5], mem[6], mem[7], mem[8], mem[9], @@ -115,6 +118,116 @@ inline int32_16 init_zero_int32_16() return simd; } +inline int32_4 init_value_int32_4(int32 value) +{ + int32_4 simd; + simd.s = _mm_set1_epi32(value); + + return simd; +} + +inline int32_8 init_value_int32_8(int32 value) +{ + int32_8 simd; + simd.s = _mm256_set1_epi32(value); + + return simd; +} + +inline int32_16 init_value_int32_16(int32 value) +{ + int32_16 simd; + simd.s = _mm512_set1_epi32(value); + + return simd; +} + +inline int32_4 init_values_int32_4(int32 a, int32 b, int32 c, int32 d) +{ + int32_4 simd; + simd.s = _mm_set_epi32(a, b, c, d); + + return simd; +} + +inline int32_8 init_values_int32_8( + int32 a, int32 b, int32 c, int32 d, + int32 e, int32 f, int32 g, int32 h +) +{ + int32_8 simd; + simd.s = _mm256_set_epi32(a, b, c, d, e, f, g, h); + + return simd; +} + +inline int32_16 init_values_int32_16( + int32 a, int32 b, int32 c, int32 d, + int32 e, int32 f, int32 g, int32 h, + int32 i, int32 j, int32 k, int32 l, + int32 m, int32 n, int32 o, int32 p +) +{ + int32_16 simd; + simd.s = _mm512_set_epi32(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p); + + return simd; +} + +inline +int32_4 f32_4_to_int32_4(f32_4 a) +{ + int32_4 result; + result.s = _mm_cvtps_epi32(a.s); + + return result; +} + +inline +f32_4 int32_4_to_f32_4(int32_4 a) +{ + f32_4 result; + result.s = _mm_cvtepi32_ps(a.s); + + return result; +} + +inline +int32_8 f32_8_to_int32_8(f32_8 a) +{ + int32_8 result; + result.s = _mm256_cvtps_epi32(a.s); + + return result; +} + +inline +f32_8 int32_8_to_f32_8(int32_8 a) +{ + f32_8 result; + result.s = _mm256_cvtepi32_ps(a.s); + + return result; +} + +inline +int32_16 f32_16_to_int32_16(f32_16 a) +{ + int32_16 result; + result.s = _mm512_cvtps_epi32(a.s); + + return result; +} + +inline +f32_16 int32_16_to_f32_16(int32_16 a) +{ + f32_16 result; + result.s = _mm512_cvtepi32_ps(a.s); + + return result; +} + inline int32_4 operator+(int32_4 a, int32_4 b) { int32_4 simd; @@ -193,26 +306,74 @@ inline int32_16 operator*(int32_16 a, int32_16 b) return simd; } -inline f32_4 operator/(int32_4 a, int32_4 b) +inline int32_4 operator/(int32_4 a, int32_4 b) +{ + int32_4 simd; + simd.s = _mm_div_epi32(a.s, b.s); + + return simd; +} + +inline int32_8 operator/(int32_8 a, int32_8 b) +{ + int32_8 simd; + simd.s = _mm256_div_epi32(a.s, b.s); + + return simd; +} + +inline int32_16 operator/(int32_16 a, int32_16 b) +{ + int32_16 simd; + simd.s = _mm512_div_epi32(a.s, b.s); + + return simd; +} + +inline f32_4 operator/(f32_4 a, int32_4 b) { f32_4 simd; - simd.s = _mm_div_ps(_mm_cvtepi32_ps(a.s), _mm_cvtepi32_ps(b.s)); + simd.s = _mm_div_ps(a.s, _mm_cvtepi32_ps(b.s)); return simd; } -inline f32_8 operator/(int32_8 a, int32_8 b) +inline f32_8 operator/(f32_8 a, int32_8 b) { f32_8 simd; - simd.s = _mm256_div_ps(_mm256_cvtepi32_ps(a.s), _mm256_cvtepi32_ps(b.s)); + simd.s = _mm256_div_ps(a.s, _mm256_cvtepi32_ps(b.s)); return simd; } -inline f32_16 operator/(int32_16 a, int32_16 b) +inline f32_16 operator/(f32_16 a, int32_16 b) { f32_16 simd; - simd.s = _mm512_div_ps(_mm512_cvtepi32_ps(a.s), _mm512_cvtepi32_ps(b.s)); + simd.s = _mm512_div_ps(a.s, _mm512_cvtepi32_ps(b.s)); + + return simd; +} + +inline f32_4 operator/(int32_4 a, f32_4 b) +{ + f32_4 simd; + simd.s = _mm_div_ps(_mm_cvtepi32_ps(a.s), b.s); + + return simd; +} + +inline f32_8 operator/(int32_8 a, f32_8 b) +{ + f32_8 simd; + simd.s = _mm256_div_ps(_mm256_cvtepi32_ps(a.s), b.s); + + return simd; +} + +inline f32_16 operator/(int32_16 a, f32_16 b) +{ + f32_16 simd; + simd.s = _mm512_div_ps(_mm512_cvtepi32_ps(a.s), b.s); return simd; } @@ -306,21 +467,21 @@ inline int32_16 &operator*=(int32_16 &a, int32_16 b) inline int32_4 &operator/=(int32_4 &a, int32_4 b) { - a.s = _mm_cvtps_epi32((a / b).s); + a.s = (a / b).s; return a; } inline int32_8 &operator/=(int32_8 &a, int32_8 b) { - a.s = _mm256_cvtps_epi32((a / b).s); + a.s = (a / b).s; return a; } inline int32_16 &operator/=(int32_16 &a, int32_16 b) { - a.s = _mm512_cvtps_epi32((a / b).s); + a.s = (a / b).s; return a; } @@ -582,28 +743,24 @@ inline int32_16 &operator|=(int32_16 &a, int32_16 b) inline int32_4 abs(int32_4 a) { - __m128i mask = _mm_set1_epi32(0x7FFFFFFF); - int32_4 simd; - simd.s = _mm_and_si128(a.s, mask); + simd.s = _mm_abs_epi32(a.s); return simd; } inline int32_8 abs(int32_8 a) { - __m256i mask = _mm256_set1_epi32(0x7FFFFFFF); int32_8 simd; - simd.s = _mm256_and_si256(a.s, mask); + simd.s = _mm256_abs_epi32(a.s); return simd; } inline int32_16 abs(int32_16 a) { - __m512i mask = _mm512_set1_epi32(0x7FFFFFFF); int32_16 simd; - simd.s = _mm512_and_epi32(a.s, mask); + simd.s = _mm512_abs_epi64(a.s); return simd; } @@ -864,4 +1021,546 @@ inline bool all_false(int32_16 a) return is_false; } +// @todo from down here we can optimize some of the code by NOT using the wrappers +// the code is self contained and we could use te intrinsic functions directly + +inline +void simd_mult(const int32* a, const int32* b, int32* result, int size, int steps) +{ + int i = 0; + + if (steps == 16) { + int32_16 a_16; + int32_16 b_16; + int32_16 result_16; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_16 = load_int32_16(a); + b_16 = load_int32_16(b); + result_16 = a_16 * b_16; + unload_int32_16(result_16, result); + } + } else if (steps == 8) { + int32_8 a_8; + int32_8 b_8; + int32_8 result_8; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_8 = load_int32_8(a); + b_8 = load_int32_8(b); + result_8 = a_8 * b_8; + unload_int32_8(result_8, result); + } + } else if (steps == 4) { + int32_4 a_4; + int32_4 b_4; + int32_4 result_4; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_4 = load_int32_4(a); + b_4 = load_int32_4(b); + result_4 = a_4 * b_4; + unload_int32_4(result_4, result); + } + } + + for (; i < size; ++i) { + ++a; + ++b; + ++result; + + *result = *a * *b; + } +} + +inline +void simd_mult(const int32* a, const f32* b, f32* result, int size, int steps) +{ + int i = 0; + + if (steps == 16) { + int32_16 a_16; + f32_16 af_16; + f32_16 b_16; + f32_16 result_16; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_16 = load_int32_16(a); + af_16 = int32_16_to_f32_16(a_16); + b_16 = load_f32_16(b); + result_16 = af_16 * b_16; + unload_f32_16(result_16, result); + } + } else if (steps == 8) { + int32_8 a_8; + f32_8 af_8; + f32_8 b_8; + f32_8 result_8; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_8 = load_int32_8(a); + af_8 = int32_8_to_f32_8(a_8); + b_8 = load_f32_8(b); + result_8 = af_8 * b_8; + unload_f32_8(result_8, result); + } + } else if (steps == 4) { + int32_4 a_4; + f32_4 af_4; + f32_4 b_4; + f32_4 result_4; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_4 = load_int32_4(a); + af_4 = int32_4_to_f32_4(a_4); + b_4 = load_f32_4(b); + result_4 = af_4 * b_4; + unload_f32_4(result_4, result); + } + } + + for (; i < size; ++i) { + ++a; + ++b; + ++result; + + *result = *a * *b; + } +} + +inline +void simd_mult(const int32* a, const f32* b, int32* result, int size, int steps) +{ + int i = 0; + + if (steps == 16) { + int32_16 a_16; + f32_16 af_16; + f32_16 b_16; + f32_16 result_16; + int32_16 resulti_16; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_16 = load_int32_16(a); + af_16 = int32_16_to_f32_16(a_16); + b_16 = load_f32_16(b); + result_16 = af_16 * b_16; + resulti_16 = f32_16_to_int32_16(result_16); + unload_int32_16(resulti_16, result); + } + } else if (steps == 8) { + int32_8 a_8; + f32_8 af_8; + f32_8 b_8; + f32_8 result_8; + int32_8 resulti_8; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_8 = load_int32_8(a); + af_8 = int32_8_to_f32_8(a_8); + b_8 = load_f32_8(b); + result_8 = af_8 * b_8; + resulti_8 = f32_8_to_int32_8(result_8); + unload_int32_8(resulti_8, result); + } + } else if (steps == 4) { + int32_4 a_4; + f32_4 af_4; + f32_4 b_4; + f32_4 result_4; + int32_4 resulti_4; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_4 = load_int32_4(a); + af_4 = int32_4_to_f32_4(a_4); + b_4 = load_f32_4(b); + result_4 = af_4 * b_4; + resulti_4 = f32_4_to_int32_4(result_4); + unload_int32_4(resulti_4, result); + } + } + + for (; i < size; ++i) { + ++a; + ++b; + ++result; + + *result = *a * *b; + } +} + +inline +void int32_4_mult(const int32* a, const int32* b, int32* result) +{ + int32_4 a_4 = load_int32_4(a); + int32_4 b_4 = load_int32_4(b); + int32_4 result_4 = a_4 * b_4; + + unload_int32_4(result_4, result); +} + +inline +void int32_8_mult(const int32* a, const int32* b, int32* result) +{ + int32_8 a_8 = load_int32_8(a); + int32_8 b_8 = load_int32_8(b); + int32_8 result_8 = a_8 * b_8; + + unload_int32_8(result_8, result); +} + +inline +void int32_16_mult(const int32* a, const int32* b, int32* result) +{ + int32_16 a_16 = load_int32_16(a); + int32_16 b_16 = load_int32_16(b); + int32_16 result_16 = a_16 * b_16; + + unload_int32_16(result_16, result); +} + +inline +void int32_4_mult(const int32* a, const f32* b, f32* result) +{ + int32_4 a_4 = load_int32_4(a); + f32_4 af_4 = int32_4_to_f32_4(a_4); + f32_4 b_4 = load_f32_4(b); + f32_4 result_4 = af_4 * b_4; + + unload_f32_4(result_4, result); +} + +inline +void int32_8_mult(const int32* a, const f32* b, f32* result) +{ + int32_8 a_8 = load_int32_8(a); + f32_8 af_8 = int32_8_to_f32_8(a_8); + f32_8 b_8 = load_f32_8(b); + f32_8 result_8 = af_8 * b_8; + + unload_f32_8(result_8, result); +} + +inline +void int32_16_mult(const int32* a, const f32* b, f32* result) +{ + int32_16 a_16 = load_int32_16(a); + f32_16 af_16 = int32_16_to_f32_16(a_16); + f32_16 b_16 = load_f32_16(b); + f32_16 result_16 = af_16 * b_16; + + unload_f32_16(result_16, result); +} + +inline +void simd_add(const int32* a, const int32* b, int32* result, int size, int steps) +{ + int i = 0; + + if (steps == 16) { + int32_16 a_16; + int32_16 b_16; + int32_16 result_16; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_16 = load_int32_16(a); + b_16 = load_int32_16(b); + result_16 = a_16 + b_16; + unload_int32_16(result_16, result); + } + } else if (steps == 8) { + int32_8 a_8; + int32_8 b_8; + int32_8 result_8; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_8 = load_int32_8(a); + b_8 = load_int32_8(b); + result_8 = a_8 + b_8; + unload_int32_8(result_8, result); + } + } else if (steps == 4) { + int32_4 a_4; + int32_4 b_4; + int32_4 result_4; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_4 = load_int32_4(a); + b_4 = load_int32_4(b); + result_4 = a_4 + b_4; + unload_int32_4(result_4, result); + } + } + + for (; i < size; ++i) { + ++a; + ++b; + ++result; + + *result = *a + *b; + } +} + +inline +void simd_add(const int32* a, const f32* b, f32* result, int size, int steps) +{ + int i = 0; + + if (steps == 16) { + int32_16 a_16; + f32_16 af_16; + f32_16 b_16; + f32_16 result_16; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_16 = load_int32_16(a); + af_16 = int32_16_to_f32_16(a_16); + b_16 = load_f32_16(b); + result_16 = af_16 + b_16; + unload_f32_16(result_16, result); + } + } else if (steps == 8) { + int32_8 a_8; + f32_8 af_8; + f32_8 b_8; + f32_8 result_8; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_8 = load_int32_8(a); + af_8 = int32_8_to_f32_8(a_8); + b_8 = load_f32_8(b); + result_8 = af_8 + b_8; + unload_f32_8(result_8, result); + } + } else if (steps == 4) { + int32_4 a_4; + f32_4 af_4; + f32_4 b_4; + f32_4 result_4; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_4 = load_int32_4(a); + af_4 = int32_4_to_f32_4(a_4); + b_4 = load_f32_4(b); + result_4 = af_4 + b_4; + unload_f32_4(result_4, result); + } + } + + for (; i < size; ++i) { + ++a; + ++b; + ++result; + + *result = *a + *b; + } +} + +inline +void simd_add(const int32* a, const f32* b, int32* result, int size, int steps) +{ + int i = 0; + + if (steps == 16) { + int32_16 a_16; + f32_16 af_16; + f32_16 b_16; + f32_16 result_16; + int32_16 resulti_16; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_16 = load_int32_16(a); + af_16 = int32_16_to_f32_16(a_16); + b_16 = load_f32_16(b); + result_16 = af_16 + b_16; + resulti_16 = f32_16_to_int32_16(result_16); + unload_int32_16(resulti_16, result); + } + } else if (steps == 8) { + int32_8 a_8; + f32_8 af_8; + f32_8 b_8; + f32_8 result_8; + int32_8 resulti_8; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_8 = load_int32_8(a); + af_8 = int32_8_to_f32_8(a_8); + b_8 = load_f32_8(b); + result_8 = af_8 + b_8; + resulti_8 = f32_8_to_int32_8(result_8); + unload_int32_8(resulti_8, result); + } + } else if (steps == 4) { + int32_4 a_4; + f32_4 af_4; + f32_4 b_4; + f32_4 result_4; + int32_4 resulti_4; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_4 = load_int32_4(a); + af_4 = int32_4_to_f32_4(a_4); + b_4 = load_f32_4(b); + result_4 = af_4 + b_4; + resulti_4 = f32_4_to_int32_4(result_4); + unload_int32_4(resulti_4, result); + } + } + + for (; i < size; ++i) { + ++a; + ++b; + ++result; + + *result = *a + *b; + } +} + +inline +void int32_4_add(const int32* a, const int32* b, int32* result) +{ + int32_4 a_4 = load_int32_4(a); + int32_4 b_4 = load_int32_4(b); + int32_4 result_4 = a_4 + b_4; + + unload_int32_4(result_4, result); +} + +inline +void int32_8_add(const int32* a, const int32* b, int32* result) +{ + int32_8 a_8 = load_int32_8(a); + int32_8 b_8 = load_int32_8(b); + int32_8 result_8 = a_8 + b_8; + + unload_int32_8(result_8, result); +} + +inline +void int32_16_add(const int32* a, const int32* b, int32* result) +{ + int32_16 a_16 = load_int32_16(a); + int32_16 b_16 = load_int32_16(b); + int32_16 result_16 = a_16 + b_16; + + unload_int32_16(result_16, result); +} + +inline +void int32_4_add(const int32* a, const f32* b, f32* result) +{ + int32_4 a_4 = load_int32_4(a); + f32_4 af_4 = int32_4_to_f32_4(a_4); + f32_4 b_4 = load_f32_4(b); + f32_4 result_4 = af_4 + b_4; + + unload_f32_4(result_4, result); +} + +inline +void int32_8_add(const int32* a, const f32* b, f32* result) +{ + int32_8 a_8 = load_int32_8(a); + f32_8 af_8 = int32_8_to_f32_8(a_8); + f32_8 b_8 = load_f32_8(b); + f32_8 result_8 = af_8 + b_8; + + unload_f32_8(result_8, result); +} + +inline +void int32_16_add(const int32* a, const f32* b, f32* result) +{ + int32_16 a_16 = load_int32_16(a); + f32_16 af_16 = int32_16_to_f32_16(a_16); + f32_16 b_16 = load_f32_16(b); + f32_16 result_16 = af_16 + b_16; + + unload_f32_16(result_16, result); +} + +// WARNING: only works with SSE4.2 +// WARNING: incl. \0 both strings must be <= 16 +bool simd_str_compare(const char* str1, const char* str2) { + __m128i s1 = _mm_loadu_si128((const __m128i*) str1); + __m128i s2 = _mm_loadu_si128((const __m128i*) str2); + + return _mm_cmpistrc(s1, s2, _SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_EACH) == 0; +} + +// @todo add more operations like the one above "int32_4_mult()" + #endif diff --git a/stdlib/simd/SIMD_I8.h b/stdlib/simd/SIMD_I8.h new file mode 100644 index 0000000..a0ab1c0 --- /dev/null +++ b/stdlib/simd/SIMD_I8.h @@ -0,0 +1,983 @@ +/** + * Jingga + * + * @copyright Jingga + * @license OMS License 2.0 + * @version 1.0.0 + * @link https://jingga.app + */ +#ifndef TOS_TOS_STDLIB_SIMD_I8_H +#define TOS_TOS_STDLIB_SIMD_I8_H + +#include +#include + +#include "../Types.h" + +struct int8_16 { + union { + __m128i s; + int8 v[16]; + }; +}; + +struct int8_32 { + union { + __m256i s; + int8 v[32]; + }; +}; + +struct int8_64 { + union { + __m512i s; + int8 v[64]; + }; +}; + +inline int8_16 load_int8_16(const int8* mem) +{ + int8_16 simd; + simd.s = _mm_loadu_epi8(mem); + + return simd; +} + +inline int8_16 init_int8_16(const int8* mem) +{ + int8_16 simd; + simd.s = _mm_set_epi8( + mem[0], mem[1], mem[2], mem[3], + mem[4], mem[5], mem[6], mem[7], + mem[8], mem[9], mem[10], mem[11], + mem[12], mem[13], mem[14], mem[15] + ); + + return simd; +} + +inline void unload_int8_16(int8_16 a, int8 *array) { _mm_store_si128((__m128i *) array, a.s); } + +inline int8_32 load_int8_32(const int8* mem) +{ + int8_32 simd; + simd.s = _mm256_loadu_epi8(mem); + + return simd; +} + +inline int8_32 init_int8_32(const int8* mem) +{ + int8_32 simd; + simd.s = _mm256_set_epi8( + mem[0], mem[1], mem[2], mem[3], mem[4], mem[5], mem[6], mem[7], + mem[8], mem[9], mem[10], mem[11], mem[12], mem[13], mem[14], mem[15], + mem[16], mem[17], mem[18], mem[19], mem[20], mem[21], mem[22], mem[23], + mem[24], mem[25], mem[26], mem[27], mem[28], mem[29], mem[30], mem[31] + ); + + return simd; +} + +inline void unload_int8_32(int8_32 a, int8 *array) { _mm256_store_si256((__m256i *) array, a.s); } + +inline int8_64 load_int8_64(const int8* mem) +{ + int8_64 simd; + simd.s = _mm512_loadu_epi8(mem); + + return simd; +} + +inline int8_64 init_int8_64(const int8* mem) +{ + int8_64 simd; + simd.s = _mm512_set_epi8( + mem[0], mem[1], mem[2], mem[3], mem[4], mem[5], mem[6], mem[7], + mem[8], mem[9], mem[10], mem[11], mem[12], mem[13], mem[14], mem[15], + mem[16], mem[17], mem[18], mem[19], mem[20], mem[21], mem[22], mem[23], + mem[24], mem[25], mem[26], mem[27], mem[28], mem[29], mem[30], mem[31], + mem[32], mem[33], mem[34], mem[35], mem[36], mem[37], mem[38], mem[39], + mem[40], mem[41], mem[42], mem[43], mem[44], mem[45], mem[46], mem[47], + mem[48], mem[49], mem[50], mem[51], mem[52], mem[53], mem[54], mem[55], + mem[56], mem[57], mem[58], mem[59], mem[60], mem[61], mem[62], mem[63] + ); + + return simd; +} + +inline void unload_int8_64(int8_64 a, int8 *array) { _mm512_storeu_epi8(array, a.s); } + +inline int8_16 init_zero_int8_16() +{ + int8_16 simd; + simd.s = _mm_setzero_si128(); + + return simd; +} + +inline int8_32 init_zero_int8_32() +{ + int8_32 simd; + simd.s = _mm256_setzero_si256(); + + return simd; +} + +inline int8_64 init_zero_int8_64() +{ + int8_64 simd; + simd.s = _mm512_setzero_si512(); + + return simd; +} + +inline int8_16 init_value_int8_16(int8 value) +{ + int8_16 simd; + simd.s = _mm_set1_epi8(value); + + return simd; +} + +inline int8_32 init_value_int8_32(int8 value) +{ + int8_32 simd; + simd.s = _mm256_set1_epi8(value); + + return simd; +} + +inline int8_64 init_value_int8_64(int8 value) +{ + int8_64 simd; + simd.s = _mm512_set1_epi8(value); + + return simd; +} + +inline int8_16 operator+(int8_16 a, int8_16 b) +{ + int8_16 simd; + simd.s = _mm_add_epi8(a.s, b.s); + + return simd; +} + +inline int8_32 operator+(int8_32 a, int8_32 b) +{ + int8_32 simd; + simd.s = _mm256_add_epi8(a.s, b.s); + + return simd; +} + +inline int8_64 operator+(int8_64 a, int8_64 b) +{ + int8_64 simd; + simd.s = _mm512_add_epi8(a.s, b.s); + + return simd; +} + +inline int8_16 operator-(int8_16 a, int8_16 b) +{ + int8_16 simd; + simd.s = _mm_sub_epi8(a.s, b.s); + + return simd; +} + +inline int8_16 operator-(int8_16 a) { return init_zero_int8_16() - a; } + +inline int8_32 operator-(int8_32 a, int8_32 b) +{ + int8_32 simd; + simd.s = _mm256_sub_epi8(a.s, b.s); + + return simd; +} + +inline int8_32 operator-(int8_32 a) { return init_zero_int8_32() - a; } + +inline int8_64 operator-(int8_64 a, int8_64 b) +{ + int8_64 simd; + simd.s = _mm512_sub_epi8(a.s, b.s); + + return simd; +} + +inline int8_64 operator-(int8_64 a) { return init_zero_int8_64() - a; } + +inline int8_16 operator*(int8_16 a, int8_16 b) +{ + int8_16 simd; + simd.s = _mm_mul_epi32(a.s, b.s); + + return simd; +} + +inline int8_32 operator*(int8_32 a, int8_32 b) +{ + int8_32 simd; + simd.s = _mm256_mul_epi32(a.s, b.s); + + return simd; +} + +inline int8_64 operator*(int8_64 a, int8_64 b) +{ + int8_64 simd; + simd.s = _mm512_mul_epi32(a.s, b.s); + + return simd; +} + +inline int8_16 operator/(int8_16 a, int8_16 b) +{ + int8_16 simd; + simd.s = _mm_div_epi8(a.s, b.s); + + return simd; +} + +inline int8_32 operator/(int8_32 a, int8_32 b) +{ + int8_32 simd; + simd.s = _mm256_div_epi8(a.s, b.s); + + return simd; +} + +inline int8_64 operator/(int8_64 a, int8_64 b) +{ + int8_64 simd; + simd.s = _mm512_div_epi8(a.s, b.s); + + return simd; +} + +inline int8_16 operator^(int8_16 a, int8_16 b) +{ + int8_16 simd; + simd.s = _mm_xor_si128(a.s, b.s); + + return simd; +} + +inline int8_32 operator^(int8_32 a, int8_32 b) +{ + int8_32 simd; + simd.s = _mm256_xor_si256(a.s, b.s); + + return simd; +} + +inline int8_64 operator^(int8_64 a, int8_64 b) +{ + int8_64 simd; + simd.s = _mm512_xor_si512(a.s, b.s); + + return simd; +} + +inline int8_16 &operator-=(int8_16 &a, int8_16 b) +{ + a = a - b; + + return a; +} + +inline int8_32 &operator-=(int8_32 &a, int8_32 b) +{ + a = a - b; + + return a; +} + +inline int8_64 &operator-=(int8_64 &a, int8_64 b) +{ + a = a - b; + + return a; +} + +inline int8_16 &operator+=(int8_16 &a, int8_16 b) +{ + a = a + b; + + return a; +} + +inline int8_32 &operator+=(int8_32 &a, int8_32 b) +{ + a = a + b; + + return a; +} + +inline int8_64 &operator+=(int8_64 &a, int8_64 b) +{ + a = a + b; + + return a; +} + +inline int8_16 &operator*=(int8_16 &a, int8_16 b) +{ + a = a * b; + + return a; +} + +inline int8_32 &operator*=(int8_32 &a, int8_32 b) +{ + a = a * b; + + return a; +} + +inline int8_64 &operator*=(int8_64 &a, int8_64 b) +{ + a = a * b; + + return a; +} + +inline int8_16 &operator/=(int8_16 &a, int8_16 b) +{ + a.s = (a / b).s; + + return a; +} + +inline int8_32 &operator/=(int8_32 &a, int8_32 b) +{ + a.s = (a / b).s; + + return a; +} + +inline int8_64 &operator/=(int8_64 &a, int8_64 b) +{ + a.s = (a / b).s; + + return a; +} + +inline int8_16 &operator^=(int8_16 &a, int8_16 b) +{ + a = a ^ b; + + return a; +} + +inline int8_32 &operator^=(int8_32 &a, int8_32 b) +{ + a = a ^ b; + + return a; +} + +inline int8_64 &operator^=(int8_64 &a, int8_64 b) +{ + a = a ^ b; + + return a; +} + +inline int8_16 operator<(int8_16 a, int8_16 b) +{ + int8_16 simd; + simd.s = _mm_cmplt_epi8(a.s, b.s); + + return simd; +} + +inline int8_32 operator<(int8_32 a, int8_32 b) +{ + int8_32 simd; + simd.s = _mm256_xor_si256(_mm256_cmpgt_epi8(a.s, b.s), _mm256_set1_epi8(-1)); + + return simd; +} + +inline int8_64 operator<(int8_64 a, int8_64 b) +{ + int8_64 simd; + simd.s = _mm512_mask_blend_epi8(_mm512_cmplt_epi8_mask(a.s, b.s), a.s, b.s); + + return simd; +} + +inline int8_16 operator<=(int8_16 a, int8_16 b) +{ + int8_16 simd; + simd.s = _mm_andnot_si128(_mm_cmplt_epi8(b.s, a.s), _mm_set1_epi8(-1)); + + return simd; +} + +inline int8_32 operator<=(int8_32 a, int8_32 b) +{ + int8_32 simd; + simd.s = _mm256_andnot_si256(_mm256_cmpgt_epi8(a.s, b.s), _mm256_set1_epi8(-1)); + + return simd; +} + +inline int8_64 operator<=(int8_64 a, int8_64 b) +{ + int8_64 simd; + simd.s = _mm512_mask_blend_epi8(_mm512_knot(_mm512_cmpgt_epi8_mask(b.s, a.s)), b.s, a.s); + + return simd; +} + +inline int8_16 operator>(int8_16 a, int8_16 b) +{ + int8_16 simd; + simd.s = _mm_cmpgt_epi8(a.s, b.s); + + return simd; +} + +inline int8_32 operator>(int8_32 a, int8_32 b) +{ + int8_32 simd; + simd.s = _mm256_cmpgt_epi8(a.s, b.s); + + return simd; +} + +inline int8_64 operator>(int8_64 a, int8_64 b) +{ + int8_64 simd; + simd.s = _mm512_mask_blend_epi8(_mm512_cmpgt_epi8_mask(a.s, b.s), a.s, b.s); + + return simd; +} + +inline int8_16 operator>=(int8_16 a, int8_16 b) +{ + int8_16 simd; + simd.s = _mm_andnot_si128(_mm_cmplt_epi8(a.s, b.s), _mm_set1_epi8(-1)); + + return simd; +} + +inline int8_32 operator>=(int8_32 a, int8_32 b) +{ + int8_32 simd; + simd.s = _mm256_andnot_si256(_mm256_cmpgt_epi8(b.s, a.s), _mm256_set1_epi8(-1)); + + return simd; +} + +inline int8_64 operator>=(int8_64 a, int8_64 b) +{ + int8_64 simd; + simd.s = _mm512_mask_blend_epi8(_mm512_cmpge_epi8_mask(a.s, b.s), a.s, b.s); + + return simd; +} + +inline int8_16 operator==(int8_16 a, int8_16 b) +{ + int8_16 simd; + simd.s = _mm_cmpeq_epi8(a.s, b.s); + + return simd; +} + +inline int8_32 operator==(int8_32 a, int8_32 b) +{ + int8_32 simd; + simd.s = _mm256_cmpeq_epi8(a.s, b.s); + + return simd; +} + +inline int8_64 operator==(int8_64 a, int8_64 b) +{ + int8_64 simd; + simd.s = _mm512_mask_blend_epi8(_mm512_cmpeq_epi8_mask(a.s, b.s), a.s, b.s); + + return simd; +} + +inline int8_16 operator!=(int8_16 a, int8_16 b) +{ + int8_16 simd; + simd.s = _mm_andnot_si128(_mm_cmpeq_epi8(a.s, b.s), _mm_set1_epi8(-1)); + + return simd; +} + +inline int8_32 operator!=(int8_32 a, int8_32 b) +{ + int8_32 simd; + simd.s = _mm256_mask_blend_epi8(_mm256_cmp_epi8_mask(a.s, b.s, _MM_CMPINT_NE), a.s, b.s); + + return simd; +} + +inline int8_64 operator!=(int8_64 a, int8_64 b) +{ + int8_64 simd; + simd.s = _mm512_mask_blend_epi8(_mm512_cmp_epi8_mask(a.s, b.s, _MM_CMPINT_NE), a.s, b.s); + + return simd; +} + +inline int8_16 operator&(int8_16 a, int8_16 b) +{ + int8_16 simd; + simd.s = _mm_and_si128(a.s, b.s); + + return simd; +} + +inline int8_32 operator&(int8_32 a, int8_32 b) +{ + int8_32 simd; + simd.s = _mm256_and_si256(a.s, b.s); + + return simd; +} + +inline int8_64 operator&(int8_64 a, int8_64 b) +{ + int8_64 simd; + simd.s = _mm512_and_si512(a.s, b.s); + + return simd; +} + +inline int8_16 operator|(int8_16 a, int8_16 b) +{ + int8_16 simd; + simd.s = _mm_or_si128(a.s, b.s); + + return simd; +} + +inline int8_32 operator|(int8_32 a, int8_32 b) +{ + int8_32 simd; + simd.s = _mm256_or_si256(a.s, b.s); + + return simd; +} + +inline int8_64 operator|(int8_64 a, int8_64 b) +{ + int8_64 simd; + simd.s = _mm512_or_si512(a.s, b.s); + + return simd; +} + +inline int8_16 &operator&=(int8_16 &a, int8_16 b) +{ + a = a & b; + + return a; +} + +inline int8_32 &operator&=(int8_32 &a, int8_32 b) +{ + a = a & b; + + return a; +} + +inline int8_64 &operator&=(int8_64 &a, int8_64 b) +{ + a = a & b; + + return a; +} + +inline int8_16 &operator|=(int8_16 &a, int8_16 b) +{ + a = a | b; + + return a; +} + +inline int8_32 &operator|=(int8_32 &a, int8_32 b) +{ + a = a | b; + + return a; +} + +inline int8_64 &operator|=(int8_64 &a, int8_64 b) +{ + a = a | b; + + return a; +} + +inline int8_16 abs(int8_16 a) +{ + int8_16 simd; + simd.s = _mm_abs_epi8(a.s); + + return simd; +} + +inline int8_32 abs(int8_32 a) +{ + int8_32 simd; + simd.s = _mm256_abs_epi16(a.s); + + return simd; +} + +inline int8_64 abs(int8_64 a) +{ + int8_64 simd; + simd.s = _mm512_abs_epi16(a.s); + + return simd; +} + +inline int8_16 simd_min(int8_16 a, int8_16 b) +{ + int8_16 simd; + simd.s = _mm_min_epi8(a.s, b.s); + + return simd; +} + +inline int8_32 simd_min(int8_32 a, int8_32 b) +{ + int8_32 simd; + simd.s = _mm256_min_epi8(a.s, b.s); + + return simd; +} + +inline int8_64 simd_min(int8_64 a, int8_64 b) +{ + int8_64 simd; + simd.s = _mm512_min_epi8(a.s, b.s); + + return simd; +} + +inline int8_16 simd_max(int8_16 a, int8_16 b) +{ + int8_16 simd; + simd.s = _mm_max_epi8(a.s, b.s); + + return simd; +} + +inline int8_32 simd_max(int8_32 a, int8_32 b) +{ + int8_32 simd; + simd.s = _mm256_max_epi8(a.s, b.s); + + return simd; +} + +inline int8_64 simd_max(int8_64 a, int8_64 b) +{ + int8_64 simd; + simd.s = _mm512_max_epi8(a.s, b.s); + + return simd; +} + +inline int8_16 clamp(int8_16 min_value, int8_16 a, int8_16 max_value) +{ + return simd_min(simd_max(a, min_value), max_value); +} + +inline int8_32 clamp(int8_32 min_value, int8_32 a, int8_32 max_value) +{ + return simd_min(simd_max(a, min_value), max_value); +} + +inline int8_64 clamp(int8_64 min_value, int8_64 a, int8_64 max_value) +{ + return simd_min(simd_max(a, min_value), max_value); +} + +inline int8 which_true(int8_16 a) +{ + int8 which_true = _mm_movemask_epi8(a.s); + + return which_true; +} + +inline int8 which_true(int8_32 a) +{ + int8 which_true = _mm256_movemask_epi8(a.s); + + return which_true; +} + +inline int8 which_true(int8_64 a) +{ + int8 which_true = _mm512_movepi8_mask(a.s); + + return which_true; +} + +inline bool any_true(int8_16 a) +{ + bool is_any_true = _mm_movemask_epi8(a.s) > 0; + + return is_any_true; +} + +inline bool any_true(int8_32 a) +{ + bool is_any_true = _mm256_movemask_epi8(a.s) > 0; + + return is_any_true; +} + +inline bool any_true(int8_64 a) +{ + bool is_any_true = _mm512_movepi8_mask(a.s) > 0; + + return is_any_true; +} + +inline bool all_true(int8_16 a) +{ + bool is_true = _mm_movemask_epi8(a.s) == 15; + + return is_true; +} + +inline bool all_true(int8_32 a) +{ + bool is_true = _mm256_movemask_epi8(a.s) == 255; + + return is_true; +} + +inline bool all_true(int8_64 a) +{ + bool is_true = _mm512_movepi8_mask(a.s) == 65535; + + return is_true; +} + +inline bool all_false(int8_16 a) +{ + bool is_false = _mm_movemask_epi8(a.s) == 0; + + return is_false; +} + +inline bool all_false(int8_32 a) +{ + bool is_false = _mm256_movemask_epi8(a.s) == 0; + + return is_false; +} + +inline bool all_false(int8_64 a) +{ + // @todo This can be optimized (requires also changes in the comparison functions return) + bool is_false = _mm512_movepi8_mask(a.s) == 0; + + return is_false; +} + +// @todo from down here we can optimize some of the code by NOT using the wrappers +// the code is self contained and we could use te intrinsic functions directly + +inline +void simd_mult(const int8* a, const int8* b, int8* result, int size, int steps) +{ + int i = 0; + + if (steps == 16) { + int8_64 a_16; + int8_64 b_16; + int8_64 result_16; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_16 = load_int8_64(a); + b_16 = load_int8_64(b); + result_16 = a_16 * b_16; + unload_int8_64(result_16, result); + } + } else if (steps == 8) { + int8_32 a_8; + int8_32 b_8; + int8_32 result_8; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_8 = load_int8_32(a); + b_8 = load_int8_32(b); + result_8 = a_8 * b_8; + unload_int8_32(result_8, result); + } + } else if (steps == 4) { + int8_16 a_4; + int8_16 b_4; + int8_16 result_4; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_4 = load_int8_16(a); + b_4 = load_int8_16(b); + result_4 = a_4 * b_4; + unload_int8_16(result_4, result); + } + } + + for (; i < size; ++i) { + ++a; + ++b; + ++result; + + *result = *a * *b; + } +} + +inline +void int8_16_mult(const int8* a, const int8* b, int8* result) +{ + int8_16 a_4 = load_int8_16(a); + int8_16 b_4 = load_int8_16(b); + int8_16 result_4 = a_4 * b_4; + + unload_int8_16(result_4, result); +} + +inline +void int8_32_mult(const int8* a, const int8* b, int8* result) +{ + int8_32 a_8 = load_int8_32(a); + int8_32 b_8 = load_int8_32(b); + int8_32 result_8 = a_8 * b_8; + + unload_int8_32(result_8, result); +} + +inline +void int8_64_mult(const int8* a, const int8* b, int8* result) +{ + int8_64 a_16 = load_int8_64(a); + int8_64 b_16 = load_int8_64(b); + int8_64 result_16 = a_16 * b_16; + + unload_int8_64(result_16, result); +} + +inline +void simd_add(const int8* a, const int8* b, int8* result, int size, int steps) +{ + int i = 0; + + if (steps == 16) { + int8_64 a_16; + int8_64 b_16; + int8_64 result_16; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_16 = load_int8_64(a); + b_16 = load_int8_64(b); + result_16 = a_16 + b_16; + unload_int8_64(result_16, result); + } + } else if (steps == 8) { + int8_32 a_8; + int8_32 b_8; + int8_32 result_8; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_8 = load_int8_32(a); + b_8 = load_int8_32(b); + result_8 = a_8 + b_8; + unload_int8_32(result_8, result); + } + } else if (steps == 4) { + int8_16 a_4; + int8_16 b_4; + int8_16 result_4; + + for (i = 0; i <= size - steps; i += steps) { + ++a; + ++b; + ++result; + + a_4 = load_int8_16(a); + b_4 = load_int8_16(b); + result_4 = a_4 + b_4; + unload_int8_16(result_4, result); + } + } + + for (; i < size; ++i) { + ++a; + ++b; + ++result; + + *result = *a + *b; + } +} + +inline +void int8_16_add(const int8* a, const int8* b, int8* result) +{ + int8_16 a_4 = load_int8_16(a); + int8_16 b_4 = load_int8_16(b); + int8_16 result_4 = a_4 + b_4; + + unload_int8_16(result_4, result); +} + +inline +void int8_32_add(const int8* a, const int8* b, int8* result) +{ + int8_32 a_8 = load_int8_32(a); + int8_32 b_8 = load_int8_32(b); + int8_32 result_8 = a_8 + b_8; + + unload_int8_32(result_8, result); +} + +inline +void int8_64_add(const int8* a, const int8* b, int8* result) +{ + int8_64 a_16 = load_int8_64(a); + int8_64 b_16 = load_int8_64(b); + int8_64 result_16 = a_16 + b_16; + + unload_int8_64(result_16, result); +} + +// @todo add more operations like the one above "int8_16_mult()" + +#endif \ No newline at end of file diff --git a/thread/ThreadOSWrapper.h b/thread/ThreadOSWrapper.h index 98280c4..d7d7909 100644 --- a/thread/ThreadOSWrapper.h +++ b/thread/ThreadOSWrapper.h @@ -265,6 +265,8 @@ void ms_to_timespec(timespec *ts, uint32 ms) return sysinfo.dwNumberOfProcessors; } + + #define pthread_exit(a) {return (a);} #else unsigned int pcthread_get_num_procs() { diff --git a/ui/Dropdown.h b/ui/Dropdown.h new file mode 100644 index 0000000..e69de29 diff --git a/ui/Image.h b/ui/Image.h new file mode 100644 index 0000000..e69de29 diff --git a/ui/Link.h b/ui/Link.h new file mode 100644 index 0000000..e69de29 diff --git a/ui/Panel.h b/ui/Panel.h new file mode 100644 index 0000000..e69de29 diff --git a/ui/Select.h b/ui/Select.h new file mode 100644 index 0000000..e69de29 diff --git a/ui/Table.h b/ui/Table.h new file mode 100644 index 0000000..e69de29 diff --git a/ui/Text.h b/ui/Text.h new file mode 100644 index 0000000..e69de29 diff --git a/ui/Textarea.h b/ui/Textarea.h new file mode 100644 index 0000000..e69de29 diff --git a/ui/Textfield.h b/ui/Textfield.h new file mode 100644 index 0000000..e69de29 diff --git a/ui/UIButton.h b/ui/UIButton.h new file mode 100644 index 0000000..ce32045 --- /dev/null +++ b/ui/UIButton.h @@ -0,0 +1,35 @@ +#ifndef TOS_UI_BUTTON_H +#define TOS_UI_BUTTON_H + +#include "UIElement.h" +#include "UILayout.h" + +#include "../animation/AnimationEaseType.h" + +enum ButtonState { + BUTTON_STATE_DEFAULT, + BUTTON_STATE_HOVER, + BUTTON_STATE_CLICK +}; + +struct UIButton { + UIElement element; + + ButtonState state_old; + ButtonState state_new; + + // Is pointer becuase we probably want to have a global layout style that we re-use over and over + UILayout* layout_default; + + UILayout* layout_hover; + float layout_hover_anim_duration; + AnimationEaseType layout_hover_anim_style; + int hover_sound; + + UILayout* layout_click; + float layout_click_anim_duration; + AnimationEaseType layout_click_anim_style; + int click_sound; +}; + +#endif \ No newline at end of file diff --git a/ui/UIElement.h b/ui/UIElement.h new file mode 100644 index 0000000..7aa1a1c --- /dev/null +++ b/ui/UIElement.h @@ -0,0 +1,20 @@ +#ifndef TOS_UI_ELEMENT_H +#define TOS_UI_ELEMENT_H + +#include "UIElementType.h" + +struct UIElement { + int id; + int type; + + int window_id; + int panel_id; + + bool is_visible; + bool is_active; + bool is_focused; + + UIElementType type; +}; + +#endif \ No newline at end of file diff --git a/ui/UIElementType.h b/ui/UIElementType.h new file mode 100644 index 0000000..6eb01e5 --- /dev/null +++ b/ui/UIElementType.h @@ -0,0 +1,20 @@ +#ifndef TOS_UI_ELEMENT_TYPE_H +#define TOS_UI_ELEMENT_TYPE_H + +enum UIElementType { + UI_ELEMENT_TYPE_BUTTON, + UI_ELEMENT_TYPE_SELECT, + UI_ELEMENT_TYPE_DROPDOWN, + UI_ELEMENT_TYPE_TEXTFIELD, + UI_ELEMENT_TYPE_TEXTAREA, + UI_ELEMENT_TYPE_IMAGE, + UI_ELEMENT_TYPE_TEXT, + UI_ELEMENT_TYPE_LINK, + UI_ELEMENT_TYPE_TABLE, + + UI_ELEMENT_TYPE_VIEW_WINDOW, + UI_ELEMENT_TYPE_VIEW_PANEL, + UI_ELEMENT_TYPE_VIEW_TAB, +}; + +#endif \ No newline at end of file diff --git a/ui/UILayout.h b/ui/UILayout.h new file mode 100644 index 0000000..74150f0 --- /dev/null +++ b/ui/UILayout.h @@ -0,0 +1,51 @@ +#ifndef TOS_UI_LAYOUT_H +#define TOS_UI_LAYOUT_H + +#include "../stdlib/Mathtypes.h" + +#include "UIPosition.h" +#include "UILocation.h" + +struct UILayout { + int x; + int y; + + int width; + int height; + + UIPosition position; + + UILocation self; + UILocation children; + + int margin[4]; + int padding[4]; + + int border_width[4]; + v3_int32 border_color; + + v3_int32 color_background; + v3_int32 color_foreground; + + int image_background; + int image_width; + int image_height; + + // Horizontal and vertical scaling can have 2 scalable areas + int image_horizontal_area1[4]; + int image_horizontal_area2[4]; + + int image_vertical_area1[4]; + int image_vertical_area2[4]; + bool image_repeatable; + + int shadow_outer_width[4]; + int shadow_outer_color; + + int shadow_inner_width[4]; + int shadow_inner_color; + + int curser_style; +}; + +#endif \ No newline at end of file diff --git a/ui/UILocation.h b/ui/UILocation.h new file mode 100644 index 0000000..1ff9b90 --- /dev/null +++ b/ui/UILocation.h @@ -0,0 +1,13 @@ +#ifndef TOS_UI_LOCATION_H +#define TOS_UI_LOCATION_H + +enum UILocation { + UI_LOCATION_LEFT, + UI_LOCATION_CENTER, + UI_LOCATION_RIGHT, + + UI_LOCATION_FLEX_ROW, + UI_LOCATION_FLEX_COL +}; + +#endif \ No newline at end of file diff --git a/ui/UIPosition.h b/ui/UIPosition.h new file mode 100644 index 0000000..c3692fa --- /dev/null +++ b/ui/UIPosition.h @@ -0,0 +1,9 @@ +#ifndef TOS_UI_POSITION_H +#define TOS_UI_POSITION_H + +enum UIPosition { + UI_POSITION_RELATIVE, + UI_POSITION_ABSOLUTE +}; + +#endif \ No newline at end of file diff --git a/ui/UIWindow.h b/ui/UIWindow.h new file mode 100644 index 0000000..aabc17b --- /dev/null +++ b/ui/UIWindow.h @@ -0,0 +1,39 @@ +#ifndef TOS_UI_WINDOW_H +#define TOS_UI_WINDOW_H + +#include "UIElement.h" +#include "UILayout.h" + +#include "../animation/AnimationEaseType.h" + +enum WindowState { + WINDOW_STATE_ACIVE, + WINDOW_STATE_INACTIVE, + WINDOW_STATE_FOCUS, + + WINDOW_STATE_MOVING, + WINDOW_STATE_OPENING, + WINDOW_STATE_CLOSING +}; + +struct UIWindow { + UIElement element; + + WindowState state_old; + WindowState state_new; + + bool is_minimizable; + bool is_maximizable; + bool is_movable; + bool is_resizable; + + // window is only movable when holding this area + int movable_area[4]; + + UILayout* layout_default; + float layout_open_anim_duration; + float layout_close_anim_duration; + float layout_min_anim_duration; +}; + +#endif \ No newline at end of file diff --git a/utils/Compiler.h b/utils/Compiler.h index 739b4cd..4bac150 100644 --- a/utils/Compiler.h +++ b/utils/Compiler.h @@ -9,7 +9,12 @@ #ifndef TOS_UTILS_COMPILER_H #define TOS_UTILS_COMPILER_H +#include +#include + #ifdef _MSC_VER + #include + inline void* aligned_alloc(size_t alignment, size_t size) { return _aligned_malloc(size, alignment); @@ -20,8 +25,6 @@ _aligned_free(ptr); } #else - #include - inline void aligned_free(void* ptr) { free(ptr); diff --git a/utils/FastPipes.h b/utils/FastPipes.h new file mode 100644 index 0000000..cbdfaa8 --- /dev/null +++ b/utils/FastPipes.h @@ -0,0 +1,50 @@ +/** + * Jingga + * + * @copyright Jingga + * @license OMS License 2.0 + * @version 1.0.0 + * @link https://jingga.app + */ +#ifndef TOS_UTILS_FAST_PIPES_H +#define TOS_UTILS_FAST_PIPES_H + +// requires kernel32.lib and user32.lib + +#if _WIN32 + #include + #include + #include + #include + + static int ENABLE_FAST_PIPES() + { + int result = 0; + + wchar_t pipe_name[32]; + wsprintfW(pipe_name, L"\\\\.\\pipe\\fastpipe%x", GetCurrentProcessId()); + HANDLE fast_pip = CreateFileW(pipe_name, GENERIC_READ|GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0); + + if(fast_pip != INVALID_HANDLE_VALUE) { + SetStdHandle(STD_OUTPUT_HANDLE, fast_pip); + SetStdHandle(STD_INPUT_HANDLE, fast_pip); + + int std_out = _open_osfhandle((intptr_t) fast_pip, O_WRONLY|O_TEXT); + int std_in = _open_osfhandle((intptr_t) fast_pip, O_RDONLY|O_TEXT); + + _dup2(std_out, _fileno(stdout)); + _dup2(std_in, _fileno(stdin)); + + _close(std_out); + _close(std_in); + + result = 1; + } + + return result; + } +#else + #define ENABLE_FAST_PIPES(...) 0 +#endif + +#endif \ No newline at end of file diff --git a/utils/StringUtils.h b/utils/StringUtils.h index 1512a32..6af49aa 100644 --- a/utils/StringUtils.h +++ b/utils/StringUtils.h @@ -15,6 +15,28 @@ #include "../stdlib/Types.h" +inline +void wchar_to_char(const wchar_t* src, char* dest, int length = 0) +{ + char* temp = (char *) src; + size_t len = wcslen(src) * sizeof(wchar_t); + + if (length > 0 && length < len) { + len = length; + } + + for (int i = 0; i < len; ++i) { + if (*temp != '\0') { + *dest = (char) *temp; + ++dest; + } + + ++temp; + } + + *dest = '\0'; +} + inline size_t str_count(const char *str, const char *substr) { size_t l1 = strlen(str); diff --git a/utils/SystemInfo.h b/utils/SystemInfo.h new file mode 100644 index 0000000..4902afd --- /dev/null +++ b/utils/SystemInfo.h @@ -0,0 +1,523 @@ +/** + * Jingga + * + * @copyright Jingga + * @license OMS License 2.0 + * @version 1.0.0 + * @link https://jingga.app + */ +#ifndef TOS_UTILS_SYSTEM_INFO_H +#define TOS_UTILS_SYSTEM_INFO_H + +#include +#include +#include "StringUtils.h" +#include "../stdlib/Types.h" +#include "../stdlib/simd/SIMD_Helper.h" + +#if _WIN32 + #include + #include + #include + #include + #include + #include + #include + #include +#endif + +#ifdef _MSC_VER + #include +#endif + +#if __linux__ && (__i386__ || __x86_64__) + #include +#endif + +// @todo implement for arm? +// @todo implement for linux? + +struct CpuCacheInfo { + int level; + int size; + int ways; + int partitions; + int sets; + int line_size; +}; + +void get_cache_info(int level, CpuCacheInfo* cache) { + unsigned int eax, ebx, ecx, edx; + int type; + + cache->level = level; + cache->size = 0; + cache->ways = 0; + cache->partitions = 0; + cache->sets = 0; + cache->line_size = 0; + + #if _WIN32 + int regs[4]; + __cpuidex(regs, 4, level); + eax = regs[0]; + ebx = regs[1]; + ecx = regs[2]; + edx = regs[3]; + + type = (eax & 0x1F); + #else + __cpuid_count(4, level, eax, ebx, ecx, edx); + + type = (eax & 0x1F); + #endif + + if (type == 0) { + return; + } + + cache->ways = ((ebx >> 22) & 0x3FF) + 1; + cache->line_size = (ebx & 0xFFF) + 1; + cache->partitions = ((ebx >> 12) & 0x3FF) + 1; + cache->sets = ecx + 1; + cache->size = cache->ways * cache->partitions * cache->line_size * cache->sets; +} + +// @todo add vendor name +struct MainboardInfo { + char name[64]; + char serial_number[64]; +}; + +void get_mainboard_info(MainboardInfo* info) { + info->name[63] = '\0'; + info->serial_number[63] = '\0'; + + HRESULT hres; + + // Step 1: Initialize COM library + hres = CoInitializeEx(0, COINIT_MULTITHREADED); + if (FAILED(hres)) { + return; + } + + // Step 2: Set general COM security levels + hres = CoInitializeSecurity( + NULL, + -1, + NULL, + NULL, + RPC_C_AUTHN_LEVEL_DEFAULT, + RPC_C_IMP_LEVEL_IMPERSONATE, + NULL, + EOAC_NONE, + NULL + ); + if (FAILED(hres)) { + CoUninitialize(); + return; + } + + // Step 3: Obtain initial locator to WMI + IWbemLocator *pLoc = NULL; + hres = CoCreateInstance( + CLSID_WbemLocator, + 0, + CLSCTX_INPROC_SERVER, + IID_IWbemLocator, + (LPVOID *)&pLoc + ); + if (FAILED(hres)) { + CoUninitialize(); + return; + } + + // Step 4: Connect to WMI through IWbemLocator::ConnectServer + IWbemServices *pSvc = NULL; + hres = pLoc->ConnectServer( + _bstr_t(L"ROOT\\CIMV2"), + NULL, + NULL, + 0, + NULL, + 0, + 0, + &pSvc + ); + if (FAILED(hres)) { + pLoc->Release(); + CoUninitialize(); + return; + } + + // Step 5: Set security levels on the proxy + hres = CoSetProxyBlanket( + pSvc, + RPC_C_AUTHN_WINNT, + RPC_C_AUTHZ_NONE, + NULL, + RPC_C_AUTHN_LEVEL_CALL, + RPC_C_IMP_LEVEL_IMPERSONATE, + NULL, + EOAC_NONE + ); + if (FAILED(hres)) { + pSvc->Release(); + pLoc->Release(); + CoUninitialize(); + return; + } + + // Step 6: Use the IWbemServices pointer to make a WMI query + IEnumWbemClassObject* pEnumerator = NULL; + hres = pSvc->ExecQuery( + bstr_t("WQL"), + bstr_t("SELECT * FROM Win32_BaseBoard"), + WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, + NULL, + &pEnumerator + ); + if (FAILED(hres)) { + pSvc->Release(); + pLoc->Release(); + CoUninitialize(); + return; + } + + // Step 7: Retrieve the data + IWbemClassObject *pclsObj = NULL; + ULONG uReturn = 0; + while (pEnumerator) { + HRESULT hr = pEnumerator->Next(WBEM_INFINITE, 1, &pclsObj, &uReturn); + if (0 == uReturn) { + break; + } + + VARIANT vtProp; + hr = pclsObj->Get(L"Product", 0, &vtProp, 0, 0); + if (SUCCEEDED(hr)) { + snprintf(info->name, 64, "%S", vtProp.bstrVal); + VariantClear(&vtProp); + } + + hr = pclsObj->Get(L"SerialNumber", 0, &vtProp, 0, 0); + if (SUCCEEDED(hr)) { + snprintf(info->serial_number, 63, "%S", vtProp.bstrVal); + info->serial_number[64] = '\0'; + + VariantClear(&vtProp); + } + + pclsObj->Release(); + } + + // Clean up + pSvc->Release(); + pLoc->Release(); + pEnumerator->Release(); + CoUninitialize(); +} + +// @todo add ipv6 +struct NetworkInfo { + char slot[64]; + byte mac[8]; +}; + +int get_network_info(NetworkInfo* info) { + WSADATA wsaData; + if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) { + return 0; + } + + DWORD dwSize = 0; + PIP_ADAPTER_ADDRESSES pAdapterAddresses = NULL; + PIP_ADAPTER_ADDRESSES pAdapter = NULL; + + // Get the size of the adapter addresses buffer + if (GetAdaptersAddresses(AF_UNSPEC, 0, NULL, NULL, &dwSize) == ERROR_BUFFER_OVERFLOW) { + pAdapterAddresses = (PIP_ADAPTER_ADDRESSES) malloc(dwSize); + if (pAdapterAddresses == NULL) { + WSACleanup(); + return 0; + } + } else { + WSACleanup(); + return 0; + } + + // Get the adapter addresses + if (GetAdaptersAddresses(AF_UNSPEC, 0, NULL, pAdapterAddresses, &dwSize) != NO_ERROR) { + free(pAdapterAddresses); + WSACleanup(); + return 0; + } + + int i = 0; + + // Iterate over the adapters and print their MAC addresses + pAdapter = pAdapterAddresses; + while (pAdapter && i < 4) { + if (pAdapter->PhysicalAddressLength != 0) { + info[i].slot[63] = '\0'; + info[i].mac[23] = '\0'; + + memcpy(info[i].mac, pAdapter->PhysicalAddress, 8); + wcstombs(info[i].slot, pAdapter->FriendlyName, 63); + + ++i; + } + + pAdapter = pAdapter->Next; + } + + free(pAdapterAddresses); + WSACleanup(); + + return i; +} + +struct SIMDInfo { + float sse; + int avx256; + int avx512; +}; + +struct CpuInfo { + char vendor[13]; + char brand[49]; + int model; + int family; + int mhz; + CpuCacheInfo cache[4]; + int page_size; + SIMDInfo simd; +}; + +void get_cpu_info(CpuInfo* info) { + int temp; + info->simd.sse = (temp = max_sse_supported()) > 9 ? temp / 10.0f : temp; + info->simd.avx256 = max_avx256_supported(); + info->simd.avx512 = max_avx512_supported(); + + get_cache_info(1, &info->cache[0]); + get_cache_info(2, &info->cache[1]); + get_cache_info(3, &info->cache[2]); + get_cache_info(4, &info->cache[3]); + + SYSTEM_INFO sys_info; + GetSystemInfo(&sys_info); + info->page_size = sys_info.dwPageSize; + + int cpuInfo[4] = { 0 }; + __cpuid(cpuInfo, 0); + + memset(info->vendor, 0, sizeof(info->vendor)); + *((int*)info->vendor) = cpuInfo[1]; + *((int*)(info->vendor + 4)) = cpuInfo[3]; + *((int*)(info->vendor + 8)) = cpuInfo[2]; + info->vendor[12] = '\0'; + + __cpuid(cpuInfo, 0x80000002); + memcpy(info->brand, cpuInfo, sizeof(cpuInfo)); + __cpuid(cpuInfo, 0x80000003); + memcpy(info->brand + 16, cpuInfo, sizeof(cpuInfo)); + __cpuid(cpuInfo, 0x80000004); + memcpy(info->brand + 32, cpuInfo, sizeof(cpuInfo)); + info->brand[48] = '\0'; + + __cpuid(cpuInfo, 1); + info->model = (cpuInfo[0] >> 4) & 0xF; + info->family = (cpuInfo[0] >> 8) & 0xF; + + DWORD bufSize = sizeof(DWORD); + HKEY hKey; + long lError = RegOpenKeyExA( + HKEY_LOCAL_MACHINE, + "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", + 0, KEY_READ, &hKey + ); + + if (lError == ERROR_SUCCESS) { + RegQueryValueExA(hKey, "~MHz", NULL, NULL, (LPBYTE) &(info->mhz), &bufSize); + } + + RegCloseKey(hKey); +} + +struct OSInfo { + char vendor[16]; + char name[64]; + int major; + int minor; +}; + +void get_os_info(OSInfo* info) { + info->vendor[15] = '\0'; + info->name[63] = '\0'; + + #if defined(_WIN32) || defined(_WIN64) + OSVERSIONINFOEXW version_info; + memset(&version_info, 0, sizeof(OSVERSIONINFOEXW)); + version_info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXW); + NTSTATUS(WINAPI *RtlGetVersion)(OSVERSIONINFOEXW*) = (NTSTATUS(WINAPI *)(OSVERSIONINFOEXW*))GetProcAddress(GetModuleHandleW(L"ntdll.dll"), "RtlGetVersion"); + if (RtlGetVersion != nullptr) { + RtlGetVersion(&version_info); + } + + strcpy(info->vendor, "Microsoft"); + strcpy(info->name, "Windows"); + info->major = version_info.dwMajorVersion; + info->minor = version_info.dwMinorVersion; + #else + strcpy(info->vendor, "Linux"); + strcpy(info->name, "Linux"); + info->major = 0; + info->minor = 0; + #endif +} + +struct RamInfo { + int memory; +}; + +void get_ram_info(RamInfo* info) { + MEMORYSTATUSEX statex; + statex.dwLength = sizeof(statex); + GlobalMemoryStatusEx(&statex); + info->memory = (int) (statex.ullTotalPhys / (1024 * 1024)); +} + +struct GpuInfo { + char name[64]; + int vram; +}; + +unsigned int get_gpu_info(GpuInfo* info) { + IDXGIFactory *pFactory = NULL; + IDXGIAdapter *pAdapter = NULL; + DXGI_ADAPTER_DESC adapterDesc; + + HRESULT hr = CreateDXGIFactory(__uuidof(IDXGIFactory), (void**)&pFactory); + if (FAILED(hr)) { + return 0; + } + + UINT i = 0; + while (pFactory->EnumAdapters(i, &pAdapter) != DXGI_ERROR_NOT_FOUND && i < 2) { + hr = pAdapter->GetDesc(&adapterDesc); + if (FAILED(hr)) { + pAdapter->Release(); + break; + } + + wcstombs(info[i].name, adapterDesc.Description, 63); + info[i].name[63] = '\0'; + info[i].vram = (int) (adapterDesc.DedicatedVideoMemory / (1024 * 1024)); + + pAdapter->Release(); + i++; + } + + pFactory->Release(); + + return i; +} + +struct SystemInfo { + OSInfo os; + MainboardInfo mainboard; + + NetworkInfo network[4]; + int network_count; + + CpuInfo cpu; + RamInfo ram; + + GpuInfo gpu[2]; + int gpu_count; +}; + +void render_system_info(char* buf, const SystemInfo* info) { + const char avx512[8][12] = { + "AVX-512F", + "AVX-512DQ", + "AVX-512IFMA", + "AVX-512PF", + "AVX-512ER", + "AVX-512CD", + "AVX-512BW", + "AVX-512VL" + }; + + sprintf_s( + buf, + 4096, + "OS:\n" + "==============\n" + "Vendor: %s\n" "Name: %s\n" "Major: %d\n" "Minor: %d\n" + "\n" + "Mainboard:\n" + "==============\n" + "Name: %s\n" "SN: %s\n" + "\n" + "Network:\n" + "==============\n" + "Slot: %s\n" "MAC: %02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X\n" + "\n" + "Slot: %s\n" "MAC: %02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X\n" + "\n" + "Slot: %s\n" "MAC: %02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X\n" + "\n" + "Slot: %s\n" "MAC: %02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X\n" + "\n" + "CPU:\n" + "==============\n" + "Hardware\n" "Vendor: %s\n" "Brand: %s\n" "Model: %d\n" "Family: %d\n" "Mhz: %d\n" "Page Size: %d\n" + "\n" + "Cache:\n" + "L1: Size %d Line %d\n" + "L2: Size %d Line %d\n" + "L3: Size %d Line %d\n" + "L4: Size %d Line %d\n" + "\n" + "SIMD:\n" "SSE: %.1f\n" "AVX256: %d\n" "AVX512: %s\n" + "\n" + "GPU:\n" + "==============\n" + "Name: %s\n" "VRAM: %d\n" + "\n" + "Name: %s\n" "VRAM: %d\n" + "\n" + "RAM:\n" + "==============\n" + "Memory: %d MB", + info->os.vendor, info->os.name, info->os.major, info->os.minor, + info->mainboard.name, info->mainboard.serial_number, + info->network[0].slot, info->network[0].mac[0], info->network[0].mac[1], info->network[0].mac[2], info->network[0].mac[3], info->network[0].mac[4], info->network[0].mac[5], info->network[0].mac[6], info->network[0].mac[7], + info->network_count < 2 ? "" : info->network[1].slot, info->network_count < 2 ? 0 : info->network[1].mac[0], info->network_count < 2 ? 0 : info->network[1].mac[1], info->network_count < 2 ? 0 : info->network[1].mac[2], info->network_count < 2 ? 0 : info->network[1].mac[3], info->network_count < 2 ? 0 : info->network[1].mac[4], info->network_count < 2 ? 0 : info->network[1].mac[5], info->network_count < 2 ? 0 : info->network[1].mac[6], info->network_count < 2 ? 0 : info->network[1].mac[7], + info->network_count < 3 ? "" : info->network[2].slot, info->network_count < 3 ? 0 : info->network[2].mac[0], info->network_count < 3 ? 0 : info->network[2].mac[1], info->network_count < 3 ? 0 : info->network[2].mac[2], info->network_count < 3 ? 0 : info->network[2].mac[3], info->network_count < 3 ? 0 : info->network[2].mac[4], info->network_count < 3 ? 0 : info->network[2].mac[5], info->network_count < 3 ? 0 : info->network[2].mac[6], info->network_count < 3 ? 0 : info->network[2].mac[7], + info->network_count < 4 ? "" : info->network[3].slot, info->network_count < 4 ? 0 : info->network[3].mac[0], info->network_count < 4 ? 0 : info->network[3].mac[1], info->network_count < 4 ? 0 : info->network[3].mac[2], info->network_count < 4 ? 0 : info->network[3].mac[3], info->network_count < 4 ? 0 : info->network[3].mac[4], info->network_count < 4 ? 0 : info->network[3].mac[5], info->network_count < 4 ? 0 : info->network[3].mac[6], info->network_count < 4 ? 0 : info->network[3].mac[7], + info->cpu.vendor, info->cpu.brand, info->cpu.model, info->cpu.family, info->cpu.mhz, info->cpu.page_size, + info->cpu.cache[0].size, info->cpu.cache[0].line_size, + info->cpu.cache[1].size, info->cpu.cache[1].line_size, + info->cpu.cache[2].size, info->cpu.cache[2].line_size, + info->cpu.cache[3].size, info->cpu.cache[3].line_size, + info->cpu.simd.sse, info->cpu.simd.avx256, info->cpu.simd.avx512 > 0 ? avx512[info->cpu.simd.avx512 - 1] : "0", + info->gpu[0].name, info->gpu[0].vram, + info->gpu_count < 2 ? "" : info->gpu[1].name, info->gpu_count < 2 ? 0 : info->gpu[1].vram, + info->ram.memory + ); +} + +void get_system_info(SystemInfo* info) +{ + get_os_info(&info->os); + get_mainboard_info(&info->mainboard); + info->network_count = get_network_info(info->network); + get_cpu_info(&info->cpu); + get_ram_info(&info->ram); + info->gpu_count = get_gpu_info(info->gpu); +} + +#endif \ No newline at end of file diff --git a/utils/SystemUtils.h b/utils/SystemUtils.h new file mode 100644 index 0000000..5fb22d8 --- /dev/null +++ b/utils/SystemUtils.h @@ -0,0 +1,15 @@ +/** + * Jingga + * + * @copyright Jingga + * @license OMS License 2.0 + * @version 1.0.0 + * @link https://jingga.app + */ +#ifndef TOS_UTILS_SYSTEM_UTILS_H +#define TOS_UTILS_SYSTEM_UTILS_H + +#include +#include + +#endif \ No newline at end of file