Skip to content

Commit 189f5f8

Browse files
docs: add site (#592)
1 parent 0f41061 commit 189f5f8

38 files changed

+4743
-35
lines changed

.github/workflows/deploy.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Deploy VitePress site to Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
- name: Setup Node
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: 20
29+
cache: npm
30+
- name: Setup Pages
31+
uses: actions/configure-pages@v4
32+
- name: Install dependencies
33+
run: npm ci
34+
- name: Build with VitePress
35+
run: npm run docs:build
36+
- name: Upload artifact
37+
uses: actions/upload-pages-artifact@v3
38+
with:
39+
path: docs/.vitepress/dist
40+
41+
deploy:
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
needs: build
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/.vscode
2+
node_modules/
3+
docs/.vitepress/cache
24
/target
35
.env
46
*.webm

Cargo.lock

Lines changed: 29 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ members = [
2525
'crates/hyperion-stats',
2626
'crates/hyperion-text',
2727
'crates/hyperion-utils',
28-
'events/proof-of-concept',
28+
'events/tag',
2929
'crates/hyperion-permission',
3030
'crates/hyperion-clap',
3131
'crates/hyperion-command',

crates/hyperion-proto/src/server_to_proxy.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ pub struct BroadcastGlobal<'a> {
2525
}
2626

2727
#[derive(Archive, Deserialize, Serialize, Clone, PartialEq)]
28-
// #[rkyv(derive(Debug))]
2928
pub struct BroadcastLocal<'a> {
3029
pub center: ChunkPosition,
3130
pub exclude: u64,
@@ -36,7 +35,6 @@ pub struct BroadcastLocal<'a> {
3635
}
3736

3837
#[derive(Archive, Deserialize, Serialize, Clone, PartialEq)]
39-
// #[rkyv(derive(Debug))]
4038
pub struct Unicast<'a> {
4139
pub stream: u64,
4240
pub order: u32,
@@ -50,7 +48,6 @@ pub struct Unicast<'a> {
5048
pub struct Flush;
5149

