How to deal with large amounts of different placeable objects?

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:

  1. 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.
  2. 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!

Hi Dennis,

I’m moving this to the Blueprints section. I believe it would generate more responses there. You may also want to take a look at some of the user created inventory systems created in Blueprints that may give you an idea of handling so many items. I’m certainly not a Blueprint specialist so this is a bit over my head for what is truly capable. There have been a lot of users doing some incredible things with it though!

Tim

You should really have a look at this blogpost:

It’s exactly what you need but you will have to do some C++ programming.

Yes I’ve seen that, it’s exactly what I was referring to with this in the OP:

I need to have Actors dependant on the data and be able to drag them into the Level Editor, and preferably also be able to create these assets inside the editor. In that link I only see how to read data through C++ at runtime, I don’t really get how it would work inside the editor.

are you playing around with the Skyrim editor? you can look how they do it.

http://www.uesp.net/wiki/Skyrim:Creation_Kit

btw

i dont see many problem, you can put it in folders to the Ld find easy.

If you want to be able to create them, and edit them in the editor why not simply have blueprints for each item, with parent weapon class? Sort them in the folders so you can scroll through and add to the level.

So you have your item blueprint with actor parent with generic variables and events that most items will have, you have your weapon blueprint with item parent with generic variables and events for weapons, then you have your specific weapon blueprint such as Iron Sword with weapon parent. Set your defaults for the iron sword place them in the level, do that with other weapons, or items. If the level editor wants to make any changes to the specific item that they are adding to the level they can directly from the editor.

Getting the data into UE4 is only the first part, thats right. The article doesn’t cover how to actually use that data. Thats the part you have to figure out on your own :wink:

I am doing this with some code to extend the editor to be able to place these objects directly in the world without the hassle to create a blueprint for every item.

However, it is not possible to achieve this behaviour with blueprints.

alright thanks I guess blueprints is the way to go then. I just wasn’t sure, with the compilation process and all, whether the engine and/or editor are actually capable of handling thousands of blueprints. But I guess it’s the best option still.

but you dont need compiled all blueprint in the same time. :confused: don’t?

No, but the mere fact that a compilation process exists tells me that there’s a lot of stuff going on behind the scenes, and blueprints may take up much more memory than would be required for my purposes.