Properties and Filters

Every Totem Shared Asset has unique properties that differentiate it from other assets. Those properties can be interpreted by game creators in their games - you get to decide how a water-type melee weapon made of obsidian with a range of 60 looks in your game, how it functions, and more. Anyone can use the canonic properties, but you can also come up with your own new properties to adapt any Totem asset to your game.

Creating New Properties using Filters

Totem Assets can support an infinite number of asset properties. This can be achieved because Totem Assets are actually abstract sets of bitstrings, that are called "DNA". Each asset has its own DNA that can be interpreted by using Filters.

If you want, for example, to differentiate Avatars inside your game by a property that doesn't exist yet, you can create a new filter and apply it in your game. Let's say this new property determines what an Avatar's favorite dessert is. You can create a new filter that's called "Favorite Dessert", and immediately every Avatar that already exists, or that will ever exist on the Totem platform, will have its own treat!

As a creator, this allows you to enrich existing assets and give them a new take. For players, it means the assets that they own keep on evolving with time the more games are introduced to the platform.

Filter Examples

Filters are used inside game engines and are represented in a simple JSON format. Here are the Canonical Avatar Filters, and the Canonical Item Filters. There are different types of filters that can be used, but they are all built using the same basic structure: description, id, type, gene, start, length, values.

Boolean Filters

Boolean Filters can be utilized to return one of two values that an Asset's property may have. This is useful for simple binary properties, like "Good/Evil", "Strong/Weak", etc.

Boolean Filter Example: The canonical Body Strength filter returns either "Wimp" or "Muscular" at a 50/50 chance. It is determined based on the 13th bit of the 0th gene.

{"description": "Body Strength", 
    "id": "body_strength", 
    "type": "bool", 
    "gene": 0, 
    "start": 13, 
    "length": 1,
    "values": ["Wimp", "Muscular"]
}

Color Filters

Color Filters are used to return color arrays, which makes generating color arrays and palettes very straightforward.

Color Filter Example: The canonical Primary Color filter returns a random true color (RGB). It is determined based on the first 24 bits of the 2nd gene.

{"description": "Primary Color",
    "id": "primary_color",
    "type": "Color",
    "gene": 2,
    "start": 0,
    "length": 24

}

Range Filters

Range Filters are great for creating filters that require custom value distributions, and make for a very common Filter type to implement in games.

Range Filter Example: The canonical Weapon Material filter returns a random material value of four different options, with "Wood" being the most common one (appearing 50% of the time) and "Obsidian" being the rarest one (appearing ~6% of the time). It is determined based on the first four bits of the 4th gene.

{"description": "Weapon Material",
    "id": "weapon_material",
    "type": "range",
    "gene": 4,
    "start": 0,
    "length": 4, values":[
        {"key": "Wood", "value": [0, 7]},
        {"key": "Bone", "value": [8, 11]},
        {"key": "Flint", "value": [12, 14]},
        {"key": "Obsidian", "value": [15, 15]}
    ]
}


Related Articles

Totem Game Development Network 2022