How do I make a graph game

Get help using Construct 2

Post » Sun Sep 14, 2014 7:28 pm

indeed, had recently read about that but it skipped my mind
B
14
S
2
Posts: 26
Reputation: 933

Post » Sun Sep 14, 2014 8:50 pm

i think 2 arrays would be easier... one array to hold all your nodes in the graph and then another to hold all the connections between the nodes, with the key to both being some unique node id. You can always make your connection array larger than you can imagine, it's unlikely to consume too much memory unless you have 1000's of nodes.

storing variable length data in a string and using tokenat is very handy but gets messy if you ever change the contents

KISS principle.. keep it simple stupid... sometimes two simple things is much easier to implement than one slightly more complex thing.

R
B
7
S
3
G
1
Posts: 184
Reputation: 1,352

Post » Sun Sep 14, 2014 10:13 pm

thanks for the replies,
found this one too that sounds interesting:

Data storage objects in a container
----
It's possible to add data storage objects like Array and Dictionary to a container with another object. Despite the fact these objects are invisible, a separate instance of the object is still created for each container. This allows you to have a dedicated Array or Dictionary for each instance of an object. This can be very useful as an advanced substitute for instance variables, such as if a very large number of variables is necessary, or if variables need to be dynamically added and removed.
www. scirra. com /manual/150/containers
B
14
S
2
Posts: 26
Reputation: 933

Post » Sun Sep 14, 2014 10:25 pm

Another thing I could use is Dictionary, if only it had a mode to work as a MultiValueDictionary, where it allows one to add multiple values for a given key and returns a list of values for the key if it has more than one value
B
14
S
2
Posts: 26
Reputation: 933

Previous

Return to How do I....?

Who is online

Users browsing this forum: DharmaOne, namaewayukidesu, nirwan1911 and 10 guests