link to play — https://aviparmar.itch.io/combat-in-unreal-engine-5
Brief
I attempted to create a version of the popular Atari game ‘Combat’ in Unreal Engine using third-person controller templates to learn UE5 and blueprints.
In this blog post, I will be going into all the different mechanics of the game and the blueprints I made to make everything work.
Combat
Combat is an old Atari game where two players try to shoot each other out within a given timeframe.

I tried to make something similar, while trying to leverage the strengths of Unreal Engine.
This meant using the third person controller given by Unreal, leveraging photorealistic quixel assets, and making enemy AI.

Third Person Controller
Controls
- The default controls that came with the template were WASD to move, and space to jump
- I had to add a sprint function, so the user can hold on shift to sprint

- I also added a projectile function, so when the user clicks on right mouse button, the character shoots a projectile.


Health & Time
- A UI canvas was created to display the various discrete mechanics such as time and health, and all the code for this was made in the Third Person Character blueprint.
- Since I was still learning at the time, the blueprint was pretty messy. If I had to do this again, I would wrap it all in a function instead of making it in the event graph itself.


Enemy AI
Pawn sensing component
- A pawn-sensing component was used to power the enemy AI’s movement.
- This was connected to the projectile mechanic as well, so that the enemy could shoot
- The shooting mechanic was given a reload time to adjust the difficulty of the game.



- Since the game still felt too easy, and the enemies weren’t scary, I had to make a couple of changes
- The first change was to make the enemy material red, and the player material blue


- The second change was to make it so that when the enemy is far, they would sprint, and when the enemy was close, they would walk.
- I could easily recycle code from the third person controller for this, but had to configure a walk and sprint animation



Environment
- The map of the game was a copy of the old Atari game combat.



- The assets were from quixel, imported into unreal using the fab plugin.
- I wanted to experiment with terrain and foliage, so I imported some rocks and grass assets as well
- The terrain was made with the built in terrain mode on unreal, and foliage was spread with the foliage mode

- I added in various lighting effects, like exponential height based fog, volumetric clouds, sky light, sky atmosphere and directional light to make the scene look more dynamic.

- Various sound effects were also added to sell the feel of the game


Leave a Reply