How dotpys/pgal works
Project Type and Purpose
• PGAL is a Procedural Generation Algorithm Library consisting of several C# class-library modules (PerlinNoise, SimplexNoise, RandomExtensions) plus two “consumer” applications:
– Benchmark (console app to measure PRNG & noise performance)
• Primary use cases:
– Provide reusable noise and PRNG algorithms to .NET developers.
– Allow live experimentation via the WebShowcase.
– Benchmark performance of different generators and algorithms.
File Structure
Top-level solution (PGAL.sln) includes five projects:
• RandomExtensions – core PRNG implementations (SplitMix64, Xoshiro variants).
• PerlinNoise – 2D/3D Perlin-noise algorithms, depends on RandomExtensions.
• SimplexNoise – Simplex-noise implementation, depends on RandomExtensions.
• Benchmark – console app referencing RandomExtensions and PerlinNoise/SimplexNoise for performance tests.
• WebShowcase – Blazor WASM app referencing PerlinNoise, SimplexNoise (and future Voronoi), with its own Node/TypeScript build pipeline and static wwwroot assets.
Build and deployment assets:
• .github/workflows/main.yml – CI build/test/deploy pipeline.
• package.json, tsconfig.json – front-end toolchain for WebShowcase.
• wwwroot/dist – compiled JS/TS graphics utilities (matrix.js).
README for Insights
• Lists supported algorithms (Perlin 2D/3D, Simplex) and future work (Voronoi).
• Provides a live demo link, indicating the need for static hosting of the Blazor app.
Main Components and Their Relationships
A. Core Library Layer
– RandomExtensions (PRNGs)
– PerlinNoise & SimplexNoise (depend on RandomExtensions)
B. Consumer Apps
– Benchmark Console App (references Core Library Layer)
– WebShowcase Blazor App (references Core Library Layer)
C. Front-end Build Pipeline (for WebShowcase)
– Node.js, TypeScript → compile matrix.js → output to wwwroot/dist
D. Deployment/CI
– GitHub Actions orchestrates build/test for all .NET projects and publishes WebShowcase to GitHub Pages.
Architectural Patterns and Principles
• Layered architecture: clear separation between algorithm libraries and apps that consume them.
• Single repository monolith with multiple .csproj projects – fosters coordinated versioning and CI.
• Blazor WebAssembly front-end: C# runs in-browser; static assets served by GitHub Pages.
• Build pipelines: MSBuild for .NET, npm/tsc for TypeScript assets.