Artificial Life

Today I was working on a self organizing data web, for displaying a graph of skills or powers in an RPG.
I was also thinking of using it for generating a game story, with branching paths and destinations…

Anyway, the current result is kind of quirky, I think I’m still doing something wrong, but it generates some quite nice graphs as long as the number of nodes isn’t too high.

Anyone else ever made any artificial life simulations?
It might be fun to have a kind of AL game jam here. I can think of a few other kinds of virtual life than can be simulated in the BGE.

If you want to try it out:
artificial_life.blend (437 KB)

When I worked on building a node layout for ‘Entropy, A Network Simulation’ (check the finished projects forum, I found that the best way to generate good webs was to place the nodes, then build a system connecting them (each node builds a connection to the nearest ‘n’ nodes with a bit ofvariation, and weighting to stop a node having too many connections.

However, that was in 3d, where I didn’t worry about overlapping roads.

Would this be good to procedurally generate a videogame?

Well the idea for this web was that given a set of nodes, each of which has n connections to other nodes, could a web be built and automatically arranged so that the most connected parts are closest to each other.

For instance in displaying a skill web some skills lead to other skills, or in a tech tree, there is a certain hierarchy branching out from an anchor or ancestor node. It’s kind of like the way cells or molecules self organize.

For a game a potential use could be procedurally generated story trees. You start at the anchor node, which could be your home village, and can then go to a neighboring node which might be a dungeon or a swamp or a city or whatever. From there you can go back to your village or you can carry on to another new node if you want.

Or even, like, procedural missions. Star Fox 64 style. Generate a randomized mission world based on random node data, and take the connected node data and apply that to secrets in the generated mission world to create branching paths.

Yes, if it can be cleaned up a bit it has some interesting potential uses. It uses simple rules to self generate, but I think it needs some more rules to clean itself a bit. For example start small and grow extra branching paths off of existing dead ends, or where two paths cross add a new node with relations with the nodes whose paths generated it.

I’ve considered making a simple game using the graph itself too, with enemies moving around the graph and the playe being able to jump from node to node avoiding enemies and picking up goodies, I think it would be a good “hacking” subgame, perhaps with some cells initially locked and requiring code keys, or virus type enemies spreading from node to node while losing or gaining strength. Perhaps it would be possible to dynamically change the graph during play by adding or removing links or nodes and have the graph update around you.

Would need to clean up the code and make it faster to run first though. :slight_smile:

I had some fun with this mini project. The final version is here:

artificial_life_update.blend (466 KB)

I switched over to dictionaries instead of lists, removed drawing lines to non-linked nodes and added the ability to move the anchor node using the mouse. Now you can drag the array around like a jelly fish. :slight_smile:

You can now click the right mouse button to regenerate the graph or the left button to clean it up, adding extra nodes at intersections and joining any orphan nodes on to the main group.

Have fun!

NOTE: If you try to clean up a graph but it requires the creation of too many new nodes, it will instead regenerate the graph. You can tell when a graph has been fully cleaned because all the nodes will turn blue.

For further development:
It’s possible to have the graph develop several hundred generations in a single tic and then apply graph cleaning to get a finished result as soon as you generate the graph.
As sdfgeoff said, it may be easier to just randomly place some nodes and then join them automatically.