content top

More on Pathfinding

I should have titled it “Moron Pathfinding”, but self deprecation aside, let’s talk about getting from point A to point B.

I set down some graph paper and translated my rough map of the Universe to a coordinate based structure. In-game, this has absolutely no bearing whatsoever. It doesn’t currently matter where each sector is located in relation to others in terms of how players get around since they can only travel via jumpgates.

But in terms of pathing, it turns out that position and relation matters a great deal. When you’re in a place surrounded by n number of avenues that could lead you to your desired destination, you need to know which avenue to pick. In the real world we have the ability to navigate by direction, since the compass never changes. We also have maps and GPS to help us. In the arbitrary world of a game map, though, we have no intrinsic way to select which exit we should start with. In my case, the fact that the sectors have no concrete relationship to one another in space (!) meant that it was damn near impossible to tell which jumpgate to use to start the journey, and later on which ones to use to continue the journey.

With my trusty graph paper I placed sectors in relation to one another and then used the Cartesian coordinates to ID each sector. I had to add support for this data to the JumpgateDataObject class, and then to the sector editor, and then had to fill out the database itself with the data. I then looked at a C# implementation of A* that I found on Code Project but realized that it would require some serious re-working to get it to play nicely with my implementation, so I opted to just roll my own with this example as a guideline.

The implementation I came up with was this: the measurement between the current sector and the destination was going to be a no-frills Pythagorean sussing out of the distance between those two coordinates. The system would first determine each exit from the current sector. It would need to calculate the distance between the destination sector and each possible exit from the current sector, and then select the shortest distance as the most viable option while discounting the others. The pointer would move to that viable system and repeat the process. This is the “A* for Idiots” explanation as I understand it. The process would continue until one of the exits leads to the destination as the next sector, at which point everything would end and the list of sectors that the system discovered was printed out for review.

Two problems: The first time I tried the process, I miscalculated on each possible exit. I was calculating the distance between the current sector and the next sector, and not the next sector and the destination. This gave rise to issues where it would pick the most convenient exit, but it wouldn’t necessarily lead me in the direction I needed to go. Picking the shortest distance between the potential exit and the destination should lead me in the direction of where I want to go, except when the sector design was broken. Some of my sectors are cul-de-sacs, with only one entrance, and the same exit. When it was determined that one of these dead-ends was the closest sector to the destination, then nothing could happen and the process would die, especially since the process negates the use of sectors we’ve already passed through.

By switching the distance calculation to use the distance between potential next sectors and the destination, and by re-working the map so there are no dead-end sectors, the code worked as expected. I was able to plot routes from one side of the map to the other, theoretically as efficiently as possible. Since I’m not considering the cost between sectors — which would be the calculation of the distance between the current and potential next sectors — the route could be a bit longer than it would be otherwise, but at least I know that my pathing will be moving in the right direction, and not taking the NPC or player into the depths of unknown space.

Read More

Finding My Way With A*

Oh boy. The longer I continue with this game development thing, the more I realize I’m nowhere near equipped to do anything about it. Case in point: simulating greater NPC livelihoods through pathfinding.

My current NPC implementation is rudimentary: I have a pool of potential, generic merchants, and there’s a chance they’ll spawn at a jumpgate in a sector that the player is in. They’ll dock at a station, take some goods or leave some goods, and then fly off to another jumpgate and go back to the pool, effectively vanishing from consideration while the background sim moves goods around on their behalf.

Ideally, I want NPC merchants to be the simulated wrench in the player’s works by allowing them to actually “move” through the game world on their own. After buying goods at a station, they’d be able to pick a station to sell at from any in the database that buy those goods, and would “use” the jumpgates to get to their destination. Because the other sectors they’d be traveling through aren’t “online” — i.e. they’re scenes that aren’t technically loaded — it would only be a simulation, but I want the NPC’s trip to be as accurate as possible. One option I considered was to simply “jump” them to their destination, meaning as soon as they left the player’s sight they’d simulate the selling and buying, would “jump” to a new sector, etc. They’d have access to technology that the player didn’t: instant teleportation to anywhere in the universe! Since that’s kind of cheating, and because I’d like to have the player maybe be able to actually follow (and maybe interrupt”) an NPC from gate to gate, I need some kind of pathfinding solution to calculate a route the NPC would expect to take if they had the ability to move from scene to scene.

