Added Tagging Utility Library
Summary
This libraries usefulness may not be directly apparent, and it may also seem a bit odd that it uses int
for tags rather than string
, however there is some purpose to it all I assure you.
So its only int
as its FAAAAR quicker to compare ints and pass them around than it is to use strings, so much like our other Types
style objects in the real world to use tags you would probably have something like:
public class TagTypes
{
public static int Armour = 1;
public static int Weapon = 2;
public static int Metal= 3;
public static int Wood= 4;
public static int Hot = 5;
public static int Armour = 6;
// ... etc
}
So then you may be asking...
So why is this useful?
As of right now its not massively useful, you can add tags to anything via the ITagged
interface if you wanted to logically group certain items/quests etc so you could search for all Quests with the tags { easy, gathering }
or all weapons with { armour, heavy }
to find any heavy armours etc.
Those are fairly simple use cases but in the future when we start to look at procedurally based content these tags can be extremely useful as an approach for managing procedural relationships by expressing related tags and the weightings with them, i.e hot
could be related to cold
with a weighting of -1.0f meaning it HATES the cold tag, but could have a positive relation with sand
of 0.4f meaning things can be related and have some form of strength/importance of relationship.
A quick example
So for example lets say you procedurally generate an area from tags { hot, illegal, sparse }
well that would conjure pictures Mos Eisley or some desert area of some sort, but then if we were to assume we had relations setup, you may find that hot
areas are more likely to have sand
textures, have little water
and hills
, you could then also find that the illegal
tag is linked to bandits
and cheap
goods, however as its sparse
there wouldn't be many NPCs or towns there.
So from just a couple of tags you can start to form a view of a place, and same sort of thing with crafting, if you were to have a blueprint for a weapon that contains
{ metal, sword }
so you could provide thatsilver
,iron
,gold
etc and it could find thatsilver
is related to lowerdurability
but improveddamage
towerewolves
etc.
A lot of this is a long way away, and even though this may sound cool it may not be applicable for all scenarios, so it is left as a utility for people to use how they see fit, like the curves etc.