Download

RTS resources - Best practices and how to store

Hello forums.

I’m trying to implement an RTS-like resource system. My intention is to make it work like a common RTS game, for example Age of Empires.

I have 3 resource types: Gold, copper, and printed circuit boards, but I wish for this to be rather dynamic, as I might add more resources later. These resources are not gathered like a typical RTS, but rather “imported” for a specific amount of price. It’s up to the player to manage how many resources are imported, meaning the player can increases or decreases the total number of imported resources per type.

I thought about using a TArray of some struct:



UPROPERTY(BlueprintReadWrite, EditAnywhere)
TArray<FResourceStruct> Resources;

But I’m not sure this is the best way to do it. I’ve never made a game with resources before, so I’m somewhat blank as to where I begin. Any tips and tricks or possible guides towards the best direction to take? :slight_smile: