Node attraction

Just something that sprang to mind while looking at Consider allowing more than one slider per policy and thinking about the kind of problem it seems to be trying to solve: Sometimes some policies are really very closely tied to each other, and it seems like they should be more closely related in some obvious way.

So I’m wondering… how does the node layout algorithm work? Because if it’s anything close to a force-directed approach (I seem to recall Cliff describing it as “wiggling” somewhere), it might be able to handle extra forces to improve the layout quality. I’m thinking of two:

  • Attract each node to its previously seen location, or maybe the last N locations (The closest one? The average of their positions? All of them?), to try to make the layout more stable over turns
  • Attract pairs of nodes to each other based on… not sure what: I was thinking of explicitly listed attracting pairs, so you’d actually specify that (for instance) Prisons and PrisonRegime should be attracted to each other. Alternately, base it on the strength of the connections between the nodes.

I haven’t got any experience of playing with this type of layout algorithm so I don’t know if these kind of additions would do anything useful… and for that matter, I don’t know if the game already does something like this.

e: Okay, after actually paying attention to it, certainly nodes tend to at least stay in position over small changes (maybe the algorithm is that they start in their previous position and wiggle to make room for any changes?), but the bit about making related nodes attract each other still stands.

3 Likes

As an extra (as we’re talking about UI, nodes, etc) - it’d be good to see if a policy is ‘maxed’ (or mined, or nearing either) with maybe a black bar for something impossible (i.e maxed out Income tax - can’t raise by 10%? Black coloured bar). That way I’d know which policies I’m just too cheap to influence, or if I’ve already maxed it.

1 Like