Skip to content

9/29/13

9/29/13 published on

Well the core functionality for NodeActions is done. Nodes, SubNodes, all that jazz. It took way longer than my initial estimates, but on the flip side the next task- Node Generation- seems like it’s going to take way less time than my estimates feared! What I’m trying to say here is that the mounting evidence that programmers are incapable of producing accurate estimates is undeniable.

Let’s talk about the simple things in life. Initially I was thinking about having all SubNodes being generated equally- ie, just pulled randomly from the entire pool. This obviously sucks for some higher logic stuff of balancing out the placement of different types of SubNodes. The solution was mercifully simple, though. I already had a SubNode classification system in place for doing stuff like “Don’t place healing fountains too close to town” and suchlike. All I had to do was hijack the classification system to be where generation starts from, allow it to have its own generation constraints (you remember those from a few weeks back? they say stuff like “only spawn 5 of these”), and as a result we get a beautiful and elegant little system arising out from a small gap in my earlier thought process. It looks like this:

  1. You have a category of “Utility” SubNodes. These SubNodes provide beneficial services to players.
  2. We can then have GenerationConstraints that apply to the “Utility” category:
    • Don’t spawn too close to a town (hardly beneficial when the player is already next to an existing healing spot)
    • Don’t spawn too close to a dungeon (because too much convenience)
    • Spawn 1-2 in each difficulty rank (provides some variance, don’t want too many or it’ll dilute their positional value)
    • Don’t spawn too close to another “Utility” SubNode.
  3. From there an individual SubNode can have its own GenerationConstraints. For example let us consider a quest SubNode that will end up spawning a healing fountain upon completion:
    • Spawn it in the “Easy/Medium” areas of a given rank (so the players have plenty of time to do the quest while the fountain will still be useful)
    • Spawn only one per game

Simple, but allows for a great deal of stacking complexity.