# Connections between objects - general strategy

**URL:** https://forum.kirupa.com/t/connections-between-objects-general-strategy/634375
**Category:** programming
**Created:** [March 22, 2016, 7:13am UTC](https://forum.kirupa.com/t/connections-between-objects-general-strategy/634375 "2016-03-22T07:13:08Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![linusj](https://avatars.discourse-cdn.com/v4/letter/l/b2d939/32.png) [@linusj](https://forum.kirupa.com/u/linusj)
#### Post date: [March 22, 2016, 7:13am UTC](https://forum.kirupa.com/t/connections-between-objects-general-strategy/634375/1 "2016-03-22T07:13:08Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![tbo](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@tbo](https://forum.kirupa.com/u/tbo)
#### Post date: [March 22, 2016, 2:16pm UTC](https://forum.kirupa.com/t/connections-between-objects-general-strategy/634375/2 "2016-03-22T14:16:48Z")

</div>

sounds like a linked list

---

<div class="post-metadata">

### Author: ![linusj](https://avatars.discourse-cdn.com/v4/letter/l/b2d939/32.png) [@linusj](https://forum.kirupa.com/u/linusj)
#### Post date: [March 22, 2016, 2:43pm UTC](https://forum.kirupa.com/t/connections-between-objects-general-strategy/634375/3 "2016-03-22T14:43:16Z")

</div>

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?)

---

<div class="post-metadata">

### Author: ![tbo](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@tbo](https://forum.kirupa.com/u/tbo)
#### Post date: [March 22, 2016, 5:24pm UTC](https://forum.kirupa.com/t/connections-between-objects-general-strategy/634375/4 "2016-03-22T17:24:00Z")

</div>

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

[![](http://3.bp.blogspot.com/-aa5Xtv8Sp7Q/Tccj6gNsH0I/AAAAAAAANAY/gRjM1RUmKd4/s640/Screen+shot+2011-05-09+at+7.11.29+AM.png) ](http://3.bp.blogspot.com/-aa5Xtv8Sp7Q/Tccj6gNsH0I/AAAAAAAANAY/gRjM1RUmKd4/s640/Screen+shot+2011-05-09+at+7.11.29+AM.png)[![](https://c1.staticflickr.com/7/6059/6290806492_d23534d54a_b.jpg) ](https://c1.staticflickr.com/7/6059/6290806492_d23534d54a_b.jpg)

---

<div class="post-metadata">

### Author: ![linusj](https://avatars.discourse-cdn.com/v4/letter/l/b2d939/32.png) [@linusj](https://forum.kirupa.com/u/linusj)
#### Post date: [March 22, 2016, 5:51pm UTC](https://forum.kirupa.com/t/connections-between-objects-general-strategy/634375/5 "2016-03-22T17:51:08Z")

</div>

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. 🙂

---

<div class="post-metadata">

### Author: ![tbo](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@tbo](https://forum.kirupa.com/u/tbo)
#### Post date: [March 22, 2016, 6:08pm UTC](https://forum.kirupa.com/t/connections-between-objects-general-strategy/634375/6 "2016-03-22T18:08:25Z")

</div>

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

---

<div class="post-metadata">

### Author: ![linusj](https://avatars.discourse-cdn.com/v4/letter/l/b2d939/32.png) [@linusj](https://forum.kirupa.com/u/linusj)
#### Post date: [March 22, 2016, 8:10pm UTC](https://forum.kirupa.com/t/connections-between-objects-general-strategy/634375/7 "2016-03-22T20:10:22Z")

</div>

Hehe,

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. 😉

---

<div class="post-metadata">

### Author: ![tbo](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@tbo](https://forum.kirupa.com/u/tbo)
#### Post date: [March 22, 2016, 9:41pm UTC](https://forum.kirupa.com/t/connections-between-objects-general-strategy/634375/8 "2016-03-22T21:41:13Z")

</div>

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

---

<div class="post-metadata">

### Author: ![linusj](https://avatars.discourse-cdn.com/v4/letter/l/b2d939/32.png) [@linusj](https://forum.kirupa.com/u/linusj)
#### Post date: [March 23, 2016, 7:25am UTC](https://forum.kirupa.com/t/connections-between-objects-general-strategy/634375/9 "2016-03-23T07:25:50Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![tbo](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@tbo](https://forum.kirupa.com/u/tbo)
#### Post date: [March 24, 2016, 1:33am UTC](https://forum.kirupa.com/t/connections-between-objects-general-strategy/634375/10 "2016-03-24T01:33:59Z")

</div>

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

---

<div class="post-metadata">

### Author: ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)
#### Post date: [March 24, 2016, 4:53am UTC](https://forum.kirupa.com/t/connections-between-objects-general-strategy/634375/11 "2016-03-24T04:53:49Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![linusj](https://avatars.discourse-cdn.com/v4/letter/l/b2d939/32.png) [@linusj](https://forum.kirupa.com/u/linusj)
#### Post date: [March 24, 2016, 5:34am UTC](https://forum.kirupa.com/t/connections-between-objects-general-strategy/634375/12 "2016-03-24T05:34:44Z")

</div>

> [@krilnon](#):
>
> A graph? Digraph? Directed acyclic graph? Scene graph?

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.

> [Seven Bridges of Königsberg - Wikipedia](https://en.wikipedia.org/wiki/Seven_Bridges_of_K%C3%B6nigsberg)

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