SuperNeon4ik / NoxesiumUtils

Communicate with The Noxesium Mod with ease.
https://modrinth.com/plugin/noxesiumutils
GNU General Public License v3.0
13 stars 3 forks source link

Server-side Qib implementation for players not using Noxesium #23

Open trolliant opened 1 week ago

trolliant commented 1 week ago

Using Qibs for speed/jump pad effects is very neat and simple to create but unless all players are required to use Noxesium wherever they're being used, you have to make some sort of server-sided implementation which gets really janky considering server-side effects override Noxesium's client-authoritative effects.

Aeltumn commented 1 week ago

I would suggest fully disabling the server-side implementation whenever someone is using Noxesium. Originally I was going to have qibs require logic on both sides but the server is simply too delayed to catch up. Everything should run on the client and the server should take more of an anti-cheat approach where it simulates the client and reigns it in if it breaks what's expected. Although I would have the server just fully ignore Noxesium players for a basic implementation.

SuperNeon4ik commented 1 week ago

Thank you for your suggestions!

I guess it could be made so if a player is not using Noxesium the plugin would mimic the mod's behavior, but server-side. Cool thing that idk if would work well: there could be some sort of a prediction mechanism, that would predict the position client-side using player's ping for non-Noxesium players.

Also, how should the plugin act as an anti-cheat? Is it something like it should check if the velocity matches what is expected, adding/removing potion effects server-side etc. when the according Qib effect is triggered? I do agree that it could be omitted from the initial implementation.

Aeltumn commented 1 week ago

I think you're over-estimating how complicated a server implementation would be, a simple one would just use the interaction entities already used by the client, build a PRTree just like the client (much faster than 100+ bounding box intersection checks), trigger collisions for all players not on Noxesium (using their current position as far as the server knows), and for a nice universal implementation just run the qib effects directly but server-side, you can copy a bit of the code from the client mod although some of the velocity-based effects need to be replaced with packets directly like add velocity needs a TNT explosion packet.

The note about anti-cheats is only relevant for people using this in public events. The way Noxesium is set up is the client is entirely trusted to run the game, that means any hacked client can do whatever it wishes. If you have a set-up where there is a risk of players using hacked clients (like MCC Island), you need to develop your own anti-cheat custom built for the qib system basically. But this is beyond the scope of what people need currently, I would just put a warning on there saying it's dangerous to use the qib system client-side if you have a public server.

SuperNeon4ik commented 1 week ago

Yup, sounds clear! Thank you!