9

From both performance and storage points single resource file is more beneficial solution (however in practice it's not always really noticeable). The drawback is that it's harder to update and manage. IMO it's not that important usually, just use that is more convenient for you, it's really just a technical detail that should not be considered until you ...


8

String-keying / Hashmaps Are fast, as read time is amortized O(1), meaning that read access is usually very fast, but in worst cases (rare, but not unheard of), it can be quite slow. Worst case results from hash collisions. Implementations sometimes have to be built, or found (for instance, in C). Writing / finding a performant string-keyed map ...


7

I did pretty much exactly what you describe. Here's a run-down of how my system works: I maintain a list of all asset files, along with some meta data. This takes the form of a table of contents (TOC) file at the root of a directory tree that will become the archive. Any file in the TOC is included in the archive, along with any metadata about the file. ...


6

Good guess, XML is not by default the simplest method of storing plain text data. It depends on a lot of things, mostly what existing tools you are planning to use. Some questions to ask yourself before choosing XML: Do you feel XML editors make you (or your team) more productive? (If you are a programmer, used to a text editor, the answer is probably no.) ...


5

Back in the days of C and no templates... we had void pointers. Good thing they weren't made obsolete, because you have just seen that templates aren't omnipotent gods. This situation is perfect for some void pointer hacks. Here, I tried to make an example that was as simple as possible: Edit: The example below makes a dangerous use of shared_ptr, please ...


5

Naughty Dog seems to use scheme for describing both the data and how it should be read. However, my knowledge of scheme is non-existent so I have no clue how that would work. This would however, solve my problem, as the data would describe itself see reference. Not something I would recommend if you are a solo developer or a small group of developers. This ...


4

It depends on how many resources you have and how they perform with your game. I recommend to start with a simple solution, which means loading all the assets at the beginning, so you can use them anytime. Once the game performs slowly because of the memory problems consider writing some kind of manager, which will load assets in a smarter way. What I ...


4

Unpacked files make it easier for the user to edit and replace files, making the game much more modding-friendly. This can be seen as an advantage or disadvantage, depending on your attitude towards modding. From a performance-perspective: Loading a lot of small files from the hard drive can be a lot slower than a single, large one, because the ...


4

When the players want to edit stuff, they will find out how. Hardcoding attributes won't stop a determined modder for long. So I would recommend you to do the only sensible thing and put that data in a config file. XML is just one option. Some people prefer JSON or custom formats because they are simpler to write and read. When you don't want to make the ...


4

I believe this could be an issue with the AssetManager as it uses an objectMap which maps loaded objects to the string used to load them. In this case you're loading the font and the assetManager is storing it in it's objectMap under the key "fonts/Roboto-Regular.ttf", then when you load your font again with second set of parameters the previous font is ...


3

Hardcoding this data as constants in the code would be terribly unpractical, requiring a recompile of the project for every change. Even for small games this is very annoying. To make the game data opaque, you either have to write custom binary formats or pack every text file into a compressed (ZIP) folder. You might even go to the extreme of encrypting ...


3

I believe creating this super editor will distract you from your true goal, to create a game. From the sound of it the editor will be more difficult to create than the actual game. Furthermore I don't believe you need such a tool for your project. An easy way to approach this is by breaking all different resources the game needs into categories and create a ...


3

You want to be able to easily sort by material in order to render everything that has the same material at once. This helps a lot with efficiency. So it's almost definitely a bad idea to store materials by actual value though this may seem handy for some reason. Instead move to some kind of index into a materials array. The rest is fine, logically speaking. ...


3

Easy indeed - you are looking for Asset Bundles, which you can read about here: https://unity3d.com/learn/tutorials/topics/scripting/assetbundles-and-assetbundle-manager In pre-2017 versions, you simply set the asset bundle at the bottom of the inspector for each asset. In 2017, I believe there have been some changes to have a UI that allows you to set ...


2

Most resources (like Texture, if its loaded from file) in libGDX are managed resources. If you load such resource using AssetManager, it takes care of it to be reloaded on resume, but you have to instruct your AssetManager to actually reload your resources. All you need to do is constantly call update() on resume until this method returns true, which ...


2

I agree with Petr Abdulin that the question is too vague. Still, here are a couple of pointers that might help you to improve your design: ItemManager is not needed at all. Use the Active Record pattern: Store item data in a database or XML file and use statements like Item::findById(5) to create item objects. Separate your classes' business logic from ...


2

It really depends on the engine or tools used internally by the developer. The simplest method of storing data is, in fact, XML, or XML-like syntax. The format for models will probably be something different; for example, Unity uses the FBX format for it's models (and it can also import MAs and MBs, Maya's format). The format for textures would be any ...


2

As Adam suggested, you can write your own custom loader which could implement a network connection to any type of server which could download assets during runtime and serve them up. Just implement the file loading interface it provides and request a url as a string for the asset name in the overriden load function and pass that to your downloader. Then you ...


2

Unfortunately, you can’t access the labels during runtime. As you said methods like AssetDatabase.GetLabels and AssetDatabase.FindAssets are part of the namespace UnityEditor, which can’t be used in runtime. But what you could do is: Write a editor script that export that all the labels information into a file and then in runtime read in that file, then ...


2

If you specifically mean revisioning large assets, GitHub has recently come to your rescue: Git Large File Storage :) Git LFS is supported by GitHub, BitBucker Server, Visual Studio Online, and GitLab. I'm sure some of the more boutique Git services have it as well, and you can install git-lfs on any servers you've manually configured. There's also source ...


2

Update Object in place. *cache["foo"] = Object(stuff); Or add a method that will reload the entire object. cache["foo"]->reload(stuff);


2

Unfortunately, the only ways to load scenes are the two options you already mentioned. However, just because it’s in the list of scenes, doesn’t mean it needs to end up in the built game. There are two options here. The first option is to manually uncheck the checkboxes in the build settings next to all of the scenes that you don’t want to include whenever ...


2

Turns out there's EditorSceneManager.LoadSceneInPlayMode which does exactly what I'm looking for! Awesome. I had asked on the Unity Forum and found the answer there


2

You don’t seem to have a lot of questions here, so I’ll answer the ones I see. Loading an asset bundle from a web server using a normal http/s URL works just fine. It can also load bundles from within the project, in the StreamingAssets folder, using Application.streamingAssetsPath, but that is irrelevant to your needs. As for the extra credit, you can run ...


1

I haven't worked with the asset in question but I work on a small hobbyist unity team and have faced a somewhat similar situation. As assets may change quite a bit between versions I have found it is easier to keep an asset version I know works in the repo. If the asset is updated then I can download it, check that it still works, possibly update the ...


Only top voted, non community-wiki answers of a minimum length are eligible