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

Added crouching and block based friction #926

Merged
merged 25 commits into from
Jan 26, 2025

Conversation

OneAvargeCoder193
Copy link
Contributor

No description provided.

Copy link
Member

@IntegratedQuantum IntegratedQuantum left a comment

Choose a reason for hiding this comment

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

I think you should average the friction differently.

Also @ikabod-kee could you take a look at how these changes feel in-game?

assets/cubyz/blocks/ice.zig.zon Outdated Show resolved Hide resolved
src/game.zig Outdated Show resolved Hide resolved
src/game.zig Show resolved Hide resolved
src/game.zig Outdated Show resolved Hide resolved
src/game.zig Outdated Show resolved Hide resolved
src/game.zig Outdated Show resolved Hide resolved
src/game.zig Outdated Show resolved Hide resolved
src/game.zig Outdated Show resolved Hide resolved
src/game.zig Outdated Show resolved Hide resolved
@ikabod-kee
Copy link
Collaborator

Also @ikabod-kee could you take a look at how these changes feel in-game?

I shall

@ikabod-kee
Copy link
Collaborator

It feels good, though there are some changes I would make.

  1. The default friction should be lowered. Somewhere between 15 and 25 feels good. Reduce friction for smoother movement #553
  2. There is a bug where being on the edge of a block will not count its friction.
    https://github.com/user-attachments/assets/5f70ee0c-f3ed-4d69-a264-b7a03b1eeb1a

I have no complaints about the crouching as of yet.

@ikabod-kee
Copy link
Collaborator

In fact, I love the sort of linear interpolation for crouching. Makes it feel very tactical.

@ikabod-kee
Copy link
Collaborator

Okay, I have found a complaint for crouching, let me record it

@ikabod-kee
Copy link
Collaborator

Crouching bug:
When being forced to crouch, but not pressing the crouch button, you cannot fall of ledges.
https://github.com/user-attachments/assets/759e1fa0-efae-4fab-905a-d58aa5b1ee57

@ikabod-kee
Copy link
Collaborator

Additionally, you cannot go up half-blocks while crouching, which can be an issue.

@ikabod-kee
Copy link
Collaborator

Additionally, you cannot go up half-blocks while crouching, which can be an issue.

Although maybe not, because jumping at the edge of it will snap you to its top

@ikabod-kee
Copy link
Collaborator

I found another bug. You can no longer fly forward and down at the same time.

@ikabod-kee
Copy link
Collaborator

Also friction affects the player in noclip when it shouldn't.

@ikabod-kee
Copy link
Collaborator

8mb.video-9Or-svDkihw0.mp4

The player should be able to fit in these holes

@ikabod-kee
Copy link
Collaborator

Sorry if this is too much, but I also think that when airborne, the player's hitbox should shrink up as a simulation of real crouch jumping.
image

@ikabod-kee
Copy link
Collaborator

Sorry if this is too much, but I also think that when airborne, the player's hitbox should shrink up as a simulation of real crouch jumping.

It would also prevent the strange bounce when crouching in mid-air

@careeoki
Copy link
Contributor

You should be able to step up slabs while crouching, especially since you can still walk down stairs while crouching.

@OneAvargeCoder193
Copy link
Contributor Author

8mb.video-9Or-svDkihw0.mp4
The player should be able to fit in these holes

The player's hitbox is exactly 1.5 blocks tall when crouching so thats probably what makes that very hard. Should i shrink it to something like 1.45?

@ikabod-kee
Copy link
Collaborator

The player's hitbox is exactly 1.5 blocks tall when crouching so thats probably what makes that very hard. Should i shrink it to something like 1.45?

Yes

@ikabod-kee
Copy link
Collaborator

ikabod-kee commented Jan 14, 2025

The recent changes look good. Here's some remaining issues:

  • Noclip bug
  • Flying bug
  • Airborne crouch
  • Remove the spam from the logs (at some point)
  • Perhaps make the player slip off of icy surfaces?

src/game.zig Outdated Show resolved Hide resolved
src/game.zig Outdated Show resolved Hide resolved
@ikabod-kee
Copy link
Collaborator

Let me check out these fixes 👍

@ikabod-kee
Copy link
Collaborator

Crouching while flying forwards is still broken. Still would also like crouch jumping to be added as it would add a layer of skill to movement.

@ikabod-kee
Copy link
Collaborator

Or, you know, crouch jumping

#926 (comment)

@ikabod-kee
Copy link
Collaborator

While the latest commit does fix the issue, I think it would feel better if the crouching hitbox shrank up when not grounded

@ikabod-kee
Copy link
Collaborator

Also, it would be nice if the player's speed during the crouching animation was also interpolated

assets/cubyz/blocks/ice.zig.zon Outdated Show resolved Hide resolved
src/game.zig Outdated Show resolved Hide resolved
src/game.zig Outdated Show resolved Hide resolved
src/game.zig Outdated Show resolved Hide resolved
src/game.zig Outdated Show resolved Hide resolved
src/game.zig Outdated Show resolved Hide resolved
src/game.zig Outdated Show resolved Hide resolved
src/game.zig Outdated Show resolved Hide resolved
src/game.zig Outdated Show resolved Hide resolved
src/game.zig Outdated Show resolved Hide resolved
@ikabod-kee ikabod-kee mentioned this pull request Jan 22, 2025
40 tasks
Copy link
Member

@IntegratedQuantum IntegratedQuantum left a comment

Choose a reason for hiding this comment

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

It seems that I am slipping off of all blocks now.

src/game.zig Outdated Show resolved Hide resolved
src/game.zig Outdated Show resolved Hide resolved
src/game.zig Outdated Show resolved Hide resolved
src/game.zig Outdated Show resolved Hide resolved
src/game.zig Outdated Show resolved Hide resolved
src/game.zig Outdated Show resolved Hide resolved
Copy link
Member

@IntegratedQuantum IntegratedQuantum 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 now. Thanks for adding this!

Next time I'd prefer it if you would split PRs like this, I'd prefer to see a separate PR for each feature introduced, and here the features crouching and friction are pretty distinct.

@IntegratedQuantum IntegratedQuantum merged commit fabc5c1 into PixelGuys:master Jan 26, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants