Flow Graph Algorithms

  • Post published:June 23, 2022
  • Post comments:0 Comments

While working on alpha v0.0.1b (you can get alpha 0.0.1a in Discord just in case you are interested, we didn’t go totally public because it’s not ready for the outside world yet 🫣), I’m also spending some time in studying how to move substances between vessels, let them be blood (circulation, food (digestion), air (respiration), and such.

Each subsystem will work in a different way but there must be consistent way to define how things will move inside the network of vessels, especially because there will be freedom for the player to build any kind of layout they want. In addition there are multiple dimensions for each kind of pipeline, which adds to complexity.

It’s really hard to have something consistent and efficient at the same time, but it’s so cool to see the result directly draw inside the game!

Continue ReadingFlow Graph Algorithms

Chemical Reactions

  • Post published:March 13, 2022
  • Post comments:0 Comments

Chemical reactions play a crucial role inside cells, likewise in Lifecraft. Many biological reactions would require a lot of time to take place naturally, that’s why enzymes are required to catalyze reactions.

This translates into a simple gameplay mechanics: a special building called catalyzer is a special intracellular building that accepts and enzyme which will define which reactions the building will be able to perform.

Reactions can have multiple input, multiple outputs and even different steps, each reaction will be different! You can see a prototype of a (simplified) glycolysis reaction which will produce energy inside cells!

Continue ReadingChemical Reactions

Delivering with dispatchers

  • Post published:February 3, 2022
  • Post comments:0 Comments

One of the main aspects of the game is expanding and building structures outside cells.

This can be done through dispatcher which can deliver materials directly to growing zones or to extracellular structures.

In this example we’re building some collagen helices with ribosomes, which are then assembled into collagen flooring and delivered outside (that’s that floating bubble!).

Continue ReadingDelivering with dispatchers

Debugging Railing Movement

  • Post published:December 10, 2021
  • Post comments:0 Comments

It’s hard to find some bugs when there are fast items which are moving in a tile map, possibly locking some states to prevent other items from moving into same tiles or allowing routing when multiple choices can be made.

To our rescue, it’s possible to slow down time to track down what’s exactly happening under the hood. This, together with some visual hints, helps the whole process.

The cyan tile represents the busy state while the string over the item tells the direction which the item is moving toward and its internal state relative to the current tile.

Continue ReadingDebugging Railing Movement

Producing and assembling proteins

  • Post published:December 3, 2021
  • Post comments:0 Comments

Living cells are all about producing proteins for all kind of purposes, joining amino acids which are the building block of all the proteins.

Even the structure which gives the shape to the cell (and has a lot of other functions), the cytoskeleton, is made by proteins.

Proteins are usually synthesized in ribosomes and then they assemble in complex structures.

This is what it’s happening right here in the animation! This small network is producing microtubules, which are used to route items on the ground of the cell, in two steps:

  • first simple amino acids (round spheres) are crafted into tubulin in ribosomes
  • then a red tubulin and a green tubulin are assembled into a finished microtubule

Continue ReadingProducing and assembling proteins

Pathfinding, this unknown

  • Post published:November 29, 2021
  • Post comments:0 Comments

I must say that pathfinding has always fascinated me, because it’s a class of algorithms which produce visible and elegant output.

Broadly speaking, it’s a sort of procedural way of generating graphics.

I’m investigating different approaches to computing all the necessary graphs, trying to optimize paths when possible according to the geometry but this is not easy.

Underneath a classic A* algorithm is used, but procedurally placing the nodes ot the graph is proving itself harder than I though!

Continue ReadingPathfinding, this unknown

Using kickers to force specific directions

  • Post published:November 24, 2021
  • Post comments:0 Comments

Since there’s no way to let a microtubule decide the direction of an item, it will continue on it’s direction unless a kicker changes it! There is only a specific circumstance in which it’s possible to determine which direction should an item go and that’s when it’s dropped on a microtubule end, in that scenario there’s only one direction to choose from.

Continue ReadingUsing kickers to force specific directions

Procedural Resource Generation

  • Post published:November 23, 2021
  • Post comments:0 Comments

It’s rather hard to find a proper way to generate resources inside an infinite map and being able to use a seed to generate them in the same way. You need two seeds: one is used as the general seed, while another seed is used for each kind of procedural data you want to generate so that you can combine the two and obtain a different start point in the PNRG sequence.

This is rather useful when you want to scatter around a start point resources randomly but at the same time lazily. Using seeds allows to avoid precomputing all the data, you will be always able to figure out if at coordinate (x,y) there is a specific resource or not with a constant (more or less) time complexity.

You add some bias and mapping function to the results and you are also able to decide how far from the center and how often compared to distance it should spawn.

Continue ReadingProcedural Resource Generation

End of content

No more pages to load