SDFPSC New Features!


Hello! 

SDFPSC's Dev Here!

I'm "Super" excited about my project, The "Super Duper First Person Shooter Controller". After beginning my indie GameDev journey and soon after I began to grasp the basics, I started to question whether the pre-built Standard Character Controllers were actually my best option. I began using them immediately and they did what I needed them to do.  At first. It wasn't until later that I began to take note of little bugs and hiccups I had overlooked or been too ignorant to notice. I noticed one and then another and then another. 

Some problems I began to notice: 

  • Movement was glitchy and unresponsive.
  • The camera could be jerky, most evident when strafing around a target.
  • Ground detection was spotty. On ledges of a drop, this would cause snagging or hanging before you fall. 
  • This tied into the jump being a bit off and times and feeling disconnected.
  • When the jump works it feels floaty compounded with too much air control.
  • Basic gravity that's used makes for a realistic fall but would "hop" down slopes.
  • Slopes paired, already, with bad jump detection mean your jumping when don't want, but not when you do.
  • No Crouching
  • Footstep sounds were hard to sync and generally always sounded terrible.
  • The headbob has to go.

Phew!

I started to modify the code of the controllers I had been using and after getting them a little nicer to use I decided to, instead, embark on another journey.. "To build a simple, effective, and modular character controller that addresses some of the problems I have stated and hopefully in the future, pass it on to the masses...

With most of the problems that I personally have with the prefab controller being noted..

Lets begin by looking at the basics of SDFPSC.. 

Damn at all those gizmos!

Seen here is the general structure of the character. Even though the current build does not sport a weapon yet, the setup is still pretty much intact and structured the way you see here.

Currently (likely to change) The character:

Is a Non-Rigidbody, Unity Character Controller. This type does not use the game engines phsyics nor is affected by outside forces.

Uses 3 Raycasts: 2 of which is utilized in the current build, The GroundCheck and RangedWeapon Raycast, and one that is upcoming but still in development, The CeilingCheck.. The purpose of The GroundCheck to fail-safe the stock ground detection and try to catch missed inputs and better physics interaction. The RangedWeapon is for detecting what the player is looking at, interacting, inflicting damage, etc. The CeilingCheck's future purpose is for detecting, when the player is crouched whether he can stand up or not.

...is rocking 2 Cameras. 1 Main Camera and 1 Camera dedicated to one purpose: Rendering the gun on top of all other geometry.

Here, the clipping issue with gun can be seen!

I thought of many ways to solve this because my original idea (the two camera's) was such common ground that I thought there might be another way.. After looking around for minute I saw fails and attempts to remedy the problem. A few ways I thought to try to solve the problem were:


Might have over thought this.


Just go with two cameras

Both camera's share the same settings and mimic each other to eliminate any weird functionally that having two camera's rendering together might cause .

The camera system is made up of 3 scripts running the 2 individual cameras, as needed. One is for player camera control with smoothing and a clamp (coming soon) to make sure the player can't do a by looking up. The second controls the field of view and is used for zooming while Aiming Down Sights. And lastly there's one that's replacing the Old headbob with a nice fluid breathing effect which can be toned down or (steadied) by crouching the player.

Player Stance and Movement!

SDFPSC stands at 2m tall with eye level being around 1 and 3/4 meters from the ground. While crouching the player squats to a height of 1m tall and the eye level being at around 3/4 of a meter from the ground.

Various Stances and Movement Types

The controller can (at the moment):

  • Walk
  • Run
  • Crouch
  • Jump
  • Slide

The speeds of each motion are dynamically calculated by the players current situation and even if they weren't they are subject to change. Stating the values wouldn't necessarily remain valid but here is the basic rundown:

The controller has a set walk speed for moving in general.. Running is about 50% faster and crouching is about 75% slower than walking.

When you begin Aiming Down Sights of your weapon walk speed is unaffected but while running you will slow to regular speed.

If the character is unarmed or if the weapons are holstered the speed of whatever state you are currently in becomes 50% faster.

When the player jumps forward, momentum is kept but your ability to direct your movement is drastically reduced.

If the player is running and and initiates the crouch the player will begin to slide.

Aiming down the sights is impossible while sliding or running.

Crouch jumps, however, are possible.

All in all, the player is still very undeveloped but already has a tally of 21 objects to make up it's current functionally. 1 parent and 9 generations of 20 children.

There are 4 AudioSources (1 for each weapon and 1 dedicated to player)

and a whopping total of 12 scripts:

  • 3 camera
  • 1 PlayerMovement
  • 1 Basic Inventory
  • 4 Weapon
  •  2 Animating
  •  1 Dynamic Crosshair/UI

Speaking of Weapons!

Coming soon to a SDFPSC near you!

Raycast Type FireArms and Projectile Type Grenades

Ok, so the current build, as of today, doesn't allow you to use these weapons but the building blocks are there and testing and development is ongoing. A tad bit more testing and then you'll have:

2 Master Weapon Handlers (1 For Primary and 1 Secondary) that are responsible for managing current weapons and adding dynamic sway to the weapons by using the users camera input.

2 Primary Weapons capable of changing its functionally based on current player state and working alongside the 2 Secondary Weapons, which always had priority (currently Grenades)

Each weapon has a set 4 animators sorted into 3 levels, consisting of over 30 Animations Total:

  • Root animation (weapons individual functionality such as racking a round and recoil)
  • Player Influence (weapons general movement based of player state such as running and crouching)
  • Top Level Animations (weapons being holstered and drawn)

All of this is then nested under the Weapon Handler for Dynamically Swaying the weapon.

Alrighty, that's about it for the first DevLog. Hopefully you have understanding of how the project works, why it is, and where it's heading.

Give it a test! Try to break it! Please, leave a comment about your experience, ideas, suggestions, problems, questions, bugs, etc etc.

Shoot me a DM over at reddit u/HolyTakenNamesBatman

Current priorities: Fine tuning the jump and crouch mechanics!

Until the next update!

Get SDFPSC

Leave a comment

Log in with itch.io to leave a comment.