gitgud banner

gitgud

9 devlogs
18h 58m 56s

A Git mod for Hytale. It will track changes made to the world, which you can rollback, commit, and revert, and more. Look at the README for a list of all the features.

This project uses AI

used to help make checkout feature

Demo Repository

Loading README...

mattseq

Shipped this project!

Hours: 18.98
Cookies: 🍪 548
Multiplier: 24.08 cookies/hr

I built a git-inspired mod for Hytale. This was my first Hytale mod and was inspired by using something like git to backup and version worlds. One of the struggles i had was keeping the memory low even though it needs to hold tons of block changes. I solved that with automatic stashing (writing compressed block changes to disk) and unstashing. Other challenges included checkout and making it compatible with newer Hytale versions.

mattseq

ActionResult

Made the rest of the commands and matching Repository methods return ActionResult so I can return more information to the user about what happened.

Tag Commands

I added more tag commands: add, delete, and list.

Checkout

You can now checkout with tag names and pointers like HEAD and TAIL. For tags you need to add the --tag flag.

README and HelpCommand

I updated the README and HelpCommand to include the new commands.

0
mattseq

Compatibility with New Hytale Updates

When I tried using my mod with the new Hytale updates (I hadn’t updated in a while), it was giving errors when trying to modify the world. I switched to a simple system that ran every tick and an edit queue for new edits instead of just making edits straight from the static Repository class.

Commit Checkout

Created a checkout command which allows you to checkout any commit. Took a lot of debugging because I modified a lot of the existing methods to make them a bit easier to use. I’m a lot more familiar with the debugger now. There’s a video below of this working.

ActionResult for Better UX

I added ActionResult so I could return both the success/fail state and any error messages to the user through the command they ran. Haven’t completely integrated this yet though.

0
mattseq

Commit History

  • getCommitHistory() method in the Repository class
  • /gitgud log command to show history

Tags

  • basic tags
  • stored as json in .tags folder
  • title and description
Attachment
0
mattseq

added automatic stashing so that it doesnt take so much memory when there are tons of block changes. i also added a HEAD file like git and made commits store their parent commit. this should make it easier for branches later. something strange happened with the new hytale version: the git command was already used. hytale literally added a git command to be used with assets and packs. i had to switch my command to /gitgud. i released v2 with file compression and automatic stashing

Attachment
0
mattseq

compresses files using gzip now.

Attachment
0
mattseq

releasing the mod today! its not entirely complete, the commit jsons arent compressed, block changes arent stashed at intervals so it might take a lot of memory after a lot of block changes. i improved the commands, wrote the README, etc. i also learned github actions yesterday, so i set up one that automatically creates issues from any TODO comments, which was cool, although not that useful for a small project

Attachment
0
mattseq

ok just finished up. changes are now automatically stashed and unstashed when stopping and starting the server so they’re never lost. i also added a status command as well, so its a bit more obvious whats going on. as promised, i recorded a video demo but it was too large to attach to this devlog so here’s a google drive link: https://drive.google.com/file/d/1O23bMkSVQa4SZZll06KLZY89ol3WN7id/view?usp=sharing

Attachment
0
mattseq

forgot to devlog for a while. i’ve most of the basics working. block tracking works (just for placing and breaking blocks), i can commit those changes and rollback to the previous commit. its not the most optimized vcs, it doesnt have hashing, buckets, file compression, or objects + trees, and it records block changes at the same position multiple times, but it does work. besides it doesnt have to store as much as git since its storing deltas not whole snapshots. im too lazy to record it but i will on the next devlog, promise. rn im working on stashing block changes if the server is turned off or at a fixed interval to prevent it from taking up too much memory

Attachment
0
mattseq

just got started with setting up my environment. i cloned a plugin template off of github. its pretty well made, it basically looks inside your hytale game files and uses server.jar from there, and when u run it i runs server.jar with your mods. then you can just join with your client. had to make a small change to the build.gradle bc my hytale files dont exist in the default location, they exist on another drive. i also got started with some of the block tracking using events. i found this repo where someone already made git for minecraft (which was my original idea a few months ago) https://github.com/rayyankhan47/Blockbase which is helpful to base it off of

Attachment
Attachment
0