You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This page includes two personal projects, ***[MadParticle](https://modrinth.com/mod/mad-particle)*** and ***NotEnoughBandwidth*** (still in active developing), both are Minecraft Java Edition mods. I am the lead creator of these projects, responsible for planning, design, programming, publication, and maintenance. Both projects are still under active development.
13
13
14
-
This page contains two core classes from my proudest Minecraft mod, ***[MadParticle](https://modrinth.com/mod/mad-particle)*** : `NeoInstancedRenderManager` and `MultiThreadedEqualObjectLinkedOpenHashSetQueue`.
14
+
## MadParticle
15
15
16
-
*MadParticle* was originally designed as a decorative particle mod for Minecraft, allowing players to create visually rich in-game scenes through a large number of configurable parameters. Unlike particle systems in Unreal or Unity, Minecraft’s particles are relatively heavier, which function more like client-side actors/entities than VFX effects.
16
+
MadParticle was originally designed as a decorative particle mod for Minecraft, allowing players to create visually rich in-game scenes through a large number of configurable parameters.
17
+
18
+
Unlike particle systems in Unreal or Unity, Minecraft's particles are relatively heavier, which function more like client-side actors/entities than VFX effects. Therefore, MadParticle also provides a highly optimized particle system that replaces the vanilla particle rendering and computation, delivering a 15–20x performance improvement.
19
+
20
+
:::info
21
+
22
+
If intersted, the complete source code of the project is available at https://github.com/USS-Shenzhou/MadParticle (My online alias is USS_Shenzhou).
23
+
24
+
:::
17
25
18
26
### Demonstration video
19
27
@@ -37,7 +45,7 @@ And there is a list of my other projects on the [Home page](/).
37
45
38
46
### Performance comparison
39
47
40
-
Later, in response to player and other developers' feedback, I began optimizing the vanilla particle system. The current version of MadParticle now achieves a 10–20x performance improvement over the vanilla Minecraft implementation.
48
+
In response to player and other developers' feedback, I began optimizing the vanilla particle system. The current version of MadParticle now achieves a 10–20x performance improvement over the vanilla Minecraft implementation.
@@ -52,20 +60,17 @@ The MadParticle project has been under active development for three years, and t
52
60
53
61
> This image illustrates a major recent architectural overhaul of MadParticle compared to the vanilla system — shifting from a mainly main-thread architecture to an almost fully multithreaded one.
54
62
55
-
## *NeoInstancedRenderManager.java*
56
-
57
-
:::info
58
-
59
-
If intersted, the complete source code of the project is available at https://github.com/USS-Shenzhou/MadParticle (My online alias is USS_Shenzhou).
60
-
61
-
:::
63
+
### *NeoInstancedRenderManager*
62
64
63
65
`NeoInstancedRenderManager` is a highly optimized particle rendering system primarily based on instanced rendering, with some specializations tailored to the Minecraft rendering pipeline.
64
66
65
67
Although instanced rendering significantly reduces the overall rendering time, filling the VBO still consumes substantial processing resources. To address this, parallel VBOs were introduced, where each thread is preassigned a starting address and a task of roughly equal size (see `MultiThreadedEqualObjectLinkedOpenHashSetQueue` below).
66
68
67
69
Additionally, a ring-based OpenGL `PersistentMappedBuffer` is employed to eliminate blocking during data uploads. Through these designs, this class maximizes hardware utilization (excluding hyper-threading considerations) and achieves performance far exceeding that of vanilla Minecraft.
68
70
71
+
<details>
72
+
<summary>NeoInstancedRenderManager.java</summary>
73
+
69
74
```java
70
75
// The import statements at the beginning of classes have been omitted.
71
76
@@ -385,7 +390,9 @@ public class NeoInstancedRenderManager {
`MultiThreadedEqualObjectLinkedOpenHashSetQueue` is a multithreaded container, essentially composed of an array of `ObjectLinkedOpenHashSet`.
391
398
@@ -399,6 +406,9 @@ Specifically:
399
406
400
407
Building on these features, the container class described below was created to meet MadParticle’s high-performance processing needs.
401
408
409
+
<details>
410
+
<summary>NeoInstancedRenderManager.java</summary>
411
+
402
412
```java
403
413
// The import statements at the beginning of classes have been omitted.
404
414
@@ -634,4 +644,184 @@ public class MultiThreadedEqualObjectLinkedOpenHashSetQueue<E> implements Queue<
634
644
CompletableFuture.allOf(futures).join();
635
645
}
636
646
}
637
-
```
647
+
```
648
+
649
+
</details>
650
+
651
+
652
+
## NotEnoughBandwidth
653
+
654
+
NotEnoughBandwidth (NEB) is a project focused on optimizing network traffic. In vanilla Minecraft, most packets carry less than 10 bytes of actual payload, while a large portion of bandwidth is wasted on TCP headers and application-layer headers. In areas where bandwidth is costly, the vanilla networking mechanism creates significant financial pressure forMinecraft server owners.
655
+
656
+
NEB aggregates game packets in short intervals, removes redundant headers, replaces string-based packet identifiers with integer indexes, and introduces improved ZSTD compression. These approaches greatly reduce the network bandwidth usage of Minecraft servers.
657
+
658
+
In the test dataset, NEB can reduce packet bandwidth consumption to 4.4% of vanilla Minecraft; even when compared with vanilla’s built-in gzip compression, it still uses only 11% of the original bandwidth.
659
+
660
+
| method |C2S(byte) |S2C(byte) | compress ratio (to raw) | compress ratio (to gzip) |
| net package amount (aggregated) |28,484|38,949|3.27%||
669
+
670
+
NEB has undergone multiple rounds of testing on real multiplayer servers. In production environments, the measured compression ratio typically fluctuates between 14% and 18%, fully achieving its intended design goals.
671
+
672
+
<p style={{textAlign:"center"}}>
673
+
<img src={require('./assets/neb0.png').default} alt="NEB raw data" style={{zoom:0.8}} />
`PacketAggregationPacket.java` is one of the core components of NEB. By introducing a new type of network packet and implementing most relevant logic within it, NEB can perform network optimizations transparently with almost no impact on the behavior of other mods.
681
+
682
+
683
+
<details>
684
+
<summary>PacketAggregationPacket.java</summary>
685
+
686
+
```java
687
+
/**
688
+
* @author USS_Shenzhou
689
+
*/
690
+
@MethodsReturnNonnullByDefault
691
+
public class PacketAggregationPacket implements CustomPacketPayload {
0 commit comments