Skip to content

February 8th, 2015

February 8th, 2015 published on

At this point the conversion of game systems to the new format is finished. Lots of new systems (fancier gates, a warp system), lots of updated old ones (ranged attacks/parties/etc). What remains is implementing a map generator for the new map format. A skeleton of it is already in place for creating basic maps, but there are no brains behind it. The main stumbling block for me right now is deciding how much of the old system is applicable to the new map style.

I don’t remember if I actually documented the newest version of the generation system here. It’s pretty simple. Every type of node (that is, a location in the game with behaviors attached to it. ie, a trap node that hurts players who pass by it or a gold node that gives players gold when landing on it) has two special properties attached to it: Tags and constraints. Tags are for organizational purposes such as “healing nodes” or “negative nodes”. Constraints are requirements and limits: ie only spawn this on medium difficulty tiles or only spawn 3 of these. Tags also have constraints and are the organizational structure that the core generator uses to decide what things to spawn (it picks a random tag and then spawns it somewhere and then moves on until out of tags or slots to fill). It becomes very easy to create behaviors like “only spawn 1 healing node per rank” or “only spawn this near other trap nodes”, especially since multiple tags per node allows varying degrees of classification. It worked great when the world only consisted of about 9 nodes per rank, and the positions of other nodes was rarely of importance.

The new system has more considerations to take. Nodes have a lot more importance to each other based on the branch they’re within. It’s trivial to generate a branch with the concept of “there should be 4 positive nodes and 2 negative nodes”, but what each of those nodes is matters a lot. If we went purely random on these players will likely end up making a decision on “what has the least negatives / the least costly negatives” or “what has the easiest gates” because the composition of each branch would be a mish mash where anything could be possible. Now imagine if we made that same branch “4 gold nodes, 2 damage nodes”. At this point players now have a good idea that if they go down this branch they will probably get some gold. If gold is a desirable resource for them at the moment, then they will weigh it against the damage nodes and have to make an interesting choice of whether the risk is worth it. While it’s easy to take that example and say “well, then have whatever node you randomly pick be used for all nodes on a given branch”, it doesn’t take into account the bigger picture. ie, having most branches randomly happen to be gold diminishes the value of gold over time. The old system by itself just won’t be enough, and complicating the problem is the fact that I don’t fully understand all the important factors of the new map style yet. That is going to be the focus of this week: figuring out what matters on maps, deciding how much of the old system can be used to generate it, and then applying it all as needed.