Resource Maker 2

Author: zelixsphere 242 views

What do I need minimally, to get these resources working in my game?

To get this working easily in your project remember to always follow the guidelines laid out earlier (here) and start with a clean project, (please) before testing in your actual game.

Additionally there are actually 2 ways  to design and setup this, depending on how your developing your game.

  • The normal RTS way with many units. We cover this in the following section labeled ” Setup – Many RTS Units”
  • The 1st or 3rd person way with just one Player Unit. We cover this in the following section labeled “Setup – Player Only (1st and 3rd Person)”

Setup - Many RTS Units

Next Really is simply the required components that make Resources System function:

  • Resource Node –
    • The one created above for example
    • Again, this Node must be tagged as Resource
  • An empty Game Object named however you would like
    • On this Game Object you will need to add the following Components
      • Game Manager
        • This allows you to set the option for Resources to even run via check box
        • This is required
      • Resource Manager
        • This is where all the Resources get stored and controlled. You can see values populate in here in real time, during game play mode (in the editor)
        • This is not required in the scene but recommended
      • Unit Manager
        • This is how the game determines who “owns” the supposed resource that your player may collect.
        • Think of this as the player component, as you would need a Unit Manager, for ever player in the game.
          • Each player has their own, Unit Manager, and their own units associated with that Manager
        • This is required
  • Player Character Game Object – (ex GC Character)
    • Must have Unit Source Component attached
      • Must have Unit Maker file inserted into Unit Source Component
        • Unit Maker file can have all 0 out stats, so long as the following are completed
          • Type = Gatherer
          • Gathering specific stats completed
            • You will learn more about how to setup a Unit Maker Character in the Unit Maker Guide
            • You will need at least 1 Character Unit for this system to register and work properly
      • This is required
  • The UI Prefab screen overlay
    • This affords you an easy way to see how much in resources you have collected thus far.
    • This is not required in the scene but recommended

After these steps are done, and test level is made, your Newly created Character will have the ability to be directed via mouse around to where you would like. Additionally they will have the ability to “Gather Resources” when you click on you new resources node, you made previously. 

** Keep in mind, the advanced topic of AI is not involved here as we are simply just testing a user controlled instance of grabbing and gain resources. The advanced topic AI Maker, will further explain how to gain resources via gathering AI. **

  • Useful examples of how this system could benefit you:
    • Traditional RTS based Game Design where you need to gain enough resources over a period of time (Also know as Economy Based RTS)
    • Traditional RTS based Game Design where you need to harvest resources to have the ability to build more buildings, units, etc, against another player or unit. (Also know as War Based RTS)
    • There are many imaginative ways to use this!

Setup - Player Only (1st and 3rd Person)

This specific setup is designed to allow you to develop a game where resources are gained, either instantly (like a game where you collect coins) , or over time, (like a game where you need to farm materials), all in a single player experience. (Let it be first or third person)

The setup for this version of RTS is slightly different from conventional RTS games, (as its use case far extends beyond the RTS genre.)

Please follow these steps:

  • Resource Node –
    • The one created in previous guide ( Resource Maker ) for example
    • Importantly be sure the collider is set to “Is Trigger”
    • Again, this Node must be tagged as Resource
  • An empty Game Object named however you would like
    • On this Game Object you will need to add the following Components
      • Resource Manager
        • This is where all the Resources get stored and controlled. You can see values populate in here in real time, during game play mode (in the editor)
        • This is not required in the scene but recommended
      • This is not required in the scene but recommended
  • The UI Prefab screen overlay
    • This affords you an easy way to see how much in resources you have collected thus far.
    • This is not required in the scene but recommended
  • Game Creator Character
    • Custom component named GCPlayer
      • Please set the stats you would like for this Character as shown
      • Gather Speed – Reflects how fast we gain the Resource
        • Think of this like a timer
      • Gather Amount – Reflects how much we grab each time the speed is counted down.
      • Instant Gather – Is exactly as it states, it ignores Gather speed, and amount, and instead gathers all of resource instantly upon contact with a Resource Node.
      • This is required

After these steps are done, and test level is made, your Newly created Character will have the ability to be directed your normal first or third person controls, and simply gather any resource that your player comes in contact with.

  • Useful examples of how this system could benefit you:
    • Car racing game design, where you drive into powerups
    • Character based game design where you farm wood from a tree
    • Character based design where you run around collect coins, powerups, or really anything your imagination can come up with
    • etc.
On this page