RTP icon

RTP -----

Deterministic-Time Random Teleportation



Besides basic features, this plugin is intended to provide a platform for custom implementations. I'm not planing to make major functional changes.

The target audience is primarily SMP servers, as that's where this functionality is most needed.


Basics

This plugin achieves deterministic selection time by storing and recalling failure areas, made possible via linear spatial indexing and basic data compression. [more detail on wiki]

This plugin works extremely well with custom world generation, but I highly recommend pregeneration as well as integration plugins for custom biomes.

Due to the in-memory database and background processing, High memory consumption and mspt is expected. Dropping below 19tps is not expected unless a single task takes longer than a gametick.

Code changes will generally be discussed for best solutions to problems, and reducing dynamic allocation is a priority.

Design Philosophy:

Function over Form


Random teleportation is often misunderstood as cheap and easy, making it one of the the most resource-intensive tasks for a server, due to chunk loading, safe placement, rerolling, and players still looking for new areas afterwards.

This plugin improves upon the fundamental design of rtp plugins by supporting selection optimizations, a location cache (similar to JakesRTP), and player queueing to give precise control over performance.

Using the inbuilt memory shape class, random selection approaches deterministic time the more it's used.

Nuanced Setup & Extreme Flexibility

Teleportation is controlled by regions, which are defined by yaml configuration files and update-able via command.

Part of setup for extra fancy people may require creating a plugin to access RTP events and methods. RTP provides a command structure, several events, interchangeable shapes, and some reflective method calls, for the main purpose of integrating with claim plugins, world generators, and user-defined behaviors. Some examples are provided in the Github repository.

Demos:

performance test [oldie but goodie]:

note: this test does not use cached locations. In this version, the minimum time is one gametick per 2 consecutive scheduled tasks, ~50-100ms.

You can set syncLoading:true to skip task scheduling and complete every command synchronously, but doing so may cause tps lag.

learning test:


command response test:


Using selection memory on top of some introductory spatial math, the plugin can learn from failures to eventually achieve deterministic selection time, as well as recall vanilla biome locations.

Features:
  • Any number of teleportation regions within each world
  • Per-region and per-world teleportation configuration
    • teleport region shape (square/circle)
    • teleport radius & center radius
    • center x,z coordinates
    • curve weighting, towards or away from the center
    • minimum and maximum y values
    • optional sky light check
    • optional world permission requirement
    • optional unique placements
    • optional region expansion
    • world override if player doesn't have perms
  • Update region and world configuration via command
  • Multi-Dimensional support
  • Teleport safety
    • configurable safety radius check
    • configurable platform creation
    • configurable invulnerability timer
    • configurable material blacklist
  • Chunk pre-loading during teleport delay
    • async chunk loading on paper servers
  • World and player parameters with permissions
  • Location Queueing
    • Distribute loading costs over time to reduce the impact of each random teleportation
    • async randomization
    • async chunk pre-loading on paper servers
    • Fast teleportation for queued locations
    • Reuse of generated locations for cancelled teleports
  • Automatically learn from bad placements
    • Selection gets statistically faster with each failure.
  • Fully configurable logs and messages in lang.yml
  • Permission-based sounds and effects
    • see here for formatting
  • an API for developers
Shapes:
Some shapes are included in the plugin, and any shape can be added via API calls and configuration


[​IMG]
[​IMG]
[​IMG]
[​IMG]
[​IMG]

Supported Claim Plugins:
Claim plugins are supported via addons and reflection. There are provided examples on github that add the following integrations -
  • Domain
  • Factions (and any factions plugins using massivecraft.factions as a base)
  • GriefDefender
  • GriefPrevention
  • HuskTowns
  • Lands
  • TownyAdvanced
  • WorldGuard
SoftDepends:
  • PaperLib
  • PlaceholderAPI
  • ProtocolLib
  • Vault
PlaceholderAPI Placeholders:
  • %rtp_player_status% - player's current teleport status
  • %rtp_total_queue_length% - total number of locations available to a player in the region that "/rtp" would use
  • %rtp_public_queue_length% - number of locations available to everyone in the region that "/rtp" would use
  • %rtp_personal_queue_length% - number of locations allocated specifically to that player in the region that "/rtp" would use
  • %rtp_teleport_world%
  • %rtp_teleport_x%
  • %rtp_teleport_y%
  • %rtp_teleport_z%

Basic Commands:
Note: console commands will work but may require specifying player, region, and/or world because it is neither a player nor in a world.
  • /rtp - teleport to the default region for the world you're in
  • /rtp [parameter]:[value] - specify region, world, player, and/or temporary region parameters before teleporting
  • /rtp update - update any/all configuration via command
  • /rtp fill - try every possible placement in a region, and store any failed placements and biome locations. (unstable)

Demos:






(rtp.onEvent.teleport permission runs rtp recursively)

Best Setup

The plugin is optimized for paper servers, using PaperLib for async chunk loading. Spigot servers work, but they also get a bit of a hit to timings when generating new locations.

Because the plugin relies on pre-loading destinations, it works particularly well when you have memory to spare.

FAQ:
Q- This plugin responds a lot faster than what I’m used to with this type of plugin. Why am I not waiting for chunk loading?
A- When I say optimized, I mean optimized! In most cases, there's a next location ready to go before you even input a command.
Q- How do I set up teleportation from/in other worlds?
A- You can check the wiki for how to configure region and world settings. On command, world info follows this order: player's current world (or provided world parameter) -> world's target region -> region's target world.
Q- How can I contact the developer about an issue or feature request?
A- You can follow the github link above and create an issue or pull request there, or visit my discord server to get general support.


Todo list:
  • devops
  • wiki
If you run into any unexpected errors, please open an issue on github with the error, plugin configuration, related plugins, and steps to reproduce the error, so I can debug it.

bStats
[​IMG]
Resource Information
Author:
----------
Total Downloads: 291,324
First Release: Jul 30, 2021
Last Update: Sep 6, 2024
Category: ---------------
All-Time Rating:
31 ratings
Find more info at github.com...
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings