Skip to main content

VIVIA โ€” MeMLP Neural Network

Overviewโ€‹

MeMLP (Modular embedded Multi-layer Perceptron Model) is the neural network stack embedded directly in the VIVIA engine. It runs 100% on CPU, in-process, with no GPU, no cloud, no external runtime.

Architectureโ€‹

ModuleShapeTask
vegetation8 โ†’ 24 โ†’ 16 โ†’ 4flower / fern / stick / pebble placement
biome8 โ†’ 12 โ†’ 9biome classification (9 world biomes)
texture8 โ†’ 12 โ†’ 6procedural texture-style selection
motion8 โ†’ 16 โ†’ 6creature animation parameters (sigmoid output)

Total: ~3,400 parameters ยท Checkpoint size: ~14 KB JSON ยท Inference: 0.01 ms

Feature Vector (8 dimensions)โ€‹

[0] terrain_height โ€” normalised 0..1
[1] terrain_slope โ€” 0 flat, 1 vertical
[2] biome_temperature โ€” from embedded NASA climatology
[3] biome_humidity โ€” from embedded NASA climatology
[4] water_distance โ€” proximity to water
[5] vegetation_count โ€” nearby plant density
[6] light_level โ€” sun exposure
[7] noise_seed โ€” procedural variation

Training Pipelineโ€‹

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Synthetic Data โ”‚โ”€โ”€โ”
โ”‚ (heuristic) โ”‚ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”œโ”€โ”€โ–บ MeMLP Training Loop โ”€โ”€โ–บ Checkpoint Save
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ (online, background thread)
โ”‚ Open-Meteo API โ”‚โ”€โ”€โ”˜
โ”‚ (real weather) โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  • Online training: background thread, 100 samples/epoch
  • Loss function: cross-entropy (vegetation, biome, texture) + MSE (motion)
  • Optimiser: SGD with gradient clipping, weight decay, NaN sanitisation
  • Learning rate: 0.01 with decay every 1000 epochs
  • Legacy migration: old single-hidden-layer checkpoints auto-upgraded

Motion Head (Creature Animation)โ€‹

The motion module outputs 6 continuous parameters (0..1, sigmoid) that drive live creature animation:

ChannelParameterEffect
0gait_ampLeg swing amplitude
1gait_freqStep frequency multiplier
2breathTorso breathing depth
3tail_wagTail sway amount
4head_dipGrazing/head-lowering
5hopVertical bounce (birds, fleeing)

Player Preference Learningโ€‹

The AI tracks player block placements and adjusts training targets to match the player's aesthetic preferences. This means the vegetation patterns adapt to each player's style over time.

Online Training (Open-Meteo)โ€‹

Real-world weather data from 8 global locations (Warsaw, Nairobi, Dubai, Amazonas, Reykjavik, Beijing, Sydney, London) feeds into training as climate features. Falls back to synthetic data when offline.

Testsโ€‹

12 MeMLP-specific tests covering:

  • Forward pass validity (probability distribution, sigmoid range)
  • Deterministic initialisation
  • Training loss decrease
  • Legacy checkpoint migration
  • Motion head independence (sigmoid vs softmax)
  • NaN/Inf survival
  • Roundtrip serialization