Skip to content

Guide 101: SmartData Basics

Dr Luke Thompson edited this page Oct 30, 2018 · 6 revisions

This page is basically housekeeping before getting to the meat, but it's important to read. I avoided calling it Housekeeping to trick you into reading it. Sorry.

If you haven't already, please watch Ryan Hipple's original talk. It explains why a framework like SmartData will probably improve your projects, whether you're a coder or a designer. Even if you don't end up using SmartData it's a great talk, and while Ryan is wrong about opening brace placement, he's right on pretty much everything else.

For simplicity, Ryan's talk focuses on a minimal framework. SmartData goes well beyond this both in features and tools. His talk therefore gives a fantastic overview of the concept, and these guides teach the specifics of SmartData as an implementation of it.

Game Architecture with Scriptable Objects

Naming Convention

SmartData has a precise high-level nomenclature. Understanding this is necessary to understand the guides.

  • SmartData is the name of the overall framework. It does not refer to objects, values or anything within the framework.
  • SmartObject means a ScriptableObject asset within the SmartData framework.
    • E.g. a FloatVar, a BoolMulti and an EventVar are all SmartObjects.
  • SmartRef means a plain (but serializable) class which links to a SmartObject asset.
    • E.g. a FloatReader, a StringSetWriter and an EventDispatcher are all SmartRefs.
  • SmartComponent means the MonoBehaviours generated by the framework to help designers. These contain SmartRefs.
    • E.g. a ReadSmartFloat, a WriteSmartVector3 and a ListenSmartEvent are all SmartComponents.
  • SmartType is the high-level group of all of these sharing the same underlying type. Each SmartType has a namespace. The generator creates entire SmartTypes at once.
    • E.g. the SmartType of FloatVar, FloatSet, FloatMultiReader and WriteSmartFloat is SmartFloat, and they exist within the SmartData.SmartFloat namespace.

Custom SmartTypes

Each SmartType involves a large number of script files. While you could manually inherit from the various base classes to make your own SmartTypes, it would be error-prone and difficult. SmartData includes a tool to generate these files for you. See Guide 401: Generating Custom SmartTypes for more.

It is not recommended to manually create SmartTypes or modify generated code files. SmartData provides powerful tools to avoid this, including the type generator and custom template support.

Clone this wiki locally