Official development blog

Multitile Actors, Revisited

Ever since my original forays into ASCII-based development with X@COM, I was both forced into and remained interested in working with actors that occupy multiple spaces on the map. The implications, the representations, the benefits, the drawbacks… all very fun issues to tackle in order to bring physically larger creatures to life, and give them the visible bulkiness they deserve.

Years back I wrote a lengthy primer on the topic, covering examples from different roguelikes, their appearances, related mechanics and design, and more. Now with Cogmind’s most recent Beta 14 release I’ve revisited this subject in my own work, so it’s about time to extend my original article with yet more information!

Some of these features were already covered on Patreon earlier this year, but here I’ll go into a little more detail, including a few of the eventual surprises I had not yet announced at the time.

Environmental Obstacles

One of the biggest obstacles to taking full advantage of multitile actors is the environment, since cramped spaces will naturally limit their movement options, preventing them from effectively chasing down smaller prey.

To an extent this can offer some interesting tactical choices--do I make a stand in this open area guarded by a large opponent, or run for it given the knowledge that even if I’m spotted I can probably get away mostly unscathed? But by extension it also limits how scary these large creatures can really be, which is rather unfortunate. Unless a majority of the surroundings are relatively open, it can be easy to slip through smaller spaces and not have to worry about being pursued.

One simpler way I addressed this issue from the beginning was to at least given these big fellows behavior that causes them to aggressively attack through walls and machines, with weapons usually powerful enough to punch right through and as a result create more open space, new pathways, and additional sight lines.

This approach definitely led (and still leads) to some scary moments marked by a feeling of gradual impending doom as walls are peeled away in your general direction as you try to make your escape. (Here we’re ignoring the players who face down such opponents with prejudice :P)

But I’ve always felt like they should be scarier, in a truer reflection of their size. Time to get smashing!

Smashing Terrain

I always wanted to have wall smashing in Cogmind, the ability for at least some robots to plow through walls as if they’re open terrain. As I demonstrated last time, this was already a feature in Cogmind’s predecessor, X@COM, so technically I removed it when I started building Cogmind, mainly because I wasn’t sure what the long-term implications of such a feature would be in this particular game, so better to wait on it. Many years later, the time had come to use it as one piece of a solution for significantly improving the multitile actor experience in Cogmind.

cogmind_multitile_entity_wall_smashing

“Haha stupid Behemoth can’t get in h--aaaaaaahh…”

These guys will only smash through walls, not machines, though they’re still happy to shoot through both those and walls where applicable.

At the same time, this doesn’t mean they go around smashing walls willy-nilly simply because they want to move. By design these bots are usually stationary in the first place, only moving if they need to engage in combat, but even then the “movement cost” to smash a wall is higher, thus they’re less likely to do so if there’s another reasonable option, even if the other option will technically take longer.

cogmind_multitile_entity_not_smashing_wall

“Why yes I could go through the wall, but I choose not to!”

Note these actors are only able to smash walls specifically, not just any solid/earth cells, so they’re not out there carving their own paths just anywhere they want across the entire map. That would be getting pretty ridiculous, so they’re still limited by the general shape of the architecture. They just need some extra room to maneuver that they can’t otherwise have in constricted areas, and enabling access to wall spaces is plenty, since that gets large robots down long narrow corridors, and into rooms adjacent to corridors.

In my earlier article I shared an image showing the more open areas where large defenders might be placed. While that aspect remains unchanged today, in the past they would not be able to venture far from those areas, or at least limited in terms of available directions, whereas now their potential range of movement practically stretches across the entire map, at least insofar as pursuing targets.

cogmind_multitile_behemoth_guard_accessible_area_beta13vs14

Research map highlighting the area where large guards have non-smashing movement access (red) from locations where they’re initially placed (white dots), compared to the areas they can reach via smashing (dark purple). As you can see, even single-tile corridors, being lined with walls, are suddenly at least three tiles wide, and pretty much the entire map becomes accessible!

Remember this doesn’t mean they will actually chase targets for that long--Cogmind includes the same old mechanics for losing pursuers, which in this case become that much more relevant since using the terrain against large pursuers may not always be the go-to option it was before.

In terms of implementation, smashing behavior was built in a generic manner so even smaller robots can be given the capability, and all smash-capable bots have an adjustable willingness to do so, though for now this ability is only found on the large actors it was meant to support, except for one special NPC in particular ;)

