Connections between objects - general strategy

What is the easiest way to store connections between objects?

-In a scene, I have many cameras.
-Each camera has a fixed set of cameras it may transition to.
-Using for example camera A, the fixed set of cameras belonging to camera A should start to preload assets.

In my mind - the usual suspect is just to create an array in each camera, containing connecting cameras - but I have a hunch that there is a more general way to do this.

I did try to search on internet, but I’m not even sure what this presumable concept is called - “connection tree” is not it?

sounds like a linked list

Yep, I guess that’s it.

There seems to be a matrix alternative, not that I understood it.

Other than that, searching for alternatives to linked lists seems to reveal (at least to me) an unknown group of odd/strange programmers. (not sure if there is some internal joke around programmers about linked lists?)

haha. well, if I was going to make a joke about linked lists. It would be this one:

1 Like

Within the realm of explaining alternatives to linked lists… I would say this is a very plausible presentation.

Next time I feel an urge to search for odd crazy stuff I will search for this. :slight_smile:

I wish I actual programming information to add, but im better at feces jokes. So i’ll leave that to someone like krilnon


It actually worked out quite ok, I managed to do a scriptable object in Unity and had it store cameras in a list on camera transitions. Since the scriptable object is persistent even after the playmode is shut down in the editor, the linked list was “selflearning” during gameplay filling up the list as I played along. So that was easy enough for me, and only one functioncall. Hurray!

The intuition that there should be an alternativ solution is probably that the reality fooled me to believe that there is some direct way of knowing the relation between objects. Like the moon and earth, or food an taste etc…when it is actually the granularity of the world that forms the linked list of reality. :wink:

how do you like unity having done as3 before? I have never tried it

Unity is like flash on steroids.

You should use c# instead of javascript in Unity, (although you have the opportunity to use two(three?) different languages in Unity).

The semantic differences are minor between c# and javascript, but with c# you get wonderful autocomplete in the free accompanying programming editor Monodevelop.

Now they also included most of the previously professional features in the free Unity edition, keeping minor important things for the professional edition. So with the free edition you can do most of the stuff for free, even sell on different appstores as long as you don’t make more money than a certain amount. There seems to be a indie version also. Not read up on all of that.

The C# language fits in a small book, (C# pocket reference, O’reilly), but there seems to very extensive libraries. I was under the impression that c# was very advanced, but its not.

Unity is easy to learn and easy to use.

thats good to hear. Someday ill give it a try. When I look at game dev talks on redit or whereever, it seems like unity is very prevalent

A graph? Digraph? Directed acyclic graph? Scene graph?

More broadly, yes, there’s a way to represent this that has nothing to do with cameras or scenes.

Directed acyclic graph.

I realized I tricked myself into believing there was a more general solution when I saw the image of the Seven Bridges of Königsberg in one of my google searches.önigsberg

This, together with what seems to be crazy programmers and the human centipad convinced me, that there is no general solution.