$ man tshabbic.projects.rct-raid
RCT-RAID(8)Server-Side Raids for TerrariaRCT-RAID(8)
Name

rct-raid -- server-side raids for terraria

Description

Terraria is an incredible game and has a plethora of bosses that can be fought with your friends and allies. While exciting, these bosses remain consistent throughout all servers, worlds, et cetera. For as long as I could remember, I always wanted to design and create an MMO-RPG style raid, where numerous powerful players come together to face a powerful opponent. In my Sophomore year at university, I began developing the skills I needed in order to realize this dream via implementation as a plugin through TShock for Terraria. Unlike most project entries, I feel as though at this point it's simply better to showcase my work than it is to attempt to describe it:

The following video is the first ever completed raid after the system was publicly released

There have since been dozens of changes, e.g., enemy/raid boss damage text is no longer red as to not clash with player damage, player Health is dynamically colored, there is now a text-UI boss health bar, and many more tweaks and adjustments! Most of these improvements are realized in the video below!


As mentioned, that was the first ever completion of the first raid after it was released. Later, I also designed a "hard" variant for veteran players, which has meaningful changes to every phase to increase difficulty, as well as many other changes. Here's what the hard mode version looks like:

This recording showcases hard mode, but also does not have ally projectile enabled, to reduce screen clutter


