Перейти к содержимому
Mineforgian

Replay FPS

An addon to the Replay Mod that improves how first-person views are handled.

97K загрузок94 подписчиковGPL-3.0-or-laterfabric

Обновлён 13 декабря 2023 г. · опубликован 4 декабря 2023 г.

Replay FPS

Which should really be called "Replay FPV" but I was thinking of first-person shooters at the time

About

The Replay Mod is a popular modification for Minecraft: Java Edition which allows you to capture gameplay for subsequent playback. While the Replay Mod is very powerful, it's severely lacking when it comes to first-person gameplay.

By default, when you render a replay from the first-person perspective of a player, the view appears extremely sluggish. This is due to the fact that Minecraft only properly updates player positions 10 times per second, so the game must interpolate the missing data.

This addon aims to fix this.

By storing client-side camera data alongside the primary replay data, the movements of the local client can be captured in greater detail, leading to a much better first-person playback experience.

Usage

This addon doesn't contain any user-facing usage beyond the normal Replay Mod stuff. Simply install it alongside the replay mod and use it as normal. Keep in mind, however, that the enhancements provided by this addon will only ever apply to the player that recorded the replay, and only if that player had this addon installed while recording.

Note: In the current build (0.2.0), Mod Menu must be installed to access the config menu.

Technical

Client-Capture

The reason that first-person movement looks so bad normally is that the Replay Mod only records the game packets communicated between the server and client. In most cases, this looks identical to observing the game in real-time. However, when it comes to first-person views, the server doesn't send enough data to accurately recreate the original movement. In fact, this is why spectating another player in Vanilla results in the same type of slushiness.

The solution is store an additional stream of data alongside the packet stream. This stream is comprised of a series of channels, each holding a continuous value at a constant sample rate. These channels are written to directly by the client at capture time, bypassing the server-client packet system entirely. Not only does this allow for samples to be captured at a much higher rate than would be possible with packets, but it also enables data to be captured that isn't normally synced with the server in the first place.

In order to store this sizeable data in a realistic way, a custom binary format was developed. When a replay is captured using this addon, a "client-capture" (ccap) file is inserted into the replay archive alongside the packet data. The specification of this file can be found in this repo.

Packets

Some data, however, doesn't make sense to store in a continuous stream. Discrete forms of data, as changes to the hotbar contents, are stored as custom packets that are injected into the replay packet stream. These so called "fake packets" get serialized to a PacketByteBuf at recording time, but instead of being sent to the server, they get saved into the replay file locally. During playback, the Replay Mod then serves these fake packets back to Minecraft as a normal packet, where a custom handler can parse and apply them to the world.

In addition to fake packets, "packet redirectors" can be registered to override how a vanilla packet gets applied during playback. This allows numerous packets, which are normally unusable during a replay, to be parsed and applied towards reconstructing the original client experience.

Building

Like most mods, to build this project, simply open a console to the root directory and enter ./gradlew build. However, it's possible that the build will fail due to a missing dependency called 'CraftFX'. This is a dependency of the ccap_viewer subproject which, as of now, is built alongside the main project. To fix this, clone and build CraftFX, and publish it to Maven Local.

Версии

ВерсияКаналИграЗагрузчикиДатаСкачать
0.2.1Релиз1.20.2fabric13 декабря 2023 г..jar (173 КБ)
0.2.0Релиз1.20.1fabric4 декабря 2023 г..jar (176 КБ)

Ченджлог

0.2.1Релиз1.20.2 · 13 декабря 2023 г.

1.20.2 Update

The replay mod has just updated to 1.20.2, so I've updated ReplayFPS to follow!

This update doesn't contain any user-facing changes, although the "fake packet" system has internally be rewritten to follow the new networking API changes.

0.2.0Релиз1.20.1 · 4 декабря 2023 г.

First Person UI

This update enables you to render your health, hunger, and hotbar! It also contains major backend changes in order to enable this.

To turn on UI rendering, you must install Mod Menu and use it to open the mod's config. In the UI tab, there is an option to enable UI rendering. In a future release, the config will be accessible via the Replay Mod's menu.

Полная история изменений — на Modrinth.

Комментарии

Загружаем…