Introduction
Hello everyone,
Over the years i’ve seen numerous kinds of Roblox games evolve, from the paintball games of the early 2010’s to phantom forces, from speed run 4 to a full on remake of the first Super Mario Bros, and from small maps to full open worlds and RPGs, these have all evolved.
There is one genre that I still feel really hasn’t reached the potential it has though, and that is Melee Combat
Melee combat has seen some improvements over time, but nothing compared to other games. We’ve gone from linked swords in Sword Fight on The Heights to games where shiftlock is used to direct attacks, but still with the same sort of concept.
That isn’t to say that these games are bad per say, but I believe we are missing out on a huge opportunity with how we design our 3D combat mechanics, one system that most 3D games today use themselves.
This system is lock on combat
Lock-On Combat, What is it and where is it from?
Lock-On combat is a type of targeting system used by many modern day 3D games that have a combat system, and may sometimes be referred to as Z Targeting
The term was coined by The Legend of Zelda: Ocarina of Time on the Nintendo 64, and was used to help guide players with their attacks on enemies by point their avatar towards the enemy they target to help direct their strikes.
This was done because when the jump from 2D to 3D was being made, game designers were forced to rethink many traditional combat systems. With the original Zelda game, all the player needed to do was point their avatar in one of 4 directions. In 3D however, this is not the case.
Why Make Use of Lock On?
Many games currently use a system where the player turns on Shift Lock in their settings and aim their attacks by moving the mouse, thus in turn moving the camera and the player.
While this system does work, this results in most of the games skill becoming how the player can position their camera accurately, not interaction with the combat system itself.
This can be very clearly seen in numerous games, as most games of this type have one basic attack or with some a second one, a block/counter move, a dash move, and sometimes a flip.
This block usually has no openings to it, its based upon reaction time, or if it does have an opening it is on the back of the player. With this kind of combat, the shiftlock system is carrying most of the skill in the game with positioning and aim.
On top of this, slow methodical combat is impossible with this, or at least very difficult to design naturally. With the shiftlock camera system, it essentially turns the game into jump position attack. It is more viable to simply be on the move with it.
With a lock-on system, you remove that element entirely. This allows for numerous new design possibilities, and let’s the concepts be more explored.
Some games that showcase this really well are games like The Legend of Zelda series and For Honor, both of which use Lock-On systems.
This isn’t to say these other systems don’t have value, but what I am saying is we should broaden our scope on combat systems on the Roblox platform.
Template Lock-On System, how does it work?
Here I have constructed a template place for a lock on combat system, with some basic mechanics:
Move your mouse to adjust your guard, which is how you block incoming attacks and direct your attacks
Running out of stamina makes your attacks slower and you take damage when blocking
Right click after attacking to fake attack
Attack before an opponents attack lands to parry them
Known Issues and Design setbacks
One of the massive setbacks with this system can be teaming with the combat system.
Because of how this combat is structured, 1v1 combat is geared towards the most. This makes handling teaming very difficult//Impossible
I have not made this compatible with NPCs. Yes, you can damage the dummy and it will block you, but this is the extent of it. You’ll need to program it yourself or alter it for NPC combat.
NPC combat can be difficult to program with this, personally i recommend having testers play and noting strategies used by them for NPCs to imitate.
These sabers use RaycastHitboxV3, a raycast module made by Swordphin123. This is an outdated version of it, and some rescripting may be needed for upgrading to V4 if you so desire. More information is here on the devforum post : Raycast Hitbox 4.01: For all your melee needs!
Lag problems
Many checks and events are fired when the game is running, this basic system is meant to be a proof of concept and I highly recommend optimizing it for future use.
The best optimization for this system by far is a custom render for the block animations when it changes for the angle.
The second optimization I’d highly recommend if you plan on using this as a template for your game is replacing the cooldown systems for attacks. The loop style is extremely inefficient and will cause major lag throughout your game. From what i’ve gathered using functions like task.delay() and multithreading are extremely useful for this.
Another possible optimization is the input event for the mouse, which I currently have set to send every .1 seconds.
Here is the template place, enjoy everyone!
https://www.roblox.com/games/7354346829/Lock-On-demo
I hope to see more lock on combat games in the future, and thank you for your time. Have a great day everyone!