Skip to content

Interpolated Looking implementation #4505

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

Open
wants to merge 1 commit into
base: 1.19.4
Choose a base branch
from

Conversation

TheThouZands
Copy link

Replaced old, in many cases not working "smoothlook" with "interpolatedLook", which forces global player rotation in both axis to follow a "path" from source looking position(rotation) to target, removing jittering when, for instance, mining blocks; it WILL hinder baritone's default mining speed, but the main purpose is to make actions seem slightly more humanly possible, time of the interpolation is controlled by interpolatedLookLength, in ticks.

Replaced old, in many cases not working "smoothlook" with "interpolatedLook", which forces global player rotation in both axis to follow a "path" from source looking position(rotation) to target, removing jittering when, for instance, mining blocks; it WILL hinder baritone's default mining speed, but the main purpose is to make actions seem slightly more humanly possible, time of the interpolation is controlled by interpolatedLookLength, in ticks.
@TheThouZands TheThouZands mentioned this pull request Sep 19, 2024
2 tasks
@TheThouZands
Copy link
Author

8mb.video-4EL-9Jlk4hg4.mp4

"showcase" video

Copy link

@sqlerrorthing sqlerrorthing left a comment

Choose a reason for hiding this comment

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

use google guidelines rn & dont commit the commented code

@@ -120,4 +121,8 @@ public static double entityDistanceToCenter(Entity entity, BlockPos pos) {
public static double entityFlatDistanceToCenter(Entity entity, BlockPos pos) {
return distanceToCenter(pos, entity.position().x, pos.getY() + 0.5, entity.position().z);
}

public static Vec3 vDivide (Vec3 A, Vec3 B) {

Choose a reason for hiding this comment

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

use google codestyle guidelines plz

if (this.target.mode == Target.Mode.SERVER) {
ctx.player().setYRot(this.prevRotation.getYaw());
ctx.player().setXRot(this.prevRotation.getPitch());
}// else if (ctx.player().isFallFlying() && Baritone.settings().elytraSmoothLook.value) {

Choose a reason for hiding this comment

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

what is it? 💀. Commits the commented code is pretty bullshit

@DeerJesus
Copy link

DeerJesus commented Nov 16, 2024

The interpolation is very cool, but given how abysmally slow the speed is you might want to 'boost' remainWithExistingLookDirection so it REALLY prefers to mine blocks in the existing look direction, to minimize turning. It looks more human anyway

Or add some sort of penalty setting for it at least?

@DeerJesus
Copy link

Actually, having played around with this a bit, it's real nice. MUCH better and FASTER somehow than smoothlook, just have to nerf the ticks. It's nice!

@LopezJLD
Copy link

Actually, having played around with this a bit, it's real nice. MUCH better and FASTER somehow than smoothlook, just have to nerf the ticks. It's nice!

hey can you help me to compile with this changes? idk why it doesnt work when i do it :( im new in all this things

@weedforspeeed
Copy link

how can i use your modification mod. btw it looks really good and smooth

@weedforspeeed
Copy link

hey i really like your mod how can i use it? is there a .jar file which i can use?

@weedforspeeed
Copy link

Actually, having played around with this a bit, it's real nice. MUCH better and FASTER somehow than smoothlook, just have to nerf the ticks. It's nice!

how did you use it? im new to github an all this so i dont have a clue. is there like a .jar file or anything i would really like to use the showcased mod

@DeerJesus
Copy link

DeerJesus commented Apr 15, 2025 via email

@weedforspeeed
Copy link

alright thank you bro imma try it out. but wouldnt it be possible that you could send me the jar file?

@DeerJesus
Copy link

DeerJesus commented Apr 17, 2025 via email

@weedforspeeed
Copy link

alright still thank you for the advice

@weedforspeeed
Copy link

im not able to do it :(

@weedforspeeed
Copy link

alright i made it to make the .jar file but which one to use that it works like in the video fabric or forge and the "unoptimized" one or the other one? because its still laggy with interpolated look

@weedforspeeed
Copy link

and which version to use?

@TheThouZands
Copy link
Author

alright i made it to make the .jar file but which one to use that it works like in the video fabric or forge and the "unoptimized" one or the other one? because its still laggy with interpolated look

Hey there, it's been a while, i have been kinda occupied with work (not coding related sadly) hence i haven't been able to correct the pr for coding guidelines.

As for this, you should be able to use the normal or obfuscated version, the unoptimized version is only for debugging, but the function should be fully implemented on all jar types

Also, i made this pr for, at it's moment, the main branch, 1.19, should work best there, but could work for other versions as well, but would need some precisions

Also yes, it may look laggy because it is based on tick updates rather than frame updates; most of baritone works on that same 20 TPS refresh rate, may have not been noticeable before as movement took less than one frame, implementing this in a way that updates frame per frame is possible, however would require mixin work, which i'm not precisely familiar with, however, upon doing playtesting, the main arc calculation function, which is the heaviest part of the pr, took near 10 ms, which again means it's entirely plausible to update it on a frame per frame basis

@weedforspeeed
Copy link

hey glad youre back so i got your version and im playing 1.19.4 fabric and i just the standalone fabric .jar file in the mods folder but eventho i got a good pc its not nearly as smooth as in your video. what could possibly be wrong?

@weedforspeeed
Copy link

okoka_compressed.mp4

this is how it looks on my end

@TheThouZands
Copy link
Author

I see, i believe you are referring to the pauses between each mined block

This is indeed something that tends to happen often, and basically it's because the interpolation is run always.

My function is directly called by baritone, since it was designed to have intant movement, it checks every single tick for moving the camera to point at the block
In this case, my function does manage to override part of that, successfully placing itself on top of the location requests and smoothing the movement within one point and the other

However, when that point is reached, the override no longer applies, and baritone attempts to call the looking function again, so if the block hasn't yet been mined, the arc will be calculated for the same point, running the cycle for the same point (hence why it looks static)

In that case, it does hinder speed a bit due to those pauses, things that could reduce it would be to lower the interpolation ticks

A more permanent solution is to know when the block has been successfully mined by the player, but once again, it involves non-implemented mixins, and as i'm still in a (slightly horrible) job, i haven't had time to explore mixins as well as implementing the solution for this

@TheThouZands
Copy link
Author

So yes, it's working without lag issues (not performance problem) but the same interpolation gets in the way if mining a block takes too little time or too much time

@TheThouZands
Copy link
Author

So yes, it's working without lag issues (not performance problem) but the same interpolation gets in the way if mining a block takes too little time or too much time

If it was a performance issue, all minecraft would stop, otherwise it would generate frames at a slowe rate or directly freeze, just need to figure out a way for baritone to see the block itself instead of a position, and know when it hasn't/has been mined

@weedforspeeed
Copy link

i mean like the camera movement is more "laggy" than in your video. how can i make it buttersmooth like you?

@weedforspeeed
Copy link

and i somehow keep looking at the bottom when im walking

@TheThouZands
Copy link
Author

i mean like the camera movement is more "laggy" than in your video. how can i make it buttersmooth like you?

Oh yeah, i see what you mean, but in the showcase it's also pretty jittery, because the movement is only called 20 times per second instead of 60, as it depends on the world's tick, just as most of Baritone, thing is that it's less noticeable because the video is heavily compressed and running at 30 fps, as at the moment I didn't have enough space

and i somehow keep looking at the bottom when im walking

and not sure what you mean, do you perchance have a video showcasing this as well?

@weedforspeeed
Copy link

unfortunatly, i cant put any videos in here that are anylonger than 10 sec. "and i somehow keep looking at the bottom when im walking" i think this is just something that happens sometimes with baritone. and what i also noticed #interpolatedlook sets itsself during the programm to false. but dont get me wrong youre programm is great and i think the only one who makes baritone a little smoother

@weedforspeeed
Copy link

when you make for example #goto 1 1 1 #interpolatedlook goes automaticly to false after that

@weedforspeeed
Copy link

but i dont know how i can fix that jittery look it doesnt look jittery in your video

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.

5 participants