Consider a large RPG project with many different types of items, like Skyrim.
A simple initial class hierarchy would look like having an Item class with properties such as a 3D model, name, gold value, and a Weapon subclass with some additional properties such as Damage Amount, Swinging Speed, Weapon Type.
What we need is to be able to define large amounts of different types of objects, such as an Iron Sword, Iron Mace, Steel Sword, Bottle of Wine, Cup, Fork, etc… you get the idea. A level designer should be able to scroll a list of items inside the editor and drag and drop them into the Level editor to place them.
The only way I can currently think of to do this would be to create a different Data Blueprint for each item I mentioned above (Iron Sword, Iron Mace…). But that could, in the end, mean that the project has hundreds or thousands of different Data Blueprints. Is the engine capable of handling this? The fact that each Blueprint has a compilation process and, internally, kind of can be viewed as some mini C++ class kind of worries me, but maybe this is no problem?
Other approaches I thought of, and my problems with those, are:
- Using external files to save data, like a database or a .csv file. My problem is that I don’t see a way with this method for a level designer to be able to find the Iron Sword object and drag and drop an instance of that into the world.
- Sticking to only the Item and Weapon subclasses, and simply dropping instances of these into the world and re-defining the data every time. However, this would mean that if 100 Iron Swords are spread throughout the world, the correct data for an Iron Sword needs to be entered 100 times over again, which is obviously very very far from ideal.
What would be the best way to deal with this? Any ideas?
Thanks in advance!