Skip to content

Bugs & Battles

Bugs & Battles published on

So the 3 basic shapes- loops, planes, and linear branching paths have been successfully implemented. Despite their simplicity, the zone generator really wasn’t built for their rigid generation (after all, it was designed for big chunky zones and not so much the smaller ones the node system revolves around). Over the course of implementing all 3 the system got built around the idea of rigidness more and more- the loops started out as a giant hack, but as the plane got completed the necessary infrastructure sort of naturally fell into place. You can see here the updated loop system that allows for post processing generation and variable segment sizes:

loop

 

I had hoped to then continue on to actually placing locations and connecting them with roads, but two bugs cropped up that prevented it. The first one is our good friend the ocean hole:

impossible

 

The test cases only involved 3 zones total so a 4+ zone hole didn’t really crop up. It’s basically impossible to fill this hole without fundamentally changing the zone links. The fix is mercifully simple, we’ll just fill the hole with another mountain (or whatever is being used as a zone edge in the area). Decorative and shouldn’t cause any problems.

The next set of problems stem from undoing zones. Sometimes a zone being generated just doesn’t work out- there isn’t enough space, it can’t connect to what it’s supposed to, etc so it needs to be erased- including all of its zone edges and links. Support for this has always been flakey and it finally began to surface with the more complicated terrain. The first glitch was just visual edges being placed where they didn’t belong- a simple problem with the edge display being tacked on debug stuff that I didn’t think through and was easily remedied with placing it the same time as the walls get generated. The second problem was with stranded non-zones:

stranded

The problem seems to stem from an adjacent zone getting undone near them, which ends up deleting their edge connection data as well in the process. Probably won’t be too hard to fix, but I didn’t have time to complete the process before this blog post.

Battle System Blues

battles

Since before starting this blog we have been in the second phase of this project. The first was to get the fundamental stuff playable if unrefined, this second phase is to make it fun, and the final phase will be to make it feel and look right. The game has two big fundamental components of the map system and battle system. So far we’ve been focusing on the map system revisions, but with its new theory in place and just tech remaining I’ve shifted my design attention to the battle system component. The battles are traditional console RPG turn based, not tactical movement or whatnot. A decision that keeps me awake at night since turn based games aren’t terribly popular at the moment, and king of the unpopularity totem is the turn based non-tactical RPG. So clearly making a multiplayer version of a traditionally single player genre that is incredibly unpopular at the moment is a great idea to bet all of your horses on. Popularity as it may be, it’s pretty much the best possible battle system for a game that’s trying to recreate the feel of an entire RPG in a single hour because it has the capacity for taking a minimal amount of time, and allows for a greater abstraction of world scale than an action RPG would.

The two topics I’ve been worrying about lately are player progression, and actual battle execution. While I’m quite confident in the basic turn based you-hit-them,they-hit-you structure, I’ve spent a lot of time thinking about what commands the player actually gets to choose in such a battle should be. The traditional mashing the attack command structure won’t really hold up here. Typical tricks such as elemental weaknesses and gimmick battles also falter in a game that is built around being replayed again and again. It also needs to have enough strategy to not have player vs player battles be determined entirely by who has the best stats. I had formulated an incredibly complicated system that succeeded at a lot of these factors, but ended up being poor for fighting against AI even on paper, and in general not being as pick-up-and-play as I’d like.

Right now the idea I’m toying with is trying to employ some of the strategy that a tactical RPG gets from positioning into the system without actually having positioning. Something like having using a particularly strong attack makes you more susceptible to damage in the next turn, to re-create the sense of positionally diving into enemy lines. I haven’t fleshed out the concept yet.

Presently most character building in the game stems from players individually purchasing skills (with a limited total per player), and equipment to build a sort of custom character. It sounded nice on paper, but skills don’t really have enough interaction between themselves on the same character to make purchase choices very interesting (it also suffered from skills being too expensive and potentially weak to bother purchasing).

So now I’m experimenting with the idea of “class packs”. Essentially at every milestone level (starting at 1, with a total of 3), players would get to choose between different class packs. Class packs would include various skills and stat gains they’d get at certain intervals. This is much more interesting since not every skill/stat boost in the pack would necessarily be beneficial- players would have to start making trade offs for certain advantages. It also isolates player build thinking time down to just 3 points in the game instead of throughout the entire game, hopefully trimming down turn time. As a final bonus, it makes level ups more exciting since players might be waiting for a certain level up to finally get a skill that they’ve been wanting. It still allows for some customization on the player’s parts since they can mix and match 3 class packs, and the available skill packs can still be randomized each session for some variety. So far I’m digging it.

 

Next week: Fixing all these bugs! And then placing locations down finally.

Loopers

Loopers published on

With the new map systems designed, I started doodling sketches of possible maps to decide how to generate maps with the new style. Since everything is node based I could have mapped out the sketches to allow for 5+ node connections something like this:

doodle1 Roads represent node connections. (does not actually contain 5+ node connections)

But pretty quickly settled on 4 node connections max for the sake of clarity in-game. I was actually heavily considering a tile-based representation of the nodes like this to be used internally:

doodle2Not represented in these doodles is that not every node need be connected.

With a system like this the number of nodes a node is connected to can be discerned at a glance just by how many roads are coming out of it in each of the 4 directions. It wasn’t until later that I decided to just use the existing zone generator, simply because the tile-based style would take more time.

Under the tile based system I basically decided upon 3 common map patterns that seemed most useful to generate off of:

Linear Branches

branches

 

A very simple system. Primary, long paths are generated. Off of them smaller, also linear branches are generated. Creates a sense of peck and hunt. Most player traffic gets focused on the long path, while going down the shorter paths creates a sense of searching.

 

Planes

planes

A whole bunch of 4-way connection nodes clustered into one area. Players end up relatively close together most of the time, and it’s a bit of a slog to get to the extremities.

Loops

loops

 

A classic board game layout. You’re either going one way or the other most of the time.

 

There’s not a whole lot of deliberate map design with just these 3 patterns. When’s the right time to use a loop? a plane? I don’t know yet. Just slap ’em down randomly and make sure there aren’t too many node jumps from the town. The placement of specific nodes has a little bit of thought in it: dungeons should block out further areas, healing fountains shouldn’t be too close to town, etc. For the time being this will have to be sufficient. My main goal is to get a basic generator up and going in order to have sample data for the rest of the new systems to work with. Maybe it’ll be good enough, maybe it won’t. I can build upon it later.

So I moved on to adding these patterns to the existing zone generator. And immediately ran into a terrible wall: the zone generator was never really meant for patterns as exacting as the loop, which requires zones to placed in a very exact way such that the final zone in the chain will connect with the origin zone. All the zone generator every really cared about was creating a zone off of the side of another zone, and allowed for a tremendous amount of random drifting. For the time being the fix is to place down guiding zone lines for each zone in the chain and disallow the random portion of the zone from spreading beyond the line:

loop_reality

 

This makes for way stiffer zones. There are various ways to diminish the effect- make it so the line lengths are distributed differently between lines (ie, for a total line of 6, the individual zones lengths could be 1,3,2). But right now I don’t really care, it makes it more readable anyway. The other problem is that it only really supports loops that start and end on the same node. Creating a double loop isn’t really available yet in this system. The short comings of the zone generator have come home to roost. The code changes required to make this work were incredibly nasty as well, and I am at a loss for a better way to do them.

Next week I will probably deliberately ignore the shortcomings of loops and implement the other two (much simpler) patterns and start generating the actual nodes and their paths and maybe rebuild the movement system for node movement I don’t know we’ll see.

The Continuing Adventures of Maps

The Continuing Adventures of Maps published on

So I’m sitting here with a fresh finalized version of the map design. Let’s take a look at some of the harder decisions of the week.

 

Movement

By the end of last week’s entry, it had become apparent that our current system of grid based movement just wasn’t going to work out if we wanted to hit our goal of 1 hour long games. It allows for too many empty turns, and lets players get too far away from each other. Some tighter map design would fix this to a degree, but more drastic measures were needed.

movement

This was probably my biggest mental block on designing this game. When simplifying things down for the sake of time, it’s very hard to find the right balance of not destroying the original feel by going too far. I was resistant to admitting the change was necessary, last week wasn’t the first time I made a rough turn time calculation. Once I finally started to flesh out the available alternatives, I finally felt comfortable about this project for the first time in a long time. I’m pretty sure I’ve finally found what we were looking for.

nodesEach dot represents a node, each line a pathway between them.

The new method is that players move solely between points of interest “nodes” (towns, dungeons, wilderness,etc), rather than individual tiles. I then started at pretty much the opposite extreme of the previous system: players could move to any known node on the map in a single turn. This was a bit much since it basically destroyed any semblance of danger on the map and allowed players to attack each other from anywhere. But going down to a single node hop in a single turn really wouldn’t be a significant improvement from the old system, either.

What I’ve settled on as a solution is the stamina system. Players have a stamina meter with a cap on it. Each point of stamina allows them to do a single node move, and they gain 2 stamina each turn. This adds a certain layer of strategy to the proceedings since players can decide whether they want to use every drop of stamina as they get it, or to save up for a single massive movement when the situation calls for it. With this in place players have significantly more mobility than before, while still allowing some importance to how deep they decide to tread. The exact numbers will probably call for a lot of tweaking, but I think the fundamental system strikes the right notes.

Endurance

The old system used empty tiles for random battles and traps, creating endurance costs for moving around. Since there are no more empty tiles, something else had to exist to create danger in the world. The obvious substitute was made, with every node hop increasing a battle gauge which triggers a random battle once filled. Traps exist as an explicit percent chance on node paths. Perhaps the most notable thing is that random battles don’t necessarily damage mobility since players still gain stamina during them, which makes them more of a battle capacity check than a dead stop. Overall these are pretty limp wristed endurance dangers (by necessity), but they may still work out in the end.

Player vs Player

Player vs player has continually been the feature most likely to get cut. There are a lot of factors for this: online players are jerks and will exploit any fragile system to annoy other players even at the cost of winning the game, the nature of RPGs requires a battle system with enough room for strategy to give significant edge over numerical brute force, and being free-for-all requires some means of balancing unbalanced scenarios such as 3 versus 1.

The solution to these issues was surprisingly simple: it costs gold to attack players, the base cost goes up after each attack, and there is a multiplier to the cost when it’s imbalanced. PVP becomes another resource to use only when advantageous. Pure trolls will be wasting so many resources that they quickly become harmless, and eventually incapable of even initiating an attack.

Actions

Previously when players landed on an object, a random event would trigger. If they had a quest objective there, that would trigger instead. A simple and elegant system for moving turns along quickly. So I’m not entirely confident in this new system as being a good thing.

Under the new system, when ending their turn on an object players get a choice of what action they want to do there. Common actions include hunting for a battle, gathering an item native to the object type, and so on. This interface also extends to allowing players to opt-in to more random events placed on the object, selecting which quest objectives to complete (players often got confused when two quest objectives ended up on the same object in the old system, or locked into multiple unrelated battles, etc), and allow a generic object to contain more esoteric repeat functionality (ie, allow for repeat trading of one item for another).

It’s a great system for being able to expand upon the game easily, to allow a wider range of object functions with a smaller number of objects, and to make global quests more explicit. But it could also turn into a big ol’ mess of player indecision, reduction of uniqueness for individual objects, and a whole bunch of other varying effects. The primary goal of this system was to give players reason to form an ideal node route in their head. And it achieves that, but it could just as easily harm it with nodes having too much. It may end up being better to give each node type a very specific purpose instead, but even so making quests more explicit will still have some gains so it’s worth pursuing regardless of how it ends up.

 

This week I need to write up some plans for how to generate maps under this system, and then break up the whole thing down into a more digestible todo list and get to work on proper implementation. The whole thing basically amounts to a ton of small changes, so it’s hard to estimate how long it’ll take.

A Tour of RPG Level Design

A Tour of RPG Level Design published on

Being that the end goal of the project is to create a multiplayer RPG that evokes feelings of single player RPGs, it seems prudent to look at level design applied across the genre to see how they evoke the feelings they do through mechanics. It should be noted that I’m largely describing the stereotypes of the design types, and that any given actual game probably breaks these convention in one way or another.

Dungeons

Dungeons are the key obstacles in an RPG. They present a space the player must conquer in order to progress in the game, either for character progression or for plot progression.

