Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New mountaineering module #789

Merged
merged 94 commits into from
Sep 6, 2023

Conversation

AdequateUsername
Copy link
Contributor

@AdequateUsername AdequateUsername commented Sep 2, 2022

Adds some mountaineering-related gear to the game: skis, poles and crampons.

Skis

  • crafted with iron ingots in the two side columns and iron boots in the centre of CC (advancement for crafting)
  • give slowness on non-snowy blocks
  • give speed on snowy blocks
  • give increased speed when moving downhill (advancement for reaching maximum speed boost)
  • create some particles when skiing

Poles

  • crafted with a stick in top centre and bottom centre and tripwire hook in the centre of CC
  • need to hold in mainhand and offhand for effects
  • give jump boost 1 normally, and 2 when skiing uphill; this is on a cooldown
  • reduce the vertical speed threshold for getting speed boosts when skiing
  • reduce fall damage when used without skis

Crampons

  • crafted with chainmail boots in top centre, and iron nuggets in centre row of CC
  • give slowness effects (they shouldn't be easy to walk in)
  • allow climbing of vertical walls made of stone, grass block, or dirt when both hands are empty
  • you cannot 'climb' on a wall indefinitely; after a while you fall off
  • the climbing mechanism is not perfect because (I think) of shulkers; it is assumed that all climbers make mistakes

Remarks

  • I can't see any changes needed to meet BPR's CC update, in that what I have looks similar to other modules. I might have missed something though I realise some changes are needed; going to look at this CC should all be correct now
  • Orbis compatibility would be good, but it looks like it is still being updated, so I'll leave this for now

when on cold blocks, but cannot use OR (e.g. cannot check ice OR snow)
and slowness when not on snowy block
poles_item, for differentiation
references to a "descending" predicate
- tripwire hook NBT not preserved
- changed custom crafter output slot (replace boots, or bottom right)
- removed lore
Also
- added cooldown for jump boost with poles (can't continually use)
- removed some unnecessary predicates/tests
- changed some conditions for when speed is applied with skis
- changed end rod to iron bars in poles recipe
@Bloo-dev Bloo-dev added submission Brand new community submitted module needs-testing Requires in-game testing labels Sep 13, 2022
Copy link
Member

@Bloo-dev Bloo-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First of all, thank you for your PR! We like the basic principles of this module and would love to see it be a part of Gamemode 4, especially with added Orbis compatibility to make these appear in loot chests!

Our in-game tests have shown some issues and necessary feature changes that are outlined below.
We have also found some more technical issues with the code, however, these may not need to be addressed individually, as some parts of this module should receive some refactoring to improve the end user experience. Though below you can still find a couple of out suggestions; bear in mind that this is not a comprehensive code review, though.

Skies:

  • the block checks need to be refined, the stepping_on condition sadly only checks the block below the player, neglecting, for example, snow layers entirely. This should be replaced with a smarter "snow detection system" which respects snow layers as a snowy surface, regardless of the block below the snow layer.
  • the falling condition seems to be somewhat flawed (air 1.3 blocks below the player yields plenty of false positives). Use the scoreboard objective minecraft.custom:minecraft.fall_one_cm or advancement condition minecraft:fall_from_height instead, however, bear in mind that these only yield values once the player has landed making them less useful as it seems like what you want to track is players having a negative y-velocity (running downhill). The latter may be achieved by spawning markers and reading their y-coordinate to get a rough velocity approximation.
  • instead of using potion effects, consider using attributes instead to apply speed (allows for more precise control, better stacking control)
  • it would be nice if skis ramped up in speed when going downhill and if the skis emulated the slipperiness of skiing instead of the hard turns you can do when walking

Poles & Crampons:

  • Whereas the skis have their unique niche and have the interesting snow interaction the crampons & poles seem to be lacking a bit. We suggest spicing them up quite a bit to make them useful, here are our suggestions:
    • Turn the crampons into boots that let you climb vertical walls by placing temporary Shulkers as temporary platforms.
    • Rework the poles -- tripwire hooks can't be used as the player can place them down. Instead, use an unplaceable item and increase the synergy with the skis (making you speed up quicker?). These should be early-game to give them the most use.

Recipes

The current recipes seem a bit awkward and could use a bit of a re-vamp. Our points of concern are:

  • iron pressure plates seem weird in a recipe
  • dripstone seems weird in a recipe
    Take some inspiration from our latest recipe re-vamp for custom crafters in which we fixed some of our old recipes.
    This PR will also have to be updated to comply with @BluePsychoRanger's latest Custom Crafters update (CC Shifting #787 ). @BluePsychoRanger will give you a detailed review as well to add more info on this topic.

Orbis Compatibility

Making these generate in Orbis Chests will advertise them to players, consider adding Orbis Compatibility. CC @kruthers who's currently updating Orbis.

@Bloo-dev Bloo-dev added outdated Some part of this isn't up to date with coding standards and removed needs-testing Requires in-game testing labels Sep 19, 2022
@Bloo-dev Bloo-dev self-assigned this Sep 29, 2022
@Bloo-dev Bloo-dev added needs-testing Requires in-game testing and removed outdated Some part of this isn't up to date with coding standards labels Sep 30, 2022
smarter fall detection system (further speed boost for faster falling
going to be added soon)
@AdequateUsername
Copy link
Contributor Author

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.

increase speed with skis.
When holding poles, jump boost 1 is given, or jump boost 2
when having an upwards velocity.
There is cooldown on the jump boost.
@TheThanathor
Copy link
Member

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.

Copy link
Member

@TheThanathor TheThanathor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty much everything looks good, but there's some updates needed to make the module compatible with 1.20+, I'd also suggest trying to improve climbing a bit more, but that is up to you.

.vscode/settings.json Outdated Show resolved Hide resolved
gm4_mountaineering/beet.yaml Outdated Show resolved Hide resolved
gm4_mountaineering/data/gm4/advancements/ski_fast.json Outdated Show resolved Hide resolved
gm4_mountaineering/beet.yaml Outdated Show resolved Hide resolved
gm4_mountaineering/beet.yaml Outdated Show resolved Hide resolved
@AdequateUsername
Copy link
Contributor Author

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.

Copy link
Member

@TheThanathor TheThanathor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two minor problems, other than that it looks good!

Comment on lines 7 to 8
execute if entity @s[gamemode=!spectator,tag=gm4_mountaineering_using_crampons,predicate=gm4_mountaineering:hands_empty] anchored eyes if block ^ ^ ^1 #gm4_mountaineering:climbable_blocks run function gm4_mountaineering:climbing_effects/add_climb_effects
execute if entity @s[gamemode=!spectator,tag=gm4_mountaineering_using_crampons,predicate=gm4_mountaineering:hands_empty] anchored eyes if block ^ ^-1 ^1 #gm4_mountaineering:climbable_blocks run function gm4_mountaineering:climbing_effects/add_climb_effects
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this means the gm4_mountaineering:climbing_effects/add_climb_effects can run twice if both checks are true, it's better to set a dummy score to 0 first, then set it to 1 if the function is called, only running the second check if the first one failed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added unless block ^ ^ ^1 #gm4_mountaineering:climbable_blocks into the second condition - that is, only run add_climb_effects in the second check if the condition for the first check was not met. I think this should achieve the same result? (in my own test, it makes climbing a little cleaner)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That will work as well, but using the score method is a little bit more optimized as it only does the score check if the first check succeeds, by using unless block it needs to do a block check, which is worse for performance

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, makes sense. Changed to a scoreboard approach (it seems a little clunky, so I don't know if there's a better way to do it, but I know at least that it works)

Copy link
Member

@TheThanathor TheThanathor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple more points found during the meeting

@BPR02
Copy link
Member

BPR02 commented Aug 14, 2023

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.

@Bloo-dev
Copy link
Member

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.

@AdequateUsername
Copy link
Contributor Author

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

Copy link
Member

@TheThanathor TheThanathor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me! There's def some opportunity to improve things with the new ride command, but that can be a thing for a later update

to prevent adding climbing effects twice
@AdequateUsername
Copy link
Contributor Author

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

@SpecialBuilder32 SpecialBuilder32 added module A concept-approved module to be added to the repository and removed needs-testing Requires in-game testing labels Sep 6, 2023
@SpecialBuilder32
Copy link
Member

Alright it looks like this is all set to merge 🎉 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 SpecialBuilder32 merged commit c0ca619 into Gamemode4Dev:master Sep 6, 2023
2 checks passed
github-actions bot pushed a commit that referenced this pull request Sep 6, 2023
* Added skis and  some test functionality
(blindly gives speed 3)

* Fixed a typo in _pack.mcmeta

* Fixed a few typos and renamed _pack.mcmeta
to pack.mcmeta

* Crafting now works

* Speed boost now (blindly) applied

* Added (possibly) functionality to give speed
when on cold blocks, but cannot use OR (e.g. cannot check ice OR snow)

* Gives speed when wearing skis and on snowy block,
and slowness when not on snowy block

* Added poles

* Renamed "Item" (to store NBT) to ski_item and
poles_item, for differentiation

* Added jump boost effects for poles, and removed
references to a "descending" predicate

* Added crampons

* Given jump boost functionality to crampons

* Response to initial feedback
- tripwire hook NBT not preserved
- changed custom crafter output slot (replace boots, or bottom right)
- removed lore
Also
- added cooldown for jump boost with poles (can't continually use)
- removed some unnecessary predicates/tests
- changed some conditions for when speed is applied with skis
- changed end rod to iron bars in poles recipe

* Fixed formatting, attempted adding 'snow detection
system', but function 'main' only runs when directly commanded

* Working snow detection system (now includes
snow layer)

* Smarter fall detection system implemented

* Speed boost applied for travelling downhill using
smarter fall detection system (further speed boost for faster falling
going to be added soon)

* Further speed added for faster descent

* Adjusted recipes and changed poles to be a stick
rather than tripwire hook

* When holding poles, a lower v_y is needed to
increase speed with skis.
When holding poles, jump boost 1 is given, or jump boost 2
when having an upwards velocity.
There is cooldown on the jump boost.

* Crampons add slowness, and give a tag when facing
a climbable block (=stone, grass, or dirt)

* Crampons now allow for vertical scaling of walls
(but shulkers still create death particles)

* Shulkers now killed without particles
(teleported to void first)

* General clean-up, and need empty hands to climb

* Changed advancement name to 'craft skis'

* Particles added when skiing

* Player can now look around when climbing, and
lengthened the climbing cooldown

* Using poles reduces fall damage

* Added advancement for reaching maximum speed boost
(but needs better name)

* Some recipe tweaks (but I don't think this is
 compatible with BPR's recent update?)

* Shulkers now summoned in a more precise way
Climbing runs on a faster clock
Shulkers no longer all killed when removing crampons

* Simplified shulker killing mechanism

* Changed context for kill_shulkers

* Removed all "execute run" before function calls

* Crampon removal commands only called once when
crampons removed

* New function to initiate crampon effects
(those that only need running once)

* Check for whether a player stands in front of a
climbable block now uses a block tag

* Further implementation of block tag for check of
facing a climbable block

* Moved function calls in main to a new player_main

* Removed some unnecessary predicate calls

* General cleanup

* Fixed some incorrect headers

* Should now use latest custom crafting system

* Changed poles recipe and advancement names

* Simplified climbing mechanism

* Simplified poles system

* Moved poles to fast_main (renamed from
climbing_main) so NBT check isn't needed

* Climbing shulker damage system moved to slow clock

* Slowness is now an attribute of crampons

* Changed jump boost conditions with poles:
- with skis, get JB1
- without skis, get JB2
- always get JB3 when moving upwards (vy>=2)

* Slowness effects called directly from
check_snowy_block

* Expanded range of climbable blocks, and general
cleanup

* Ordered climbable_blocks and removed settings.json
changes (I don't even know how those got there?)

* Simplified player_main, updated custom crafting loading to
lib_machines warning message

* Moved crampon tag-adding and -removing to main

* Added a submain function for the fast clock

* Moved kill_shulkers into damage_shulkers
and reworked commands for check_steep_downhill_ski_speed

* Reduced if score subcommands in
check_downhill_ski_speed

* Reduced score-checking subcommands in
poles_equipped

* Updated contributors.json with my own name
(I don't have links)

* Updated pack.png, removed pack.svg

* Added snowy_blocks block tag and
reduced particle count for skis

* Removed HideFlags:64 from items

* Summon shulkers high up, then tp down to
avoid visual glitch (but doesn't work)

* Moved damage_shulkers call to main from
player_main

* Another attempt at teleporting shulkers down

* Moved at @s to fast_main from player_fast_main

* Added blank links field to contributors and put
my name in right place alphabetically

* Renamed poles to ski poles

* Set shulker peek 1t after teleporting to avoid
player getting stuck

* minor optimisation to reset_shulker_peek

* Empty commit to run workflow

* Shulkers will no longer spawn in air, and
only one shulker will spawn in a given place

* Crampons provide correct armour

* Easier to maintain speed on flat, but
harder to maintain uphill

* Downhill ski speed effects removed if the player
stops moving

* Replacing pack.mcmeta with beet.yaml

* Updated beet.yaml to 1.4.0 standard

* Revert .vscode/settings.json to how it was
(I don't know why this is getting changed)

* Update translations, remove particles
 from resistance effect, minor reformatting

* A few more formatting tweaks

* Made it easier to climb walls of odd-valued height

* Stop add_climbing_effects from running twice when
two (different) conditions get met

* Velocity updated whenever poles or skis equipped
(formerly skis only)

* Add a new tag to track the shulker peek setting

* Rename 'Ski Poles' to 'Ski Pole'. Note the item is
still called 'poles' on the backend.

* Ski pole unstackable, and a scoreboard-based way
to prevent adding climbing effects twice

* Can only craft one ski pole at a time

* Add Experimental Module Note

* Add a README

---------

Co-authored-by: Misode <[email protected]>
Co-authored-by: Bloo-dev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module A concept-approved module to be added to the repository submission Brand new community submitted module
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

7 participants