Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Solved]Syncing player movement based on RenderTickEvents with ServerTickEvents

Featured Replies

Posted

I'm looking for ideas on what direction I should take, not necessarily a specific answer.

 

Long story short:

 

I'm managing building pre-recorded structures during server tick events and doing pre-recorded player movements during render tick events (to get smooth motion).  Although I can mostly get things synced up and consistent, the player movements are dependent on performance and get out of sync with structure building if conditions change (like when I try to record things with video capture software).

 

Any thoughts on how best to get the camera (player) from point A to point B in a specific amount of server ticks while still having it be smooth?

 

Long story long:

 

I made a mod which lets me record block placement and then playback the recordings.  I can adjust the playback speed, number of copies, location etc.  The playback process is handled during SeverTickEvents.  In addition to this, I am able to move the camera (the player) to and between set locations during RenderTickEvents .  The idea is to build structures while the camera moves around to set locations.

 

The problem is that while structure building is not dependent on performance (it's pretty consistent because it's based on server ticks) the player movement is based on performance.  I figured that I could manage with this because the results were "consistent" (given the same conditions).  However, the moment I tried to start recording the results using video capture software, the player movements and structure building quickly got out of sync.

 

Possible Fixes:

 

- I was thinking that I could time player movements based on server ticks (ex. Move player from A to B in 20 ticks) but keep track of the average number of render ticks per per server tick (based on current performance) and update the players location exactly 3 times per server tick (to accommodate 60fps recording).  For example, if there was 30 render ticks during the last server tick, I would update the player's location every 10 render ticks during the next server tick.  I'm not really sure if I can do this smoothly without judder and inconsistent movements.

 

- A more extreme solution (which I hope I don't have to implement) would be to try and render everything offline like some recording mods do.  I hope that there's an easier solution.

 

Any thoughts?  Am I making things more complicated than it should be?

  • Author

I've got a crazy solution.  You're welcome to talk me out of it...

 

For this mod that will only be used by me under controlled conditions, I think I might just be able to get away with managing everything under the render tick event...

  • Author

It's turns out that using the render tick events actually works really well for me.  For a workable mod that is supposed to be played by people, not so much.  For my video capture purposes, it works great.  In fact, it's better now.  I can individually build blocks at 120 (or more) individual block placements per second instead of just 20...

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.