One potential mechanical collision I had to account for is Engineer repairs. Anyone who plays Cogmind is familiar with the zealousness with which those guys are out there repairing any damage to the Complex, so you can imagine their consternation whenever some large friend of theirs is ripping out the walls just to get around. To prevent this from becoming an issue, walls destroyed specifically via smashing are put on a looser repair schedule. If not for this delay, you could easily have a swarm of Engineers following one of these large bots around to make instant repairs, generally getting in the way.

Pushing and Crushing

So that’s static obstacles taken care of, but we have another prevalent issue when it comes to ensuring convenient fluid movement of large actors: other actors!

The normal way to handle actor blocking, especially if it’s between allies, is to simply allow them to swap places, but we can’t reasonably do that when one is regular sized while the other occupies at least four times as much space…

What we can do is allow pushing! This is way better than trying to find another way around (which probably doesn’t exist anyway), plus it’s cool and makes a lot of sense that a large actor could push around smaller ones.

Fortunately I already pioneered this feature for Polymind, having completed half the work involved by developing the mechanical side of how to properly push robots out of the way. Sure pushing one robot is easy enough, but when you have a chain of robots and more complex scenarios, it can take a bit of doing… (I described that a bit in Part 1 of my Polymind articles) With that done, I’d just have to borrow the code and teach the AI how to actually use this as well, since I’d previously only needed to consider player control.

cogmind_multitile_entity_pushing

“Coming through!”

We also have another related option in an actor-blocking scenario, not required but definitely cool and fun: crushing! Not for friendlies, of course, but if the blocker isn’t an ally and we’re big and buff, crushing them to pieces seems like a reasonably desirable outcome. So that can happen, too.

cogmind_multitile_entity_crushing

“Coming through… you!”

Only single-tiled actors may be pushed/crushed, so multiple large actors moving around near each other will be limited as before, though this doesn’t often come into play except with Cogmind allies, and they are equipped with some great new supporting features…

Multitile Allies

The biggest driver for improvements to multitile actor behavior has always been their performance as allies. Since players spend more time with allies, up close and personal, that also means more opportunities for frustration when your big friend just won’t get the hell out of the way, or can’t follow you to a new area without you hacking away at the terrain yourself.

For quite a number of versions now I’ve wanted to include solutions to these and other problems, but despite always putting it on the near-term TODO list, it always bubbled to the top shortly before release and I’d run out of time to complete it, this being a decent-sized project on its own. Well with Beta 14 I said enough of that, it’s going at the top, and did it right at the beginning. HA, take that :D

The smashing and pushing capabilities described above are a good start, and inherent in the new movement behaviors of large actors so we don’t have to worry about any special treatment there, but there’s definitely plenty more we can do which is specific to allies.

For one we can solve the problem of entering a new map that simply doesn’t have enough room for big friends. As a backstop for players with big armies tagging along, I did already increase the maximum distance at which they can spawn into a new map, though this can only go so far, and isn’t ideal as they get spawned further and further away, or large actors take up chunks of room that could be used for other allies, maybe even preventing others from spawning at all.

Easy enough. Now that we know large actors can smash walls, let’s just allow them to do that upon entering new maps.

cogmind_multitile_entities_smash_entrance

“We’re heeeeeeeere!”

That’s overall a minor issue compared to behaviors that start getting in the way while traveling with large allies over the long term. For that we’re going to need some more complex solutions.

Avoidance

Well at least your multitile allies can push you just fine, so you and your normal-sized friends are generally not an obstacle as far as they’re concerned. But what about the other way around--you’re certainly not pushing them, and that’s the bigger problem.

First of all their ability to push other actors and smash walls if necessary means they’re much less likely to get stuck doing their own movement, say for example if they’re ahead of you trying to reach some target further ahead.

That much is great, but they might still get in your way, and we’ve got some new helpful behaviors to manage this.

The simplest is the STAY order, which when given to a large ally causes them to always attempt to maintain some distance between you and them. They’ll even back up into a wall if they have to, since the top priority is just get out of the way, and they might very well be in a narrow corridor or corner scenario where a little smashing is the only solution.

cogmind_multitile_entity_back_away

A large ally with the STAY order trying to avoid blocking Cogmind, whatever it takes. This can technically also be used to get them to “back up” in front of you as you advance.

Caravans

Another important change we need to focus on is preventing large allies from bunching up to begin with, especially considering their inability to swap with or push one another. We need them to spread out…

In the beginning all Cogmind allies tended to just move around you in a shifting cloud. This is fine if you have a few combat allies, but has become a problem before, like you probably don’t want your Mechanic hanging out on the front line of a hostile encounter. So back in 2020 I modified non-combat AI follower behavior to “hang back” more, even retreating ahead of you if you decide to retreat along or near your original path.

cogmind_noncombat_follower_hang_back

An Operator buddy generally staying back a little, rather than circling Cogmind’s position like a combat robot can. This feature has worked out pretty well since it was added, increasing their survivability in hostile situations.

This is a pretty big improvement over getting your defenseless friends shot up while just traveling around.

We can borrow this same system to keep large allies out of the way as well, although since they’re chunkier we probably don’t want them getting in the way of other smaller allies, including those already hanging back, suggesting we want large allies even further behind everyone else.

cogmind_allies_mixed_group_formation_labeled

A typical controllable mixed ally layout when all are following Cogmind, heading west.

Having a nice point a little further back for our big chonker is great and all, but what if we are fortunate enough to be supported by a whole collection of chonkers at once? All of them trying to hang back at the same point is just not going to work, not to mention the resulting cluster will hinder the movement of other bots.

More spacing is needed, and each large ally is like their own cluster of bots after all, so let’s just extend the following system further, as far as it needs to go, adding a new point for each subsequent ally.

cogmind_multitile_entity_caravan

Multiple multitile allies following Cogmind in a chain.

Backing up will also cause the entire “caravan” to reverse direction and back up in the same order, at least for a little while until it’s maybe time to swing everyone around and return to following behind you.

Vision

In my other article I discussed targeting origins and AOE effects, but I didn’t cover another aspect technically not given any special attention in Cogmind at the time: line-of-sight. Although less of a true problem or even a factor that more than a few players noticed, line-of-sight for multitile actors had some quirks and it was about time to do something about them.

cogmind_multitile_entity_FOV_beta13_old

Simulated FOV of a Behemoth in a guard position prior to Beta 14. (“Simulated” because AIs in Cogmind, aside from drones, don’t technically calculate actual FOV in the normal sense.) Talk about tunnel vision!

You’d think FOV from such a position would look symmetrical, but it’s clearly not. It’s actually calculated as it is for any other actor using its base position, which for large actors is their top-left corner. You can see this in action by observing the shape of the FOV in the above image, and imagine that the shapes are equally odd (but in a different way) for other orientations and scenarios where a large actor is blocked by something immediately adjacent to them.

For those aware of this discrepancy, it could impact tactical decisions by suggesting an optimal direction of approach in some scenarios, which of course doesn’t make sense.

The original method was used simply because it was easier and involved fewer calculations or special cases, something that’s always nice to be able to iron out after working on the same game for, oh… over a decade, which is completely normal I promise.

cogmind_multitile_entity_FOV_beta14

The expanded Beta 14 FOV of the same Behemoth in a guard position shown earlier. Now they not only smash through walls, they even have much improved (normal…) vision!

The same situation technically applied to AIs attempting to spot large targets, only caring about their top-left corner, but that has been addressed in a similar manner for greater accuracy.

I’m altogether very happy to have all these new features in the game now, which are definitely contributing to a better play experience around large actors--scary when a hostile one’s spotted you, and not so annoying when they’re on your side. Can’t wait to do the type of run that is more likely to have large allies, or even more than one! Also looking forward to seeing more player stories or streams featuring fearsome Behemoth chases :)

cogmind_doshdoshington_RIF_army

DoshDoshington‘s love for bothacking has already seen him doing runs in which he gathers quite impressive armies, like in the above screenshot, and large allies can play helpful roles now rather than being roadblocks most people want to murder or ditch ASAP. (He’s shared some even better shots on Discord, but big spoilers so I won’t share those here…)

This entry was posted in Design and tagged , , . Bookmark the permalink. Trackbacks are closed, but you can post a comment.

Post a Comment

Your email is never published nor shared. Only the anti-spam entry is required. See here for the privacy policy.

You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>