My mega challenge showcase

video of me playing:
https://drive.google.com/file/d/1giUXZ6J1eiNWp-oXf5ZmerupOUbBT1dJ/view?usp=sharing

the game itself (in case you wanna try it out yourself, there is an extra level thats not in the video cause i kept dying) :
https://drive.google.com/file/d/1UvH_f3FbL7zGG4DDwXby4o-X1ASzAa5D/view?usp=sharing

there are 2 guns: assault rifle(low damage, high range) and shotgun(high damage, very low range).\

you gain ammo by killing enemies: rifle:5 per kill, shotgun: 1 per kill.

there are 2 types of enemies:
shotgunHoldingEnemies: theyll charge you as soon as they see you and shoot when youre in their shotgun range. they are imprecise(miss more shots) compared to the other group. since they hold shotguns, they have high damage(5times the other group). they are way faster than you
rifleHoldinEnemies: they are aggressive when there are shotgunHoldingEnemies around and they have enough health, otherwise theyll be passive and try to keep distance. they are more precise. they will try to use cover and theyll try to support shotgunHoldingEnemies AIs. on their passive state, theyll try to break the line of sight. they are slower than you. their movement is a bit unrealistic. **when they cant find a good location/path theyll just move around randomly but they wont get close to you. :wink: **

there are 4 levels (3 in video) : they play out almost the same but i tried to make them at least look different. you can go through them by pressing Enter(Pause) and clicking “next level”.

use left mouse button to shoot, space to jump, enter to pause, scroll to change weapon.
use alt+F4 to quit the game, the quit button in the pause menu will take you to the first level.

use cover, move a lot, keep changing between the guns based on the situation.

opinions and suggestions are more than welcome.

3 Likes

Awesome job with your mega challenge showcase! how much time and effort did you put into it?

Enough time, other than the second AI class, the rest moved along fast and easy,
The levels were in the asset packs, I just tweaked their lighting and added a bunch of cover everywhere, other than the last level which was the level I made for the course’s first challenge .
The shotgun is also " the launcher" in the asset pack.

I’m interested in how you implemented a cover system, can you explain anything about that?

I didn’t. not for the player.
if you mean how does the AI take cover, if there aren’t any shotgun enemies around and you’re approaching or dealing damage, the behavior tree goes down to a bunch of nodes that move the AI to break line of sight with the player.
you can do this in two ways:
1)just move them away from the player with a bit of random (orthogonal relative to player) direction until they can break line of sight.
2)add another camera for the AI(or the main one if it isn’t important) that searches for a location to break line of sight with the player then move the AI to that location.
in either case, the location to search for or move to is strictly away form the player with random/found orthogonal. imagine the player as the center , the AI searches only its behind, like a half eaten pizza slice.

Ah, ok! Thanks for explaining that, I was thinking of something similar for backing away randomly, but I like the idea of spawning a second camera to do the random searching for cover.

I’m hoping to create some kind of behavior for the AI that encourages the AI to find half-cover (like barrels or crates) to shoot from. I’m still not sure how to solve this, but I’m just starting to look to see if there’s a way to query the navmesh to check if there’s a direct line along the navmesh to the player, so then I’d just need to find a new location for the AI to shoot from where there’s a line of sight, but not a direct line to the player along the navmesh.

i did this because i wanted to be able to drop enemies in any level.
if you want a cover system, you should make a cover class/actor(or maybe component) and put those in the level to distinguish them between other actors/static meshes in the level. this way the AI has access to cover locations and can chose easily between them without needing to search for them. this way you can also add other animations, mechanics,… for when the player or the AI is using cover.
i think(not sure) this is how they did it in the third person shooters I’ve played : which meshes are cover and which aren’t was clear and distinguishable.

1 Like

This is basically what I’m trying to do, but to make it work, I still need to test whether there’s a direct line along the navmesh between the player and the AI. This is the easiest way I can think of to tell the AI which side of the cover it should go to so that it’s hidden from the player.

It will take me a while to figure out, but I’m confident I can check to see if the AI is behind cover by doing a trace from the AI’s root bone to the player’s root bone (or from the AI’s feet to the player’s feet) and then also do a trace from AI viewpoint to player viewpoint, and then comparing the two, so if both traces return the player as the first hit object, the AI isn’t behind cover, if only one trace returns the player, the AI is in half cover, and if neither returns the player, the AI is in full cover.

Then I just need to use something like the trick you mentioned with the camera, but doing both of these traces. Then once I know which side of an obstacle is the “cover” side, I can think about doing special animations for hiding behind, shooting over, or jumping over the cover actors.

Before I go down that route of doing my own traces, I wanted to see if there were any built-in systems that did that stuff in the Environment Query System (I’m still looking).

Well done on making the game, it looks really fun to play!

Privacy & Terms