SettingDust / RespawnComplex

Other
0 stars 0 forks source link

Addon for adding points to Map mods #1

Open Ultimushadow opened 9 months ago

Ultimushadow commented 9 months ago

Hey there, I really like the concept for this mod but I'm afraid it has some issues I have not been able to resolve, I'll be making another issue report on that later as there was a crash involved, but honestly I had so many ideas for the concept I wanted to get them down before I forgot.

Straight off the bat, it seems like this mod may be meant for a minigame server or something, but I will be approaching it from the survival MC experience. Removing the functionality from beds does not feel like a good idea. Beds are used to skip the night - this is very important especially on servers, and not a functionality that should be removed. I'm not sure the technical challenges you face while coding this functionality but it feels like you should be able to write a mixin which targets the bed and overwrites the function to not set a player spawn point. I can see running into issues with modded bed items, or modded "day time" beds that skip day, so maybe there is a better way of doing it. Either way though, skipping time is a very important functionality.

Next, I do like the idea of beacons as spawn points, but making them the only way to set spawns in the overworld is a harsh move. I assume this is meant to work with the Waystones mod (your mod page says "from the two" which does not make sense to me), but for those without this mod, beds are how we are able to build bases. If a player wanted to build somewhere other than world spawn, they would either need to make a respawn anchor or kill a wither , that is just not balanced. Perhaps you could add your own "Respawn Obelisk" which could be made with early game materials. Smooth stone and some gold is about as late as I would go with this since normally the player can just, have their base as their spawn point with 3 wool and a log.

As far as the spawning logic itself goes, I have not actually been able to test it as the mod does not want to run properly, but I had thought about some potential problems. Beacons as spawn points are a great idea, but, they are not always wanted as a spawn point. Players who may use a lot of beacons to stack effects or spread them throughout a large area would have dozens of spawn points in what may be random locations, and to get those effects down in the world (like Haste), those spawn points could all end up being underground. I know there is a command to remove spawn points, but this is clunky - user interface is better practice than commands. Rather than interacting with the beacon for a spawn point, add a button in the beacon UI itself. This way, the player can choose which beacons to use as spawns, and can even disable them if they need to. This obviously is exclusive to beacons, so perhaps it would be better to do something similar to the waypoints in Xaero's minimap mod, rather than messing with commands, just open a list via keybind. When you interact with an object in the tag, a message appears in chat indicating this is a spawn point, at which point you can open the list and hit "Add new spawn point" to link it, which of course means they can easily be disabled (for balance reasons, they should only be disabled if the player is at the location).

Another thing I was thinking of is, while spawning to the closest point is cool in concept, when you aren't playing with Waystone it could become a big hassle. Spawning at an inopportune location could make the difference between recovering your items or having them despawn, even if you have a gravestone mod spawning somewhere you shouldn't is a massive annoyance for travel. I was thinking potentially about a new screen on death which would allow the player to select their spawn point from their pool of possibilities. The easiest way to do this of course would just be a list with names (as you can name beacons), but I was thinking of something a little more useful. The coords of each spawn point are recorded, so rather than just displaying that in text you could display it visually via what's basically a map. It would plot the points on a blank background (since this is MC, I was envisioning the background to be something akin to soul sand, with the spawn points labelled with soul flames). You could see your death location in relation to your network of spawn points (but not outright coordinates, or make that a config option). This screen could also both look visually more appealing and provide more function by actually showing the distance to other nearby points. Each spawn point would essentially become a node, they would connect to the four closest nodes with a small line (following the theme from earlier these would likely be small trails of the soul flame particle or something) which would display how far apart they are, and the nodes showing their coords and a name if they have one. To choose a point you simply select it and off you go.

In a vacuum, without Waystones, choosing your spawn point like this could get quite easily abused with ender chests and the like, essentially forfeiting experience in order to travel long distances, so I had a suggestion that would be a good middle ground as well. The player can always spawn at the point nearest to them, as is intended by the mod. They will essentially have a radius around them that is guaranteed to succeed if selected, which will be 10% more than the distance to the nearest spawn point, minimum of 100. This is the "safe" radius, and it only takes x and z distance into account, not y. To explain, if the character dies 200 blocks away from a spawn point, they have the option to pick any point within 220 blocks (we use distance off the death point here because their most effective spawn point may be the complete opposite direction of their closest spawn point). However, if their closest is 60 blocks away, they are still allowed to choose any point within 100 blocks, this is mainly due to that surface/cave issue I brought up earlier. In this suggestion the player is guaranteed to choose those points from the "safe" radius and end up where they want to, but if they try to stray too far, they may end up somewhere they did not expect. If a point is beyond the "safe" radius, it will gain a chance to fail and move to a closer point. The rate of failure is 1% for every 40 blocks, and when this chance is hit, the game should pick the next point closest to both the destination and the player and try again. Going back to the 200 block example, this means that they are safe to pick any point within 220 blocks. However, between 220 and 260 blocks away, they have a 1% chance to fail and instead teleport them to the next closest point to the player. Ideally, the calculation would take into account the direction the selected point was in and move to a closer point in the same general direction, this can be done with some math that I could probably manage if it was needed. Anyways, the player essentially cannot pick a point more than 4000 blocks away from their closest spawn point, but even 2000 is a 50% chance to end up somewhere completely random. Also, on failure, node selection would be locked for 5 minutes and for those 5 minutes they will be unable to disable or break the spawn point to make sure they are locked to that location. This ensures they can't just die to try again.

I know this is essentially tripling the features of the mod, but I expect you will probably be tossing out a large majority of that anyways, this is mostly so I have the idea down somewhere lol On the off chance that you are interested in the concept, I would be happy to test and balance and work out any kinks, I'm currently in the middle of a pack project so mods are permanently on the brain at the moment

SettingDust commented 9 months ago

Thanks for your sooooooo long thinking. This mod is more like for my rpg modpack idea from years ago in 1.12.2 lul. https://ore.spongepowered.org/SettingDust/Multi-Spawn Actually you can custom the blocks to act as a spawn point with a data pack since they are a block tag #respawn_complex:respawn_point. And I don't use beacon as points in my pack. Waystones are good enough. Base on this, you can make the bed as points. So, I disable it.

skipping time is a very important functionality

Sleeping is a point that I agree with.

It's easy to add points to maps mod with their API.

And for the others, I prefer as a standalone mod.

Ultimushadow commented 9 months ago

Thanks for trying to add the sleeping function back in! Is there anything else from this report you may be considering? Otherwise, I can go ahead and close it 😅

SettingDust commented 9 months ago

Add points to maps mods with their API