GM4_Datapacks icon indicating copy to clipboard operation
GM4_Datapacks copied to clipboard

New mountaineering module

Open AdequateUsername opened this issue 2 years ago • 3 comments

Adds: skis (iron boots, provide speed 1 on snowy blocks, speed 2 while moving down, slowness elsewhere) poles (tripwire hooks held in both hands, provide jump boost 1) crampons (chainmail boots, provide jump boost 1, and jump boost 2 when used in conjunction with poles)

Conventions/formatting was generally taken from Boots of Ostara and SCUBA Gear

AdequateUsername avatar Sep 02 '22 13:09 AdequateUsername

Firstly, thank you for the feedback. A quick update, in part to prove that I'm still working on this

  • in general, I've given the skis better functionality: a better snow detection mechanism, a smarter way to detect falling (calculate y-velocity) and add speed (now with attributes, not potion effects) depending on v_y.
  • re: emulating slipperiness, that was something I wanted to implement from the start but can't find a nice way of doing it. The way I envision it is that it's as if the player is on an ice block. I don't know if it's possible to set the block beneath the player to ice with the texture of whatever block is actually there, but that sounds rather messy.
  • adjusted recipes, and changed the poles to be sticks (maybe too 'boring'?)

The adding-speed functionality generally follows the mechanism used in speed paths, but it feels a bit clunky/I don't know if it puts an unnecessary burden lag-wise. A way to increase the speed attribute as a function of the player's y-velocity would probably be the gold standard, but the current method didn't seem horrific so I went with it.

Further updates will come for poles/crampons to make them more whole, bearing in mind Bloo's feedback. And adjusting to conform to BPR's CC update + Orbis compatibility (but I need to learn how to do that first.. :) I can't guarantee any timeframe right now; sorry for that, but I haven't forgotten this.

AdequateUsername avatar Oct 04 '22 16:10 AdequateUsername

Since you're still working on this I won't do a full in-depth review. On the functionality side I've tested the skis and they feel great to use now!

On the technical side you should attempt to limit the amount of execute as @a[gamemode=!spectator] at @s. For example, after calling gm4_mountaineering:ski_effects/check_snowy_block you should put the gm4_mountaineering:get_velocity call in that function directly instead of calling it from main later.

Directly calling a function will keep any as or at context, so you only have to check for any additional conditions. This goes for pretty much all of the ski related function calls in main, where you can call from the checking function directly instead of adding a tag to the player then checking for players with that tag.

TheThanathor avatar Oct 22 '22 11:10 TheThanathor

Understood about pulling all of those checks out of main. I'll write the crampons section of the module in that way, then come back to fix the skis at the end (a decent chunk of reformatting is needed anyway). Thanks!

AdequateUsername avatar Oct 23 '22 18:10 AdequateUsername

This should be more or less ready for submission; I've updated the main post with full details of the module. As always, thank you for the help so far

AdequateUsername avatar Nov 05 '22 21:11 AdequateUsername

Thank you for the detailed feedback! I've adjusted the code for most of the issues; for those that I haven't I've left a brief explanation to justify that. The crafting system isn't working quite as I thought it was - I'll spend some time soon to try and work it out, but I think probably I'll have to ask BPR.

Aside from the adjustments from that feedback, poles now reduce fall damage (I don't see them really as a way to get more speed, but they do help with general stability when walking - fall damage ties in nicely), and there are some particles when skiing. I also added an advancement for reaching maximum speed boost, but I'm not good with names so it's somewhat dull. The functionality as detailed in the main post should all be up-to-date.

AdequateUsername avatar Nov 12 '22 22:11 AdequateUsername

I think the custom crafting is now all working on the latest version. That should be everything for this feedback round; I've re-requested a review, but there's no hurry from my side.

AdequateUsername avatar Nov 19 '22 16:11 AdequateUsername

Okay, everything should be updated to meet the latest feedback - thank you (again) for giving it. I'll ask BPR for a crafting-focused review to check that's all fine.

AdequateUsername avatar Nov 27 '22 22:11 AdequateUsername

Should be all updated/responded to now. Thanks for the feedback!

AdequateUsername avatar Nov 28 '22 17:11 AdequateUsername

To summarise the changes: everything should now be in order (I think), ~with the glaring exception of the shulker-teleporting stuff which I'll try and work out~ shulker problem is fixed

AdequateUsername avatar Nov 30 '22 09:11 AdequateUsername

We're going to look into this more later, but for now here's a few things about the Crampons you can work on:

  • shulkers seem to detect snow layers as blocks
  • shulkers can spawn in air (seems to be related to being 2 blocks above the snow layer?)
  • crampons don't give armor

TheThanathor avatar Jan 02 '23 22:01 TheThanathor

Thanks for pointing those out, I'll get a look at it at some point (hopefully) within a week, as soon as I can.

AdequateUsername avatar Jan 09 '23 07:01 AdequateUsername

I personally would like to see the skis speed increase persist as long as you're consistently running on snow (there shouldn't be that much of a speed decrease if you're coasting at a speed, if you're still running/skiing on snow, though I'm not a skier so I don't know how true that is) and if possible, reacquire the increased speed after landing if the player decides to jump with the increased snow speed.

