top of page

This project is a collections of scenes that test out different systems and mechanics. While every mechanic will not be listed, it will go over the most prominent ones in my opinion. 

Systems and Mechanics

Bow and Arrow Mechanic

In this mechanic I wanted to see if I could even get a bow to work. In the end it works just like a regular projectile. It nocks a new arrow on start and instantiates an arrow when fired. When it instantiates it grabs the rigidbody and adds a force to it to throw it forwards. This rigidbody has to be in a certain collision detection mode. Which is continuous dynamic. This allows the arrow to hit other fast moving objects instead of passing through them.

 

The bow version 2 builds on the 1st version by allowing the player to hold a button to ready the bow. This is done by using a Vector3.MoveTowards method. While holding right mouse button the bow is ready so move to ready position using the method. If the player releases the mouse, then unready the bow and move it back to the unready position. 

Finally, the bow version 3 builds on all other versions by adding an animator to the mix. When the bow is ready, it plays an isReady animation. When the player releases the button, it plays the same animation in reverse. The same goes for the audio in this special case. The bow has a dummy arrow in this version that it does not shoot. So it plays the fire animation with the dummy arrow, then disables it and instantiates a new arrow in its place in an instance. This allows us to play the firing animation and do a quick bait and switch on the arrow object. 

Grenade Mechanic

A good portion of demo two will be taken up by a grenades testing scene. In it we test a variety of grenades which are frag, sticky, teleport, smoke, cluster, bouncing betty, magnet, emp, proximity mine, flash bang and black hole. Below is an overview of each one and its creation process. 

Frag - This turned into my baseline for most of the other types of grenades as it needed to have a few of the same variables such as cook time, throw power, explosion particles and audio source. Other variables that changed was the explosion force. Once I had a prefab of this I turned it into a reusable baseline by grabbing the prefab, unpacking it completely then reconfiguring the components of the grenade to fit the new type. Once done, this was then remade into a new prefab for the new grenade type.

Sticky- Working off the main frag grenade this one was easy to do. All I needed to do is freeze its transform on collision enter of any surface other than another grenade. Unless if I wanted the player to be able to stick multiple grenades together, as of now they cannot.

Teleport- This is a very simple implementation of the grenade itself. It doesn't even have an explode method, it just teleports on impact. Grabbing the player and setting their position to the grenades position. 

Smoke- This is a very simple one as well. It just turns on a smoke particle system and audio source for the duration of its active cycle. I should fade out the audio and unchild the smoke particle system on death so it doesn't just disappear out of the world on destroy.

Cluster- This grenade type is spawning a sub type of grenade after a certain amount of time passes after thrown. Then these will explode on impact with their own forces, audio sources and components. If all impact at once it seems to amplify the force effect created.

Bouncing Betty- The easiest of all the implementations so far. It is a regular frag grenade with a physics material applied. This material has a higher bounciness than the normal default value. Enabling it to bounce off surfaces until it explodes.

Magnet-This grenade type attracts metal materials towards it at a fairly average pace. No other materials can be affected by the grenade while its attracting metals.

Emp- This grenade allows the player to take down turrets for a small duration of time. I had to do checks within their ai notice range and ai chase range scripts to keep the turret from popping out of the downed state. The grenade has a small range but will knock the turret out for 10 seconds altogether at this time. 

Proximity Mine- This "grenade type" allows the player to place the grenade on the ground and let an ai enemy walk over it. Once in range they will trigger the effect. Currently there is a bug where it double triggers the explosion if they are back to back, but can be fixed will a simple bool check.

Flash bang- This grenade can "Blind" or confuse the enemy ai for a short duration indicated by a purple color and question mark icon. The implementation was much like the emp where I had to put in checks for the ai notice and chase range scripts.

Black hole- This grenade type works much like the metal grenade however it works on all objects and at a faster rate. Once it's done pulling in things it explodes outwards.

Shield and Turret Mechanic

In this mechanic I wanted to test if I could have the player use a shield a block incoming damage. This works by doing a check against his isBlocking bool, then dealing half damage if so, full damage if not. It works surprisingly well for such a simple implementation of it. I can see some small problems in the future. Things like taking damage the second you stop blocking even though the shield is still there in front of you. 

The turret is pretty basic as well. He has two trigger ranges that determine what state he is in while the player is in range. One is an ai notice range, where the turret will turn yellow and track the player. The other is an ai chase range, where the turret will turn red, track the player and shoot at a predetermined rate. I did run into a funny bug where I did not initialize any of the variables for the projectile launch force or the fire rate for the turret itself. So it just started launching tens of these things out at a time every second while trying to track the player. 

Systems and Mechanics Demo 1

This demo incorporates just a few levels and ideas, such as basic damage system and some explosion mechanics with bricks or a basic pokemon capture system. Although these weren't hard to code, some of the levels are not the most optimized and I've found different ways to fix or do some of these things since then. 

© 2023 by Web-Designer. Proudly created with Wix.com

bottom of page