The Big Name in pathfinding is A*, and that’s where all roads seem to lead me, but A* is built on some specific assumptions that my system doesn’t currently subscribe to. I’m finding that all examples and explanations are presented as a function of contiguous steps, as in a grid of squares or hexes. My map is more spread out, although technically I could illustrate it so that each sector is immediately adjacent to one another, forming a crude tile map. Another issue is that the requirements of the algorithm are based on a weighted metric that’s a factor of A) how far you are from where you started, and B) how far you have left between where you are at any given time, and your intended destination. I don’t have measurements between my sectors, since a jumpgate solves the distance issue by fiat: you’re teleported between connected gates without regard to how far the sectors are in physical space.

So the plan, then, is to lay out the sector map in a grid (on paper). This will only allow each sector to have four possible adjacent sectors, which will require some re-mapping of my current layout. Each gate will have a D value of 1, since moving between any two adjacent sectors is equally cost-efficient thanks to the jumpgates. Using a grid will allow me to pin a Cartesian coordinate to each sector — something I really didn’t want to do from day one — which means I can calculate the (I’ve seen people saying to “estimate” h, but I have no idea how we’re supposed to do that if we don’t know how many sectors we need to pass through…which is part of why we’re doing pathing in the first place!). Since g is an additive value — the cumulative distance from the start — I should have all the parts I need to do these calculations.

Why not use an established A* implementation? Again, this is all simulated. I don’t have a physical anything to work off of. I have a table which contains the jumpgates, their home sectors, their destination sectors, and their destination jumpgate ID’s. That equates to the “map” of the universe, or at least the traversable map of the universe, but it’s all “theoretical”, highly irregular in space, and without measurement between each sector. I’m having to throw in a whole lot of useless, arbitrary data just to get a rudimentary A* system in place, and that doesn’t make me happy, but I am so outclassed in this corner of the project that it’s the only solution I’ve been able to grasp well enough to make a go of it.

The good news is that if I can pull this off, I can also use this algorithm to allow the player to plot routes to known sectors, at which point I might be able to use the Cartesian coordinates to somehow lay out a map of the known universe. The only issue with that would be that I couldn’t represent the sectors as adjacent; they’d have to be displayed with representative distances so the universe doesn’t look like it was designed with a ruler and graph paper.

Read More

Getting to Know You

No matter what kind of “voice” a blogger chooses for his or her blog, there’s always going to be an injection of personality in the posts. A question that occurred to me the other morning after reading the morning paper (i.e. my Feedly selection) is that I wonder how many people write about themselves as opposed to writing in regards to themselves, and then how many people prefer, have no preference, or dislike reading posts about the blogger’s on their gaming blogs?

“Writing about themselves” is when a blogger gives you direct access to his or her life. They’ll maybe write about non-gaming things like where they went, who they went with, or even offer deeper personal insights. “Writing in regards to themselves” is more like talking about personal opinions on games or even non-game related activities, which I think is really the default state of most personal blogs anyway.

Is hearing about people’s actual lives something that people look for in a blog? Is it something that will turn people off from a blog? In either case, why?

Read More

On The Hook

As an amateur game developer using Unity, I often turn to the Unity Asset Store for stopgap measures used to cover aspects of the game development process that I can’t/can’t yet/don’t see myself ever being able to get around to making myself. Some of it has been specific — like buying 3D models for at least the prototyping stage — and others have been more general, nice to haves because an asset offers a faster way of doing something that I could do, but know would take me a lot of time (and momentum is important for me if I want to keep interested).

One major issue that I have with a community marketplace is…well, the community. I don’t mean in a typical forum way. Instead, it’s with the idea that just because one can doesn’t necessarily mean one should, especially when it comes to ongoing support.

I’ve recently been looking at an asset called The Spaghetti Machine which is a user-definable node editor. My plan for this would be to set it up so that each node would represent a sector in Project Universe, and the connections between nodes would represent the jumpgates. I would then (hopefully) be able to use the output of TSM to generate my Scriptable Objects, thereby creating a nice, visual representation of my game world. TSM would save me the “hassle” of having to learn to create my own node editor, although I put “hassle” in quotes knowing that learning how to do it would benefit me more in the long run than buying something off the shelf.

