Home Artists Posts Import Register

Content

Ever since my very first design docs from Cogmind pre-alpha, written back in 2013, I always wanted a projectile deflection mechanic. Like it doesn't get much cooler than that, being able to swat away bullets or even send beams back at an attacker, or redirect them into other targets.

Every few years I think about the concept again, and it finds its way into my ongoing notes in yet another location in some slightly-altered form or alongside some other content idea, begging to be implemented. At the same time, being so cool it's likely one of those rarer abilities that ends up being more suitable to unique parts, and has yet to find a proper place on Tau Ceti IV.

A couple days ago I decided this mechanic needs to happen now.

Technically particle deflection still doesn't have a place in Cogmind, but seeing as its time is approaching given that we're now in the Era of Cool Expansions outside the core game, and I needed a smaller project to tackle while getting my health back on track after repeated concussions (seriously annoying), I wanted to implement something fun and compartmentalized, as opposed to the grand things I'm supposed to be working on right now xD

I'm happy to announce that it's now complete, and interestingly it marks the first time in Cogmind history that I've implemented a new mechanic before having a specific use case.

Not Recommended

In gamedev it's generally a Bad Idea to do this, building mechanics for your game that you aren't ready to apply anywhere. Having one or more detailed use cases helps you think through your specific needs and acceptable limitations, otherwise when it comes time to use a generically-implemented feature for an unplanned use case, you may either find there are problems or insufficiencies and have to rewrite it, or eventually discover that you did too much work because you're never going to actually use all those features or options you built in anyway :P

I already know I've built a system that's probably more flexible than I'll make use of, based on a lot of hypotheticals as opposed to real world scenarios, but at least it includes a set of features I do know I want.

The main other aspect to worry about when prematurely constructing any non-simple system is that when it comes time to use it and you find the system doesn't quite fit your real world needs, you then have to go back to make adjustments, which can easily be more time consuming than it would have been if the initial implementation happened at the same time, given complete familiarity with the system at the time. It's just potential for extra overhead, really, but dammit I wanted to see projectiles bouncing around!

Aside: That whole section strongly reminds me of people who design, build, and expand game engines without actually using them to make a game, though that's on a different scale altogether.

Flexible Deflection

So I've tried to cover all the bases by building a flexible implementation for projectile deflection, identifying tweakable parameters in order to maybe support some fairly different items, of course all still centered around the idea of making sure projectiles hit something other than their intended target ;)

Among the main features of this system:

  • random deflection within a specified relative arc
  • deflection that always counterattacks the source
  • redirecting projectiles to target nearby hostiles
  • categorization of projectiles for deflection purposes, and the ability to specify a category to deflect, or deflect all of them

Architecturally, deflection of projectiles is somewhat related to the penetration and guided waypoints systems, which served as a good starting point for implementation. The main requirement is to be able to give the projectile a new trajectory at the right time and let it continue on its way.

On that note, it's nice that there were actually multiple indirect benefits of building a deflection system, improving the game in other areas along the way, including addressing the longstanding issue of guided projectiles always treating weapon ranges from the original source, rather than by measuring their actual path, enabling them to exceed their maximum range in some cases. It wasn't too much of an issue, hence why I'd left it like that for years, but this also factors into play with deflected projectiles, so it was about time to do something about it--projectiles traveling along a non-straight path now measure cumulative range for accurate distance calculations:

Shiny Applications

So yeah there's no spot in Cogmind for this now, and in fact there's currently no plans to use this system in Beta 13 at all (I might still slip it in somewhere, we'll see, I mean it's already built!), but deflection is most definitely be something you'll see when the Unchained arrive :)

And beyond that no doubt as well, since there are a good number of ways to use this new tech. When we think of deflection, the obvious use case is in kinds of shields, but most any item is allowed to have deflective properties, meaning we must have an energy sword that can deflect incoming projectiles. Because duh.

Below are some recordings made while I was building the system. Note they're all just test shots with fake and/or random items I was using to make sure everything works as expected, so don't read anything into that aspect. These are also not usually very realistic scenarios, either, just having a bit of fun :)

The very first system test, deflecting grenades back in the direction they came from within a 90-degree arc:

Similarly deflecting incoming shots within an arc, but sending them back into an enemy within that arc:

Deflecting kinetic projectiles backwards, like shedding them off to the side:

A 360-degree deflection capability redirecting incoming missiles at a nearby group of Swarmers:

Spectating a dangerous game with the local opposing Demo squads:

The system also supports per-item animations and SFX for the deflection, but since I don't have any real deflection items I didn't make any media for that yet, just dropped in a placeholder for confirmation that it does indeed work:

(You can also see there deflection benefiting from the cumulative projectile range limitation feature, unlike the earlier shots before that was implemented.)

Also yes, deflection is reflected in the all-important revamped combat log introduced earlier:

Well I can finally cross that off my list! Or at least the technical list. Another issue is that I now have to go leave some notes on just what kinds of items I might want to build with this, and how to properly use the available settings to get the desired results, since I've already tested it all and will forget this stuff by the time I need it :P

Now that we have deflection... I wonder if there will ever be a case for ricochet mechanics? (though I'm doubting that one--it doesn't really have the same appeal aside from being gimmicky)

Comments

John Schmidt

Really cool, looking forward to playing around with this in the game at some point! :D

Kyzrati

Hell yeah! To temper expectations, obviously this will have associated resource costs for proper balance (as opposed to the invincibility suggested by testing shots :P), though yeah now that we're past Beta 11, future releases get to see more and more wild and fun "experimental" tech. Tip of the iceberg here! In particular the Unchained will be bringing lots of unique tech, although some of their capabilities will not be acquirable since they'll stem from unique AI/behaviors, but more on that another time. Beta 13 itself already adds lots of items, many of more special origin and function.

Qingyao Sun

Isn't this the "Deflective armor" feature suggested by me 4 years ago? So glad to see it finally materialize! https://www.patreon.com/posts/patrons-create-29178814?utm_medium=clipboard_copy&utm_source=copyLink&utm_campaign=postshare_fan&utm_content=join_link

Kyzrati

Haha yes it's apparently on that list, too! And although it wasn't planned at the time I did in more recent days manage to slip it into a potential encounter you can get in Beta 13. At least it's now planned to be there, anyway. Might as well make use of the mechanic now that it's implemented :)