LaggFPS DevLog #2

Test playground where all the magic happens.

Two weeks ago I finished a new version of LaggFPS (v0.0.2), which resulted in adding one the most obvious and important feature of any FPS: “shooting“.

Though far from being completed, it includes: muzzle flash, bullet trace, shooting sound, impact holes, sparks and smoke, and a very straightforward implementation of recoil, as well as some basic gunshot sounds for each weapon. All of it, ready for multiplayer, tested and playable. 🙂

Let’s go with some implementation details.


Muzzle Flash: Its been approached with 3 orthogonal planes to show different shapes depending from where do you look at it, where the plane most misaligned with the camera is faded out gradually to avoid breaking the illusion (inspired by foliage hiding planes technique). Once combined with translucency and applied the gradient map, the effect is quite convincing.

Finally, it is instantiated as a Niagara Emitter, where some rotation/scale is randomly applied for each instance. Last but not least, the flash also turns on/off a light attached to the muzzle weapon to add illumination on its surroundings.

Muzzle flash plane composition. On the right, the final result on Unreal Engine.

Bullet trace: In this first iteration, traces are straight lines with instantaneous hit time; yet parabolic bullet physics are on the roadmap, I didn’t want to over-complicate this version. Implemented with a Niagara Beam Emitter, it does the job for now, but I will rework it in later iterations since I’m not fully convinced.


Impact holes, sparks and smoke effects: Smoke and sparks are implemented trough regular Niagara Emitters (in a same Niagara System). On the other hand the bullet holes are instantiated as translucent decals with textures created with Substance Designer. Though I managed to have decent results, I didn’t feel really in control using SD, so I might consider switching to a Blender approach to create the rest of decals, which I fell more comfortable.

Current state of the impact effects

Weapon Recoil: I apply translation/rotation aligned to the weapon axis in the later stages of the animation blueprint, following custom animation curves for each weapon. Every bullet shot, the animation effect stacks on top of the previous ones, making the recoil effect compounding the faster you pull the trigger. At this point, though only the forward-axis (translation) and right-axis (rotation) are animated, the effect is quite pleasant. In following versions I plan to add more layers on the animation process to achieve even more convincing results.

Finally, I would like to mention that since I don’t need to duplicate the animation work for each 1p-3p mesh, I can say that the “True FPS” approach I took is paying off -for now. That being said, in the future I might consider simplifying some third-person animations -especially for replicated proxy actors- if performance suffers from it.


Gunshots: After looking at some gunshot design YouTorials, I rapidly saw that there is a lot of stuff behind a good shoot sound, which I couldn’t afford right now -time-wise. So ended up recording some basic free sounds from internet, mixing them with Audicity to give them a more interesting character, and then played inside a MetaSound with small pitch variation and Attenuation Settings to have some spatial awareness.

Nothing cool, but enough to prove the point.


Multiplayer: This time I wanted to go a step further regarding multiplayer. Instead of just “it works on the editor”, I wanted to see it work -across a server hundred of miles away.

And it worked! After some YouTorials, I managed to compile a server version of the game and deployed it to a Linux Server on AWS. Even using on the cheapest Amazon EC2 instances (t2.micro, 1 vCPUS, 1GB RAM), at the time of writing this, the server has been running for about 3 straight weeks, using a modest ~300Mb of RAM and using only 4% of the CPU (idle) or 6-8% when several 2-4 players are in it. Still room to grow 🙂

Top processes running on the AWS server (Paris)

Even with the game still being far from playable – in a fun way – I’m pleased with how it’s beginning to feel.

See you in 0.0.3!

v0.0.2 running connected to a server in Paris, with 2 player in different computers from BCN.

LaggFPS DevLog #1

There it is, the firsts steps of my baby FPS on UE5!
It doesn’t speak yet, but it walks!

The goal of this first iteration is to create a solid foundation and focus only on the essentials:

Basic locomotion, using idle/walk/run cycle animations interpolated in a blend space. As a starting point, I’ve borrowed the animations from the Lyra demo project, where at some point I’ll adapt & improve them as de project evolves.

Basic aiming, with two modes: Hip and ADS. Player’s mesh upper body is procedurally animated using a Control Rig, and later blended back to the locomotion animation result.

Also I decided to go as a True FPS -no difference between what the player sees and how the world sees them-. It does come with some additional challenges due to the fact that some tricks used on traditional FPS are not an option here, but also it comes with its strengths. Its provides a world cohesion that helps in some technical challenges -shadows matching, player visibility vs. player POV, etc. Overall, I hope it will help more than harm, and adding value to create a more immersive player experience. Time will tell!

Last but not least, multiplayer replication is a must from the beginning. The game will be PVP focused, so I don’t want to get caught off guard later on this part. I really have 0 (ZERO) previous experience in real-time multiplayer games, so this will be one of my main challenges.

Enjoy!

v0.0.1 running two players locally on the UE5 editor.