multiple gridgraphs, aiLerp:
I need different “nations” on my map to have different “territories” restricted to travel/traversal if “borders” are closed.
I thought I would use tags for this, thinking tags were flags. So I find out they aren’t. No biggy. (I found out they are actually four flags, 19 - 23, in a node’s flags, but you know what I mean, I think). A tag system would not work for this.
Plan B: multiple graphs for different nations with different political rules as to where their units can travel. I am trying to create a Civilization like map, where some area are walkable to some nations, some not, with up to 16 “nations” at once, but, not turn based.
Do the NNConstraint masks just determine what is and what is not walkable?
Do they combine gridNodeBase penalties and tags if nodes from both graphs are walkable? (just add penalties and tag penalties together?)
…I feel like I cant get my question clear…
Try this: How do penalties/tags get applied/analyzed when a seeker is scanning multiple graphs at once using a mask?
Should I have a base terrain penalty gridgraph, and just layer on top of that a gridgraph with no tags or penalties just walkable/uwalkable to get the political restrictions? (ie cant walk through territories without open borders treaties) .
…or would I be better off with each nation getting its own “personal” graph, with identical terrain penalties to all the other graphs, just different areas turned on/off as walkable as necessary.
As far as I understand it, a political gridgraph mask on top of base terrain graph may be simpler.
Performance cost, (compared to a single/“personal” graph) not really noticeable, due to the “area” components thing, (very impressive, BTW, much wikipedia read on the topics now, little understanding, but I am impressed with this package yet again).
If there is noticeable performance costs, I prefer performance over simplicity/manageability. Graphs are 256 x 256 to 1024 x 1024, with at most 1 other graph layer, and seeker using tags.
Also, I am struggling to make copies of graphs via code. I am trying to make an instance of the original (terrain) graph, and then copy it to AstarPath.active.data.graphs, but I cant really find a constructor/method that takes a graph and makes a new copy of it. So would it be simpler to rescan, retag, and reapply penalties to the nations “personal” graphs?