[Mod] Cellular Automata [0.1.2] [automata]

User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

[Mod] Cellular Automata [0.1.2] [automata]

by bobomb » Post

A minetest mod for creating, importing and growing various cellular automata, including Conway's Game of Life and procedural giant trees -- now with pleasing sounds keyed to the pattern growth stats and timing!

Image

This mod adds two new blocks and a tool:
1. an Active and Inactive Automata Cell
2. a Remote Control tool for triggering activation of cells according to 1D, 2D and 3D cellular automata rules, Importing of Game of Life .LIF files, and pausing resuming patterns.
3. a chat command (//owncells) to follow up WorldEdit commands such as //replace, //set. //mix, //load etc. Used to recover orphaned cells, create random fields, save and load patterns, and convert terrain and in-world objects into cells ready to activate with the remote.

Explanatory video at https://www.youtube.com/watch?v=DSBbuvQmhwY and the readme.md included in the mod is also thorough. Most recently a new tab has been added to the remote control to adjust the settings of an example of a non-totalistic 3D automata to create giant trees complete with roots, leaves and fruit.

Mod dependencies: worldedit (optional for certain features)
Mod only tested with Minetest v.0.4.12
Author: bobomb
License of code and textures WTFPL
(Included .LIF file collection by Alan Hensel, Game of Life patterns generally attributed to original discoverers)

repository: https://github.com/bobombolo/automata (has a full readme with screenshots)
zip: https://github.com/bobombolo/automata/a ... master.zip (always current)
Last edited by bobomb on Fri Mar 10, 2023 17:25, edited 18 times in total.

User avatar
cd2
Member
Posts: 562
Joined: Mon Jun 01, 2015 06:30
GitHub: cdqwertz
In-game: cd cd2
Location: Linux
Contact:

Re: Cellular Automata

by cd2 » Post

looks amazing!

User avatar
Kilarin
Member
Posts: 894
Joined: Mon Mar 10, 2014 00:36
GitHub: Kilarin

Re: Cellular Automata

by Kilarin » Post

Wow, cool! I remember writing and playing life back in the 80's! :)

User avatar
cd2
Member
Posts: 562
Joined: Mon Jun 01, 2015 06:30
GitHub: cdqwertz
In-game: cd cd2
Location: Linux
Contact:

Re: Cellular Automata

by cd2 » Post

Kilarin : yea, I did that too :D

User avatar
Krock
Developer
Posts: 4649
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: Cellular Automata

by Krock » Post

But... the game of life uses way too many block modification operations, please use the VoxelManipulator to give low-end computers a chance to display it.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

Re: Cellular Automata

by bobomb » Post

yes i will be learning voxelmanip next. I think it will solve several of my problems.
also game of life entities that enter a steady-state need to be removed from the abm.
there are lots of other optimizations that need to be made, i'm just getting started.

User avatar
cd2
Member
Posts: 562
Joined: Mon Jun 01, 2015 06:30
GitHub: cdqwertz
In-game: cd cd2
Location: Linux
Contact:

Re: Cellular Automata

by cd2 » Post

bobomb : try to study paramat`s Mapgen framework/example [noise23]
It helped me a lot!

User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

Re: Cellular Automata

by bobomb » Post

cd2:
I will, though this isn't really a mapgen mod. Even the very large patterns grow a layer at a time and watching them grow is most of the appeal. I am reading up on voxelmanip and planning a rewrite this week. see: https://github.com/bobombolo/automata/issues/2

What parts of that mapgen framework are you specifically thinking I should look at?

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: Cellular Automata

by paramat » Post

CA need to use the non-mapgen voxelmanip, which uses different code, see my catacomb mod as an example https://github.com/paramat/catacomb of ABMs triggering the processing of defined volumes.

However ABMs have random timing, perhaps better to just loop the code so it runs as fast as it can.

Reading your post in the LVM thread, it's best to not use metadata because the LVM can only read/process/write content-id, param1 or param2. The fastest method would be to have several different CA nodes and process only content-ids.
For detecting the extent of CA nodes, perhaps better to store the limits of the startng volume and just process this plus 1 node on all sides. Each generation: if a node is placed outside the volume them increase that limit by 1 node. This way you will always know the exact volume of CA nodes you need to process with the LVM

User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

Re: Cellular Automata

by bobomb » Post

paramat wrote:CA need to use the non-mapgen voxelmanip, which uses different code, see my catacomb mod as an example https://github.com/paramat/catacomb of ABMs triggering the processing of defined volumes.
However ABMs have random timing, perhaps better to just loop the code so it runs as fast as it can.
that is what I am doing in my current rewrite. I have some strategies to mitigate lag, i can't really use ABMs. I think I see what you are doing in catacomb. need to study further
paramat wrote: Reading your post in the LVM thread, it's best to not use metadata because the LVM can only read/process/write content-id, param1 or param2. The fastest method would be to have several different CA nodes and process only content-ids.
i tried this already but it means a node type for each combination of rules. I have moved completely away from metadata in the current rewrite except for setting one identifier which i planned to use to persist active patterns to a file. i was under the impression that LVM would deal with meta, so I will find another way. persisting to a file is a secondary objective for me anyway. I have the mod down to two node types and an activator tool.
paramat wrote: For detecting the extent of CA nodes, perhaps better to store the limits of the startng volume and just process this plus 1 node on all sides. Each generation: if a node is placed outside the volume them increase that limit by 1 node. This way you will always know the exact volume of CA nodes you need to process with the LVM
Even before I start using LVM I have started to track the pmin and pmax of each pattern at start and each iteration, should make the transition to LVM easy...

you can see my progress at https://github.com/bobombolo/automata/tree/development

thanks for the input

User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

Re: Cellular Automata

by bobomb » Post

still haven't started using lvm but latest version 0.0.3 has node, tool and formspec definitions that are much more refined and getting towards a final version. Importing of Life entities finally supported, ships with a large collection of .LIF files to play with. Ability to trigger a single node to current location (ie, in the sky). Still no persistence on game exit / restart.

User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

Re: Cellular Automata

by bobomb » Post

version 0.0.4 has some new features, again a much more useful form, management tab, 1D automata, 3D automata, and other new features.

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: [Mod] Cellular Automata [0.0.4] [automata]

by paramat » Post


User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

Re: [Mod] Cellular Automata [0.0.4] [automata]

by bobomb » Post


User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

Re: Cellular Automata

by bobomb » Post

Krock wrote:But... the game of life uses way too many block modification operations, please use the VoxelManipulator to give low-end computers a chance to display it.
This has now been completed. No Advanced Block Modifier is used and VM has been fully implemented.

Message to all: please test this mod, particularly the multiplayer functionality (manage tab) and how it runs on a server. Also open to any suggestions on improving the efficiency of the growth algorithm.

For version 0.1.0 I plan to have several more features such as persistence, importing / exporting improvements, some form improvements for people used to NKS nomenclature, and possibly an admin tab. Also at this time any rule that uses 0-neighbor birth is inaccurate as 0-neighbor birth is simply ignored. I plan to solve this issue before v.0.1.0.

For those truly interested in cellular automata a recently added feature, stepwise growth (in the manage tab you can add extra generations to any finished pattern, as well as pause/resume) might interest you.

a 3D pattern started from a single cell (18neighbor 0,3,5/1,3,8)

Image

NKS rule 30 in RAINBOW mode... grown in -Y

Image

A 2D pattern finished in mese (8 neighbor, 01234/14) grown in X

Image

User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

Re: [Mod] Cellular Automata [0.0.8] [automata]

by bobomb » Post

Request for education: Re: voxel areas and indexes:

Is it possible to mathematically convert indexes from one extent to a different extent as long as the nodes to be converted are in both extents (the overlapping area)? My intent is to eliminate a costly conversion from area1 indexes, into positions {x,y,z} and then back into area2 indexes. This is due to the fact that the extent of the pattern changes each iteration. I have eliminated as much of this as possible by storing both indexes and positions in the pattern's cell table but I would like to completely eliminate it if possible.

It occurs to me that learning about the .mts format and importing/exporting to that format might be another way to refactor the growth function more efficiently at the same time as accomplishing the goal of providing better import/export functionality...

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: [Mod] Cellular Automata [0.0.8] [automata]

by paramat » Post

Wow, nice. I will think on your question.

User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

Re: [Mod] Cellular Automata [0.0.8] [automata]

by bobomb » Post

when an extent is created, what is the base index number, which should be 1, but is always in the thousands, based on?

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: [Mod] Cellular Automata [0.0.8] [automata]

by paramat » Post

> Is it possible to mathematically convert indexes from one extent to a different extent as long as the nodes to be converted are in both extents

Maybe but it will still be complex, and therefore very slow in lua, it's best to use the c++ voxelarea area.index(p) api as much as possible.

Whenever you work with a particular volume, the actual emerged voxelmanip volume (emin, emax) is the volume of complete mapblocks (16^3 with origin at (0,0,0)) that contains your requested volume.
The voxelmanip index is relative to this volume of complete mapblocks, which is why the index number is large for the first position in your requested volume.

So, the emerged voxelmanip volume only changes it's volume when your structure crosses a mapblock border, so the index for a cell only changes then, you only need too recalculate the index when a border is crossed, not every iteration.
Also, you only need to create a new voxelmanip volume when a border is crossed, because it will be identical until a border is crossed.

User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

Re: [Mod] Cellular Automata [0.1.0] [automata]

by bobomb » Post

version 0.1.0 released. active development will largely halt now. please report bugs here. Will post a video within next few days.

User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

Re: [Mod] Cellular Automata [0.1.0] [automata]

by bobomb » Post


User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

Re: [Mod] Cellular Automata [0.1.0] [automata]

by bobomb » Post

help testing processing time:
my standard patterns for testing efficiency are:
singlenode map, start 3 patterns from single cell in space (obviously), growth: 1, destruct mode on, trail: stone, final: mese
1D pattern, rule 30, main axis: x, growth axis z, 100 generations (should end with 103 cells)
2D pattern, 8 neighbors, rule 01234/14 growth axis y 50 generations (should end with 3776 cells)
3D pattern, 18 neighbors, rule 0,3,5/1,3,8, 30 generations (should end with 36460 cells)
- i start these one after the other not waiting for one to finish before triggering the next

the current total growth times (readable from the manage tab) are:
1D: 25145ms
2D: 46831ms
3D: 19770ms

please let me know your results

User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

Re: [Mod] Cellular Automata [0.1.0] [automata]

by bobomb » Post

how do i get this mod to show up in the mod store?

User avatar
Blockhead
Member
Posts: 1622
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: [Mod] Cellular Automata [0.1.0] [automata]

by Blockhead » Post

bobomb wrote:
Sun Jan 15, 2023 22:25
how do i get this mod to show up in the mod store?
https://content.minetest.net/user/login/
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

Re: [Mod] Cellular Automata [0.1.0] [automata]

by bobomb » Post

i have submitted this mod for approval

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests