For the Unity project using this code, please see here: https://github.com/Ratstail91/Chemistry/releases/tag/scalar-fields
Please note that 1 pixel is equal to 1 unity unit - this is unrelated to scalar fields; it just feels better to me.

In this post, I'd like to outline how I coded my scalar fields for a systemic game prototype.
First, you'll need to know about systemic games - for that, I highly recommend you watch this video by Mark Brown: https://www.youtube.com/watch?v=SnpAAX9CkIc
Now that you're caught up, lets begin with the core concepts …