5250
#[derive(Archive, Deserialize, Serialize, Clone, PartialEq)]
53-
// #[rkyv(derive(Debug))]
5451
pub enum ServerToProxyMessage<'a> {
5552
UpdatePlayerChunkPositions(UpdatePlayerChunkPositions),
5653
BroadcastGlobal(BroadcastGlobal<'a>),

docs/.vitepress/benchmarks.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Hyperion Minecraft Engine
2+
3+
## Overview
4+
5+
Hyperion is a custom Minecraft game engine designed for building scalable, high-performance game modes and events.
6+
Unlike traditional Minecraft server implementations, Hyperion takes a ground-up approach to game mechanics through its
7+
plugin-first architecture.
8+
9+
## Key Features
10+
11+
### Plugin-First Architecture
12+
13+
Hyperion starts with minimal base features and implements game mechanics through a fundamental plugin system. This
14+
approach differs from traditional Minecraft servers that modify vanilla implementations:
15+
16+
- Core mechanics like combat are implemented as plugins
17+
- Easily swap between different combat systems (e.g., 1.8 vs modern combat)
18+
- Flexible customization without complex patching of vanilla code
19+
20+
### Entity Component System (ECS)
21+
22+
Hyperion utilizes [Flecs](https://github.com/SanderMertens/flecs), an Entity Component System, as its core architecture:
23+
24+
- Entities are organized in a table-like structure
25+
- Rows represent individual entities
26+
- Columns represent components (e.g., health, position)
27+
- Systems process entities through efficient iterations
28+
- Components can be dynamically added (e.g., LastAttacked component for combat)
29+
- For a more accurate representation of an ECS, see the [ECS FAQ](https://github.com/SanderMertens/ecs-faq)
30+
31+
### Performance Optimization
32+
33+
#### Parallel Processing
34+
35+
The ECS architecture enables efficient parallel processing:
36+
37+
- Entities are automatically partitioned across available threads
38+
- Systems can process multiple entities simultaneously
39+
- Automatic handling of dependencies and thread safety
40+
- Optimal resource utilization while maintaining data consistency
41+
42+
:green{hola} oi
43+
44+
#### Proxy Layer
45+
46+
Performance bottlenecks are addressed through a sophisticated proxy system:
47+
48+
- Horizontally scaled proxy layer
49+
- Vertically scaled game server
50+
- Efficient packet broadcasting:
51+
- Global broadcast capabilities
52+
- Regional broadcasting for proximity-based updates
53+
- Optimized movement packet distribution
54+
55+
### Scalability
56+
57+
Hyperion is designed to handle large-scale events efficiently:
58+
59+
- Support for up > 10,000 concurrent players
60+
- Performance constraints:
61+
- 20 ticks per second (50ms per tick)
62+
- Optimized processing within timing constraints
63+
- Visibility optimization:
64+
- Configurable player render limits (400-700 players)
65+
- Customizable nametag visibility
66+
- Moderator-specific viewing options
67+
68+
## Technical Considerations
69+
70+
### Performance Management
71+
72+
- FPS optimization through selective rendering
73+
- Nametag rendering management for performance
74+
- Regional packet distribution to reduce network load
75+
- Modular performance settings for different user roles
76+
77+
### Resource Utilization
78+
79+
- 50ms processing window per tick
80+
- Balanced distribution of computational resources
81+
- Efficient handling of IO operations through proxy layer
82+
- Optimized packet management for large player counts
83+
84+
## Use Cases
85+
86+
Hyperion is ideal for creating custom Minecraft experiences similar to popular servers like Hypixel or Mineplex, where
87+
vanilla mechanics can be completely customized to create unique game modes and events.
88+
89+
## Getting Started
90+
91+
Developers interested in using Hyperion should familiarize themselves with:
92+
93+
- Entity Component Systems (particularly Flecs)
94+
- Minecraft networking protocols
95+
- Parallel processing concepts
96+
- Plugin development principles

docs/.vitepress/config.mts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import {defineConfig} from 'vitepress'
2+
3+
import {withMermaid} from 'vitepress-plugin-mermaid';
4+
5+
6+
// https://vitepress.dev/reference/site-config
7+
const config = defineConfig({
8+
title: "Hyperion",
9+
description: "The most advanced Minecraft game engine built in Rust",
10+
themeConfig: {
11+
// https://vitepress.dev/reference/default-theme-config
12+
nav: [
13+
{text: 'Home', link: '/'},
14+
{text: 'Guide', link: '/guide'},
15+
],
16+
17+
sidebar: [
18+
{
19+
text: 'Guide',
20+
items: [
21+
{text: 'Introduction', link: '/guide/introduction'},
22+
{text: 'Architecture', link: '/guide/architecture'},
23+
]
24+
}
25+
],
26+
socialLinks: [
27+
{icon: 'github', link: 'https://github.com/vuejs/vitepress'}
28+
]
29+
}
30+
})
31+
32+
33+
export default withMermaid(config);
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<script setup>
2+
import { computed, defineProps } from 'vue'
3+
4+
const props = defineProps({
5+
target: {
6+
type: String,
7+
required: true
8+
},
9+
style: {
10+
type: String,
11+
default: 'atom-one-dark'
12+
},
13+
height: {
14+
type: String,
15+
default: '434px'
16+
}
17+
})
18+
19+
const iframeUrl = computed(() => {
20+
const params = new URLSearchParams({
21+
target: props.target,
22+
style: props.style,
23+
type: 'code',
24+
showBorder: 'on',
25+
showLineNumbers: 'on',
26+
showFileMeta: 'on',
27+
showFullPath: 'on',
28+
showCopy: 'on'
29+
})
30+
return `https://emgithub.com/iframe.html?${params.toString()}`
31+
})
32+
</script>
33+
34+
<template>
35+
<iframe
36+
:src="iframeUrl"
37+
frameborder="0"
38+
scrolling="no"
39+
:style="{ width: '100%', height }"
40+
allow="clipboard-write"
41+
class="github-snippet"
42+
></iframe>
43+
</template>
44+
45+
<style scoped>
46+
.github-snippet {
47+
padding: -100px -100px -100px 0;
48+
border-radius: 8px;
49+
}
50+
51+
@media (max-width: 640px) {
52+
.github-snippet {
53+
margin: 12px -16px;
54+
}
55+
}
56+
</style>

docs/.vitepress/theme/custom.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* .vitepress/theme/custom.css */
2+
.green-tps {
3+
color: #4ade80; /* You can change this to any green color you prefer */
4+
}

docs/.vitepress/theme/index.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// .vitepress/theme/index.js
2+
import DefaultTheme from 'vitepress/theme'
3+
4+
import GithubSnippet from './components/GithubSnippet.vue'
5+
import './custom.css'
6+
7+
// import {NolebaseInlineLinkPreviewPlugin} from '@nolebase/vitepress-plugin-inline-link-preview/client';
8+
9+
10+
// export default DefaultTheme
11+
12+
export default {
13+
...DefaultTheme,
14+
enhanceApp({app}) {
15+
app.component('GithubSnippet', GithubSnippet)
16+
}
17+
};

0 commit comments

Comments
 (0)