To name just a few things that went into designing the raid system:

  • Party System - to group players together; raids largely revolve around knowing which players have chosen to take on the challenge of a raid!
  • Everything is Server Side! - I do mean everything -- the client has zero set up and simply needs to join and express interest in participating to enjoy the content, that's all! Navigating around these limitations has given birth to numerous creative solutions, many of which previously not thought reasonably possible.
  • Hit Detection - Since the raid system uses server-side attributes (health, etc.), we cannot use nor trust the client. All players are given client-side godmode; therefore, we must perform our own hit detection as the server.
    • Unlike normal Terraria; there are no immunity frames after taking damage in a raid.
    • Also unlike other video games with no immunity frames, players can still take damage from the same source multiple times if they are in still in contact with the source. In this case, the cooldown is 1 full second.
  • Balance - Ensuring the phases are fair, that players are well equipped, etc.);
  • Raid/Phase Design - Creating intuitive, learnable patterns that players can figure out and adapt to
  • Thread-Safety - Most phases fire multiple types and patterns of projectiles on a timed interval, and as such, required a hefty amount of dedicated multi-threading as well as co-routines in the form of async/await.
  • Asynchronous Packet Processor - All outgoing damage display packets go into a priority queue on a dedicated runner thread as to not block the server's main thread, but also to prioritize displaying when players take damage as opposed to when the raid boss takes damage (as the client can only display ~200 damage texts at a given time).
  • Designing the text-UI - Displays the player's health, the health of other party members, the Raid Boss' remaining health, your current damage per second (dps), et cetera.
    • You can toggle the display of your dps with /showdps in-game.
    • You can toggle the display of your allies' remaining tealh with /showallyhp in-game.
  • Designing Failure Conditions - It's very possible to lose the raid; raids terminate if any of the following conditions are met:
    • All players are dead simultaneously. Ouch! Offline players are marked dead!
    • The total number of accumulated deaths since starting the raid has exceeded the maximum threshold.The more players in the party, the higher and more forgiving this number is
    • The raid was not defeated after a certain number of time usually indicative of a player/party equipment issue
  • Performance Optimization - Managing 8+ players throwing out hundreds of projectiles and taking damage possibly hundreds of times per second was, at times, quite challenging.
  • Plus many, many other systems! - Including but not limited to:
    • Limiting players to one raid a week.
    • An entire material and equipment crafting system to build gear out of the loot obtained from the raid.
    • A stat tracker for both normal and hard versions of the raid.
    • A contribution chart and measurement ranking during and after raids.
    • Linking raid rewards and leaderboards with the server's public Discord Server + announcing raid status information to Discord to notify players / invite them to participate.


    The following is an example of the aforementioned after action report of a raid:


    When players finish a raid, in addition to their contributions being broadcast, their rewards are as well:


    As also mentioned, players can view the stats of other players at any time, on an individual basis, as well as in a leaderboard style using:

    /raid top <RaidName> <Stat> [-rh]. Available Stats: Completes (C), Attempts (A), WinRate (WR), DmgDealt (DD), DmgTaken (DT), DmgRatio (DR), Deaths (D), HPRestored (H), TimeToComplete (TTC), TimeSpentInRaid (TIR).

    To see the top 10 players with the most completes for "Celestial Embodiment of Storming Ruin" in hard mode: /raid top cesr c -h
    [Raids] Top 10 Raiders with the highest Completes for The Celestial Embodiment of Storming Ruin (Hard):
    1. Rhema: Completions/Attempts: 11/73 (Success Rate: 15.07%) | DmgDealt: 158212720 | HPRestored: 173281 | ShieldSupport: 0 | DmgTaken: 5037245, Deaths: 338 | DmgRatio: 31.41 | AvgTimeToComplete: 00:06:00, TimeSpentInRaid: 00:06:16:02
    2. Eric: Completions/Attempts: 10/40 (Success Rate: 25.00%) | DmgDealt: 165631800 | HPRestored: 155375 | ShieldSupport: 0 | DmgTaken: 2350988, Deaths: 107 | DmgRatio: 70.45 | AvgTimeToComplete: 00:06:17, TimeSpentInRaid: 00:03:52:21
    3. Riterality: Completions/Attempts: 8/46 (Success Rate: 17.39%) | DmgDealt: 147125504 | HPRestored: 34575 | ShieldSupport: 0 | DmgTaken: 2636209, Deaths: 198 | DmgRatio: 55.81 | AvgTimeToComplete: 00:05:59, TimeSpentInRaid: 00:03:44:43
    4. Meowxo 420: Completions/Attempts: 7/60 (Success Rate: 11.67%) | DmgDealt: 133491693 | HPRestored: 0 | ShieldSupport: 227519 | DmgTaken: 4946716, Deaths: 358 | DmgRatio: 26.99 | AvgTimeToComplete: 00:05:45, TimeSpentInRaid: 00:05:19:58
    5. 7o27a: Completions/Attempts: 6/42 (Success Rate: 14.29%) | DmgDealt: 174959071 | HPRestored: 0 | ShieldSupport: 0 | DmgTaken: 2477354, Deaths: 125 | DmgRatio: 70.62 | AvgTimeToComplete: 00:07:12, TimeSpentInRaid: 00:03:58:08
    6. Submeowrine: Completions/Attempts: 5/44 (Success Rate: 11.36%) | DmgDealt: 162713714 | HPRestored: 0 | ShieldSupport: 0 | DmgTaken: 3261659, Deaths: 193 | DmgRatio: 49.89 | AvgTimeToComplete: 00:06:20, TimeSpentInRaid: 00:03:51:17
    7. SmooshIe: Completions/Attempts: 5/26 (Success Rate: 19.23%) | DmgDealt: 29344597 | HPRestored: 63783 | ShieldSupport: 0 | DmgTaken: 1478080, Deaths: 124 | DmgRatio: 19.85 | AvgTimeToComplete: 00:06:20, TimeSpentInRaid: 00:02:02:14
    8. Arcturus: Completions/Attempts: 4/29 (Success Rate: 13.79%) | DmgDealt: 83306410 | HPRestored: 12969 | ShieldSupport: 0 | DmgTaken: 1850234, Deaths: 125 | DmgRatio: 45.02 | AvgTimeToComplete: 00:06:16, TimeSpentInRaid: 00:02:45:14
    9. Odd: Completions/Attempts: 3/22 (Success Rate: 13.64%) | DmgDealt: 89210349 | HPRestored: 0 | ShieldSupport: 26045 | DmgTaken: 1073164, Deaths: 67 | DmgRatio: 83.13 | AvgTimeToComplete: 00:06:03, TimeSpentInRaid: 00:02:06:46
    10. A Good guy: Completions/Attempts: 3/35 (Success Rate: 8.57%) | DmgDealt: 67255855 | HPRestored: 147531 | ShieldSupport: 705844 | DmgTaken: 3870258, Deaths: 169 | DmgRatio: 17.38 | AvgTimeToComplete: 00:08:15, TimeSpentInRaid: 00:03:10:22

    In truth, what I have discussed above is really only scratching the surface of the complexity that this endeavour was. With that said though I very much enjoyed iterating upon this, my most favorite project, with members from the RenCorner Terraria community. All in all, over the course of over 11+ years of operation, this is uncontestably the most critically acclaimed addition to the server in its history.

Usage

Boot up Terraria and join the RenCorner Terraria Server to fight in these raids!

See Also
History

Various systems were built starting from March of 2024 to support the initial release of server-side raids, which was brought to production in August of 2024 after several weeks of full-time work!

The raid system was refactored in its entirety in November-December of 2024 to more effortlessly allow creation of new raids, and remains the largest code refactor I have ever performed (tens of thousands of lines across dozens of source files).

Source code not available as this is a proprietary work for the RenCorner Terraria and is a major selling point of our server.