Skip to content

Tukyo/SaltPeter2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SaltPeter

A WebGPU pixel simulation game.

TypeScript WebGPU WGSL


SaltPeter is a pixel simulation game built on Nitrate — a custom WebGPU engine where every cell in the world is simulated in parallel on the GPU. Materials flow, react, burn, freeze, and dissolve with no shortcuts.

Inspired by the cellular automata of Noita and the open simulation philosophy of Cortex Command.

Algorithms & Techniques

One of the main goals in this project is to obtain a better understanding of game-engine subsystems and the processes that provide us as gamers with reliable behaviors during gameplay.

Concept Source Formula
Cellular Automata John Von Neumann $s_{t+1}(x,y) = f(s_t(x,y),\ \mathcal{N}(x,y))$
Chebyshev Distance Pafnuty Chebyshev $d(p,q) = \max(|p_x - q_x|,\ |p_y - q_y|)$
Lennard-Jones Potential John Edward Lennard-Jones $V(r) = 4\varepsilon\left[(\sigma/r)^{12} - (\sigma/r)^{6}\right]$
Graham Scan Ronald Graham $\text{cross}(A,B,C) = (B_x - A_x)(C_y - A_y) - (B_y - A_y)(C_x - A_x)$
Perlin Noise Ken Perlin $f(t) = 6t^5 - 15t^4 + 10t^3$
Worley Noise Steven Worley $F_1(\mathbf{x}) = \min_i\ d(\mathbf{x},\ \mathbf{x}_i)$
Ridged Multifractal Noise Ken Musgrave $n_i = 1 - |f(\mathbf{x} \cdot 2^i)|$
Dot Product Josiah Willard Gibbs $\mathbf{a} \cdot \mathbf{b} = \sum_i a_i b_i = |\mathbf{a}||\mathbf{b}|\cos\theta$
Coulomb Friction Charles-Augustin de Coulomb $F_f = \mu N$
Baumgarte Stabilization Joachim Baumgarte $Jv + \beta \frac{C}{\Delta t} = 0$
Bresenham's Circle Jack Elton Bresenham $d(x, y) = x^2 + y^2 - r^2$
Thermal conduction Joseph Fourier $q = -k\nabla T$
Euler's Identity Leonhard Euler $Δω += (r × n) * j / I$
Herringbone Wang Tiles Sean Barrett $E_i(d) = E_j(\bar d)$

Guides

Guides are available for the proprietary systems such as the Editor.

EDITOR GUIDE

Engine

Nitrate is the simulation engine powering this project — released separately under CC0, fully public domain.

src/engine/

Changelog

CHANGELOG

License

Scope License
Engine (src/engine/) CC0 1.0 Universal — public domain
Game (src/game/) All Rights Reserved

About

SaltPeter2 game and Nitrate engine.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages