Sunday, 23 February 2025

Making a VHS Style Horror Game in UE5 Pt2

 


I started by sketching out the front face of the school with some basic cubes. These were sized accordingly and placed with a certain plan in mind.

Some extra cubes were added, and i used the Boolean tool to make holes in the inital cubes to get a more detailed model for windows and balconies. Later on in the project I end up removing these.
Then i added some triangles above the initial cubes to match the concept and made the wall 3d by placing other walls
Then, I simply copy and pasted this arrangement in a square, 4 times. I added a 'sun' light source and set the color to a brilliant white, as the moon has no atmosphere to make sunsets etc. I then set up a shader and a basic material to be applied to everything, so that there would be reflections, shadows and highlights.
There is an object in all games known as a sky cube, or sky sphere. This is an infinetely large sphere that wraps around the game world with a texture of the sky on it. I found and edited a starry night sky and added a fog to make the game more atmospheric. I then applied this starry sky to the world
I found a dog toy ball model and realised that it could be used as a dome for the base. I scaled it over the building and set a futurstic material to emphasise the retro modern look. I then make a hollow glass sphere to go around this dome to make it more realistic
After setting up shaders and and VHS filter with raytracing, this is how the game looks in the preview pane
Next, i made a simple room by modelling a floor and ceiling cube, and placing some default rectangular lights on the ceiling. I ended up liking the look of these and used them throughout the game



I added some basic room objects and an astronaut suit model, to make the idea of this being a moon base more authentic. I then decided that this looked cheesy and that the space suits would be better off in their own dedicated room, so i replaced this space with some bunk beds.









I decided i wanted a small dot in the center of the screen to interact with objects and give some functionality to the game. I started by creating a 'widget', a small lightweight image, with an animation called fade 0->1. This would turn the transpancery of the image from fully transparent (invisible) to fully opaque (visible).



Blueprints:
To get functionality in any game, you need some sort of logic. In UE5, this is in the form of blueprints. For example, here is the logic for a door:
When an event called interact is called, all the required audio files are loaded in.
Then a variable called 'is unlocked?' is checked. If this is true, the true line coming out of the branch is activated, if it is false, the false line activates. If a key is picked up, the is unlocked value is set to true. When this happens, the light turns green to unlock the door, and if not, the light turns red
after the lights turn red, an animation called rattle is played and a door rattling sound is played. The animation is actually just a function that makes a variable go from 0 to 1 to 0 to 1 and so forth very quickly. This then gets multipled by 4, so that the door 'rotates' 4 degrees every time the oscillation happens. This feeds into the door's relative rotation, so that it rotates.









This computer was also coded with blueprints, I have uploaded them here:
https://blueprintue.com/blueprint/2t3jtxkb/



This is a nuclear generator I coded with a simple blueprint to turn on the lights and sound effects when an event is called:
https://blueprintue.com/blueprint/1-hgp0sd/





The below screenshots will alternate from without rendered lighting to with high quality lighting:









The game is not release ready yet, but in this post, we have done enough to make a cutscene for the game: