Jump to content

[1.12.2] Accurately render high-speed projectile


Cadiboo

Recommended Posts

I've got an entity that goes to about 15 times as fast as the max speed of arrows (shooting velocity is between 5 & 50). At this speed rendering the entity becomes hard and simply using entity.position + entity.motion * partial ticks leads to pretty inacurate rendering positions. Is there any way to get a better render position? I'm already updating the entity & syncing it as fast as possible.

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

2 hours ago, Cadiboo said:

I've got an entity that goes to about 15 times as fast as the max speed of arrows (shooting velocity is between 5 & 50). At this speed rendering the entity becomes hard and simply using entity.position + entity.motion * partial ticks leads to pretty inacurate rendering positions. Is there any way to get a better render position? I'm already updating the entity & syncing it as fast as possible.

No there isn't you are limited by Minecraft here/your FPS.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

2 hours ago, Animefan8888 said:

No there isn't you are limited by Minecraft here/your FPS.

Thats unfortunate.

Apparently theres nothing at all that I can do, I rewrote all my entity code to use BigDecimals instead of doubles to increase the motion's accuracy & that ended up looking even worse.

Edited by Cadiboo

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

I think what I'm going to do is only render the entity when its on the ground (stuck in a block)

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

2 minutes ago, Cadiboo said:

Apparently theres nothing at all that I can do, I rewrote all my entity code to use BigDecimals instead of doubles to increase the motion's accuracy & that ended up looking even worse.

Using partial ticks and doubles is probably the best you can do to animate something in minecraft. Since it wasn't designed for something to move that fast within normal conditions.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Just now, Animefan8888 said:

Using partial ticks and doubles is probably the best you can do to animate something in minecraft. Since it wasn't designed for something to move that fast within normal conditions.

Should I try giving my entity a destination position (vector) & render it between it's start & end position based on velocity & partial ticks and ignore my motion variables?

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

6 minutes ago, Cadiboo said:

Should I try giving my entity a destination position (vector) & render it between it's start & end position based on velocity & partial ticks and ignore my motion variables?

Isn't that what you are already doing? The motion variables in the entity class are velocity, and the entities position is its position. So the partial ticks multiplied by the motion variable + the position would result in the same thing.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Wait, first of all what do you mean by it rendering inaccurately? It should be rendering accurately. Do you mean moving inaccurately? The reason why this is important question is: do you think that it is the partial ticks part causing trouble or the actual position at the time of each render? The partial ticks is the way Minecraft tries to "tween" the motion between two ticks since motion can only update on ticks (20 times per second) but screen gets re-rendered over 60 times per second (some people now run at 120 or even higher).

 

So i think you need to figure out which part is causing trouble before you just start using doubles or higher precision math. I am quite certain this isn't a precision problem per se.

 

Secondly, the benefit of something moving quickly is that it should be harder to notice irregularities in its motion. So I'm surprised you're noticing something.

 

One thing I'm wondering is: did you set your entity for fast tracking? Projectiles are set for fast tracking so that server syncs more often.

 

If something is really fast then I think you can consider a different approach to rendering. Why not simply show sort of a "flight path" where the whole arc of the flight is rendered briefly like a bit of a "trail"? Or you can leave a couple previous positions rendered (with increasing fading transparency) to create sort of a motion blur effect.

 

Anyway, first figure out if it is the partial ticks or the motion/position updates causing the problem. Make sure you're fast tracking as well. Then use a rendering trick to hide any remaining imperfections.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.