• Register

Project Grand Vault is a 3rd person action adventure, game with some light rpg elements. The story follows two Treasure Hunters that attempt to move into a new city, only to get caught up in a race to uncover a legendary treasure.

Report RSS Dev Diary: Shop System

A look into our Shop system, shows features and GUI elements.

Posted by on

Hey Everyone!

Back again with another Dev Diary for Project Grand Vault.

Havenlock City is the Hub that players return to inbetween ruin runs in Project Grand Vault. As you would imagine there are several ingame shops for players to buy equipment, and prepare for their adventures. Lately I have been neck deep in User Interfaces and the systems/interactions that they involve,this is breakdown on our Shop System.

ShopLook

CONCEPT
Most shops in Havenlock city will only give the players options to BUY, some will offer you to SELL and even fewer will offer CRAFTING. These 3 options pretty much increase in complexity respectively. One of the shops that will offer all 3 is the Junk Shop, owned by the vendor Floyd.

PLAN
Building off of our previous work involving the interactions with other actors (including conversations) we can proceed to build a the necessary GUI (or Widgets in UE4) elements that are required. Below you can see a picture of the flow between actors.

Plan

ITEM STRUCTURE
Our item pickups contain a structure of variables that help define the specific item.

ItemStructure


Above you can see the structure of variables. This structure is applied to all Item Actors and their data is populated. On Character overlap these actors information is passed onto the active character and is added to the their Inventory. The active character's Inventory is actually an array of our Item Structure.

ADDING ITEMS
To add items to our inventory for example from buying items or crafting we can simply spawn the actor with its information at our active character's location and it will be added to their inventory.

AddItemsBP


But the complex part is limiting the quantity the player can purchase based off of available item space and meeting cost requirements for the items. For this I had some fuzzy logic to work out. Check out a snippet of the BP

AddQtyCheck


While not the visually most intimating BP this for me was a struggle to find the right logic. Praise be to print strings

REMOVING ITEMS
Thankfully removing items for discard, or selling is far easier. No limits on QTY or check for required funds. We simply populate the item class and the qty we want removed. If selling we add the value for those items to their wallet. Pretty straight forward.

RemoveItems

The neat part is all of this data is pulled form the Item Structure!


With that in place we can execute our plan.

CHARACTER -> SHOP MENU
Using our existing character interaction source code, we create a new character actor, and set the initial components. As of right now we don't have a model for Floyd, so for now we will use our Police Officer with a blue grid material.

FloydMesh


Once we interact with him it launches our Dialogue Tree which then leads to the opening of our Junk SHOP MENU. Below you can see the flow of the instructions that drive this interaction.

FloydBP

From this point here it was just a matter of setting up the Widget elements to work with and drive the logic we dictated above. Until we eventually reached the results in the video below.

And there we have it. I hope you guys enjoyed a look into the crafting of the buy/selling system for Project Grand Vault.

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: