This month, I covered Camera-Based Movement and finished coding my Persistent Settings Menu to help with the inevitably low frame rate I’ll be getting if I keep running my game at max quality settings on my low end laptop.

After I had done all the important student life stuff, I decided to dive back in and see what I can fiddle around in my project. I’m really surprised that in 8 days I’ve done considerably more progress than any of the previous months combined (In terms of priorities)!

I wanted to record a video on how things worked but it seems I don’t have enough RAM for it. It gets really choppy when I record my game… Such is the life at the Low End.

Camera and Player Movement

I’ve been struggling to get a 3rd person camera that’s simple and light ever since I started this project (which was a long time ago). After searching through the Unity forums I managed to code one together. All that was needed was a Camera Rig, with a Pivot child, and the Main Camera parented to the pivot.

The camera rotations were taken as a reference for the movement script. Now, I have kind of a Monster Hunter type of movement system where the directions are based on the camera. The movement itself was done using just the Character Controller (I can’t believe how simple .move was to use…).

I added a zoom function into all this, and made the view switchable between the left and right shoulders (so the player can see better).

Settings

The settings are staples in any game, so I figured I’d go all out on it and get it off my “These are Placeholder” list. I just went for that Settings grind, and told myself I wouldn’t stop until I’ve coded in enough adjustable settings to make it at least competent.

Being on the low-end of the PC rig spectrum, I’ve grown familiar with some of the important ones that affect performance a lot. I added settings I normally tweak in my games and the result is this (See featured image above).

Notes on Settings:

Resolution: Detects all supported resolutions by the PC, lower resolutions really do give faster performance.

Fullscreen: Exclusive fullscreen. Borderless is accessed by selecting the native resolution + having Fullscreen toggled off (Using a plugin that removes borders). Unity still doesn’t support switching between them in-game so it’s one or the other…

VSync + FPS Lock: Apparently if I turn on VSync, it bypasses my FPS lock of 30. I think I can only have a combo of my refresh rate (60) and the same FPS limit as the refresh rate.

XY Sensitivity: The camera sensitivity. At 0 their actual value is 20, and at 100 it’s actually 120 (Prevents camera from staying still at value 0).

Textures: I’ll need to have all my important textures at around 4096 for the high end people out there. It’s nice I can lower it globally anyway using my settings code.

Shadows: The biggest offender of fps tanking in most of the games I play (Haven’t experienced it affecting my game all that much, though).

Anti-Aliasing: Apparently I had it switched off since way back. No wonder the edges were odd (I’ll always keep it at 8x because it looks nicer this way).

Post-Aliasing: It has a nice effect that makes the colors contrast better (I mistook it for non-post anti-aliasing before).

Text Volume: I plan to have dialogue text sounds have their own volume (just like Voices). I’m planning to do something with them later on.

All these I shoved into one .cs file so all values are organized into one place (even the on click and slider functions). I save them into a JSON file as bools and ints, though in-game the ints become floats. I made them ints just for cleanliness and ease of editing (and for some reason my rounded floats save in JSON as if they haven’t been rounded before).

How it looks doesn’t matter right now since it’s just a design prototype. I have to make it consistent with a finalized style later on. I’ve optimized it to be as fluid as possible. I’m just happy that at least my scripts aren’t placeholder anymore.

*Ambient Occlusion, Depth of Field and other settings are pending for later down the line. They don’t really serve a purpose right now since I don’t have any actual environment assets to test them on.

*I didn’t want to use PlayerPrefs since it saves somewhere else in the PC. I want the file to be easily accessible for the user’s convenience. When something screws up the user can just delete the file and the game will generate a new file with default settings.

Next Up

I’ve been playing around with the NavMesh stuff and it’s really fun. I’ve made a basic Follow script but it needs further testing so I’ll just go deeper into it on another post. All things NavMesh may be what I do this November.

Thanks for reading!

Changelog:

October 15

-Started coding functional third person camera

October 19

-Finished coding fully functional orbiting camera (Still clips through walls/gets blocked by walls, but it’s functioning)

-Player movement with respect to camera direction (weird rotations)

October 20

-Script to load the “Preload” scene first so I can hit Play button in any scene

-Run with Shift (No run animations)

-Crouching toggle (No crouch animations)

-Player Model now rotates properly when changing direction

-Zoom in & Out using Mouse Scrollwheel

October 21

-Over-the-Shoulder view when close to Player Model

-Over-the-Shoulder can now be switched left or right

-Working Camera XY Sensitivity added to Options

October 28

-Adjustable Texture Quality (4096, 2048, 1024, 512)

-Adjustable Shadow Quality (None, Low, Medium, High, Very High)

-Texture and Shadow Quality can now be saved and changed in the settings UI

October 29

-Changed Resolution from Dropdown to a Left/Right sort of UI thing (More convenient when using controller)

-Camera X and Y Axes can now be inverted using checkboxes in the UI

-Adjustable FPS Lock, Options: Uncapped, 30,

October 30

-Pause menu actually pauses everything now (Inputs were still received before)

-Each slider now has an indicator of what its value is

-Renamed Anti-Aliasing to Post-Aliasing since it’s actually Post Anti-Aliasing

-Adjustable actual Anti-Aliasing added to Options (0x, 2x, 4x, 8x)

-Added some more effects to the camera (no noticeable performance loss/Stable 30FPS on my low-end laptop)

-Since Unity still can’t switch between Exclusive and Borderless Fullscreen in-game, I made the game Exclusive Fullscreen instead (It gets all the GPU)

-Borderless Fullscreen is still accessible by selecting the native resolution (All windows now are borderless though, I’ll improve on this again someday)

-Kinda fixed Cursor being able to leave the window when changing resolutions (Needs work)

October 31

-Countdown timers now work while Paused using Time.realtimeSinceStartup

-Changing Camera X/Y Sensitivity doesn’t change direction after applying anymore

-Vertical Camera boundaries don’t bug out on any Sensitivity and FoV setting now

November 3

-Updated Unity 5.5 >> 2018.2 and Visual Studio 2015 >> 2017 (Nothing broke!)

-Made a simple NavMesh surface for the Debug Room floor

-Made a simple Follow script, AI follows Player up to a certain distance (Personal space and such)

-Following AI now either Runs or Walks based on its current distance from the player (Just speed differences, no animations yet)