Git Product home page Git Product logo

ndcell's Introduction

NDCell Release badge Tests badge Discord badge

NDCell logo

Any number of dimensions
Any neighborhood range
Any computable transition function

Simulate any deterministic cellular automaton

A fast, flexible, and feature-rich interactive multidimensional cellular automaton simulator written in Rust.

Downloads

Download the latest release.

To build NDCell yourself, see BUILDING.md.

Screenshots

Click to view full resolution / play video.

Gosper's Glider Gun simulated for 57 generations Catacryst simulated for 7.9 million generations WireWorld primes calculator simulated for 2.9 million generations, displaying the number 23 3D WireWorld XOR gate supporting 3-micron signals

What works right now

  • 2D and 3D rendering, simulation, and editing
  • Copy/paste
  • Save/load files

See the Changelog for the latest list of features.

What's planned for the future

In roughly descending order of priority/likelihood:

  • Everything on the short-term to-do list
  • Arbitrary range and neighborhood within a reasonable limit.
  • Custom symmetries with different cell states for each orientation. Any symmetry can be used in part or all of the transition function.
  • Custom colors and icons with several built-in presets and primitives.
  • Custom 3D models with several built-in presets and primitives.
  • Lua scripting for custom rule generators and other plugins.
  • Command-line interface for use in scripts and other automated tools.
  • Anywhere from 4 to 6 spatial dimensions supported via CLI.
  • 2D and 3D spacetime for 1D and 2D rules respectively.
  • Spacetime residue - Rules will be able to define several arbitrary "spacetime residues" (linear combination of spatial and temporal positions, modulo some value) available for use in the transition function, within some reasonable limit. This means a rule like Busy Boxes would only need 2 states instead of 7.
  • Block CA such as Margolus - This would be possible anyway with the spacetime residues above (using x + time mod 2 and y + time mod 2), but native support would improve ergonomics.
  • Custom regular tilings including hexagonal and triangular neighborhoods.
  • Reversible CA - "Go back in time" in a reversible CA, if an inverse transition function is defined.
  • Grid topology - Each axis will be able to be infinite, half-infinite, finite, looped (torus), looped with an offset (twisted torus), or flipped (Möbius loop),
  • Infinite agars and native support for "B0" rules

What's NOT planned for the future

These are things that NDCell will probably never support, in rough order from least likely to most likely:

  • More than 256 states - Original plans for NDCell included up to 2^64 states, but this particular generalization has proved much harder to support than arbitrary range or number of dimensions without significantly harming memory usage and speed for automata with 256 states or fewer, which comprise the vast majority of CA. Hopefully other features like spacetime residue will be able to curb the number of states required for most automata.
  • LtL and other "continuous" CA - Although NDCell can simulate LargerThanLife with smaller neighborhoods, continuous CA are better simulated using GPGPU. Ready is a fantastic simulator for such automata written by the Golly Gang.
  • Nondeterministic CA - Nondeterministic CA are incompatible with HashLife, which NDCell relies on for efficient simulation. It's possible that NDCell will support non-hashing simulation in the future, but nondeterministic CA would still require significant work to make usable.

Contributing

NDCell is currently under very rapid development, and a lot of things are in flux. Bug reports/fixes and minor feature requests are welcome, either via Discord or the issues tracker, but the project is currently not in a position to accept larger contributions. Ideas and feedback are always welcome on the Discord server.

License

Licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

ndcell's People

Contributors

btbd avatar hactarce avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

isgasho heav-4

ndcell's Issues

Gridlines disappear at screen edge

Steps to reproduce:

  1. Open NDCell
  2. Do not resize the window
  3. Zoom in all the way
  4. Pan one pixel to the left

The rightmost vertical gridline disappears

Support turmite rulestrings

Tentative notation

[ and ] represent literal characters. < and > do not.

  • <turmite type>[<transitions per internal state>]
  • <turmite type> is Turmite, AbsoluteTurmite, TriTurmite, or HexTurmite
  • <transitions per internal state> is a |-separated list of <transitions per tile state>
  • <transitions per tile state> is a ,-separated list of <transition>
  • <transition> is <new tile state><directions>
  • <new tile state> is a non-negative integers less than the number of tiles
  • <directions> is a list of <direction> with no separator
    • If no directions are listed, the turmite disappears
    • If multiple directions are listed, the turmite is cloned
  • <direction> is a relative or absolute direction (depending on the type of turmite) optionally followed by a 3D orientation change optionally followed by a new internal state, which is a non-negative integer less than the number of internal states

Relative directions

  • F = forwards (no turn)
  • B = backwards (180 turn left/right)
  • L = left
  • R = right
  • U = up
  • D = down

Absolute directions

  • E = east
  • W = west
  • N = north
  • S = south
  • U = up
  • D = down

3D orientation changes

  • l = roll 90 degrees counterclockwise
  • r = roll 90 degrees clockwise
  • f = roll 180 degrees

Examples

  • Langton's Ant: Turmite[1R,0L]
  • Langton's LLRR Ant: Turmite[1R,2R,3L,0L]
  • Highway 2074575: AbsoluteTurmite[1N1,1W0|0S1,1N1|1S3,1S2|0N2,0E1]

Other considerations

3D orientation may be determined by using the previous "forward" direction of the turmite as the new "up" direction.

It may be worth creating a more concise Ant[...] generator with limited capabilities.

See also:

Add another "single state" variable to ND-tree node

Currently there is a field, single_state: Option<u8> that holds None if the node contains more than one cell state value or Some(state) if all cells in the node have state state.

I'd like to retype this field to the enum:

enum CellsSummary {
    /// All cells have the same state.
    SingleState(u8),
    /// There is a mix of zero and nonzero cells; all nonzero cells have the same state.
    SingleNonzeroState(u8),
    /// There are multiple nonzero cell states.
    Mixed,
}

This will enable rendering while zoomed to can include colors even in sparsely populated regions.

2D selection occasionally renders with extra cells

Steps to reproduce:

  1. Draw a rectangle of cells from [-36, 47] to [-35, 40] (inclusive)
  2. Select the rectangle of cells from [-36, 47] to [-35, 40] (inclusive)
  3. Click and drag on the selection of cells to move them

This produces the following strange artifacts (the grid is empty except for the selection):
image

2D selection resize-to-cell is buggy with 1x1 selection

Steps to reproduce:

  1. Create a 1x1 selection in 2D
  2. Hold ctrl+shift to show selection resize preview
  3. Move the mouse to the north and/or east of the selection

Expected behavior: resize preview is shown as expected, same as with 2x2 selection.

Actual behavior: resize preview does not extend beyond the northeast corner of the selection.

This behavior appears along each axis indepedently; e.g. a 1x2 selection is glitchy along one axis, but not the other.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.