Skip to content

piedoom/modsynth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

modsynth

modsynth is an implementation of model synthesis intended for use in interactive applications like games. It can take a grid of arbitrary data and synthesize new grids with local similarity. This is very similar/also known as "wave function collapse" (wfc).

Examples

Input samples

🟩🟩❎❎❎🟩🟩🟩🟩🟩    πŸŸͺπŸŸͺπŸŸͺπŸŸͺ⬜⬜🟩🟩🟩🟩
🟩❎🟦🟦🟦❎🟩🟩🟩🟩    πŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺ⬜⬜🟩🟩🟩
🟩❎🟦🟦🟦❎🏠🟩🟩🟩    πŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺ⬜⬜🟩🟩
🟩❎🟦🟦❎🟩🟨🟨🟩πŸŸͺ    πŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺ⬜⬜🟩
🟩❎🟦🟦❎🟨🟨🟩🟩🟩    πŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺ⬜⬜
🟩❎🟦🟦❎🟨🟩🟩🟩🟩    🟧πŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺ⬜
🟩❎🟦🟦❎🟩🟩🟩🟩🟩    🟧🟧πŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺ
🟩❎🟦🟦🟦❎🟩🟩🟩🟩    🟨🟧🟧πŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺ⬜
πŸŸͺ❎🟫🟫🟫❎🟩🟩🟩🟩    🟨🟧🟧πŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺ⬜⬜
🟩❎🟫🟫🟫❎🟩❎❎🟩    🟧🟧πŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺ⬜⬜🟩
🟩❎🟦🟦🟦❎❎🟦🟦❎    🟧πŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺ⬜⬜🟩🟩
🟩❎🟦🟦🟦❎🟦🟦🟦❎    πŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺ⬜⬜🟩🟩🟩
🟩❎🟦🟦🟦🟦🟦🟦❎🟩    πŸŸͺπŸŸͺπŸŸͺπŸŸͺ⬜⬜🟩🟩🟩🟩
🟩❎🟦🟦🟦🟦🟦❎🟩🟩    πŸŸͺπŸŸͺπŸŸͺ⬜⬜🟩🟩🟩🟩🟩
🟩❎🟦🟦🟦❎❎🟩🟩🟩    πŸŸͺπŸŸͺπŸšƒπŸšƒπŸšƒπŸšƒπŸšƒπŸšƒπŸšƒπŸŸ©
🟩🟩❎❎❎🟩🟩🟩πŸŸͺ🟩    πŸŸͺ⬜⬜🟩🟩🟩🟩🟩🟩🟩

Output

πŸŸͺ🟩🟨🟩πŸŸͺπŸŸͺπŸŸͺ🟩🟩🟩❎❎❎🟩πŸŸͺπŸŸͺ
πŸŸͺ⬜🟩❎🟩🟩πŸŸͺ⬜⬜⬜🟩🟩❎🟩πŸŸͺπŸšƒ
πŸŸͺπŸŸͺ⬜🟩πŸŸͺπŸŸͺ🟩🟩🟩🟩🟩🟩🟩🟨🟩🟩
πŸŸͺπŸŸͺπŸŸͺ🟩πŸŸͺπŸŸͺ❎🟩🟩🟩πŸŸͺ⬜⬜🟩πŸŸͺ🟩
πŸŸͺπŸšƒπŸšƒπŸšƒπŸŸ©πŸŸ©πŸŸ©πŸŸ©πŸŸ¨πŸŸ©πŸŸ©πŸŸ©πŸŸͺ⬜🟩🟩
πŸŸͺ🟩🟩🟩🟩🟩🟩❎🟩🟩🟩πŸŸͺπŸšƒπŸšƒπŸšƒπŸŸ©
πŸŸͺπŸŸͺπŸŸͺ🟩🟩🟩🟩🟩🟩πŸŸͺπŸŸͺ⬜⬜⬜⬜⬜
πŸŸͺ🟩πŸŸͺ⬜⬜⬜⬜⬜🟩πŸŸͺπŸŸͺ⬜🟩🟩πŸŸͺπŸŸͺ
πŸŸͺπŸŸͺπŸŸͺπŸŸͺ⬜⬜🟩🟩🟨🟩πŸŸͺ🟩🟩🟩πŸŸͺπŸŸͺ
πŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺ🟩🟩❎🟨🟩πŸŸͺ❎🟩πŸŸͺπŸŸͺπŸŸͺ
🟧🟧🟧🟧🟧πŸŸͺ🟩🟩🟩🟩🟩🟩🟨🟧🟧πŸŸͺ
🟨🟨🟨🟨🟧πŸŸͺπŸšƒπŸšƒπŸŸ©πŸŸͺπŸŸͺ❎🟩πŸŸͺπŸŸͺπŸŸͺ
🟩🟩🟨🟩πŸŸͺπŸŸͺ⬜⬜🟩🟩🟩🟩🟩πŸŸͺπŸŸͺπŸŸͺ
❎🟨🟧πŸŸͺπŸŸͺ⬜⬜⬜🟩❎❎❎🟩πŸŸͺ🟩πŸŸͺ
🟩🟩πŸŸͺπŸŸͺπŸŸͺπŸŸͺ🟩🟩🟩❎❎🟩🟩🟩🟩πŸŸͺ
πŸŸͺπŸŸͺπŸŸͺπŸŸͺπŸŸͺ🟩🟩❎🟩🟩🟩πŸŸͺπŸŸͺπŸŸͺπŸŸͺ⬜

Features / limitations

I want to implement everything here eventually.

  • synthesize from input samples (no need to specify constraints manually)
  • multiple sample support
    • multiple sample weight adjustments
  • detection of grid boundaries when calculating probabilities (see maze_2d example to see how the edge of the grid isn't properly synthesized)
  • simple backtracking
  • 3D support
  • generation with smaller segments
  • bevy integration

As it stands, it's pretty slow to generate and often fails, espcially at bigger sizes.

About

naive model synthesis in rust

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages