r/KineticCode•
scripton

Redoing the way bullets fire

I've been hating myself because of the complexity of setting up the sights. (which I now have to redo, for all guns and all sights).

My current (old?) system fires the bullet in whatever direction the gun is pointing, at all times. This means when aiming down sights the bullet still shoots where the barrel is pointing. This is realistic but it means that while I can have the sights look spot-on while aiming, the bullet might end up going somewhere much higher/lower than the center of the crosshair. This was the case with the AKM and the iron sights.

My new method (starting todayish) is going to involve using the sights to determine where the bullet goes. When not aiming the bullets will still follow the barrel, but when aiming the bullets will follow the center of the sight's crosshair, which as mentioned above may be quite far from where the barrel actually points.

This is not only going to prevent a bunch of headaches, but also save a lot of time. With this method I think I can completely eliminate the need for setting up sights. Currently each sight must be aligned to each gun individually. With 10 guns and 3 sights that would be 30 sights I would need to center. With this new system I think I'll be able to completely automate that, so I'd never have center a single sight, it'd just "work" on all the guns in every case.

That being said I'll also be able to normalize recoil. Currently recoil just rotated the gun in some direction by X degrees. This is fine but problematic at the same time. The pivot (where the rotation is) for recoil is different on each gun, which means a 0.5 degree recoil on the AKM might be much more/less noticeable than a 0.5 degree recoil on the ACR. My new plan is to make recoil dependent on the sights location, which should normalize everything.

This will take a few days and probably not be all that noticeable to the average player, but dev-wise this speeds things up quite a lot.

PS: At this rate PvP should be enabled by the end of the month!

Posted May 15, 2016, 7:30 PM UTC

67
Loading comments…