Spotlight Sale: Save 50% on select Props now through October 7.

Game Facts

defaltdobrasao - Code Plugins - Oct 6, 2024
Not Yet Rated

A system that implement "facts" into gameplay, keeping track of things that happen in the world for later use.

  • Supported Platforms
  • Supported Engine Versions
    5.4
  • Download Type
    Engine Plugin
    This product contains a code plugin, complete with pre-built binaries and all its source code that integrates with Unreal Engine, which can be installed to an engine version of your choice then enabled on a per-project basis.

System that make use of tags to keep track of things that happen during gameplay in order to be used at a later stage from other systems.

The system has endless use cases, i will just mention a few to give an idea of what it is:

  • Quest systems.
  • Story progression.
  • Characters short and long term memory.


Let's say that a particular quest need a door to be opened, a specific item to be picked up in the world and specific dialogue line to be triggered in order to be completed.


In a normal scenario you would have to retrieve the door actor to check if it was opened, maybe check in the inventory if the item has been picked up and need a very specific way to store the FACT that a specific dialogue line has been triggered, this however has a few potential issues:

  • Maybe the door has been unloaded or is in another level, it's not in the world anymore and you can't check if it is open.
  • The quest need an item to be picked up, but it does not care if you actually have it in an inventory so you can't rely on checking the inventory item quantity.


A solution would be to store a boolean for each of these FACTS which is fine, game facts work the same way, instead of storing boolean store gameplay tags with an associated integer for more flexibility.

Following up on the above example, the plugin could do something like this:

  • Add a game facts component to the game state, game instance or whatever, somewhere global that we know is always loaded.
  • When the door is opened add the fact to the game state.
  • When the item is picked up add the fact to the game state.
  • When the specific dialogue line is triggered add the fact to the game state.
  • Once the quest need a resolution, simply retrieve the facts stored in the game state and proceed however you want.

Technical Details

Features:

  •  Implemented in a component allowing game facts to be stored on every actor.

Code Modules:

  •  GameFacts (Runtime)

Number of Blueprints: None

Number of C++ Classes: 5

Network Replicated: Yes

Supported Development Platforms: Win64

Documentation: https://drive.google.com/file/d/1Z5EhZrPII3pwdvgJ7uKeps_5xWtLxl-t/view?usp=sharing

Tags

NoAI