Enemy Projectiles and Parry Synchronization

A few weeks ago, I came up with the projectile parry idea and fully implemented the system in my PVE game, Muffin Assault. The mechanic is inspired by Ultrakill’s and Bleed 2’s, which you reflect projectiles by using normal/quick melee attacks. Here’s the thing, though: it communicates through the client (melee), and all enemy projectiles are purely server-based. So here’s when I tested 3 kinds of server projectiles:

  • Fireball: This projectile is fired with 40 studs/s. The player can easily parry it
  • Rocket: Fired with 100 studs/s. The player still can parry that, but has to stand by the side, as the rocket will be unsynchronized and likely to hit in front of them
  • Boulder: Lobbed with 1 second interval (based on @/EgoMoose’s projectile motion) and Roblox physics. Often not registering a parry hit when the boulder’s falling velocity is high

Based on testing, the efficiency of the parrying system and projectile raycast is heavily reliant on server pings (including ping check and distance check). The slower the projectile is, the more likely the parry will land. But as for some game like Combat Initiation, it features only client-sided melee and enemy projectiles which the player can seamlessly reflect them, even in front of them (like I mentioned in the rocket part), without having to worry about exploits(?) and other clients. Note that both melee systems use OverlapParams, but mine has 5-time task.wait() loop for each attack frame.


(pardon high pings. i had unexpectedly slow connection. but it might have proved something, maybe?)

Any ideas to achieve something Combat Initiation had?

Bumping this thread as I give out another clue for the idea. When I played Zombie Strike and looked at its source codes, there’s a client projectile script that, whenever an enemy attacks on the server, it sends in a projectile to all clients (no server projectile involved except damage register). The projectile will register when it hits only local player.

So, as Zombie Strike’s projectile system almost behaves like Combat Initiation’s, I assume there’s might be possible to perform client melee parry synchronization, then send it to the server. However, there’s no clear method for this, so it’s uncertain if I should follow this practice. If you still have any other ideas or solutions, please let me know. Thank you.

You wouldn’t be doing projectiles on the server. You do them on the attackers client, then replicate them visually to the other player’s clients. If the attacker sees that they hit someone, it tells the server, and the server can use the data the attacker sent for projectile replication to instantly replay the path the projectile took. You’d rewind the hit player’s hitbox based on the attacker’s ping, and if the projectile intersects the hitbox at any point then that’s a hit.

Parries are basically the same concept except instead of being reported by the attacker it’s reported by the defender, and instead of using their character’s hitbox you’d be comparing the parry hitbox.

The possibility of your client “mispredicting” is a case you’d need to consider for either way, parry or no parry. After all, if you shoot on the client but you were dead on the server and just didn’t know because of latency, you never actually fired that bullet on the server. If that bullet were to hit like an explosive barrel or something, the player’s gonna be real confused as to why the barrel un-exploded itself lol.

Yeah, you are correct in most parts. But I also learned more about Combat Initation projectiles. So here’s the information I have gathered so far:

  • The enemy npc will send a projectile to all clients. But has to store server projectile data first before that
  • Projectile that is created in the client has also been stored in the cache table, just like the server
  • Instead of raycast, the projectile uses both Roblox physics and touch event. But it still has to fire server to verify server damage
  • Projectile has CanQuery property enabled for client melee hit. When the projectile is parried by the player, tag it before replicating to the server. The server will also tag it as parried and then send feedback to other clients for visual
  • When destroying the projectile, its data stored in both server and client will be removed

Following these methods above, I managed to create a prototype system

Even if it works with both enemy npcs and players., right now I’m still trying to figure out how to make it work for enemy npcs damaging ally npcs on the server side while maintaining projectile replication. That’s something Combat Initation is having. Let me know if you have any other clues

P/s: apologize for bumping lately, I recently discovered it not long ago.

1 Like

Where are you getting this information from? Touch events / roblox physics are not recommended for projectiles for many reasons. You can’t instantly replay a projectile’s path to verify shots accurately, you can’t filter what you’re looking for, server doesn’t usually run physics by itself but instead offloads it to the nearest player’s client, etc etc.

sir


use this its more reliable + less laggy

you are two months late in responding. i already replaced with spatial query. but thanks for providing advice nonetheless giggles