Extending Tagging / Collection Service Proposition

Currently, as a developer, I find it extremely hard to bridge the gap between studio accessibility and my game codebase. My proposition is relatively simple, and I think it would help many game programmers in organizing and creating a lot more reusable code by implementing this.

Proposition:

  1. Allow arbitrary key-value data to be paired with tags.
  2. Extend Tags to a “Folder” like instance in the main game hierarchy that can carry that arbitrary data. Similar to how attributes work on instances, but when creating the Tag Instance, the properties are the corresponding data associated with the Tag, which can then be modified directly on that instance.

More on Proposition 1:

local loot = CollectionService:GetTagged("Loot")
for i, v in next, loot do
  CollectionService:GetData("Loot", i :: number) -- or :GetData("Loot", v :: Instance) 
  CollcetionService:SetData({[string]: any}, i)
end

Or

for i, v in next, loot do
  local DataReference = CollectionService:GetData("Loot", i :: number) -- or :GetData("Loot", v :: Instance) 
  DataReference.Radius = 100
  DataReference.State = "Proximity Detection"
  DataReference.TickSpawned = tick()
end

And obviously expanding this to the Instance class.

Instance:GetTagData("Loot")

You may say, “Yes, but we can just use ECS modules”, that’s not the point. The point is that the Roblox Studio interface AND your game programming should be paired.

You may recognize this to be extremely similar to ECS-based engines, and that’s what I’m essentially proposing. It is complicated to pair your game codebase with the studio itself so you can create changes fast and efficiently without using Roblox’s default value instances. Simply by altering a Tag Instance property, you can change how your codebase interacts with the object(s), making it 100 times easier for developers to integrate their codebase into Studio itself.

Use Case 1:
Weapon Frameworks:

  • Usually, weapon frameworks involve a lot of data to be coupled with them. Sometimes that is through a module, or it’s through the game hierarchy by using Instance Values. Every weapon is usually unique, and sometimes it contains related data to other weapons.
  • How my idea comes in: Instead of wasting space on 20+ instance values, create a singular tag instance of a “Gernade”, and modify its existing values, including maybe setting .Name = "M617 Smoke Gernade". Now you can store the model under the tag instance, and its data is present under the main instance. Apply this on a large scale, and you can easily create a variety of grenades without absolutely littering your game hierarchy with instances.

Use Case 2:
Static Objects:

  • Imagine you are spawning an oil barrel that explodes when shot. You could obviously just apply the tag to the object before spawning it. Instead, you parent it to the associated Tag Instance. Imagine there is some data about all oil barrels you want to modify quickly. Simply go to the Tag Instance and modify that data, and every instance under that tag instance immediately knows its new data. This works a lot better when you apply this on a larger, more partitioned list: [“Small Explosives”, “Large Explosives”, “Cat Explosive”, “Grenade Explosive”]. All of these share the same functionality but have different data. So this is an easy scenario to apply this to.

My use cases may not be the best, but you see what I’m proposing.

I really think the issue with Roblox Studio development is the fact that your game programming is completely decoupled from Studio itself; it is quite literally restricted to the game world model. Most of these ideas are inspired by Unity, and I think Roblox should 100% take some notes from Unity/Godot, given how they give the developer a lot of room to modify and use the interface to speed up the development process.

If my idea was not proposed in the best way, I hope some of you readers take inspiration from this and create better ideas. Hopefully, the issue I’ve shown is apparent.