Hi all,
I am still working on my personal PCG project, I got a little delayed by the holidays plus trying to work out a reasonably efficient collision detection strategy that didn't involve me in too much development (translation I did a lot of development trying to avoid doing too much development :-) ).
However, I am getting to the point where I'll be able to work some more on the content generation (although to make serious obstacles I'll need to implement some opponents, which may entail another delay...)
So... I've done a little reading (shallow, I didn't want to buy any £800 text books) around graph rewriting and I am aware of the standard approaches (
https://en.wikipedia.org/wiki/Graph_rewriting) -- this all sounds a bit basic to my mind, and I am a little surprised not to have encountered any "advanced" rewrite techniques. For example:
--
1) I have inserted a town into my level, I want to apply a "walled" transform to this town.
This would involve:
a) identify all nodes compromising "town", you might flood-fill looking for a label, or you might have a higher-order node that has no spatial location but which has all parts of the town as its children...
b) insert "wall" nodes into all edges leaving the town (depending on your representation the inserted nodes might all be "gates" -- if every edge is necessarily a path -- or you might need to choose wall or gates according to whether the edge inserted into is tagged as "path"...)
--
2) As discussed previously, when inserting door-sets into a part-build level you:
a) identify a cutting line which separates the graph into "immediately accessible" and "interesting to visit" portions (e.g. the first contains the entrance and the latter contains some sort of reward)
b) making sure the cut line doesn't split any other door-set (this is the simplest rule that avoids deadlock, more complex ones are possible; and "door-set" generalises into "distributed set of components that enforce ordering")
c) insert doors into all edges that cross the line
d) insert a suitable OBSTACLE --> KEY sequence on the "accessible" side of the cutting line
--
So you see these are both of a different nature from the standard approaches. They both involve identify sub-graphs of arbitrary size and topology, and then applying a rule(s) to transform the overall graph based on the disposition of the sub-graph.
These two examples both generalise to identifying a sub-graph and inserting along the boundary, however other possibilities exist:
1) apply rule to nodes inside the sub-graph
2) identify two sub-graphs and apply rules to their boundary
3) use different rules such as delete, replace or apply label
Another example might be identifying the regions occupied by two hostile populations and inserting old battle grounds at random points between them; or identify a "compromised" region and remove or unlock all the doors in it... and more advanced rules might, for example, insert guard-posts only on major roads. And sub-graphs can obviously be identified in a host of different ways...
--
So....
I cannot imagine this type of rewrite hasn't been considered. It seems a fairly obvious extension of existing approaches. Does anybody know of resources (I really need them on-line) or people (or forums) where I can ask, or even the terminology that is used to refer to this sort of thing. Terminology could be the problem here. Graphs treated this way may not be called "graphs" but "networks" for example :-(
Regards and a happy new year,