top of page
ryandwakeford

Playtest Project - An Interaction System!

Hello and welcome. In this post I will be presenting inside views on the interaction system I have been working to implement which will allow the player to interact with different systems inside the game world such as doors and more, so lets dive in.

 

Interaction System

Image 1: Interaction System Interface

Firstly, we jump in with the implementation and progress of an interaction system.

As one of my interests is creating an immersive world where the player can interact with the world around them, I started to create the foundation on which to build the system.


For the basis of this I decided to try out a very simple scripting interface design, as shown above. Although the interface design at the moment is very minimalistic, it creates a foundation for improvements later on, from adding more details to an interactable (object), to creating an entire item system.


Now that I have created a interface for the interactables, each script I create to control a certain type of interactable, be it a light switch, a television, a radio, or even a door, the script will derive the core code methods used to perform the action or event based on the interactable it is attached to.

Image 2: Basic Light Switch Class Code

As an example, here is the script I have currently working for a light switch. For the light switch, the interaction process is quite simple: Whenever the player is looking at the light switch and presses the interaction key set up in the input system, the Interact() method of the class will be called. In the case of the light switch, all that happens is the referenced light (this being the ceiling light in the room) is toggled on and off depending on its current state.


Alongside the light switch interaction, I have current got the following interactions implemented using a similar script to the light switch script above:

  • Door Interaction

  • CCTV Feed switching

  • Television and Radio Interaction

  • Fire Alarm/Power Outage System

Although the interaction system in its current state isn't complex, with the structure I have used, it will be easy to continue to add different interactions to the scene, without necessarily rewriting any of the base code (although adding more details to the interaction interface wouldn't be a bad thing).



That is it for this post. As always, if you would like to stay up to date, be sure to check back regularly to see if there is any news or updates regarding this project!

7 views0 comments

Comments


bottom of page