Skip to content

Commit a01e6c7

Browse files
mja00Cherry
andauthored
feat: proper hytale renders (#133)
Co-authored-by: James Ross <james@jross.me>
1 parent da6e39a commit a01e6c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+24190
-1586
lines changed

.env.example

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Upload method configuration
2+
# Options: "http" (default) or "s3"
3+
# http: Uses the HTTP endpoint (requires running wrangler dev)
4+
# s3: Uses S3-compatible protocol to upload directly to R2
5+
UPLOAD_METHOD=s3
6+
7+
# HTTP endpoint configuration (used when UPLOAD_METHOD=http)
8+
# Default is http://localhost:8787/upload-asset
9+
UPLOAD_ENDPOINT=http://localhost:8787/upload-asset
10+
11+
# S3/R2 configuration (required when UPLOAD_METHOD=s3)
12+
# Get these values from your Cloudflare R2 dashboard
13+
R2_ENDPOINT=https://<your-account-id>.r2.cloudflarestorage.com
14+
R2_ACCESS_KEY_ID=your-access-key-id
15+
R2_SECRET_ACCESS_KEY=your-secret-access-key
16+
R2_BUCKET=hytale-assets
17+
18+
# Optional: Prefix to prepend to all S3 keys
19+
# Example: Set to "assets/" to upload files as "assets/Common/Characters/skin.png"
20+
# Leave empty to upload files directly at the bucket root
21+
R2_KEY_PREFIX=

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
dist
22
node_modules
33
target
4-
pkg
4+
pkg

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@ node_modules/
1111
.idea
1212
.wrangler/
1313
dist/
14+
src/hytale-skin-renderer/target/
15+
.env
16+
17+
# Localflare generated files
18+
.localflare/

Cargo.lock

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

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ cfg-if = "1.0"
1313
wasm-bindgen = "0.2"
1414
js-sys = "0.3.77"
1515
imageproc = { version = "0.25.0", default-features = false }
16+
hytale-skin-renderer = { path = "./src/hytale-skin-renderer", default-features = false, features = [
17+
"wasm",
18+
] }
1619

1720
# The `console_error_panic_hook` crate provides better debugging of panics by
1821
# logging them with `console.error`. This is great for development, but requires

assets/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Assets
2+
3+
This directory contains extracted game assets used by Crafthead.
4+
5+
## Hytale Assets
6+
7+
To extract Hytale assets, use the `extract-hytale-assets.ts` script.
8+
9+
### Prerequisites
10+
11+
- Node.js 24 or higher
12+
- Hytale Assets.zip file
13+
14+
### Extraction Methods
15+
16+
#### Method 1: Place zip file in assets folder (Recommended)
17+
18+
1. Place `Hytale Assets.zip` in the `assets/` folder
19+
2. Run the extraction script:
20+
```bash
21+
npm run extract-hytale-assets
22+
```
23+
24+
#### Method 2: Automatic Windows detection
25+
26+
On Windows, the script will automatically detect if Hytale is installed and use the Assets.zip from the default installation location:
27+
- `%APPDATA%\Hytale\install\release\package\game\latest\Assets.zip`
28+
29+
Simply run:
30+
```bash
31+
npm run extract-hytale-assets
32+
```
33+
34+
### Configuring Extraction Patterns
35+
36+
The script extracts files based on glob patterns defined in `scripts/extract-hytale-assets.ts`. To modify which files are extracted, edit the `GLOB_PATTERNS` array in that file.
37+
38+
Current patterns extract:
39+
- Character Creator JSON files
40+
- Blocky model files (`.blockymodel`)
41+
- Character PNG textures
42+
- Cosmetics PNG textures
43+
- Tint gradient PNG files
44+
45+
### Output
46+
47+
Extracted files are placed in `assets/hytale/` preserving the original directory structure from the zip file.

assets/hytale/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Common/
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[
2+
{
3+
"Id": "Default",
4+
"Model": "Characters/Player.blockymodel",
5+
"Name": "avatarCustomization.bodyCharacteristics.Default.name",
6+
"GradientSet": "Skin",
7+
"GreyscaleTexture": "Characters/Player_Textures/Player_Greyscale.png",
8+
"IsDefaultAsset": true
9+
},
10+
{
11+
"Id": "Muscular",
12+
"Model": "Characters/Player.blockymodel",
13+
"Name": "avatarCustomization.bodyCharacteristics.Muscular.name",
14+
"GradientSet": "Skin",
15+
"GreyscaleTexture": "Characters/Player_Textures/Player_Muscular_Greyscale.png"
16+
}
17+
]

0 commit comments

Comments
 (0)