A strange request I have is that I believe skis should have a default movement speed debuff (they're difficult to walk in! regardless of snow or not), and then quickly increment speed. would be more speed increase intervals.

tl;dr Remove the "remove speed if no longer traveling downhill" part of Skis. Default slow movement speed, add more speed increments but also activate speed increments quicker, and potentially slight max speed increase

EpyonProjects avatar Jan 09 '23 21:01 EpyonProjects

Thanks for the comments! Some tweaks made in response to both:

  • shulkers no longer spawn in air (I'm not sure what is meant about snow layers though? I couldn't reproduce any issues to do with them)
  • Shulkers won't spawn on top of each other (not an issue raised here, but discovered while fixing the air problem)
  • Crampons will give correct armour now
  • Speed will persist for much longer on snow (not forever, but somewhere around 10 seconds on flat), and will be easier to maintain. The same vertical velocity thresholds for getting the speed have been kept, but the threshold for keeping the speed effects have been lowered (players should only need to drop by 1 block to keep it). The speed increase is also greater.
  • To balance the longer speed time, if a player goes uphill, the additional speed effects are lost faster
  • update 22-01-23: Additional speed effects from downhill skiing are removed if the player stops moving (it doesn't make sense to keep them after a player stops)

I'm not sure about the gradual speed increases when starting out. It does take longer to get up to speed than, say, walking normally, but I don't think the effect is significant enough that implementing it wouldn't feel clunky to use. If more people echo the want for this feature, I'm happy to put it in, but I think it would feel somewhat strange to use, given that gradual speed increases are uncommon in the rest of the game (sprinting, minecarts, even boats to a degree). But what I would kind of like is creating the 'ice effect' so the player slides around a bit more - I don't know if this is actually possible though, and don't see a nice (certainly not obvious) way to implement it.

AdequateUsername avatar Jan 12 '23 18:01 AdequateUsername

Thanks for the comments. Translations have been updated to the latest standard, and the formatting changed as requested.

Some notes about the climbing:

  • I have now made a small change that (should) make it much easier to climb a height-5 wall (or any odd-height wall).
  • I have kept the countdown-based shulker-killing mechanism; as I don't think players should be able to hold onto a wall forever (it's unrealistic for someone to do this).
  • I think much of the remaining clunkiness will be coming from the shulker-spawn function not running during a jump (since the shulker-spawn function is running every 4t, but a jump may be finished within that). I don't think there's a way to improve that without increasing the number of times the function runs, which I'm not keen to do.

I'll continue to think of possible improvements to the climbing system over the next days, but this is where I am now.

AdequateUsername avatar Aug 14 '23 13:08 AdequateUsername

The Ski Poles should be called "Ski Pole" which would make it more clear that the player needs two of them and that they need one in each hand. We also discussed making them unstackable, but that can be done later and isn't an immediate issue. Ping me on discord for info about making items unstackable.

BPR02 avatar Aug 14 '23 20:08 BPR02

We now have a planned timeline for this:

Once all the multiplayer issues (second review by @TheThanathor) and the fixes listed by @TheThanathor above have been applied, this will get one more feature-check just to make sure all the item names and Advancements follow Gamemode 4 Guidelines and be merged after. However, the module will get a note of Experimental Module, similar to Combat Expanded.

This is due to us having ideas on how to make the skis feel better and us wanting to apply some advanced beet stuff to make the Crampons easier to use:

  • The skies may be better of being a sled, similar to the sleds found in Origin Realms (but this would look very bad without the resource pack
  • The ski poles should be unstackable
  • Using beet and display entities the shulkers should also summon a display entity which mimics the block being climbed on, but pushed out by one pixel (creating the impression of a ledge the player stands on)

These changes are not to be made by you (unless you really want to) but will be added as a later update.

Bloo-dev avatar Aug 14 '23 20:08 Bloo-dev

Okay, thanks for the update and comments; some changes have been made.

  • 'Ski Poles' now called 'Ski Pole'; I haven't made these unstackable for now, but it makes sense/makes it clearer that you need to have one in each hand. Not sure of the most elegant way.
  • Shulker peek setting is set by a different tag, so should be fine in multiplayer
  • Velocity is updated also when holding poles now, so you can't remove skis while going uphill to keep jump boost effects
  • add_climb_effects shouldn't run twice now, but I made a comment above under the original suggestion to confirm the approach makes sense

AdequateUsername avatar Aug 16 '23 09:08 AdequateUsername

Final tweaks:

  • scoreboard-based approach to prevent add_climb_effects running twice when the two possible conditions are both met
  • the ski pole can no longer be stacked

AdequateUsername avatar Aug 17 '23 05:08 AdequateUsername

Alright it looks like this is all set to merge :tada: Thanks for all your patience and hardwork @AdequateUsername.

We've got a marketing plan laid out for the next few weeks to publicize newish modules in various discord servers: Mountaineering is slated for next week's spotlight.

SpecialBuilder32 avatar Sep 06 '23 01:09 SpecialBuilder32