Portobelly Production Journal #4

16/01/2019

Although I did not make any progress on Portobelly today, I learned about the first steps in making an inventory system during the masterclass today.

Fig 1 - Final outcome at the end of the masterclass, the shape that the player walks up to represents a health potion.

Fig 2 - EventTick line trace coming from the player checking if there is an object in front of the player that is part of the BPI Interaction interface.

This blueprints sends out line trace from the players location along the players forward vector at a set length. This line trace is attached to a Event Tick so that the line trace is updated every frame. Using the Event Tick in this circumstance is required as using a timer instead would make the interaction system feel unresponsive. If the line trace hits an object which is part of the Interaction interface will activate the hovered state.

Fig 3 - When the player presses “E“ they will interact with the object.

This blueprint allows the player to interact with objects in the level using the “E“ key. Objects will only interact if they have entered the hovered state.

Fig 4 - BPI Interaction Interface.

During the masterclass we were shown how to use interfaces effectively and I learned that they were an effective way of casting between different blueprints without using a cast node. The only downside of using an interface, as the tutor mention, is that they are very performance intensive so if I was to use them in Portobelly I would use them sparingly.

Fig 5 - Event Graph for BP ItemBase

Fig 6 - Post process material for the players camera

Above shows the Event Graph for ItemBase Blueprint. This blueprint is used as a parent class for all the items in the inventory system. Using parent blueprints is useful because it allows the user to make changes to any blueprint that is a child of the parent by just changing the parent blueprint. This saves the programmer a massive amount of time and energy because they only need to make changes in one place rather than changing all the blueprints individually. This is something I will definitely apply to Portobelly as it will be used for the items that can be absorbed.

The post process material on the camera applies an outline to the selected mesh when it is being hovered over by the player. This can be seen in the GIF at the top of the blog post.

Fig 7 - Construction script for BP PickupActor

BP PickupActor is a child of the ItemBase blueprint. Above is the construction script of this blueprint, in which the blueprint finds an item with the ItemList data table based on the ItemID variable. This node looks for a row in the data table and when the row is found the ItemName variable is set.

Fig 8 - ItemList data table

Fig 9 - Structure for SavedItems

Fig 10 - Structure for ItemData

Fig 11 - Enumerator for ItemType

Fig 12 - EventGraph for PickupActor

This blueprint adds the selected item into the CurrentItems array for the player when the object has been interacted with.

Fig 13 - Variable defaults for BP ConsumableHealthPotion

These default variables belong to the health potion blueprint and is a child of the PickupActor blueprint. This blueprint only requires the ItemID variable to be filled out to function correctly as a pickup object as all of the functionality has been added in the previous blueprints. All of the information for the health potion is stored in the data table. This blueprint is seen in the GIF at the top of the blog post.

After taking the masterclass I feel that I could apply some of the knowledge I have gained and apply it to Portobelly. For example, using interfaces would allow me to send information between objects without creating a cast node. Data tables could be used to store large amounts of information for the different object or enemies in Portobelly.

 

Figures List

  1. Rees, O (2019). Final outcome at the end of the masterclass, the shape that the player walks up to represents a health potion. [Offline]. [Accessed 18/01/2019].

  2. Rees, O (2019). EventTick line trace coming from the player checking if there is an object in front of the player that is part of the BPI Interaction interface. [Offline]. [Accessed 18/01/2019].

  3. Rees, O (2019). When the player presses “E“ they will interact with the object. [Offline]. [Accessed 18/01/2019].

  4. Rees, O (2019). BPI Interaction Interface. [Offline]. [Accessed 18/01/2019].

  5. Rees, O (2019). Event Graph for BP ItemBase. [Offline]. [Accessed 18/01/2019].

  6. Rees, O (2019). Post process material for the players camera. [Offline]. [Accessed 18/01/2019].

  7. Rees, O (2019). Construction script for BP PickupActor. [Offline]. [Accessed 18/01/2019].

  8. Rees, O (2019). ItemList data table. [Offline]. [Accessed 18/01/2019].

  9. Rees, O (2019). Structure for SavedItems. [Offline]. [Accessed 18/01/2019].

  10. Rees, O (2019). Structure for ItemData. [Offline]. [Accessed 18/01/2019].

  11. Rees, O (2019). Enumerator for ItemType. [Offline]. [Accessed 18/01/2019].

  12. Rees, O (2019). EventGraph for PickupActor. [Offline]. [Accessed 18/01/2019].

  13. Rees, O (2019). Variable defaults for BP ConsumableHealthPotion. [Offline]. [Accessed 18/01/2019].