Jump to content
  • Advertisement
Sign in to follow this  

Connect Centroids / Dynamic Medium

Recommended Posts



I have been here about 2 months ago with my Dynamic Foam project and got help from a developer but we ran into some problems connecting centroids to establish a network between the 'foam bubbles'. 

Here is some extra information for why those centroids need to be connected and form a network along with the problem explained at the end.

I. Dynamic Medium
II. Fields and Boids
III. From Boids to a PBD Network
IV. From Curling Motion to Strings
V. Position Based Dynamics (PBD)
VI. The Problem


I. Dynamic Medium

The goal of this project is to create a kind on a Zero-player game, a bit like Conway's Game of Life, where cells fluctuate based on surrounding cells, and where the goal to generate Knots within a Dynamic Medium.

To get a sense of such a dynamic network think of a foam with bubbles (volumes) where a micro-fluid runs through the edges (currents). These currents move from high to low pressure, forming circuits. The intensity of the fluid passing the bubbles can make the bubbles shrink or expand. Some currents will be able to line up and form closed circuits. 
In 2D these structures are simple loops, in 3D these loops can form strings, and in a next step these strings form again closed-circuits -> knots.



II. Fields and Boids

One way to get a model of bubbles and currents going was by using Boid-particles and Fields, which was tried in Processing. Here are short clips to show the interaction:


A. In the first clip the Fields (red circles) keep their size while the small particles flow in between and form a circuit.


B. In the second version the size of the Fields is influenced by the number of particles within. This gives rise to a dynamic foam with Fields fluctuating. Expand <-> Shrink



III. From Boids to a PBD Network

The problem with using Boids is that they have their limitations whereby the quick expansion of Fields causes the particles to be splattered around, interrupting the steady current. (stable flow vs. splashed around)


Keeping the Boid-particles flowing is important, because a flow-circuit gives rise to organisational rules such as flows going against each other block each other, others can go along and strengthen each other, similar to an electronic circuit:


So to fix these problems a move to PBD was made and hoping to create a network model (nodes/edges) that replaces the small particles.

The flow replaced by edges:


Fields expanding and shrinking depending on the amount of flow through the edges:


• Having two Fields A.B. and in between from point a. to b. an edge.
• This edges (a.b.) can replace all the boids moving in between (A.B.)
• Edge (a.b.) can represents 1 or 1 million small particles or more, simplification.
• Between Field A. and B. a measurement of tension •-VVVVV-•  (A/B)
• The more tension between (A.B.) the less flow there can be in (a.b.)
• Inverse the more flow there is in (a.b.) the less tension between (A.B.)
• The edge (a.b.) runs through the Fields A. and B, cooling or heating up Fields A. and B.
• Through edge (a.b.) runs a current the larger this current the bigger the Fields A. and B. become, expansion vs. shrinking, hot vs. cold, condense vs. vaporise.


The inspiration for the move to 'Position Based Dynamics' came from a talk by Jos Stam where he explained a method explicit on position and using springs:




IV. From Curling Motion to Strings

At the basis of this Dynamic Foam is the idea to get the bubbles moving through the medium based on self regulated currents between the bubbles:


The mechanics are like a sliding-puzzle where the parts can move to where there is space (created):


Space can be created by letting the bubbles shrink on one side and expand on the other, so they can move into that created space, and as a result we get fluctuations and a rolling-curling-motion:


Here is a fun animation that is similar to the idea: 


But for those lemons the input-force is gravity, in my model it are the micro-fluid-currents that effect the size. If the fluid is colder than the bubble than it will condensate and the field will expand; when it is warmer the field will vaporise and shrink. The dynamic curing motion from above, could also turn around and close-loop into knots:


In 3D the wind up curls would be like these folk dansers waving strings:

(at 1:44)


These strings can turn into knots etc. etc.


V. Position Based Dynamics (PBD)

For a look at the current situation you can check this short clip, where a small network is in place based on centroids, and where the volumes can fluctuate:



Here is are the project files on GitHub if you would like to have a closer look:
https://github.com/InteractiveComputerGraphics/PositionBasedDynamics (The PDB software)


VI. The Problem

We took the PBD software from GitHub and modified the Demo example called 'GenericConstraintsDemos'. All constraints are taken out except the distance constraint , and the simulation is limited to work on a 2D plane with the intention of extending to 3D eventually. Check out the graph:


