Saturday, 29 February 2020

Text to TextMeshPro

I've worked on the subtitle system quite extensively over the last few weeks, from functionality to aestheics. I pretty much nailed down the whole system bar conversations (still to come). I've also been very busy with personal life these last couple of weeks so development time has been very limited.
So in the little time I've had I've managed to upgrade the quality of the text to what I would consider a final standard.

Original

Unity Text

TextMeshPro (TMP)

The Unity Text looks fine but has issues using rich text formatting when using the animated typewriter effect, also it is impossible to get the text gradient to be even accros each letter uniformly. 
TMP on the otherhand allows for a much wider variety of text effects and customisation. I was easily able to recreate the uniform gradient across each letter, rich tags also work properly and I can colour specific sections of text.

So overall I think visually it is finished, I may make it a bit brighter but that is all. Next I will add multi-line conversations and then it is done!

Tuesday, 25 February 2020

New-Old Animations

So next on the list of things to-do is animations. Getting the characters rigged and ready for in-game is straightforward, animations on the otherhand are not. Animating is one of the skills I admire the most because I find it very difficult to do.

I wanted a specific set of animations which were in the original game, online these can be found everywhere, from paid assets to free mocap data etc. I've decided to try and keep some original animations for better sense of authenticity.

Having found all the models with animations online I've managed to setup a scene that allows me to mirror these animations frame for frame, or atleast as close as possible.

I did this by having my rigged character centre of the scene for best results, I then had the original character by the side and on top of my rig. This way when i cycle through frames I can see what bones need moving and how it should look.

This works quite well using this method, but more complex movements are harder to mimic. Not only that but extra tweaking is required such as hand rotation to make it look a bit more realisitc. 

While I'm not great at this I think the result is good and in game it looks fine!

The animation looks fast, but it is exactly the same. The only reason why it looks out of place is because in game the animation is frozen halfway while he's "picking up" whatever item it is and is then resumed after a button press.
This is easy to replicate and will be next on the list, alongside a stading variation of this.

I think new animations would have probably been better, but due to my lack of skill and my desire to keep the game as authentic as I can this result is satisfactory and honestly I dont think anyone will even notice.

Monday, 24 February 2020

Adding Character Models

A while a go I implemented the main protagonist Harry. He was a quick test to see if I could rig it and get it working in-game.
Having re-done this I have now made a much nicer rig for the animations and even fixed of texture issues. Originally because of the way I created the rig, his shoulders would hunch up way more than they should whenever he moved.
Adding this new model to the animator system I have worked straight away, nice and quick!

I have even started working on the next character required:

Luckily here involvement is very limited at this stage of the game, all she does is walk and sit. Which is going to be easy to animate.

However that is another discussion for a different post.

Sunday, 23 February 2020

HDRP v URP

(Click for a larger view)

The image above shows the difference in my project from URP to HDRP. Visually it looks great conidering it's exactly the same scene / assets. This isnt without its drawbacks though, as the new renderer does impact performance.
In HDRP the game now rounds around 35fps whereas in URP its usually 55fps+, my graphics card is somewhat old though so this is to be expected.

At anyrate, HDRP looks much closer to the originals aesthetics:

HDRP Café 5to2

It took a while, but here is the result of migrating this scene to HDRP:


While the scene is still unfinished, i think the atmosphere looks exactly how I wanted it to! Now its a case of re-implementing all my gameplay, tuning up some of the assets like pickups and then starting the next area!

Friday, 21 February 2020

HDRP

Unity has recently stepped into the realm of photorealism via its HDRP renderer. While this is still fairly new, its officially out of beta and ready to use for commercial projects.

Personally I've always been happy with their Universal renderer, but this has its limits visually. With this project I'm trying to get as close to AAA quality as possible with my skill set. This means I'm having to adopt new work flows and practises to really realize the full potential of this project.

I've begun the process of migrating to HDRP, with the help of Dan, I've learnt new ways to create 3d assets. With this and Unity's new renderer I believe I can achieve close to even better results of some of the other rendered 3D scenes of the Cafe. With the added benefit of being fully playable.

But this is also potentially a double edged sword, because I may need to reel in the scope of my project. I originally wanted the first playable 5-10 minutes of the game. But depending on how extensive creating content for HDRP is, I may have to cut an area.
But... Having the visual fidelity of a AAA project and gameplay to match will easily make up for this!

For now though, I'll recreate the Cafe again, since this is purely visual-related work and post updates soon.

Sunday, 16 February 2020

Subtitle Extension > Item Pickups

Following on from my previous posts about recreating the whole subtitle mechanic, I've now expanded upon it's functionality even more to add the next most important aspect of it. Item Pickups!

I've coded in a dynamic way to allow any obect to be a pickup! All through the same code base as the object interactions. So now, if I give an object an interactable property, I can now set it as a static object for interaction, an area transition or an item pickup. Because they're all derivitives of the base subtitle system they all share the same functions which allows me to expenad on the whole system.

Not only that but I've also rewrote my code a bit to make it much more responsive. In the previous iteration I was using checks in the OnTriggerStay function to then do any actions, this was an issue, as I found out that this isn't ran until after or during fixed frames. Meaning that it is run at the end of every single computed frame, so any down or up button checks were delayed, resulting in un-responsive interactions.

I then decided to migrate the bulk of my code into the Update function as this is ran every frame in realtime and the results are great. The whole system works as it should now.
In the video below you can see the optimisations and workflow I've managed to create, allowing me quickly create more complex interactions with ease.
(Watch in full screen to see inspector)


On a more techy side; this is achieved using triggers, just like the static object interactions I've done previously. Because it uses the same code to pull a message from the donor object to display in the susbtitle system, it now also copies the model attached and instantiates it. This is then rendered to a texture and displayed on the same canvas as the text.

The only issue to this that I've noticed, is that if an object has a model with multiple meshes or elements it will not render on the canvas. I don't know why, but it does work for single meshes, so long as I make sure I combine all my assets on export it should work absolutely fine.


The onscreen prompts also work as they should. If you select no, then the object is placed back onto the ground. Pressing yes will remove the original and instantiated object from the game (and eventually add this to the inventory).

Tuesday, 11 February 2020

Improved Subtitles

Another system to replicate is the interaction mechanic. This allows contextual feedback to be delivered to the player through many different outlets, such as interesting objects, items, dialog etc.

I initially already implemented this (see previous blog post here) to a satisfactory standard and it worked for 1/3 of the things mentioned above. The other two were yet to be developed and still are.
This post is a revisitation of the initial mechanic ...object interactions. The other 2 aspects of this mechanic, item pickups are dialog are easy extentions of the mechanic, that can be implemented when needed.

Originally I had simple UI Text object, that was passed on a string that was attached to any given object via a trigger.

This works quite well, it allowed me to attach messages to almost anything. However it wasn't true to the original. Font was wrong, alignments off and even animation.
The above image was taken from the original game, even compared to my first iteration it doesnt really compare.
The video below shows the new subtitles working. They now have a combination of 4 phases; static, automatic and animated. Each of these interactions is showcased below.


While it works much better, it still needs a little tweaking, little things such as font style and type.
The next step is to add item pickups, this is almost entirely the same, just with the addition of a 3D object of the picked up item on screen.

Monday, 10 February 2020

Gameplay: Movement Local vs World

Silent Hill utilises many quirky camera angles throughout to invoke different feelings. trying to replicate this is interesting because movement quite often varies from a world perspective to local axes.
To combat the shift in perpective, I've created a script that I can attach to each and every camera (more precisiely their triggers). This script already grabs one camera from another to allow seemless gameplay. Now they also have an attribute which is set in-editor, this new addition means I can set a camera to either World or Relative. This then passes the information to the player object which then moves based on player input in relation to what type of camera is in use.


So the above script is attached to a cameras trigger box, this then has 2 camera inputs to swap between. It has 2 because while the player is within the trigger 'Cam' is used, when they leave 'Main Cam' is then resumed.

And as you can see 'State' is the method which invokes that particular control style:

Although I've diverted from the games original 'Tank' control scheme to better suit a modern audience, I've retained some of the other core movement mechanics.

To better explain this; in the original if the player is moving in any particular direction he will continue to do so even after a camera transision. It isnt until the player stops moving then any new input is then adapted based on the new active camera.
This means that the player could run in a straight line without having to re-adjust that input, even if the camera changes. The game continues to use any input related to that specific camera from when the input was first detected, even if it is no longer active until any movement input has stopped.

While this behaviour may not work smoothly in some areas, I think overall it better suits the gameplay. Otherwise, if the player always held 'up' for example, I could place camera triggers in a way that the game would automatically always move them without interuption, which wouldnt look or feel right.

So even though I've ditched the classic tank controls, I do believe it doesnt distract from the experience and infact will better allow for newer players. This would be a great matter to be discussed in greater length: "The Evolution of Gameplay".

Tuesday, 4 February 2020

Lighting Issues


This is a screenshot of the level being playing in the editor. As you can see lighting looks great.
However upon building the project, this lighting is lost, the scene still looks good but not as good as it could.



Monday, 3 February 2020

Unity Lighting

Progress on the project is coming along nicely overall. Since modelling is done, I've decided to work on bringing the scene together in Unity and trying to recreate the atmosphere for the Café scene.

In the original the cafe scene is in a seperate area, this allows for a bit more detail to be placed in the scene. 
This is one of a few areas throughout the game that uses this technique. The quality of the scene is quite impressive considering the hardware its running on.

The assets I remodelled when placed in Unity look ok, but lighting is missing and textures need creating.
 The scene is mostly untextured, some post effects are present such as DoF and AO, which do add to the quality somewhat.

The lighting in this screenshot shows the effect I'm trying to achieve, Unity's lighting is pretty limited when it comes to effects such as this, so a 3rd lighting asset is being used to create this. The light shafts look good, but the overall fog tied to it is too over-bearing.

So after a lot of tweaking, the lighting looks much better!
This is the accumulation of the above iterations; DoF, AO and some texturing is done. Light shafts look exactly how I want them, ambient lighting could possible be a bit lighter and the colour grading is off.
But, I think it looks very professional, even at such an early stage. Once all the textures are complete this scene will look great!
x

Sunday, 2 February 2020

Learning Substance Painter

To continue with my work on the Cafe, I'm now in the process of unwrapping all the models and texturing them. I usually have my own work flow which involved doing said unwrap and then google for real-world textures to place on them. This usually works reasonably well, though for this project I want to achieve a higher level of quality, so I'm having to learn Substance Painter, so here goes:

Here is a model of a bar chair, it's fully modelled, optimised for stray verts and unwrapped:

Now with these two I can import them into Substance Painter (SP). 
After some messing around I ended up with this:

While it looks ugly, it is painted to somewhat what I want. 

I then take this and all its textures and import them into my project:
Its harder to see the detail here, but it is using all the exported materials from SP. 

Here it is again from a better angle:

I think the end result is better than expected. Its currently out of context, so when the whole scene is textured I'm sure it will look much better!

Café 5to2 Final Model



This is the café re-modelled in its entirety. it took a couple of days, especially since I was adding in more detail. Now its onto texturing the whole thing.

Saturday, 1 February 2020

Café 5to2 Progress


Progress so far. Everything has been remodelled from scratch to the exact dimensions as the original, no meshes have been re-used.