The last communication that I have been able to find from the developers of TSM has come in about a year ago. There are several posts on the official Unity Forum thread that are currently unanswered, and I checked into their Get Satisfaction support page only to find the same drop of communication. Links to a demo version of the product are broken, and even their sales-pitch YouTube video hasn’t had a comment in quite some time. The developers of the product have said that TSM was a tool that they developed internally for their own use, which means that it was never created specifically to be sold on the Asset Store, but at $100 for a single seat license, I have to carefully consider if this is something I want to buy. I’ve no doubt that the Asset is in sound condition because I haven’t seen too many complaints about it, but I am left to wonder if there will be improvements or even any responses to bugs in the software that fixing is going to benefit the developer’s internal use.

 

What bugs me the most is when a company sees a community marketplace as a dumping ground, or as a source of secondary income that they can take advantage of by releasing their internal projects for a fee. A lot of tools are made by experienced developers that have benefits outside of their own projects, and those tools would be a magnificent boon to people like me, but because supporting the product on the marketplace isn’t the company’s focus, I’ve seen several assets that have just been left to rot while still being sold at their original price point. That’s dangerous for people like me who come across them at a point after their heydays, who think that the asset is what they’ve been looking for, but who then have to seriously consider spending the money to get what they need, or to withhold the purchase because it’s well beyond it’s expiration date and the developer doesn’t care about the support of that facet of their project any longer.

If a developer is going to publish a tool on a community market, then the developer must make a promise to treat it as what it is: a real product for sale, complete with a support contract for the life of the product. If the product is to be no longer supported, then it should be removed or severely discounted in price to reflect this. Simply offering a mea culpa after months of silence claiming that they were busy with their “real project” isn’t good enough because who knows if that will ever come? It’s disappointing to search for a solution that would help significantly only to find that it’s expensive and yet poorly supported by the developers.

Read More

The Rise and Fall, Fall, Fall of Firefall

FirefallLogo

When someone talks about first person shooters (FPS or just “shooters” for the purpose of our conversation), it’s a safe bet to assume that they’ll be referring to competitive shooters like multiplayer modes of Call of Duty or Halo, much in the same way that analysts who mention “video games” are actually referring to the narrow subset of “console games”. It’s still considered somewhat necessary to include a single player component in AAA shooters, but the talk of the town is almost always about how the online, PvP modes sell the game and keep it relevant until the next installment is released.

Firefall started out no different from these multiplayer games when it was announced in 2010. The game was to be set in a world in the midst of a collapse after a several cataclysmic events that made most of the planet unlivable, and which paved the way for an extra-dimensional condition called the Melding.  The player would be taking on the role of an ARES pilot, an elite soldier of the world government called the Accord, and tasked with keeping the Melding-mutated Chosen at bay, and to hopefully push back the Melding and reclaim the planet. There would be mission structures that allowed the players to follow a story arc over time, as well as take one-off missions for currency, reputation, and other awards. The biggest selling point of the game was that player activity would actually have an impact on the shared world by allowing players to activate Melding repulsor devices that would reveal new sections of the map, but would require upkeep to ensure that the Melding didn’t fall back into place.

I played Firefall for quite some time a few years ago after the game had it’s own real-world cataclysm. According to street-lore back around the time the game was in closed alpha, production was stalling and behind-the-scenes the company was a mess. Mark Kern, the CEO at the time, was apparently a hot-head and had made several poor decisions, so the story goes, including spending a massive amount of money on a custom built Firefall branded bus that contained several game demo stations. The plan was to drive the bus cross-country to advertise the game, but in the end the bus never even made it onto the road (literally…it didn’t run, from what I understand). The game itself had shifted directions several times, from a balanced PvE/PvP game to a majority PvP game with an intended focus on e-sports, to a majority PvE game which is where it sits today. At one point the PvP content was totally removed from the game (or at least made entirely inaccessible), which was a complete 180 degree turn from what the game was supposed to be when it had been announced.

Firefall ended up being a legitimate punchline in some sections of the gaming community. Since hearsay is an official currency in some gaming circles, everyone claimed to know that Firefall was a disaster, had no direction, and wouldn’t live to see another year (every year). As someone who played it quite religiously during what I’m now personally calling it’s “golden age”, I thought that things were moving along nicely after the company appeared to be getting back on its feet after ousting Kern and promising to get production back on track. For the most part, the game itself has always flown under the radar, which was both a blessing and a curse. It allowed the team at Red 5 to work on the game without constant toxic scrutiny that the gaming public usually provides, but it also allowed Red 5 to continue to operate more or less in the dark, a factor which kind of crept up on everyone at the end of last year when a post on Reddit from a supposed employee of the company claimed that the company had failed to make a payroll deadline, leaving everyone in the company without their expected paycheck. Once again, Firefall and Red 5 were being put through the community ringer for being mismanaged and an unmitigated disaster.

