Currently, Stardust Sandbox bases its element simulation on simple discrete movement rules, where particles fall, float, or move laterally according to their type (e.g., powder, liquid, or gas). While this model is sufficient for basic behaviors, it does not account for the cumulative effect of the weight of stacked materials. Introducing a pressure system would allow for a simple representation of how stacking elements influences stability, flow, and possible structural failures within the game world.
In this context, pressure can be defined as the cumulative effect of the weight of elements located above a given grid cell. Instead of representing continuous physical forces or complex fluid dynamics, the system can use a discrete model derived directly from the grid configuration. Thus, each cell would have a pressure value calculated from the sum of the weights of the elements positioned above it. Empty spaces interrupt this accumulation, resetting the pressure calculation in the corresponding column.
Implementation can be done by traversing each grid column from top to bottom in each simulation cycle, accumulating the weight of the elements found. Each material would have simple properties, such as a weight value and a maximum supported pressure limit. The resulting pressure value can then be used during the element update step to influence its behavior. Granular materials may stop moving when the pressure exceeds their tolerance, allowing the formation of stable piles and basic structural support. Liquids can use pressure differences between neighboring cells to decide the direction of lateral flow, favoring leveling and the formation of natural reservoirs.
To avoid overly rigid behaviors, the system can consider small lateral contributions when calculating the effective pressure of a cell, partially taking into account the pressure values of upper neighbors. This favors sliding and progressive collapse of stacked materials, producing visually more natural results without significantly increasing simulation complexity.
In addition to influencing element movement, pressure can also be used as a trigger for transformations or structural failures. Each material can have a maximum supported pressure limit; when this limit is exceeded, the element may undergo compaction, transform into another material, or be destroyed. This mechanism allows for the representation of phenomena such as sediment compaction or the rupture of simple structures.
This model maintains the simplicity of the current system, as pressure is derived directly from the grid structure and does not require the introduction of velocity, continuous forces, or complex physical fields. Nevertheless, it significantly expands the emergent potential of the simulation, enabling richer interactions between stacked materials and confined environments.
Currently, Stardust Sandbox bases its element simulation on simple discrete movement rules, where particles fall, float, or move laterally according to their type (e.g., powder, liquid, or gas). While this model is sufficient for basic behaviors, it does not account for the cumulative effect of the weight of stacked materials. Introducing a pressure system would allow for a simple representation of how stacking elements influences stability, flow, and possible structural failures within the game world.
In this context, pressure can be defined as the cumulative effect of the weight of elements located above a given grid cell. Instead of representing continuous physical forces or complex fluid dynamics, the system can use a discrete model derived directly from the grid configuration. Thus, each cell would have a pressure value calculated from the sum of the weights of the elements positioned above it. Empty spaces interrupt this accumulation, resetting the pressure calculation in the corresponding column.
Implementation can be done by traversing each grid column from top to bottom in each simulation cycle, accumulating the weight of the elements found. Each material would have simple properties, such as a weight value and a maximum supported pressure limit. The resulting pressure value can then be used during the element update step to influence its behavior. Granular materials may stop moving when the pressure exceeds their tolerance, allowing the formation of stable piles and basic structural support. Liquids can use pressure differences between neighboring cells to decide the direction of lateral flow, favoring leveling and the formation of natural reservoirs.
To avoid overly rigid behaviors, the system can consider small lateral contributions when calculating the effective pressure of a cell, partially taking into account the pressure values of upper neighbors. This favors sliding and progressive collapse of stacked materials, producing visually more natural results without significantly increasing simulation complexity.
In addition to influencing element movement, pressure can also be used as a trigger for transformations or structural failures. Each material can have a maximum supported pressure limit; when this limit is exceeded, the element may undergo compaction, transform into another material, or be destroyed. This mechanism allows for the representation of phenomena such as sediment compaction or the rupture of simple structures.
This model maintains the simplicity of the current system, as pressure is derived directly from the grid structure and does not require the introduction of velocity, continuous forces, or complex physical fields. Nevertheless, it significantly expands the emergent potential of the simulation, enabling richer interactions between stacked materials and confined environments.