add some notes about the architecture

This commit is contained in:
Bixilon 2022-06-30 18:13:23 +02:00
parent ee459bee47
commit 1597ada864
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
4 changed files with 60 additions and 9 deletions

View File

@ -25,7 +25,7 @@ Minosoft is an open source minecraft client, written from scratch in kotlin (and
- Independent, I will probably accept almost all patches
- Way more stuff
(some ~~technical~~ explanation about the render system is [here](/doc/rendering/ReadMe.md))
(some ~~technical~~ explanation about the render system is [here](/doc/rendering/ReadMe.md)). You can find the architecture design [here](/doc/Architecture.md)
## System requirements

58
doc/Architecture.md Normal file
View File

@ -0,0 +1,58 @@
# Architecture
## Modules
Basically minosoft consists of 3 models:
- Core
- Eros
- Rendering
To only start the core, you can start the jar with the `--headless` parameter.
### Core
The core should not depend on other modules (currently not true, but reduced to a minimum). It contains all the network code,
account management, entity logic, pyhsics and a lot more.
### Eros
Eros is the main gui, you can refer to it as launcher or server list. It is mostly using the [mvc design pattern](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller).
The model is not part of the package, mostly util classes or code from the core.
### Rendering
Rendering does not depend on Eros, it only depends on the core. It is written pretty much abstract and even/watcher driven.
This module contains most of the part. It does everything rendering (aka. what you actually see from the game).
It is also pretty dynamic, you could say that it also exists ot of modules. It also handles a lot of the logic.
You can find more about it [here](/doc/rendering/ReadMe.md).
## Networking
Networking is sitting on top of [Netty](https://netty.io/).
Every packet has its own class, all data is (due to compatibility and multi versioning) read manually from the buffer.
Every packet needs to include all version checks (e.g. `if(versionId >= V_1_19)`). If a packet changed fundamentally in a version,
there might be a legacy packet. Not all (but pretty much all) packets are implemented.
Every packet has a handle function, the use of it is pretty much straight forward. Most of those handle functions trigger events,
that might get handled by mods or other modules.
## Version data
Minosoft does not have all properties of blocks, items, ... hardcoded into it.
There is a large data blob generated by [PixLyzer](https://gitlab.bixilon.de/bixilon/pixlyzer) that gets downloaded and
loaded on demand.
Personally I don't really like that design, but it allows multi versioning and the adaption of new versions really quick.
## Assets
Assets are downloaded directly from mojang. Those assets are then hashed (to prevent duplicated saving) and compressed with
[zstd](https://en.wikipedia.org/wiki/Zstd). There are assets functions (e.g. sound). You can disable downloading of those assets
if you don't need them. The textures and models are stored in the original minecraft jar, this file is getting downloaded,
uncompressed and striped down. Original minecraft code never gets executed.
Assets are getting manged by assets managers. There are a few of them. Because of that design, you can easily load resource packs.
You can find more about assets [here](/doc/Assets.md)

View File

@ -1,7 +0,0 @@
# Config file
There is a config file located in:
* Windows: `%AppData%\Minosoft`
* MacOS: `"~/Library/Application Support/Minosoft"`
* Linux (and all others): `~\Minosoft`

View File

@ -25,7 +25,7 @@ Generally I'd say TBA, but some basic rules are here. Feel free to contact me fi
## What not to include
- This is a non-profit project, so don't include anything that violates open source rules.
- This is a non-profit project, so don't include anything that makes money or includes closed source code.
- No connections to other servers than mojang or resources (aka this or another git repo).
- No ads, no data collection, nothing in this direction.
- No copyright protected content.