Resource Spawning


This was the first thing I tackled with my project.  I imagined this system being easily editable, meaning I could place an object in the world and immediately change what type of resource would spawn there.  Each BP_ResourceSpawnPoint is just a sphere collision that has an instance editable E_ResourceType variable.  Whatever this is set to is what type of resource will spawn there.  This doesn’t determine the specific resource that spawns there, it just picks randomly from a Data Table that corresponds with the resource type.

There is a Data Table for each resource type that houses information for the specific resources like the 2d image of the resource, the 3d assets that can be chosen from, the amount of health of the resource, the chance it is chosen, the range of amounts it can drop, the chance of each amount, and how much it is worth in gold.  Every time the resource spawnpoint is asked to respawn, it will pull the information from this Data Table to determine what will go there.

Each resource is managed by a general manager of many things.  Basically the BP_ResourceManager houses a majority of my code, including things for respawning these resources, ordering them in an array (for saving purposes), and adding these broken resources to the player inventory.  More of this BP will be talked about in other dev logs, but I will link where you can look at the BP at the bottom of this one.

Putting a bunch of these throughout a level allows the player to use the tools they have to gather the resources they need for upgrades and repairs.

Above you can find some images and a video of the Data Tables and the Resources.

Here are links to where you can see the important BPs mentioned in this Dev Log.

Get GGD Resource Project

Leave a comment

Log in with itch.io to leave a comment.