Designer Maze

The type of dungeon you think of when someone says first person dungeon crawler, possibly popularized by the novelty of 3d on early computers. There’s usually multiple pathways through the critical path in this style of dungeon. This creates a certain pattern of exploring simply to find the critical path and to understand the layout of the dungeon. Due to the size of the dungeon there’s also an expectation to backtrack to a safe point for recovery since the dungeon is almost certainly larger than the player’s total endurance. Backtracking can take the form of checkpoints (in the case of one continuous dungeon), returning to the beginning (in the case of multiple dungeons), or opening shortcuts at critical points. Traps and puzzles adding unpredictable resource consumption are also hallmarks of the style.

Open Maze

The style typically seen in roguelikes, both traditional and action RPG variants. In this style there’s only a single critical point of down stairs to the next level. As such, many of the rooms are technically unnecessary to progress in the dungeon. Most players will explore all of the rooms thoroughly for the sake of additional experience and treasure. Safety points often don’t exist at all beyond an option to rest after clearing a floor or room, making the focus on a constant plunge forward rather than a careful back and forth.

Linear

Evolved from a greater emphasis on story telling in jRPGs since it allows for a finer control over pacing, but now not uncommon in western RPGs as well (and really, most story focused games today). Characterized by a straight line to the end of the dungeon with various optional off branches. While functionally a straight line, a well designed dungeon will mask it with twists and turns in layout as well as shifts in scenery. Often designed as a straight shot for the player, but earlier instances were still designed for backtracking for resource replenishment.

Overworlds

Overworlds are the connective tissue between the other areas in an RPG. In some cases they exist mostly for context, but are quite capable of offering their own spin on exploration. It’s also possible for the overworld to merely be a set of menus instead of a physical space to move around in, but the differing styles can just as easily be mapped to the menu (although directed is the most common use).

Open

Pretty much what it says. In this form the player is dropped somewhere in the world, probably next to a town, and told to figure it out. Direction might come from NPCs, or it might not come at all. In the elder form this basically turns the game into the player fishing around for new areas and deciding whether they can take it on yet or not through experimentation. In later years it became more popular to scale areas to the player’s current level, draining any importance of discovery out of the game for the sake of freedom.

Range

Similar to the open model, but in this case the player merely unlocks a chunk of the world at a time as the plot progresses. The player has a smaller range of places to discover, but still has to contend with figuring out which ones are viable for their level.

Directed

Range scaled down even further to make it so that the player typically only has one or two places to go next. This makes it easy for the player to progress in the game while lending geographical context to the world. A common practice is to unlock access to several areas at once when a key part of the plot is met (ie, getting a vehicle). These areas are typically optional, or have a flat level requirement in order to make it safe for the player to pick and choose.

Towns

Towns might be one of the most varied components of the genre. In a lot of cases the mechanical exploratory element isn’t really present, creating to-scale areas where the player must simply wade through to the correct vendor or quest giver- either through a map, pointed to them directly, or even reduced to a menu. NPCs might have unique text boxes for themselves, entire dialogue trees, respond only to keywords based on type, or be largely non-interactive. I’m not going to cover all of them in detail since they’re not especially relevant to our game.

The one form I’d like to highlight for its exploratory elements is that of the hint NPC town. This is a town where the player isn’t strictly required to talk to any given NPC, but doing so will uncover directions to the next area, hints as to what enemies it contains and how to deal with them, and reveal what’s going on in the town. As such, talking to all of the NPCs becomes a sort of investigative research game. Once the idea of key NPCs came around, NPCs required to push the plot and who generally gave exposition dumps to the player about the new area, the hint NPC form started to erode. With the key NPC telling the player what’s going on anyway, dungeons becoming safer, and overworlds simpler the key functions of the hint NPC were quickly forgotten and they devolved into vestigial flavor text that no one wants to read.

—————————————

Throughout most of them there’s a common theme of endurance and discovery. Endurance because travelling typically incurs resource expenses on the player, some times requiring them to make judgment calls of when to walk back to safety. This lends weight and importance to travelling. Discovery because exploring the space is often required to know how to most efficiently use resources. This fleshes out the locations and lends them a sense of place beyond the flavor text and artistry. Most comfortingly, it shows that there’s a wide variety of ways to invoke similar feelings in players. My job is to figure out how to compress it all down into an hour, and allow multiple players to partake in it. Not the easiest task in a genre often defined by its length.

