Skip to content

TASmod Beta1.0

Latest
Compare
Choose a tag to compare
@ScribbleTAS ScribbleTAS released this 25 Jul 17:04
· 2 commits to develop since this release
Beta1.0
38cfefd

This is the first Beta release of TASmod with a lot of reworks, better architecture and a new mod loader.

Highlights

Legacy Fabric

This release switches the modloader from Forge to LegacyFabric. The reason behind this is that forge 1.12.2 is just very old and unsupported. Plus, Legacy Fabric gives us built-in Mixin support and less modifications to the source code. The downside is that forge mods are incompatible with legacy fabric. However, some mods are already backported to legacy fabric.

Input Engine

The input engine or playback engine is the part of the code that hooks into the vanilla input system and redirects the inputs, so that they can be recorded or changed.

In Alpha, I found a flaw in how the inputs are set up. The idea behind it was that inputs can only happen once every tick, except for the mouse that can happen more times a tick, due to GUI-Screens. That idea was flawed and this introduced awkward compromises.

So for Beta, the input engine was extended to allow inputs in between ticks for Keyboard and Camera Angle as well, which I named "Subticks". Now inputs should behave exactly like vanilla.

Interpolation

Storing subticks for mouse and camera also has the added benefit of allowing for better input interpolation.

Normally, cursor location in GUIs and the camera angle are processed at 20 tps, which is very apparent to the player. So for the camera, TASmod-Alpha basically guessed some camera angles to fill in between the ticks, to make it look more watchable.

Now in Beta, all camera interpolation is handled by the subticks, so it should look pretty close to vanilla.

In addition to that, the cursor in GUI screens is also interpolated the same way now, which also fixes some issues with scroll bars

Input saving/loading (Serialisation)

With a new input engine comes the challenge of actually storing the new inputs.
This required a new structure of the TASfile to allow for easy editing.

The new structure goes as follows:

1|Keyboard|Mouse|Camera
	1|Keyboard-Subtick|Mouse-Subtick|Camera-Subtick
	2|Keyboard-Subtick|Mouse-Subtick|Camera-Subtick
	3|Keyboard-Subtick|Mouse-Subtick|Camera-Subtick
2|Keyboard|Mouse|Camera
	1|Keyboard-Subtick|Mouse-Subtick|Camera-Subtick
	2|Keyboard-Subtick|Mouse-Subtick|Camera-Subtick
3|Keyboard|Mouse|Camera
4|Keyboard|Mouse|Camera

Ticks are the same as the before, with Mouse inputs having their subtick syntax removed which is now moved to the indented "subtick" part of a tick.

Serialisation APIs

After revisiting the old serialisation code it became clear, that a serious overhaul is needed, as a lot of things were hardcoded.

To get around this I created 3 APIs that modders can use to add their own functionality to the TASfile.

Metadata

Data about the TAS like credits, start position and options at the beginning of the file can now be dynamically added. Modders can also create add-ons for TASmod and you can store custom metadata in the header.

FileCommands

A feature that was prototyped by PancakeTAS during the Alpha was "Control Bytes". With a special $ syntax, you could add a line to the TASfile and when the playback passes that line, the command would've been executed, for something like disabling the HUD or a nameplate in the corner

This feature has been expanded (and renamed) so modders can add their own file commands that TASers can add to their files.

In the future I would like to rewrite LoTAS as a separate Add-On to TASmod so it uses this system. Then we can merge functionalities and have LoTAS functions with TASmod playback

Flavors

By far the greatest effort was modularizing the serialisation itself. Modders can now easily create their own file format for TASmod, maybe to support other file formats from other tools and export them back to it. I named the file syntax "Flavor" as that name exists for the many different Markdown-Flavors that different sites like GitHub or GitLab use

Savestates

Back in Alpha, savestates had tons of issues as well, so this release fixes a lot of the issues described and of course adds the new subtick functionality

Changelog

New

  • New event handling
  • Packet handling
  • Config handling
  • Serialisation APIs
  • Improved packethandling
  • [Commands] /fileCommand for enabling/disabling fCs
  • [Keybinds] , and . for decreasing and increasing the tickrate
  • [Keybinds] Secret keybinds for turning 45° left and right
  • [Flavor] Add Beta1 (File format)
  • [Flavor] Add legacy Alpha flavor for loading and saving TASes from Alpha versions
  • [Playback] Add the ability to play back TASes while being tabbed out of the game (F3 and P to activate)

Changed

  • Switched to legacy fabric
  • Added support for subticks in Keyboard and Camera Angle, improved Mouse subticks
  • Changed TASfile syntax to support subticks
  • Add relative coordinates to TASfile, prepending with a ~ lets you specify a change relative to the previous one: ~45 will turn the player 45 degrees

Fixes

  • [Playback] Fix keyboard keys only being recognized after a tick
  • [Playback] Fix scroll bars sometimes desyncing
  • [Tickrate] Fixed initial tickrate not being sent, when a player joins the server
  • [Savestates] Fixed savestates failing when a player does not have playerdata
  • [Savestates] Fixed player not getting motion applied in multiplayer
  • [Savestates] Fixed loading across dimensions not working on first try
  • [Savestates] Fixed world not being visible after loading a savestate
  • [Savestates] Fixed scoreboards not being loaded after loadstate
  • [Savestates] Fixed boss bars duplicating on load
  • [Savestates] Fixed resources.zip in world folder breaking savestates
  • and so much more, but I lost track of it all...

Known issues

  • RNG is not being recorded. So mobs, loot and blocks will still be random. This will be my next focus