I’ve developed a force directed graph system for a game I’m working on, and am curious if there is any interest out there in me polishing it up and putting on the asset store? Here’s a quick demostration video (showing the editor used to mess with the physics settings until you’re happy with them).
The library is designed to be easy to use but flexible and powerful, for instance, the code used to spawn each node in the video above is:
Where the “new Thing(“Node”)” is the thing the node represents (which can be anything).
I imagine it being useful for game maps, skill trees, puzzle elements, or in my case, network topologies. It also functions in a 2D mode, which flattens the graph onto a plane and could be useful for other applications.
I guess I just want to gauge any interest in such a library, to decide it would be work tidying it up for the asset store and pop it up on there for a few bucks
I am playing with pulling some graph data from graphX into unity and think your library would be a good starting point. I would spend the money if source is included. I plan on using VR to explore graph data
I added 2D graphs, which can be used exclusively, or mixed with with 3D graphs for interesting UI possibilities.
EDIT:
Keep in mind the 2D mode is simply a 3D graph projected onto a plane, either defined by a normal or camera facing. It would be fairly trivial to add a pure 2D mode that uses sprites instead of meshes, there may even be some mild performance gains.
The data is exclusively populated at runtime, as is the requirements for my game. Each use case would need to write a small layer between their parser and the library to generate the graph using static data, but once generated, more nodes can be added at runtime with ease.
I’m currently finishing off an editor which makes it easy to play with different physics settings and generates .phys (JSON) files which the library can use at runtime. I’m a bit of a perfectionist, but if you need the library in short order, I can forego some of the polish (it’s already quite usable).
The format is up to you, as the nodes are added at runtime. It should be trivial to write a layer that generates nodes based on any kind of file. If the demand is there, I’d be happy to add some generators for some common file types, but to be honest, I don’t really know much about any existing standards in this area, as my experience is primarily in games.
Here’s a web demo of the current version of the library. All the work is done on the GPU now for substantial performance improvements. Unfortunately it will not run on OSX currently as they don’t support Compute Shaders (Apple has not kept very up to date with OpenGL).
Also, run this in something other then Chrome, as I’m sure most of you’re aware, Chrome doesn’t like Unity’s web player any more, and WebGL hasn’t caught up with Compute Shaders yet.
Would just like to say this looks awesome, and I’m looking forward to seeing it on the Asset Store! I’d like to visualise the node graph of a choose-your-own-adventure type game I’m working on. I’m doing that with Python and GraphViz currently, and it’s not that great
I’m afraid the library I’ve been working on has been caught up in a data visualization start-up company, so as much as I wanted to release it on the Asset Store, it’s looking unlikely this will happen any time soon I’m sorry everyone.
All I can do is suggest you read up on “force directed graphs”, “constraint relaxation” (as opposed to using spring forces, which are much less stable at low frame rates), “verlet integration”, “compute shaders” or “OpenCL” (which is more cross-platform), and perhaps “barnes-hut simulation” and “oct-trees” (mostly if you take a CPU approach, less important with GPU approaches). The trick for large graphs is getting as much of the math running on the GPU.
Hey @doombob this is an old thread but I just wanted to see if all that IP lockup story is still a thing or if you could resuscitate this or share a little more I am on a small team and this is exactly the wheel we are trying to re-invent. Anyhow, thanks for the pointers we see the same problem using Springs too !