So here are a few different problems I’ve been tackling this week:

The nature of multiplayer exploration

 If you want to be reductionist, exploration in games pretty much amounts to picking a random direction and seeing what’s over there. This is perfectly fine for a single player game or even a co-op multiplayer game since the player can eventually get around to everything. If they pick a direction that’s too hard for them or has no reward in it, it doesn’t really matter. Finding that out was still entertaining, and they can pick another direction at their leisure until they find something useful. This pretty much falls apart in a competitive multiplayer environment immediately. Discovery opportunities are finite, another player finding something cool while the others don’t sucks the joy out of the process and it becomes more like advantages from luck. Even if you don’t care about balance, it still damages the joy of the process when players are focused on what someone else found.

The simplest solution is to make sure every corner has something of equal value. This also basically destroys any of the interest. You can mask the balance by delaying the reward- ie, one spot gives a key to get something even better from another spot. This distracts from the sameness, but doesn’t really improve it. You can apply the philosophy that every reward requires an equivalent challenge to gain, but this still requires a certain amount of sameness so that one player doesn’t find a challenge too hard for them while another finds several at their level. A little more direct application of that philosophy is to make it costly to uncover new land, and consequently unearned rewards are acceptable. These are all workarounds, the fundamental idea of exploration simply seems incompatible with fair competition. But they might be enough to create the illusion.

 The Tyranny of Turns

Let’s assume that the average length of a turn is 30 seconds (attempting to take into account short simple turns and long thinky turns). Now let’s assume the target time for a game is an hour. That gives an entire game about 120 turns, or 30 turns per player in a 4 player game. That’s not a lot of turns, and it gets even worse when you account for the number of turns probably spent inside a battle. It pretty much puts backtracking out of the question, and makes even the choice for 4-directional movement questionable. This is pretty much where I’m sitting, trying to figure out how to make each turn significant enough to give scale to the game within the limits.

For the next week I’ll continue to mull these and other design mysteries while perhaps working on some refinements to the game proper such as, I dunno, an options menu. The design phases of this project are incredibly stressful on me since you can’t really force progress and we’re working under a tight time limit, which is probably why I keep putting them off.

 

 

World Generation: Edges Complete

World Generation: Edges Complete published on

yay_oceans

 

As you can see here single edges with proper ocean hole detection was successfully implemented, pretty much finishing up the basic building blocks of the new world generation. You might be asking, “what is ocean hole detection”. Since the map generator fills in land by moving a cursor tile about randomly, there’s a chance for unclaimed ocean tiles to end up residing inside land masses. This isn’t really desirable since beach edge tiles take up a lot of space, so at the end of generation they’re searched for and filled in with land.

This was pretty simple when the map was composed of just ocean tiles and land tiles (find isolated ocean tiles), but the addition zones and edges made things a little more complicated since edges are neither ocean nor land until they’re next to another zone. It also added a secondary purpose for ocean hole filling since redundant edges were possible during generation:

redundantGreen is zones, yellow is edges.

While it was perfectly reasonable to leave the far right edge during generation, in reality it’s not a practical edge of anything- it’s surrounded by its own zone. As such, it’s the same thing as an ocean hole. Detecting redundant edges is exactly what you think it is: if you’re surrounded by other edges and are only adjacent to one zone, then you’re unnecessary and thus considered an ocean hole. A special exception was made for edges bordering the ocean, to prevent ocean rivers leaking into zones excessively.

Originally the ocean filling was run on a per-zone basis but this lead to a tricky edge case:

hard holesMountains denote zone borders, white mountains/caves/graveyards represent different zone’s edges.

If you ignore the bottom and left zones and consider the top right zone’s existence it made perfect sense for that edge to be where it is- it was just ocean there after all. But when the bottom zone was generated and it created an ocean hole, it was impossible for it to claim that tile- it was surrounded by the first zone’s edges. The first zone could fill it, but it had already been processed. The fix was to simply process all ocean holes for all zones at the end of generation, letting whatever logical adjacent zone fill them in.

