Refactoring of game logic - #11
Merged
Merged
Conversation
- Existing game logic has been removed and chunk generation is placed inside game.c
- This change add the ability to send prefixed buffers (length sent as a varint)
- Procedural terrain generation is still missing in this commit but will be used as a starting point
- close the https connection when the data is received - only get the auth ip once during the lifetime of the application
- Surface layer is added
- Cave layer is added
- Maximum of 3 sections are sent depending on the Y value {this is currently garbage }
- Perlin noise library is intoduced
vimpop
marked this pull request as draft
May 8, 2026 17:08
vimpop
force-pushed
the
refactor_game_logic
branch
2 times, most recently
from
May 8, 2026 17:26
187de44 to
573c61f
Compare
- socketio now sends compressed packets NOTE: Inbound packets are not decompressed yet!
- moved chunk section to 3 to 7 - change spawn point to 0,26,0 - removed 2d hashing world seed function
- utils are removed because they are very outdated and no longer serve any purpose
- The file is refactored so it can obtain the palette through a helper function instead of hardcoding it. - Removed local definitions of the heightmaps and just put them on the bss for simplicity - worldGetBlock function is introduced which returns the block from the terrain with the given coordinates. NOTE: This is not cached yet and will regen the heightmap per call
vimpop
force-pushed
the
refactor_game_logic
branch
from
May 8, 2026 17:45
573c61f to
8c3fbcc
Compare
- socketio is also fixed for the values returning incorrectly
- Inventory storage mechanism is introduced and item enums are added. - Core logic inside game.c is also updated for both Block interactions and inventory mangement
- inventory crafting - crafting table implementation - recipes added - socketio: introduce formatted strings - Tick time is set to 9000 (was lower) to prevent disconnections
- mojangs api does not return content length anymore so \r\n\r\n is used to check the end of data
vimpop
force-pushed
the
refactor_game_logic
branch
2 times, most recently
from
July 28, 2026 00:08
d7855b3 to
9f6b81e
Compare
vimpop
force-pushed
the
refactor_game_logic
branch
from
August 16, 2026 01:03
cc34c35 to
a3c2ec3
Compare
vimpop
marked this pull request as ready for review
August 16, 2026 01:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, the source code is a mess and the feature set is quite minimal.
But since socket IO is proven to be relatively stable, the following feature set can now be implemented with the following milestones: