top of page

Week 2: Nicholas McInroy

  • Nicholas McInroy
  • Jan 15, 2017
  • 2 min read

Introduction

In the second week of final project, I accomplished a paint splatter effect when the paint balls collide with something, made tunneling less occurring on the projectiles, refined the weapon script for the use of automatic fire, and took out side movement to reduce movement sickness.

Paint Splatter

To appreciate what I have accomplished you need to first understand the first adaption of the paint splatter. The first time I created the effect I would load in a plane, which is 20 triangles with hit detection baked in, with a png of a paint splatter on it. Well this clearly wasn't a good idea as it made our stable 90 fps drop down to 10 fps when we took a couple shots at the wall. The way I achieved the much better version is that I made a sprite out of the png and made a prefab out of it. This prefab has a script on it that after 10 seconds it will delete itself. The projectile script instantiates the prefab with its forward vector equal to the normal of the surface so the orientation of the decal is always correct. It also parents the decal to the object so it moves with the object it hit.

Tunneling

We have been having several problems with tunneling. Our paint balls have been traveling through our mesh colliders very often. We have explored many solutions. One of which is turning the rigid body detection mode from Discrete to Continuous. That helped a lot now it tunnels about half as much but it is still not uncommon. I saw the Don'tGoThroughThings script out there on the internet and may give it a shot or try to create my own fast moving sphere collision detection.

Weapon Script

I created a script for automatic fire with adjustable fire rate for our weapon. The way i did this was by creating a Fire() method that we will be InvokeRepeating("Fire", 0.0f, 60.0f/FireRateRPM) this will call the Fire function only at its fire rate eliminating hundreds of if checks on the update. It will only fire if the shooting bool is true which gets set in update by the trigger button being pressed.

MOTION SICKNESS IS REAL! (Pt. 2)

As I mentioned last week, motion sickness is real. That being said I took out side movement. This vastly reduced the amount of motion sickness one felt while playing. For some unknown reason though, when you look down and move backwards you jump in game. Which is not the best feeling in the world. This makes me consider implementing another form of movement entirely such as teleportation. The way we would balance it would be to put a cool down scaled by the distance you traveled. If you move 1 m you shouldn't have the same cool down as if you moved 30 m.

Future Plans and Improvements

I plan on improving performance by adding a pull of already pre-instantiated objects so during run time i do not need to instantiate and delete objects which is expensive but rather toggle on and off a set number of them. For example, the projectiles and the paint splatter decals. I also plan on working on the paint grenade and either make the grenade instantiate a bunch of projectiles in random directions of make a AOE spray effect.


 
 
 

Comentários


bottom of page