As you can see in the example, there are nine circles. The simulation allows for any number of circles. The green dots represent the centers of the circles; the red dots represent the centroids of the three adjacent/connected circles; the black dots represent some (outer) intersections between circles; and the blue lines connect either centroids with other centroids, or centroids to intersections in a particular pattern. In the simulation, the radii of the circles can change and, since a distance constraint is applied, the varying sizes of the circles causes the locations (and existence) of the dots and lines to change.

The code at this point is able to identify/calculate the locations of the black dots and the red dots, but he had trouble coming up with an algorithm that correctly connects the red and black dots. The diagram above shows the correct connections, but coming up with an algorithm to do this automatically and as the simulation runs stalled our progress.

So I'm now looking for a developer who can take it to the next level. It doesn't necessarily need to be in PBD an other Physics Engine (Bullet?) might do the job, one where on top of the physics-interactions a network-formula can balance out the weights and regulate the system.

All suggestions and questions are more than welcome!


Edited by Chelle

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement
  • Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By Sebastian Starke
      Animating characters is a pain, right? Especially those four-legged monsters!

      This year, we will be presenting our recent research on quadruped animation and character control at the SIGGRAPH 2018 in Vancouver. The system can produce natural animations from real motion data using artificial neural networks. Our system is implemented in the Unity 3D engine and trained with TensorFlow.

      If you are curious about such things, have a look at this:
    • By Dromo
      I am about to start a PhD that will investigate ways of replicating creativity in the AI systems of simulated people in virtual environments. I will research which psychology theories and models to use in order to achieve this, with a focus on creative problem solving.
      The aim of this project is to create virtual characters and NPCs that can create new solutions to challenges, even if they have never encountered these before. This would mean that not every possible action or outcome would need to be coded for, so less development resources are required. Players would encounter virtual people that are not bound by rigid patterns of pre-scripted behaviour, increasing the replay value and lifespan of games, and the accuracy of simulations.
      I am looking for companies or organisations that would be interested in working with me on my PhD, and I think computer games companies might be the most likely. I am trying to think of ways in which this new AI system might benefit games companies, or improvements and new types of games that might be possible. I am on this forum to ask for your thoughts and suggestions please, so I can approach games companies with some examples. 
      Thank you for your time and interest.
    • By Gourav Mishra
      Please help in completing the code. I am unable to use defined function
      import sys
      import nltk
      import random
      from nltk.tokenize import word_tokenize,sent_tokenize
      GREETING_KEYWORDS = ("hello", "hi", "greetings", "sup", "what's up",)
      GREETING_RESPONSES = ["'sup bro", "hey", "*nods*", "hey you get my snap?"]
      User_input = input ("User said:")
      type (User_input)
      def check_for_greeting(sentence):
          """If any of the words in the user's input was a greeting, return a greeting response"""
          words = word_tokenize (sentence)
          if words in GREETING_KEYWORDS:
      check_for_greeting(sentence = User_input )
    • By Lightness1024
      Hello gamedev, I am currently evaluating the worthiness of jumping into RD work for an automatic impostor system in our engine. In the past I've witnessed tremendous performance increase from such a system into the engine of LumenRT (which has to cope with unoptimized user created content). We're a little bit in the same situation right now. Possibly large fields with way too much data (high poly etc..).
      So if the engine would support auto-impostor-ing of stuff that'd be cool. Though, to make it a bit more modern, I was thinking that we could extend the parallax validity of billboards by storing the depth too, and render them using parallax occlusion mapping.
      So the invalidation could come after the camera has moved to a more radical angle than for traditional impostors. These exist techniques with full volumetric billboards that I am aware of, but they need the gometry shader to generate slices, and cost heavy voxel storage. I need something very light on the bandwidth to cope with switch/PS4 limitations.
      Can you point me to modern research on well balanced imposter techniques sounding like this ? or any idea you have on the matter.
    • By xiaohan wen
      If you have CROWDFUNDED the development of your game, which of the following statements do you agree with?
      1. I went out of my way to try to launch my game by the estimated delivery date
      2. I made an effort to launch my game by the estimated delivery date
      3. I was not at all concerned about launching my game by the estimated delivery date
      Hi there! I am an academician doing research on both funding success and video game development success.
      For those who have CROWDFUNDED your game development, it would be extremely helpful if you could fill out a very short survey (click the Qualtrics link below) about your experiences.
      The survey would just take 5 minutes and I’ll be happy to share my findings of what leads to crowdfunding success and how it affects game development based on an examination of 350 Kickstarter projects on game development in return.
      This is an anonymous survey and your personal information will not be recorded.
      Thank you very much in advance!
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!