So then I finally moved on to some proper level generation. This is a very early sample of generating a central town zone and then creating 3 linear paths off of it. At the end of one of the paths the next central town zone would be generated (not pictured) which will then create its own linear paths, and so on.

yay_paths

The generator basically consists of pre-made things called zone generators. These things create zones in specific patterns. In this example there’s the Linear Path zone generator which continually creates a certain number of small new zones in a given direction. The other is the Town generator which simply creates a single small zone.

In order to make more complicated patterns out of these, each zone can be given a deferred zone generator. So the real crux of this town generator is that it contains a populator component. The populator component is told to place a single town object within the zone, making it a proper town zone. Not only that, but the populator component can also place down a few Linear Path deferred generators on the town zone, so on the next pass of generation the linear paths will be created off of it.

In layman terms this level generator is ran by a magic gnome that can make land. After making some land, the gnome can plop down work orders for the next set of gnomes with instructions for what he wants built next to that piece of land. The next set of gnomes can do the same thing, and the process goes on until the gnomes are satisfied with the world.

This is all well and good, but now that it’s time to legit produce some level designs I realized I never really put down proper plans for the new world. I had a lot of scribbled ideas for what can be done and how it should be done, but not a concise plan. So get ready for an exciting adventure in game level design this Sunday.

World Generation: Level Design Week 3

World Generation: Level Design Week 3 published on

ocean problem

 

It all started with that little ocean hole right there.

ocean problem 2Green represents claimed zones, yellow edges, blue ocean.

The problem was that it was impossible for the current zone to claim that ocean tile. It wouldn’t be able to create a double edged border . No amount of hole checking would solve it, it’d require allowing an already placed zone to revise itself or manipulating it in some other way. A can of worms. With single edged zones rapidly appearing more sane I hastily started to revise the edge system to use them instead of wasting time on a double edged system I’d probably just change later anyway.

If you can recall from last week, the big problem with single edged zones was the possibility of multi-zone connection edges:

zoneproblems

 

My solution is quite simple, during zone creation a single edge tile is reserved to be used as a doorway link between two zones at a later date. If two zones don’t have a reserved edge, then they aren’t truly connected. If an edge is connected to 3 or more zones, then it can only be opened if all 3 zones are declared open to each other. The problem was trying too hard with two edge cases:

single edge problem3  The white edge represents the currently considered reserved edge.

In this problem the considered edge is only directly connected to two zones. But it’s adjacent to an edge that’s connected to a third zone- if both are opened then it effectively creates a link between all 3.

single edge problem2

In this case the considered edge is connected to unclaimed ocean. In theory, a new zone could eventually crop up there and then it’d need an edge adjacent to the reserved edge lest it create an unintended connection! But that new edge wouldn’t actually be connected to any other zones unless it knew the reserved edge was actually open.

My unnecessarily complicated solution was to mark adjacent tiles that there was a possible zone connections near the reserved edge and to not create an open tile unless it was desired to connect to those two zones. This was, of course, completely stupid and unnecessary complexity. In the first case, who cares if it creates a connection- for all intents and purposes the player is traversing through the middle zone to get to the other zone- it just happens to be a particularly quick route. In the second case the unclaimed tile should simply be assumed to eventually be another zone and consequently that edge is unusable for reservation.

So then another problem cropped up:

double edged swordGrey mountains represent edges linking two zones. White mountains and caves represent unlinked edges.

If you direct your eyes to the top of the image you’ll notice the top of the border of the two zones isn’t detected as linked. This is because those two edges are bordering against the unclaimed ocean tiles. The solution to this was mercifully simple: I had been placing land on -all- zone edges. If I simply kept edges as ocean tiles up until a link is detected, the issue goes away.

At this point the code base had been ravaged from multiple ways of doing edges, unnecessary reserve code, and so on. So I stripped it all down, re-implemented critical components, made it so zones generate land instead of the layered multi-zone continent non-sense I had going, and so on. This entry doesn’t end on a high note, that’s where I still am. Ironically, doing the last few adjustments to get ocean hole detection working again. Look forward to a mid-week shame post, where I actually start generating level design.