x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

What is the Asset Manager?

The Asset Manager is a new feature being added in 4.16 to allow games to add rules to easily query, cook, and load game-specific assets like quests/heroes/etc. The 4.16 version of the feature is in early access, and it will be ready for full use in 4.17. The documentation isn't ready yet, but because the feature will be very difficult to use without any I created this thread to post my in-progress documentation. A PDF version of the doc is attached, and like everything else about this feature it is subject to change in 4.17.

So what is the Asset Manager actually? It's a C++ class that is created once at startup, and can be subclassed by specific games. It will read settings out of the AssetManagerSettings section of DefaultGame.ini and build a dictionary of "Primary Asset Types" which are top level game-specific things that can be queried, cooked, and loaded. Once you have those types registered it provides an interface on top of the Asset Registry that allows reading information about them even if they're not loaded. This information allows a lot of different things, detailed in the doc.

So who is this feature useful for in 4.16? If you're a C++ programmer building a complicated game with RPG elements, and plan to update to 4.17 you should take a look as it will probably make things easier for you. If you were using the ObjectLibrary functions to load assets at runtime you definitely want to read this as this is basically a much improved version of those functions. If you're interested please read the attached documentation, and if you have any follow up questions or feedback please leave a comment on this question.

Product Version: UE 4.16 Preview
Tags:
more ▼

asked May 02 '17 at 04:22 PM in C++ Programming

avatar image

[EPIC] Ben Zeigler
231 3 4 20

avatar image rYuxq Jun 02 '17 at 06:37 PM

Is it possible to create assets at runtime dynamically in a persistent way? I mean, create assets at runtime without having to recreate them on the next startup... Loading an asset, modifying it and writing the changes back to the asset on the disk would also be very interesting. Is this possible?

avatar image [EPIC] Ben Zeigler Jun 02 '17 at 07:18 PM

That is not supported by default. Your game-specific AssetManager subclass is a good place to write that code

avatar image rYuxq Jun 02 '17 at 07:28 PM

Then do I understand it right that I would need to write methods to serialize assets to disk using stuff like FArchive? But how does the asset manager discover those new assets at startup? Do I need to implement this as well? And in case I modify an existing asset and want to save the changes, do I create a new file as well? And how do I prevent the asset manager from loading the old asset?

avatar image [EPIC] Ben Zeigler Jun 02 '17 at 07:45 PM

I was just saying that the Asset Manager is a good place to write custom game-specific code to deal with assets. The Asset Manager provides methods for searching and loading assets, it doesn't have any built in logic for creating or saving them so you would need to write that. The engine doesn't have any built in support for "runtime created assets", so I don't have much advice for you. If I was doing that I would probably write them to a special directory on disk so they can't be mixed up with normal editor-created assets.

avatar image rYuxq Jun 02 '17 at 08:02 PM

Thank you, I think I understand what needs to be done :)

avatar image Vertex Soup Jun 26 '17 at 06:48 PM

If I get this right, I can use this class to create collections of class based assets without prior making any global references to them. Eg use it shop window with list of products that are populated on demand.

avatar image [EPIC] Ben Zeigler Jun 26 '17 at 06:53 PM

Yes, that was one of the primary use cases I designed the system for. If all of your shop products are in one folder you can set it up purely in ini, if it's more complicated you can do things in your game-specific subclass

avatar image Vertex Soup Jun 26 '17 at 07:03 PM

And on top of that bundle them all together so I can offer DLC? If so this is truly awesome class and deserves full blown wiki entry as well! Well done!

avatar image BigBen1992 Jul 22 '17 at 09:30 AM

The AssertManager can't find any objs in Paks , in the same path I can load the obj in pak. Why? The pak is mount already

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I'm answering my own question so this counts as resolved

more ▼

answered May 02 '17 at 04:23 PM

avatar image

[EPIC] Ben Zeigler
231 3 4 20

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question