I opted to jump into the game this weekend to see for myself (how novel!) how things had progressed since the Golden Age. Red 5 had just released a new mega-patch, albeit one that was apparently having some issues with legacy characters who needed to be ported to a new mechanic. Overall, the game is still recognizable as the Firefall that I played: the main focus is on PvE, although the arena PvP game “Jet Ball” has returned. I was able to reclaim my old battleframes — swappable weapons platforms usable on a single character — although a few were retired, and the management for all of them was totally different. Whereas before you’d simply improve the existing frame, now each frame has slots for different parts of the armor like arms, legs, torso, head, reactor, and operating system that you can upgrade discreetly. Primary and secondary weapon slots are still present, as are the three standard and one mega-ability slots you can trigger in addition to your main fire modes. They did make some changes to the weaponry — for example, it used to be that the right mouse button offered an alternate fire mode, but now it simply aims every weapon, and the main weapon of my Firecat frame now acts as a flamethrower and not the beloved splash-damage fireball shooter I so enjoyed. I was surprised and a bit horrified that even with my advanced frames, I was being asked to perform the tutorial mission arc, a task for which I was way overpowered. It helped me get back into the game, but the “tutorial” melds into the story missions (some of which I’d done way before now, and before they were part of any coherent story) didn’t seem to care that I was well beyond the proper level for them to be anything more than busy-work.

That jarring juxtaposition of trying to create a normal, logical game from this point forward, and the existence of legacy players and designs appears to be the hallmark of the current state of Firefall. It seems like there’s two different ages of the game going on here at the same time. One is the legacy game with all of it’s original promises and conceits like the terrain, the battleframes, the Melding, and the Chosen, and the other is trying to correct the mistakes that had been made throughout the years in some of the mechanics and presentation. It’s like building a skyscraper around an ancient cathedral, where the mandate is to not wreck the beautiful work that’s already been done, but which also needs to upgrade the space for the modern era. These two states are co-existing, but are not always complimentary, and sometimes unintended consequences arise like missing voice overs and strange camera glitches that should have been (and were) fixed years ago, in addition to a number of bugs that are simply unavoidable in software development.

Red 5 has a deal to bring Firefall to China, and as always I hope it pans out for them in many ways. I still really like the game, and had played for a few hours this weekend. I really enjoyed the new mission arc that I’ve been plowing through, even though I’m way overpowered for it (they now have a zone down-level feature, although you still get to use your up-leveled arms and armors). But every now and then I ran into some baffling situations that were so incongruous that they couldn’t be anything other than bugs. This is taking its toll on the existing community, as you’d expect. I watched one player scream at a community manager in general chat about the litany of sins that Red 5 had committed with this game’s muddled mission-statement and the company’s attitude towards the player-base over the years, and while I certainly would never condone the kind of behavior that player was displaying (double especially when directed at someone who has no decision making power and whose job it is to willfully interface with the community), I can appreciate that his frustration was the end result of years of apparent indecision and bad management of a game which really has a whole lot of potential, even to this day. It seems that for every step forward that Firefall makes, it always manages to fall back on it’s ass somehow.

There’s not too many games like Firefall out there or planned at the moment from what I can tell, and I think we’d be poorer for not having it around. Had it all gone swimmingly from day one, I think Firefall would be a game that people would be talking about in positive tones as something special that stands out as a welcome hybrid among the fantasy MMOs and testosterone-laced military shooters. It has an interesting story, great community-goal mechanics, and a solid feel to it’s gameplay. Everything wrong with the game doesn’t seem to be with the game directly, but with the decisions and the directions made about the game and their implementation, and I’m worried that it’s gotten itself so tied up in knots at this point that it won’t be able to un-knot itself to realize it’s potential. At any rate, it’s damaged goods in the eyes of many gamers, and if history is any indication, there’s no way even the best case scenario could redeem it going forward. That’s why I hope it does well in China, that it brings in new money, and allows the game to get itself back on the track that I think the game deserves.

Read More
content top