Mist banner

Mist

25 devlogs
64h 38m 33s

Updated Project: Added bunch of new packets and other necessary stuff
An minecraft server implementation made from scratch in rust.
The code for the website is on the “site” branch on the repo.

This project uses AI

gh copilot for inline completions and claude for bugfixing and help with the rust build step

Demo Repository

Loading README...

Cyteon

Shipped this project!

Hours: 64.64
Cookies: 🍪 1279
Multiplier: 28.64 cookies/hr

Made huge progress, was basically unusable before. But now you can craft and mine and stuff

Cyteon

Made it so you actually need the correct tool of the correct tier to break blocks, and made it so certain tools actually break blocks faster (client was stupid and didnt know this, so i have to tell it :c). But now its actualyl kinda playable? You can break trees and get wood, craft wooden tools then progress to stone. Though you cant go further than that cause we dont have furnaces so you cant get iron.

Changelog

Attachment
0
Cyteon

Implemented managing the inventory in survival (cause its diffrent than creative), rn we completly trust the clients new slot suggestions, but that will change in the future. Also implemented crafting in the 2x2 grid in inventory and in crafting tables.

Changelog

Attachment
0
Cyteon

Implemented major parts of player syncing and changed how entity syncing works:

  • Player tick now manages spawning/despawning entities for player
  • All players are added to the entities list
  • Players manage their entity’s pos and rot
  • Movement and rotation changes are sent to players in range, so players can see eachother now, but i still need to implement skins, along with implementing stuff like sneaking and hand animations

Changelog

Attachment
0
Cyteon

Implemented dropping items and item stacks.
And implemented taking blocks and items from the creative inventory and moving things around in your inventory (only creative, as survival uses a diffrent packet)

Changelog

Attachment
0
Cyteon

Implemented a entity system with incrementing entity ids (player gets a entity id now, and its sent to the client in the login (play) packet). Also added item drops if you mine blocks in survival, and they simulate gravity and measure distance to player, and if player is close enough the player will pick up the item.

Changelog

Attachment
0
Cyteon

Added way better world generation! There are bigger diffrences in areas, so there can be both deep oceans and high mountains. Also added trees, grass and flowers. There are also caves and ores generating below ground, with deepslate below y=0. There is also a minor issue where worldgen is pretty slow but ill fix that in the future.

Changelog

Attachment
0
Cyteon

Implemented basic worldgen:

  • Generates bedrock at y = -64
  • Generates stone between y = -63 and up until 4 blocks under the surface
  • Generates 4 dirt blocks then grass
  • Generates water if surface under y = 62, and generates sand instead of grass
  • Generates ores underground between -63 and 320
    In the image, ores above ground was due to testing, same with the chunks missmatching, i did that on purpose.

Changelog

Attachment
0
Cyteon

I have been trying a lot to optimize the server and fix some critical bugs, but its just not working. I have improved some bad code but the server keeps crashing with random errors that dont make any sense. So its currently not working but ill try to downgrade to 1.21.10 or 1.21.9 and see if smth works

Changelog

Attachment
0
Cyteon

Shipped this project!

Hours: 11.22
Cookies: 🍪 224
Multiplier: 19.91 cookies/hr

Second ship! Implemented a lot of important stuff like sending chunks as you move, fixed chatting, updated to 1.21.11, and more!

Cyteon

Made an proper hompage, along with basic docs

Attachment
0
Cyteon

Implemented:

  • Sending chunk center and chunks to player as they move
  • Improve concurrency by separating the tcp writer and reader
  • Procedural generation of regions if get_region() cant find the region
  • Save and unload all regions from memory if all players leave, as they arent needed (i will add unloading regions as players move later on)

And:

  • Made further ram optimizations
  • Made the code a bit cleaner
Attachment
0
Cyteon
  • Updated registries and packets to 1.21.11
  • Implemented handling player movement and input (we have to calculate movement on server-side)
  • Implemented player rotation
  • Dont let players join if server is full
  • Show actual player count when pinging server instead of placeholder saying 0
Attachment
0
Cyteon
  • Implemented sending player skins
  • Implemented player remove packet
  • Renamed the property player.name to player.username and all refrences
Attachment
0
Cyteon

Make a lot of stuff sync to reduce async overhead, cause my code had a lot of stuff that didnt need to be async. Also fixed registry order as that was unpredictable ending in chat getting messed up. Screenshot shows an example of change in one packet. Also includes some work on trying to optimize the server.

Attachment
0
Cyteon

Shipped this project!

Hours: 17.68
Cookies: 🍪 348
Multiplier: 19.66 cookies/hr

Made some basic stuff work. Tho its still kinda broken cause the mc api keeps changing things up?? So it works on dev and not prod. But its not anything breaking, tho your ping might mess up packet order its fine just reconnect again

Cyteon

Implemented chatting. It was a pain cause the docs are kinda lacking so i just had to try some random values for the chat type field until it worked loll.

Attachment
1

Comments

Hoshino Takanashi
Hoshino Takanashi 3 months ago

peak project

Cyteon

Implemented the packet for sending player info updates, only implemented adding player, and making a player listed in the tablist. But easy to expand with just adding to the enum.

Attachment
1

Comments

aneezakiran07
aneezakiran07 3 months ago

this project is so cool!!!

Cyteon

Made a log module that works as a drop-in replacement for all the old logging code, but also saves the logs to the logs/ folder. Also implemented breaking and placing blocks, but placing blocks is currently using stone as an placeholder. Breaking and placing blocks also modifies the chunks on the server and are saved, and will persist if you restart the server.

Attachment
Attachment
Attachment
Attachment
2

Comments

Cheetah
Cheetah 3 months ago

Awesome to see you make progress so quickly!

Cyteon
Cyteon 3 months ago

ty :D

Cyteon

Create a simple site as the demo with a video and instructions on how to connect.
Site is on the “site” branch

Attachment
0
Cyteon

For this devlog i did:

  • Add view and simulation distance to config
  • Generate more regions around 0,0, now making 4 regions
  • Only send chunks that are within the distance client accepts (view distance * 2 + 7), so it needs to send from 4 different regions if you are on 0,0
  • Load block data from an json file so i can access block ids with “BLOCKS.get(“minecraft:grass_block”).unwrap().default”
  • Fix sending blocks
Attachment
2

Comments

secret x
secret x 4 months ago

how did you done this it hard

Cyteon
Cyteon 3 months ago

it was a pain so it was mostly trial and error

Cyteon

So this is sadly a huge devlog, but i spent so long debugging the data packets :(

This devlog adds the following

  • Generating chunks, trying to match minecraft’s palette format (not very good at it but)
  • Saving and loading chunks (with zlib compression, an 32x32 chunk region with only air is 2.8KiB)
  • Sending chunk and light data to client (no light data for now, just sending zeroes)
    Making the chunk packets work was an absolute pain as the packet documentation is kinda lacking on that front, but i ended up figuring it out after a long time.

For the next devlog im going to make sending actual blocks and just not air, which shouldnt be too hard.

Attachment
2

Comments

Cheetah
Cheetah 4 months ago

Wow this is a really cool project !

Cyteon
Cyteon 4 months ago

Thanks :D

Cyteon

Added the initial setup for saving, along with implementing player saving
Also added some of the base for chunk/world stuff

Attachment
0
Cyteon

Upgrade packets to protocol 773 (1.21.10), and temporarily remove packet 0x44 (player_info_update).
Added sending server type to client, as shown in top right.
Also implemented sending the game event indicating client should start waiting to get chunk data

Attachment
1

Comments

Gizzy The Slack API Hater

absolute potatoima